📄 delete_offer.php
字号:
<?php
include_once('logincheck.php');
include_once('myconnect.php');
$sbcom=''; ///just for redirection to rigt page
if(isset($_REQUEST["sbcom"]) && ($_REQUEST["sbcom"]=='new'))
$sbcom=$_REQUEST["sbcom"];
$strinlist="0";
foreach($_POST as $key => $value)
{
if(stristr($key,"checkbox"))
$strinlist.=",".$value;
}
// echo $strinlist;
// die();
$strquery=" and sb_id in ($strinlist) ";
$query_msg_del="delete from sbbleads_offers where 1 $strquery";
$rs_del=mysql_query($query_msg_del);
$msgdeleted=mysql_affected_rows();
if($msgdeleted > 0)
{
/////-----removing from categories
$query="delete from sbbleads_offer_cats where 1 and sb_offer_id in ($strinlist)";
mysql_query($query);
/////------removing images
$query1="delete from sbbleads_offer_images where 1 and sb_offer_id in ($strinlist)";
mysql_query($query1);
////-----remove favorites
$query2="delete from sbbleads_favorites where sb_type='sell' and sb_offer_id in ($strinlist)";
mysql_query($query2);
if($sbcom=='new')
{ //redirects to right page
header ("Location: selloffers_new.php?msg=".urlencode("$msgdeleted sell offer(s) removed"));
die();
}
header("Location: selloffers.php?msg=".urlencode("$msgdeleted sell offer(s) removed"));
die();
}
else
{
if($sbcom=='new')
{ //redirects to right page
header ("Location: selloffers_new.php?msg=".urlencode("Unable to remove sell offer(s), please try again"));
die();
}
header("Location: selloffers.php?msg=".urlencode("Unable to remove sell offer(s), please try again"));
die();
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -