📄 manage_favorites.php
字号:
<?
include "logincheck.php";
include_once "myconnect.php";
include_once "date_time_format.php";
function main()
{
$config=mysql_fetch_array(mysql_query("select * from sbbleads_config"));
?>
<script language="JavaScript">
//<!--
function select_all()
{
for (var i=0;i<document.form2.elements.length;i++)
{
var e =document. form2.elements[i];
if ((e.name != 'check_all') && (e.type=='checkbox'))
{
e.checked = document.form2.check_all.checked;
}
}
}
function select_all2()
{
for (var i=0;i<document.form3.elements.length;i++)
{
var e =document. form3.elements[i];
if ((e.name != 'check_all') && (e.type=='checkbox'))
{
e.checked = document.form3.check_all.checked;
}
}
}
//-->
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0" dwcopytype="CopyTableRow">
<tr>
<td valign="top" > <div align="center"><font class='red'> </font> </div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top"> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0" class="onepxtable">
<tr >
<td valign="top"> <table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" class="innertablestyle">
<tr>
<td height="25" class="titlestyle"> Favorites</td>
</tr>
<tr>
<td valign="top"> <p><font class='normal'>To remove an entry
just click the check box and click the remove button
below.</font></p></td>
</tr>
<tr>
<td valign="top"><form name="form2" method="post" action="delete_favorite.php">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr class="subtitle">
<td width="10">
<input type="checkbox" name="check_all" value="yes" onClick="select_all();">
</td>
<td width="100%"><b><font class='normal'>Title</font></b><b></b></td>
</tr>
<?php
$sbq_off='select * from sbbleads_favorites where sb_type="sell" and sb_uid='.$_SESSION["sbbleads_userid"];
// echo $sbq_off;
$sbrs_off=mysql_query($sbq_off);
$sbid_list='-1';
while( $sbrow_off=mysql_fetch_array($sbrs_off) )
{
$sbid_list.=",".$sbrow_off["sb_offer_id"];
}
$sbq1_off="select * from sbbleads_offers where sb_id in ($sbid_list) and sb_approved='yes' and
DATE_ADD(sb_postedon,INTERVAL ".$config["sb_expiry_sell"]." MONTH) > NOW() ";
// echo $sbq1_off;
$sbrs1_off=mysql_query($sbq1_off);
while( $sbrow1_off=mysql_fetch_array($sbrs1_off) )
{
?>
<tr>
<td >
<input name="sell<?php echo $sbrow1_off["sb_id"];?>" type="checkbox" id="sell<?php echo $sbrow1_off["sb_id"];?>" value="<?php echo $sbrow1_off["sb_id"];?>">
</td>
<td ><a href="view_offer.php?id=<?php echo $sbrow1_off["sb_id"]; ?>" ><?php echo $sbrow1_off["sb_title"]; ?></a> <font class="smalltext">[
sell ]</font></td>
</tr>
<?php
} //end while
$sbq_off='select * from sbbleads_favorites where sb_type="buy" and sb_uid='.$_SESSION["sbbleads_userid"];
$sbrs_off=mysql_query($sbq_off);
$sbid_list='-1';
while( $sbrow_off=mysql_fetch_array($sbrs_off) )
{
$sbid_list.=",".$sbrow_off["sb_offer_id"];
}
$sbq1_off="select * from sbbleads_offers_buy where sb_id in ($sbid_list) and sb_approved='yes' and DATE_ADD(sb_postedon,INTERVAL ".$config["sb_expiry_buy"]." MONTH) > NOW() ";
$sbrs1_off=mysql_query($sbq1_off);
while( $sbrow1_off=mysql_fetch_array($sbrs1_off) )
{
?>
<tr>
<td > <input name="buy<?php echo $sbrow1_off["sb_id"];?>" type="checkbox" id="buy<?php echo $sbrow1_off["sb_id"];?>" value="<?php echo $sbrow1_off["sb_id"];?>">
</td>
<td ><a href="view_offer_buy.php?id=<?php echo $sbrow1_off["sb_id"]; ?>" ><?php echo $sbrow1_off["sb_title"]; ?></a> <font class="smalltext">[
buy ]</font></td>
</tr>
<?php
} //end while
$sbq_off='select * from sbbleads_favorites where sb_type="product" and sb_uid='.$_SESSION["sbbleads_userid"];
$sbrs_off=mysql_query($sbq_off);
$sbid_list='-1';
while( $sbrow_off=mysql_fetch_array($sbrs_off) )
{
$sbid_list.=",".$sbrow_off["sb_offer_id"];
}
$sbq1_off="select * from sbbleads_products where sb_id in ($sbid_list) and sb_approved='yes'";
$sbrs1_off=mysql_query($sbq1_off);
while( $sbrow1_off=mysql_fetch_array($sbrs1_off) )
{
?>
<tr>
<td > <input name="product<?php echo $sbrow1_off["sb_id"];?>" type="checkbox" id="product<?php echo $sbrow1_off["sb_id"];?>" value="<?php echo $sbrow1_off["sb_id"];?>">
</td>
<td ><a href="view_product.php?id=<?php echo $sbrow1_off["sb_id"]; ?>" ><?php echo $sbrow1_off["sb_title"]; ?></a> <font class="smalltext">[
product ]</font></td>
</tr>
<?php
} //end while ?>
<?php
$sbq_off='select * from sbbleads_favorites where sb_type="profile" and sb_uid='.$_SESSION["sbbleads_userid"];
$sbrs_off=mysql_query($sbq_off);
$sbid_list='-1';
while( $sbrow_off=mysql_fetch_array($sbrs_off) )
{
$sbid_list.=",".$sbrow_off["sb_offer_id"];
}
$sbq1_off="select * from sbbleads_companyprofiles where sb_id in ($sbid_list) and sb_approved='yes'";
$sbrs1_off=mysql_query($sbq1_off);
while( $sbrow1_off=mysql_fetch_array($sbrs1_off) )
{
?>
<tr>
<td > <input name="profile<?php echo $sbrow1_off["sb_id"];?>" type="checkbox" id="profile<?php echo $sbrow1_off["sb_id"];?>" value="<?php echo $sbrow1_off["sb_id"];?>">
</td>
<td ><a href="view_profile.php?id=<?php echo $sbrow1_off["sb_id"]; ?>" ><?php echo $sbrow1_off["sb_companyname"]; ?></a> <font class="smalltext">[
profile ]</font></td>
</tr>
<?php
} //end while
?><tr>
<td colspan="2"> <input type="submit" name="Submit" value="Remove">
</td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" height="25"><font class="red">
<? //if($msg1<>"") echo $msg1;?>
</font></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>
<?
}// end main
include "template1.php";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -