📄 category_function.php
字号:
<?php
//include"myconnect.php";
function test()
{
$sbcol_count=0;
// $sbno_of_cols=3;
echo "<table width='100%'>";
////----
/////-----
function category_fun($passedid, $sblevel)
{
global $sbcol_count;
$query1_cat="SELECT * FROM sbbleads_categories where sb_pid=$passedid";
$rs1_cat=mysql_query($query1_cat);
if(mysql_num_rows($rs1_cat)==0)
return;
else
{
while($row1_cat=mysql_fetch_array($rs1_cat))
{
if ($sblevel == 1)
{
if($sbcol_count%2 == 0)
echo '<tr>';
echo '<td valign="top" ><table>';
}
if($sblevel != 1)
{
echo '<tr><td >';
//echo '<img src="images/side_bullet_triangle.gif" width="10" height="12">';
echo '<input type="checkbox" name="sell'.$row1_cat["sb_id"].'" value="'.$row1_cat["sb_id"].'" ';
$sbqd="select * from sbbleads_fav_cats where cid=".$row1_cat["sb_id"]." and sb_type='sell' and mid=".$_SESSION["sbbleads_userid"];
// die($sbqd);
$sbqrow=mysql_query($sbqd);
echo (mysql_num_rows($sbqrow) == 1)?'checked >':' >';
echo '<input type="checkbox" name="buy'.$row1_cat["sb_id"].'" value="'.$row1_cat["sb_id"].'" ';
$sbqd="select * from sbbleads_fav_cats where cid=".$row1_cat["sb_id"]." and sb_type='buy' and mid=".$_SESSION["sbbleads_userid"];
// die($sbqd);
$sbqrow=mysql_query($sbqd);
echo (mysql_num_rows($sbqrow) == 1)?'checked >':' >';
echo '<input type="checkbox" name="product'.$row1_cat["sb_id"].'" value="'.$row1_cat["sb_id"].'" ';
$sbqd="select * from sbbleads_fav_cats where cid=".$row1_cat["sb_id"]." and sb_type='product' and mid=".$_SESSION["sbbleads_userid"];
// die($sbqd);
$sbqrow=mysql_query($sbqd);
echo (mysql_num_rows($sbqrow) == 1)?'checked >':' >';
echo '<input type="checkbox" name="profile'.$row1_cat["sb_id"].'" value="'.$row1_cat["sb_id"].'" ';
$sbqd="select * from sbbleads_fav_cats where cid=".$row1_cat["sb_id"]." and sb_type='profile' and mid=".$_SESSION["sbbleads_userid"];
// die($sbqd);
$sbqrow=mysql_query($sbqd);
echo (mysql_num_rows($sbqrow) == 1)?'checked >':' >';
for($sbi=1;$sbi<$sblevel;$sbi++)
echo ' ';
echo '<a href="cat_sell.php?cid='.$row1_cat["sb_id"].'" class="insidelink" > '.$row1_cat["sb_cat_name"].'</a></td></tr>';
}
else
{
echo '<tr><td >';
echo '<input type="checkbox" name="sell'.$row1_cat["sb_id"].'" value="'.$row1_cat["sb_id"].'" ';
$sbqd="select * from sbbleads_fav_cats where cid=".$row1_cat["sb_id"]." and sb_type='sell' and mid=".$_SESSION["sbbleads_userid"];
// die($sbqd);
$sbqrow=mysql_query($sbqd);
echo (mysql_num_rows($sbqrow) == 1)?'checked >':'>';
echo '<input type="checkbox" name="buy'.$row1_cat["sb_id"].'" value="'.$row1_cat["sb_id"].'" ';
$sbqd="select * from sbbleads_fav_cats where cid=".$row1_cat["sb_id"]." and sb_type='buy' and mid=".$_SESSION["sbbleads_userid"];
// die($sbqd);
$sbqrow=mysql_query($sbqd);
echo (mysql_num_rows($sbqrow) == 1)?'checked >':' >';
echo '<input type="checkbox" name="product'.$row1_cat["sb_id"].'" value="'.$row1_cat["sb_id"].'" ';
$sbqd="select * from sbbleads_fav_cats where cid=".$row1_cat["sb_id"]." and sb_type='product' and mid=".$_SESSION["sbbleads_userid"];
// die($sbqd);
$sbqrow=mysql_query($sbqd);
echo (mysql_num_rows($sbqrow) == 1)?'checked >':' >';
echo '<input type="checkbox" name="profile'.$row1_cat["sb_id"].'" value="'.$row1_cat["sb_id"].'" ';
$sbqd="select * from sbbleads_fav_cats where cid=".$row1_cat["sb_id"]." and sb_type='profile' and mid=".$_SESSION["sbbleads_userid"];
// die($sbqd);
$sbqrow=mysql_query($sbqd);
echo (mysql_num_rows($sbqrow) == 1)?'checked >':' >';
echo '<a href="cat_sell.php?cid='.$row1_cat["sb_id"].'" class="sbboldinside" >'.$row1_cat["sb_cat_name"].'</a></td></tr>';
}
category_fun($row1_cat["sb_id"],$sblevel+1);
if ($sblevel == 1)
{
echo '</table></td>';
$sbcol_count++;
if($sbcol_count%2 == 0)
echo '</tr>';
}
}
}
return;
}
category_fun(0,1);
echo "</table>";
}
test();
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -