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

📄 project_man.php

📁 CRM 不仅仅是一个管理名词和管理概念
💻 PHP
字号:
<?
	########################################
	#OsoonCrm
	#项目操作
	########################################
		
	include "include/db.inc.php";
	include "include/check.inc.php";
?>
<?
	///////////////////////////////////////////////////
	// 删除
	if ($action == "delete")
	{
		// 项目表
		$sql = "delete from $tbl_crm_project where ProjectId='$pid' and $where_account_self";
		mysql_query($sql);
		// 费用表
		$sql = "delete from $tbl_crm_expense where ProjectId='$pid' and $where_account_self";
		mysql_query($sql);
		
		// 返回列表
		echo "<p style=\"font:14.8px\">删除成功!稍候,页面将返回到列表......</p>";
		echo "<meta http-equiv=\"refresh\" content=\"0;URL=project_list.php\">";
		exit;
	}
?>
<?
	////////////////////////////////////////////////////
	// 激活
	if ($action == "jihuo")
	{
		// 项目表
		//$sql = "update $tbl_crm_project set Closed='0',CloseID='',CloseTime=NULL,CloseReason='',Successful='' where ProjectId='$pid' and $where_account_self";
		$sql = "update $tbl_crm_project set Closed='0',CloseID='',CloseTime=NULL,CloseReason='',Successful='',JieDuan='2' where ProjectId='$pid' and $where_account_self";
		mysql_query($sql);
		
		// 返回项目信息
		echo "<p style=\"font:14.8px\">项目已经激活!稍候,页面将返回到项目信息......</p>";
		echo "<meta http-equiv=\"refresh\" content=\"0;URL=project_view.php?pid=$pid\">";
		exit;
	}
?>
<?
	/////////////////////////////////////////////////////
	// 关闭
	if ($action == "close")
	{
		// 项目表
		$CloseTime = date("Y-m-d H:i:s");
		//$sql = "update $tbl_crm_project set Closed='1',CloseID='$G_uid',CloseTime='$CloseTime',CloseReason='$CloseReason',Successful='$Successful' where ProjectId='$pid' and $where_account_self";
		($Successful == 1)?($JieDuan=3):($JieDuan=4);
		$sql = "update $tbl_crm_project set Closed='1',CloseID='$G_uid',CloseTime='$CloseTime',CloseReason='$CloseReason',Successful='$Successful',JieDuan='$JieDuan' where ProjectId='$pid' and $where_account_self";
		mysql_query($sql);
		
		// 返回项目信息
		echo "<p style=\"font:14.8px\">项目已经关闭!稍候,页面将返回到项目信息......</p>";
		echo "<meta http-equiv=\"refresh\" content=\"0;URL=project_view.php?pid=$pid\">";
		exit;
	}
?>
<?
	/////////////////////////////////////////////////////
	// 编辑
	if ($action == "edit")
	{
		// 检查输入
		if (!$ProjectName) {
			echo "请输入项目名!";
			exit;
		}
		if (!$ContactID) {
			echo "请选择项目联系人!";
			exit;
		}
		if (!$AccountID) {
			echo "请选择所属的客户!";
			exit;
		}

		// 项目表
		$ModifyTime = date("Y-m-d H:i:s");
		$sql = "update $tbl_crm_project 
				set ProjectName='$ProjectName',ProjectSN='$ProjectSN',Possibility='$Possibility',ProjectSale='$ProjectSale',JieDuan='$JieDuan',ProjectState='$ProjectState',ProjectSource='$ProjectSource',BeginTime='$BeginTime',EndTime='$EndTime',ProjectContent='$ProjectContent',ModifyID='$G_uid',ModifyTime='$ModifyTime',AccountID='$AccountID',ContactID='$ContactID' 
				where ProjectId='$pid' and $where_account_self";
		mysql_query($sql);
		
		// 返回项目信息
		echo "<p style=\"font:14.8px\">项目修改成功!稍候,页面将返回到项目信息......</p>";
		echo "<meta http-equiv=\"refresh\" content=\"0;URL=project_view.php?pid=$pid\">";
		exit;
	}
?>
<?
	/////////////////////////////////////////////////////
	// 添加(包括复制)
	if ($action == "add")
	{
		// 检查输入
		if (!$ProjectName) {
			echo "请输入项目名!";
			exit;
		}
		if (!$ContactID) {
			echo "请选择项目联系人!";
			exit;
		}
		if (!$AccountID) {
			echo "请选择所属的客户!";
			exit;
		}
		
		// 项目表
		$CreateTime = date("Y-m-d H:i:s");
		$sql = "insert into $tbl_crm_project (AccountID,ContactID,ProjectName,ProjectSN,Possibility,ProjectContent,ProjectSale,JieDuan,ProjectState,ProjectSource,BeginTime,EndTime,CreateID,CreateTime)
				values ('$AccountID','$ContactID','$ProjectName','$ProjectSN','$Possibility','$ProjectContent','$ProjectSale','$JieDuan','$ProjectState','$ProjectSource','$BeginTime','$EndTime','$G_uid','$CreateTime')";
		mysql_query($sql);
		$pid = @mysql_insert_id();
		
		// 返回项目信息
		echo "<p style=\"font:14.8px\">项目添加成功!稍候,页面将返回到项目信息......</p>";
		echo "<meta http-equiv=\"refresh\" content=\"0;URL=project_view.php?pid=$pid\">";
		exit;
	}
?>

⌨️ 快捷键说明

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