📄 job_kf.php
字号:
<?php
session_start();
include "middle.php";
require_once "../MessageBox.php";
$Message = new MessageBox;
if ( !empty($_SESSION["userid"])) {
include "../datasource.inc.php";
$page = $_REQUEST['page'];
$id = $_REQUEST['id'];
$action = $_REQUEST['action'];
$job_body = str_replace("\n", "<BR>", $_REQUEST['job_body']);
$date = Date("Y-m-j");
if ($action == 'add') {
$sql = "select * from job_kf where job_name='$_REQUEST[job_name]' or job_phone='$_REQUEST[job_phone]';";
$result = mysql_query($sql);
if ( mysql_num_rows($result) > 0 ){
$Message->setMessage("对不起,该客户已被绑定!","job_kf.php?page=add");
$Message->ShowMessage();
} else {
$sql = "insert into job_kf (id,userid,date,job_name,job_y,job_phone,job_address,job_email,job_qq,job_company,job_http,job_fl,job_body,department) values ('','$_SESSION[userid]','$date','$_REQUEST[job_name]','$_REQUEST[job_y]','$_REQUEST[job_phone]','$_REQUEST[job_address]','$_REQUEST[job_email]','$_REQUEST[job_qq]','$_REQUEST[job_company]','$_REQUEST[job_http]','$_REQUEST[job_fl]','$job_body','$_SESSION[department]');";
$result = mysql_query($sql);
$Message->setMessage("添加成功!","job_kf.php");
$Message->showMessage();
}
}
if ($_REQUEST['action'] == 'update') {
$sql = "update job_kf set date='$date',job_name='$_REQUEST[job_name]',job_y='$_REQUEST[job_y]',job_phone='$_REQUEST[job_phone]',job_address='$_REQUEST[job_address]',job_email='$_REQUEST[job_email]',job_qq='$_REQUEST[job_qq]',job_company='$_REQUEST[job_company]',job_http='$_REQUEST[job_http]',job_fl='$_REQUEST[job_fl]',job_body='$job_body',department='$_SESSION[department]' where id='$_REQUEST[id]';";
$result = mysql_query($sql);
$Message->setMessage("编辑成功!","job_kf.php");
$Message->showMessage();
}
?>
<link href="../css/a1.css" rel="stylesheet" type="text/css">
<body leftmargin="0" topmargin="0">
<table width="789" border="0" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><img src="../images/home_12.jpg" width="789" height="12"></td>
</tr>
<tr>
<td width="776" valign="top">
<table width="776" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td width=10> </td>
<TD vAlign=top><FONT color=#565656> <IMG height=14
src="../images/closedfold.gif" width=14> 您当前的位置<BR> <IMG
height=15 src="../images/bar.gif" width=15> <IMG height=14
src="../images/openfold.gif" width=14> 客户跟踪表</FONT></TD>
</tr>
</table>
<table align="right" cellpadding="0" cellspacing="0" width="766">
<tr>
<td bgcolor="#3494D4" height="1"></td>
</tr>
</table>
<script language=javascript>
function check_input()
{
if (document.form.job_name.value=='') {
alert("请输入公司名称!");
return false;
}
if (document.form.job_phone.value=='') {
alert("请输入联系电话!");
return false;
}
if (document.form.job_body.value=='') {
alert("请输入备注内容!");
return false;
}
return true;
}
</script>
<?php
switch ($page){
case "add":
// if ($_SESSION["userid"]=="admin") {
?>
<center>
<form enctype="multipart/form-data" name=form method="post" action="job_kf.php" onsubmit="return check_input()">
<table border=0 cellpadding=0 cellspacing=0 bgcolor=#3494D4 width=776>
<tr>
<td width=10 bgcolor=#ffffff> </td>
<td>
<table border=0 cellpadding=0 cellspacing=1 bgcolor=#3494D4 width=766>
<tr>
<td width="15%" align=center bgColor=#ffffff>登记时间</td>
<td width="85%" bgcolor=ffffff> <?php
echo "<input type=text size=30 name=job_date maxlength=8 height=24 value=$date>";
?> <font color=red>*</font> 号为必填项
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>公司名称</td>
<td width="85%" bgcolor=ffffff> <input type="text" size="30" name="job_name" maxlength="20" height=24> <font color=red>*</font>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>跟踪情况</td>
<td width="85%" bgcolor=ffffff> <select name="job_y">
<option value="一般">一般</option>
<option value="重点">重点</option>
<font color=red>*</font>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>联系人</td>
<td width="85%" bgcolor=ffffff>
<input type="text" size="30" name="job_company" maxlength="30" height=24>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>联系电话</td>
<td width="85%" bgcolor=ffffff> <input type="text" size="30" name="job_phone" maxlength="40" height=24> <font color=red>*</font> 有多个电话、手机请用,分开
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>联系地址</td>
<td width="85%" bgcolor=ffffff>
<input type="text" size="30" name="job_address" maxlength="30" height=24>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>联系EMAIL</td>
<td width="85%" bgcolor=ffffff>
<input type="text" size="30" name="job_email" maxlength="60" height=24>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>网络通讯</td>
<td width="85%" bgcolor=ffffff>
<input type="text" size="30" name="job_qq" maxlength="40" height=24> 注:OICQ,MSN之类
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>公司网址</td>
<td width="85%" bgcolor=ffffff>
<input type="text" size="30" name="job_http" maxlength="40" height=24 value=http://>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>业务类型</td>
<td width="85%" bgcolor=ffffff>
<select name=job_fl>
<option value=网站、推广>网站、推广</option>
<option value=主机、邮局>主机、邮局</option>
<option value=域名、数据库>域名、数据库</option>
<option value=主机租用、托管>主机租用、托管</option>
<option value=其他业务>其他业务</option>
</select>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>内容</td>
<td width="85%" bgColor=#ffffff> <textarea name="job_body" cols="65" rows="6"></textarea> <font color=red>*</font></td>
</tr>
</table>
</td>
</tr>
</table><br>
<input type="hidden" value="add" name="action">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
<input type="hidden" name="department" value="<? $_SESSION["department"] ?>">
<input type="submit" name="submit" value=" 确 定 "> <input type="reset" name="submit1" value=" 重 置 ">
</form>
</center>
<?
//}
break;
case "delete":
/*$sql = "select * from job_kf where id='$id';";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$dele = `rm $row['job_pic1']`;
$dele = `rm $row['job_pic2']`;
$dele = `rm $row['job_pic3']`;
$dele = `rm $row['job_pic4']`;
*/
$query = "delete from job_kf where id='$id';";
mysql_query($query);
$Message->setMessage("删除成功!","job_kf.php");
$Message->showMessage();
break;
case "update":
$sql = "select * from job_kf where id='$id';";
$result = mysql_query($sql);
$row = mysql_fetch_array($result);
$id = $row['id'];
$job_name = $row['job_name'];
$job_body = str_replace("<BR>", "\n", $row['job_body']);
?>
<form enctype="multipart/form-data" name=form method="post" action="job_kf.php" onsubmit="return check_input()">
<center>
<table border=0 cellpadding=0 cellspacing=0 width=776>
<tr><td width=10 bgcolor=#ffffff> </d>
<td><table border=0 cellpadding=0 cellspacing=1 bgcolor=#3494d4 width=766>
<tr>
<td width="15%" align=center bgColor=#ffffff>登记时间</td>
<td width="85%" bgcolor=ffffff>
<?php
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -