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

📄 delete_profile.php

📁 通达OA部分源代码
💻 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_companyprofiles where 1 $strquery";
		$rs_del=mysql_query($query_msg_del);
		$msgdeleted=mysql_affected_rows();
	if($msgdeleted > 0)
	{	
	/////-----removing from categories
		$query="delete from sbbleads_profile_cats where 1 and sb_profile_id in ($strinlist)";
		mysql_query($query);
	/////------removing images
//		$query1="delete from sbbleads_profile_images where 1 and sb_offer_id in ($strinlist)";
//		mysql_query($query1);
////-----remove favorites
		$query2="delete from sbbleads_favorites where sb_type='profile' and sb_offer_id in ($strinlist)";
		mysql_query($query2);

		mysql_query("delete from sbbleads_profile_markets where sb_profile_id in ($strinlist)");
	
		if($sbcom=='new')
		{		//redirects to right page
			header ("Location: profiles_new.php?msg=".urlencode("$msgdeleted company profile(s) removed"));
			die();
		}	
	
		header("Location: profiles.php?msg=".urlencode("$msgdeleted company profile(s) removed"));
		die();
	}
	else
	{
	
		if($sbcom=='new')
		{		//redirects to right page
			header ("Location: profiles_new.php?msg=".urlencode("Unable to remove company profile(s), please try again"));
			die();
		}	
	
		header("Location: profiles.php?msg=".urlencode("Unable to remove company profile(s), please try again"));
		die();
	}
?>

⌨️ 快捷键说明

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