⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 delete_product.php

📁 通达OA部分源代码
💻 PHP
字号:
<?php
	include_once('logincheck.php');
	include_once('myconnect.php');

$sbcom='';
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_products where 1 $strquery";
		$rs_del=mysql_query($query_msg_del);
		$msgdeleted=mysql_affected_rows();
	if($msgdeleted > 0)
	{	
	/////-----removing from categories
		$query="delete from sbbleads_product_cats where 1 and sb_offer_id in ($strinlist)";
		mysql_query($query);
	/////------removing images
		$query1="delete from sbbleads_product_images where 1 and sb_offer_id in ($strinlist)";
		mysql_query($query1);
////-----remove favorites
		$query2="delete from sbbleads_favorites where sb_type='product' and sb_offer_id in ($strinlist)";
		mysql_query($query2);
	
		if($sbcom=='new')
		{		//redirects to right page
			header ("Location: products_new.php?msg=".urlencode("$msgdeleted product catalog(s) removed"));
			die();
		}	

		header("Location: products.php?msg=".urlencode("$msgdeleted product catalog(s) removed"));
		die();
	}
	else
	{

		if($sbcom=='new')
		{		//redirects to right page
			header ("Location: products_new.php?msg=".urlencode("Unable to remove product catalog(s), please try again"));
			die();
		}	

		header("Location: products.php?msg=".urlencode("Unable to remove product catalog(s), please try again"));
		die();
	}
?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -