Хаанаас хайх:
 
 
$fetch_not[id]"; } if($text_com==true){ $search = "WHERE cat LIKE '%:43:%'".$text_com; } else{ $search = "WHERE cat LIKE '%:43:%'"; } $link = "index.php?module=accessories"; if($id==true){ $link = $link."&id=$id"; if($search==true){ $search = $search." AND cat LIKE '%:$id:%' "; }else { $search = "WHERE cat LIKE '%:$id:%' "; } } if($price==true){ $link = $link."&price=$price"; $price1 = explode("-", $price); //echo $price1[0]; //echo $price1[1]; if($search==true){ //$search = $search." AND cat LIKE '%:$id:%' "; $search = $search."and price >= ".$price1[0]." and price <= ".$price1[1]." "; }else { $search = "WHERE price >= ".$price1[0]." and price <= ".$price1[1]." "; } } if($class==true) { $link = $link."&class=$class"; if($search==true){ //$search = $search." AND cat LIKE '%:$id:%' "; $search = $search."and zereg='$class' "; }else { $search = "WHERE zereg='$class'"; } } //echo $link; ?>
Ангилал
"; $sql_cat = mysql_query("SELECT * FROM category WHERE cat='0' and id='43'"); while ($fetch_cat = mysql_fetch_array($sql_cat)){ echo "
  • $fetch_cat[title]"; $tooloh_cat = mysql_num_rows(mysql_query("SELECT id FROM products WHERE cat LIKE '%:$fetch_cat[id]:%'")); echo "($tooloh_cat)"; echo ""; echo "
      "; $sql_cat1 = mysql_query("SELECT * FROM category WHERE cat='$fetch_cat[id]'"); while ($fetch_cat1 = mysql_fetch_array($sql_cat1)){ echo "
    • $fetch_cat1[title]"; $tooloh_cat1 = mysql_num_rows(mysql_query("SELECT id FROM products WHERE cat LIKE '%:$fetch_cat1[id]:%'")); echo "($tooloh_cat1)"; echo "
        "; $sql_cat2 = mysql_query("SELECT * FROM category WHERE cat='$fetch_cat1[id]'"); while ($fetch_cat2 = mysql_fetch_array($sql_cat2)){ echo "
      • $fetch_cat2[title]"; $tooloh_cat2 = mysql_num_rows(mysql_query("SELECT id FROM products WHERE cat LIKE '%:$fetch_cat2[id]:%'")); echo "($tooloh_cat2)"; echo "
      • "; } echo "
      "; echo "
    • "; } echo "
    "; echo "
  • "; } echo ""; //echo $link; ?>
    Үнэ
    "; if($price==true){ $link1 = preg_replace("/&price=[0-9]{1,}\-[0-9]{1,}/", "", $_SERVER['REQUEST_URI']); echo "
  • 0-100.000 ("; } else{ echo "
  • 0-100.000 ("; } if($search==true) { echo mysql_num_rows(mysql_query("SELECT id FROM products $search and price >= 0 and price <= 100000")); }else{ echo mysql_num_rows(mysql_query("SELECT id FROM products WHERE price >= 0 and price <= 100000")); } echo ")
  • "; if($price==true){ $link1 = preg_replace("/&price=[0-9]{1,}\-[0-9]{1,}/", "", $_SERVER['REQUEST_URI']); echo "
  • 100.001-200.000 ("; }else { echo "
  • 100.001-200.000 ("; } if($search==true) { echo mysql_num_rows(mysql_query("SELECT id FROM products $search and price >= 100001 and price <= 200000")); }else{ echo mysql_num_rows(mysql_query("SELECT id FROM products WHERE price >= 100001 and price <= 200000")); } echo ")
  • "; if($price==true){ $link1 = preg_replace("/&price=[0-9]{1,}\-[0-9]{1,}/", "", $_SERVER['REQUEST_URI']); echo "
  • 200.001-500.000 ("; }else { echo "
  • 200.001-500.000 ("; } if($search==true) { echo mysql_num_rows(mysql_query("SELECT id FROM products $search and price >= 200001 and price <= 500000")); }else{ echo mysql_num_rows(mysql_query("SELECT id FROM products WHERE price >= 200001 and price <= 500000")); } echo ")
  • "; if($price==true){ $link1 = preg_replace("/&price=[0-9]{1,}\-[0-9]{1,}/", "", $_SERVER['REQUEST_URI']); echo "
  • 500.001-1.000.000 ("; } else{ echo "
  • 500.001-1.000.000 ("; } if($search==true) { echo mysql_num_rows(mysql_query("SELECT id FROM products $search and price >= 500001 and price <= 1000000")); }else{ echo mysql_num_rows(mysql_query("SELECT id FROM products WHERE price >= 500001 and price <= 1000000")); } echo ")
  • "; if($price==true){ $link1 = preg_replace("/&price=[0-9]{1,}\-[0-9]{1,}/", "", $_SERVER['REQUEST_URI']); echo "
  • 1.000.000 түүнээс их ("; }else{ echo "
  • 1.000.000 түүнээс их ("; } if($search==true) { echo mysql_num_rows(mysql_query("SELECT id FROM products $search and price >= 1000001 and price <= 100000000")); }else{ echo mysql_num_rows(mysql_query("SELECT id FROM products WHERE price >= 1000001 and price <= 100000000")); } echo ")
  • "; echo ""; ?>
    Зэрэглэл
    "; echo ""; }else{ echo ">"; } echo "Модерн ("; if($search==true) { echo mysql_num_rows(mysql_query("SELECT id FROM products $search and zereg='1'")); }else{ echo mysql_num_rows(mysql_query("SELECT id FROM products WHERE zereg='1'")); } echo ")"; echo ""; if($class==true) { $link1 = preg_replace("/&class=[0-9]{1,}/", "", $_SERVER['REQUEST_URI']); echo "Классик( "; }else{ echo "Классик( "; } if($search==true) { echo mysql_num_rows(mysql_query("SELECT id FROM products $search and zereg='2'")); }else{ echo mysql_num_rows(mysql_query("SELECT id FROM products WHERE zereg='2'")); } echo ")"; echo ""; ?>
    0) { ///////// echo ""; $rowsperpage = 10; $totalpages = ceil($numrows / $rowsperpage); if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage']) ) { $currentpage = (int) $_GET['currentpage']; } else { $currentpage = 1; } if ($currentpage > $totalpages) { $currentpage = $totalpages; } if ($currentpage < 1) { $currentpage = 1; } $offset = ($currentpage - 1) * $rowsperpage; $sql = "SELECT * FROM products ".$search." ORDER BY id DESC LIMIT $offset, $rowsperpage "; $result = mysql_query($sql) or trigger_error("SQL", E_USER_ERROR); $z=1; while($list = mysql_fetch_assoc($result)) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } ////////////////////////////////////////////////////// echo ""; echo "
    "; echo ""; echo ""; echo "

    $list[title]

    "; //echo "$list[cat]"; echo "Web ID: $list[id]
    "; $pieces = explode(":", $list[cat]); $cat1 = mysql_fetch_array(mysql_query("SELECT title FROM category WHERE id ='$pieces[1]'")); echo $cat1[title]; echo "
    "; $cat2 = mysql_fetch_array(mysql_query("SELECT title FROM category WHERE id ='$pieces[3]'")); echo $cat2[title]; echo "
    "; echo "Материал: "; echo $list[material]; echo "
    "; echo "Үнэ: $list[price]
    "; //echo "Хэмжээ: 25*25*25 "; echo "Дэлгэрэнгүй »"; echo ""; echo "
    "; $list_com = mysql_fetch_array(mysql_query("SELECT id,title,image,utas,fax FROM company WHERE id='$list[company]'")); echo "Компани: $list_com[title]
    "; echo "
    "; echo "Утас: $list_com[utas]
    "; echo "Факс: $list_com[fax]"; echo "
    "; $range = 5; if ($currentpage > 1) { echo " << "; $prevpage = $currentpage - 1; echo " < "; } for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { if (($x > 0) && ($x <= $totalpages)) { if ($x == $currentpage) { echo " [$x] "; } else { echo " $x "; } } } // end for // if not on last page, show forward and last page links if ($currentpage != $totalpages) { // get next page $nextpage = $currentpage + 1; // echo forward link for next page echo " > "; // echo forward link for lastpage echo " >> "; } // end if /****** end build pagination links ******/ echo "
    "; //// } ?>