?? 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> 您當(dāng)前的位置<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("請輸入聯(lián)系電話!");
return false;
}
if (document.form.job_body.value=='') {
alert("請輸入備注內(nèi)容!");
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>登記時(shí)間</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> 號為必填項(xiàng)
</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="重點(diǎn)">重點(diǎn)</option>
<font color=red>*</font>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>聯(lián)系人</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>聯(lián)系電話</td>
<td width="85%" bgcolor=ffffff> <input type="text" size="30" name="job_phone" maxlength="40" height=24> <font color=red>*</font> 有多個(gè)電話、手機(jī)請用,分開
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>聯(lián)系地址</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>聯(lián)系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>網(wǎng)絡(luò)通訊</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>公司網(wǎng)址</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>業(yè)務(wù)類型</td>
<td width="85%" bgcolor=ffffff>
<select name=job_fl>
<option value=網(wǎng)站、推廣>網(wǎng)站、推廣</option>
<option value=主機(jī)、郵局>主機(jī)、郵局</option>
<option value=域名、數(shù)據(jù)庫>域名、數(shù)據(jù)庫</option>
<option value=主機(jī)租用、托管>主機(jī)租用、托管</option>
<option value=其他業(yè)務(wù)>其他業(yè)務(wù)</option>
</select>
</td>
</tr>
<tr>
<td width="15%" align=center bgColor=#ffffff>內(nèi)容</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>登記時(shí)間</td>
<td width="85%" bgcolor=ffffff>
<?php
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -