$q_cat = "SELECT * FROM `category` WHERE `cat_id` = '".mysql_real_escape_string($_GET['cat_id'])."'";
$res_cat = mysql_query($q_cat);
while($row_cat = mysql_fetch_assoc($res_cat)){
$cat_id = $row_cat['cat_id'];
$cat_name = $row_cat['cat_name'];
$cat_description = $row_cat['cat_description'];
$cat_image = $row_cat['cat_image'];
$cat_total = $row_cat['cat_total'];
}?>
$q_subcat = "SELECT * FROM `category` WHERE `cat_fatherid` = '".mysql_real_escape_string($_GET['cat_id'])."' ORDER By `cat_name` ASC";
$res_subcat = mysql_query($q_subcat);
$affected = mysql_affected_rows();
echo '';
if($cat_image != '0'){ echo ' ';
}
echo ' | ';
echo '';
while($row_subcat = mysql_fetch_assoc($res_subcat)){
echo ' '.$row_subcat['cat_name'].' ('.$row_subcat['cat_total'].') ';
}
echo ' | ';
?>
|
$q = "SELECT c.cat_id, c.cat_name, c.cat_fatherid, a.* FROM ad as a, category as c WHERE ((c.cat_id = a.ad_cat_id) AND ((c.cat_id = '".mysql_real_escape_string($_GET['cat_id'])."') OR (c.cat_fatherid = '".mysql_real_escape_string($_GET['cat_id'])."'))) ORDER BY a.ad_id DESC";
$pager = new PS_Pagination($conexiune,$q,$_el_per_page_frontend,20);
$rs = $pager->paginate();
while($r = mysql_fetch_assoc($rs)){
//echo '
';print_r($r);echo '
';
$pic = mysql_query("SELECT `filename` FROM `picture` WHERE `pic_ad_id` = '".$r['ad_id']."' LIMIT 0,1");
$res = mysql_fetch_array($pic);
$poza = $res['filename'];
if($poza == '') $img = $_LINK.'/img/fara_imagine.gif';
else $img = $_LINK.'/images/'.$poza;
?>
 |
=stripslashes(trim_text($r['ad_description'],180));?>
|
|
    }?>
0) && ($r['ad_totalscore'] <= 1)){?>    }?>
1) && ($r['ad_totalscore'] <= 2)){?>    }?>
2) && ($r['ad_totalscore'] <= 3)){?>    }?>
3) && ($r['ad_totalscore'] <= 4)){?>    }?>
4) && ($r['ad_totalscore'] <= 5)){?>    }?>
5) && ($r['ad_totalscore'] <= 6)){?>    }?>
6) && ($r['ad_totalscore'] <= 7)){?>    }?>
7) && ($r['ad_totalscore'] <= 8)){?>    }?>
8) && ($r['ad_totalscore'] <= 9)){?>    }?>
9) && ($r['ad_totalscore'] <= 10)){?>    }?>
=date("d.m.Y",$r['ad_date'])?>
|
}?>
$q = "SELECT c.cat_id, c.cat_fatherid, ad_cat_id FROM category as c, ad as a WHERE ((c.cat_id = a.ad_cat_id) AND ((c.cat_id = '".mysql_real_escape_string($_GET['cat_id'])."') OR (c.cat_fatherid = '".mysql_real_escape_string($_GET['cat_id'])."')))";
mysql_query($q);
if(mysql_affected_rows() > $_el_per_page_frontend){
?>
}?>