?? contact_edit.php
字號(hào):
<?
########################################
#OsoonCrm
#編輯聯(lián)系人
########################################
include "include/db.inc.php";
include "include/check.inc.php";
include "include/array.inc.php";
if($Submit)
{
//check submit
if(!$ContactName)
{
echo "請(qǐng)?zhí)顚?xiě)聯(lián)系人姓名...";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3; url=contact_edit.php?ContactID=".$edit."\">";
exit;
}
if (!(eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$",$Email)))
{
echo "聯(lián)系人電子郵件填寫(xiě)錯(cuò)誤,請(qǐng)返回重新填寫(xiě)...";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3; url=contact_edit.php?ContactID=".$edit."\">";
exit;
}
$sql="update $tbl_crm_contact set ContactName='$ContactName',ZhiWu='$ZhiWu',Email='$Email',Dept='$Dept',OfficeTel='$OfficeTel',ChenWei='$ChenWei',Mobile='$Mobile',Source='$Source',HomeTel='$HomeTel',Birthday='$Birthday',OfficeFax='$OfficeFax',Relation='$Relation',Hobby='$Hobby',AccountID='$AccountID' where ContactID='$edit'";
mysql_query($sql);
echo "成功編輯聯(lián)系人,請(qǐng)稍候...";
echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"3; url=contact_list.php\">";
exit;
}
include "include/header.inc.php";
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="90%">
<tr valign=top>
<td width="201">
<?
include "include/left.inc.php";
?>
</td>
<td>
<?
$sql="select * from $tbl_crm_contact where ContactID='$ContactID'";
$res=mysql_query($sql);
$row=mysql_fetch_array($res);
$sql_account="select * from $tbl_crm_account where AccountOwnerID='$G_uid'";
$res_account=mysql_query($sql_account);
$sql_source="select * from $tbl_crm_source";
$res_source=mysql_query($sql_source);
$sql_relation="select * from $tbl_crm_account_relationship";
$res_relation=mysql_query($sql_relation);
?>
<br>
<form method="post" action="contact_edit.php">
<table width="95%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td width=50%><b>編輯聯(lián)系人</b><font color="red"> * </font>為必填項(xiàng)</td>
<td width=50% align=right><a href="contact_add.php">添加聯(lián)系人</a> | <a href="contact_list.php">聯(lián)系人列表</a></td>
</tr>
</table>
<hr width=95% align=center>
<table width="95%" border="1" cellspacing="0" cellpadding="5" align="center" bgcolor="#ede5d2" bordercolor="#FFFFFF">
<tr>
<td colspan="2"> <b>基本信息</b></td>
</tr>
</table>
<table width="95%" border="1" cellspacing="0" cellpadding="5" align="center" bgcolor="#F5F1E9" bordercolor="#FFFFFF">
<tr>
<td width="25%">聯(lián)系人姓名<font color="red"> * </font></td>
<td width="25%">
<input type="text" name="ContactName" value="<? echo $row[ContactName] ?>">
</td>
<td width="25%">職務(wù)</td>
<td width="25%">
<input type="text" name="ZhiWu" value="<? echo $row[ZhiWu] ?>">
</td>
</tr>
<tr>
<td width="25%">電子郵件</td>
<td width="25%">
<input type="text" name="Email" value="<? echo $row[Email] ?>">
</td>
<td width="25%">部門(mén)</td>
<td width="25%">
<input type="text" name="Dept" value="<? echo $row[Dept] ?>">
</td>
</tr>
<tr>
<td width="25%">工作電話</td>
<td width="25%">
<input type="text" name="OfficeTel" value="<? echo $row[OfficeTel] ?>">
</td>
<td width="25%">稱(chēng)謂</td>
<td width="25%">
<input type="text" name="ChenWei" value="<? echo $row[ChenWei] ?>">
</td>
</tr>
<tr>
<td width="25%">移動(dòng)電話</td>
<td width="25%">
<input type="text" name="Mobile" value="<? echo $row[Mobile] ?>">
</td>
<td width="25%">來(lái)源</td>
<td width="25%">
<select name="Source">
<?
while($row_source=mysql_fetch_array($res_source))
{
$option_source = "<option value=".$row_source[SourceID];
if($row_source[SourceID]==$row[Source])
$option_source.= " selected";
$option_source.= ">".$row_source[SourceName]."</option>\n";
echo $option_source;
}
?>
</select>
</td>
</tr>
<tr>
<td width="25%">家庭電話</td>
<td width="25%">
<input type="text" name="HomeTel" value="<? echo $row[HomeTel] ?>">
</td>
<td width="25%">生日</td>
<td width="25%">
<input type="text" name="Birthday" value="<? echo $row[Birthday] ?>">
</td>
</tr>
<tr>
<td width="25%">工作傳真</td>
<td width="25%">
<input type="text" name="OfficeFax" value="<? echo $row[OfficeFax] ?>">
</td>
<td width="25%">與聯(lián)系人的關(guān)系</td>
<td width="25%">
<select name="Relation">
<?
while($row_relation=mysql_fetch_array($res_relation))
{
$option_relation = "<option value=".$row_relation[RelationshipID];
if($row_relation[RelationshipID]==$row[Relation])
$option_relation.= " selected";
$option_relation.= ">".$row_relation[RelationshipName]."</option>\n";
echo $option_relation;
}
?>
</select>
</td>
</tr>
<tr>
<td width="25%">個(gè)人愛(ài)好</td>
<td width="25%">
<input type="text" name="Hobby" value="<? echo $row[Hobby] ?>">
</td>
<td width="25%"> </td>
<td width="25%"> </td>
</tr>
</table>
<br>
<table width="95%" border="1" cellspacing="0" cellpadding="5" align="center" bgcolor="#ede5d2" bordercolor="#FFFFFF">
<tr>
<td colspan="2"> <b>所屬客戶</b></td>
</tr>
</table>
<table width="95%" border="1" cellspacing="0" cellpadding="5" align="center" bgcolor="#F5F1E9" bordercolor="#FFFFFF">
<tr>
<td width="25%">客戶名稱(chēng)</td>
<td width="75%">
<select name="AccountID">
<?
while ($row_account=@mysql_fetch_array($res_account))
{
$key = $row_account[AccountID];
$val = $row_account[AccountName];
if ($key == $row[AccountID])
echo "<option value=\"$key\" selected>$val</option>";
else
echo "<option value=\"$key\">$val</option>";
}
?>
</select>
</td>
</tr>
</table>
<br>
<table width="95%" border="1" cellspacing="0" cellpadding="5" align="center" bgcolor="#ede5d2" bordercolor="#FFFFFF">
<tr>
<td colspan="2"> <b>創(chuàng)建者</b></td>
</tr>
</table>
<table width="95%" border="1" cellspacing="0" cellpadding="5" align="center" bgcolor="#F5F1E9" bordercolor="#FFFFFF">
<tr>
<td width="25%" height="21">創(chuàng)建者</td>
<td width="25%" height="21"><? echo $array_crm_id2user[$row[AddID]] ?></td>
<td width="25%" height="21">創(chuàng)建時(shí)間</td>
<td width="25%" height="21"><? echo $row[CreateTime] ?></td>
</tr>
</table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="5" align="center">
<tr>
<td>
<input type="hidden" name="edit" value=<? echo $ContactID ?>>
<input type="submit" name="Submit" value="編輯聯(lián)系人">
<input type="button" name="button" value="取消并返回" onclick="javascript:history.back();">
</td>
</tr>
</table>
</form>
<p> </p></td>
</tr>
</table>
<?
include "include/footer.inc.php";
?>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -