📄 manage_offers_buy.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"));
$sbq_gro='select * from sbbleads_groups where sb_memtype='.$_SESSION["sbbleads_memtype"];
$sbrow_gro=mysql_fetch_array(mysql_query($sbq_gro));
/////////--------------getting information bout user's privious postings
$sbq_off="select * from sbbleads_offers_buy where sb_uid=".$_SESSION["sbbleads_userid"];
$sbsell_count=mysql_num_rows(mysql_query($sbq_off));
$sbq_off='select *,UNIX_TIMESTAMP(sb_postedon) as sbposted, UNIX_TIMESTAMP(DATE_ADD(sb_postedon,INTERVAL '.$config["sb_expiry_buy"].' MONTH)) as sbexpiry from sbbleads_offers_buy where sb_uid='.$_SESSION["sbbleads_userid"]." and DATE_ADD(sb_postedon,INTERVAL ".$config["sb_expiry_buy"]." MONTH) > NOW()";
// echo $sbq_off;
$sbrs_off=mysql_query($sbq_off);
?>
<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>
<script language="javascript">
//<!--
function formValidate(form) {
if(form.add_desc.value == "") {
alert('Please enter description.');
return false;
}
return true;
}
//-->
</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"> Buy Offers</td>
</tr>
<tr>
<td><font class='normal'>Posted - <strong><font class='red'><?php echo $sbsell_count; ?></font></strong>
Maximum Allowed - <strong><font class='red'><?php echo $sbrow_gro["sb_buy_cnt"]; ?></font></strong>
</font></td>
</tr>
<tr>
<td valign="top"> <p><font class='normal'>To remove an offer
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_offer_buy.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><b><font class='normal'>Title</font></b></td>
<td><b><font class='normal'>Posted On</font></b></td>
<td><b><font class='normal'>Expires On</font></b></td>
<td><b></b></td>
</tr>
<?php
while( $sbrow_off=mysql_fetch_array($sbrs_off) )
{
$sbq_off_img="select * from sbbleads_offer_images where sb_offer_id=".$sbrow_off['sb_id'];
$sbno_of_images=mysql_num_rows(mysql_query($sbq_off_img))
?>
<tr>
<td ><input name="checkbox<?php echo $sbrow_off["sb_id"];?>" type="checkbox" id="checkbox<?php echo $sbrow_off["sb_id"];?>" value="<?php echo $sbrow_off["sb_id"];?>"></td>
<td valign="top" ><a href="view_offer_buy.php?id=<?php echo $sbrow_off["sb_id"]; ?>" ><?php echo $sbrow_off["sb_title"]; ?></a></td>
<td valign="top" ><font class='normal'><?php echo sb_date($sbrow_off["sbposted"]);?></font></td>
<td valign="top" ><font class='normal'><?php echo sb_date($sbrow_off["sbexpiry"]);?></font></td>
<td valign="top" ><a href="edit_offer_buy.php?sb_id=<?php echo $sbrow_off["sb_id"]; ?>">Edit</a></td>
</tr>
<?
}
?>
<tr>
<td colspan="5"> <input type="hidden" name="cnt" value="<?php echo $cnt; ?>">
<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>
<?php
$sbq_off='select *,UNIX_TIMESTAMP(sb_postedon) as sbposted, UNIX_TIMESTAMP(DATE_ADD(sb_postedon,INTERVAL '.$config["sb_expiry_buy"].' MONTH)) as sbexpiry from sbbleads_offers_buy where sb_uid='.$_SESSION["sbbleads_userid"]." and DATE_ADD(sb_postedon,INTERVAL ".$config["sb_expiry_buy"]." MONTH) <= NOW()";
// echo $sbq_off;
$sbrs_off=mysql_query($sbq_off);
?>
</td>
</tr>
<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"> Buy Offers (Expired)</td>
</tr>
<tr>
<td valign="top"> <p><font class='normal'>To remove an offer
just click the check box and click the remove button
below.</font></p></td>
</tr>
<tr>
<td valign="top"><form name="form3" method="post" action="delete_offer_buy.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_all2();">
</td>
<td><b><font class='normal'>Title</font></b></td>
<td><b><font class='normal'>Posted On</font></b></td>
<td><b><font class='normal'>Expired On</font></b></td>
<td><b></b></td>
</tr>
<?php while( $sbrow_off=mysql_fetch_array($sbrs_off) )
{
$sbq_off_img="select * from sbbleads_offer_images where sb_offer_id=".$sbrow_off['sb_id'];
$sbno_of_images=mysql_num_rows(mysql_query($sbq_off_img))
?>
<tr>
<td ><input name="checkbox<?php echo $sbrow_off["sb_id"];?>" type="checkbox" id="checkbox<?php echo $sbrow_off["sb_id"];?>" value="<?php echo $sbrow_off["sb_id"];?>"></td>
<td valign="top" ><a href="view_offer_buy.php?id=<?php echo $sbrow_off["sb_id"]; ?>" ><?php echo $sbrow_off["sb_title"]; ?></a></td>
<td valign="top" ><font class='normal'><?php echo sb_date($sbrow_off["sbposted"]);?></font></td>
<td valign="top" ><font class='normal'><?php echo sb_date($sbrow_off["sbexpiry"]);?></font></td>
<td valign="top" ><a href="edit_offer_buy.php?sb_id=<?php echo $sbrow_off["sb_id"]; ?>">Edit</a></td>
</tr>
<?
}
?>
<tr>
<td colspan="5"> <input type="hidden" name="cnt" value="<?php echo $cnt; ?>">
<input type="submit" name="Submit" value="Remove">
<input type="submit" name="Submit2" value="Relist">
</td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
</table></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 + -