secure($_GET['catid']); if($cat=='search') { $cat = new stdClass; $q = $db->secure($_GET['q']); $cat->c_title = $q; $where = "p_title LIKE '%$q%'"; $link = '/search/?q='.$q.'&'; } else { $cat = $db->getRow("SELECT c_id,c_title,cat_type FROM category WHERE c_id = '$cat' LIMIT 1"); $where = "p_cid = '$cat->c_id'"; $link = '/'.seo($cat->c_title).'/?'; if (!$cat) { header('Location: ../'); exit; } if(!$cat->cat_type) { $row = $db->getRow("SELECT p_id,p_title FROM product WHERE p_cid = '$cat->c_id' LIMIT 1"); if($row) { header('Location: ../'.seo($row->p_title).'-'.$row->p_id.'.html'); exit; } } } ?> -
1 ? (9 * $page)-9 : 0; $count = $db->getRow("SELECT count(p_id) as cnt FROM product WHERE $where"); $per_page = 9; $count = $count->cnt; $max_pages = ceil($count / $per_page); $rows = $db->getResults("SELECT p_id,p_title,p_price,p_priceold,p_photo,p_comment FROM product WHERE $where && p_active = '1' ORDER BY $order LIMIT $start,$per_page"); if($rows) { echo ''; echo paging($page,$max_pages,$link.($_GET['order'] ? 'order='.(int)$_GET['order'].'&' : '').'p=',''); } else { echo '
'; $cats = $db->getResults("SELECT c_id,c_title,c_seo FROM category WHERE c_parent = '$cat->c_id'"); if($cats) { foreach($cats as $c) { echo '

'; } } else { echo $l[46]; } echo '
'; } ?>