📄 new.php
字号:
<?php
include_once( "inc/auth.php" );
echo "\r\n<html>\r\n<head>\r\n<title>新建客户</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n\r\n";
echo "<s";
echo "cript Language=\"JavaScript\">\r\nfunction IsNumber(str)\r\n{\r\n return str.match(/^[0-9]*\$/)!=null;\r\n}\r\n\r\nfunction IsValidEmail(str)\r\n{\r\n var re = /@/;\r\n return str.match(re)!=null;\r\n}\r\n\r\nfunction CheckForm()\r\n{\r\n if(document.form1.CUSTOMER_NAME.value==\"\")\r\n { alert(\"客户名称不能为空!\");\r\n return (false);\r\n }\r\n \r\n if (document.form1.EMAIL.value!=\"\"&&!IsValidEmail(document.form1.EMAI";
echo "L.value))\r\n { alert(\"请输入有效的电子信箱!\");\r\n return (false);\r\n }\r\n \r\n if (document.form1.POSTALCODE.value!=\"\"&&!IsNumber(document.form1.POSTALCODE.value))\r\n { alert(\"邮编只能是数字!\");\r\n return (false);\r\n }\r\n}\r\n\r\nfunction LoadWindow()\r\n{\r\n URL=\"/module/user_select_single\";\r\n loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;\r\n loc_y=document.body.scrollTop+";
echo "event.clientY-event.offsetY+200;\r\n window.showModalDialog(URL,self,\"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:350px;dialogHeight:300px;dialogTop:\"+loc_y+\"px;dialogLeft:\"+loc_x+\"px\");\r\n}\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\" onload=\"document.form1.CUSTOMER_NAME.focus();\">\r\n\r\n";
$query = "select * from SALE_MANAGER where MANAGER_ID=1";
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$MANAGER_ID = $ROW['MANAGER_ID'];
$MANAGERS = $ROW['MANAGERS'];
}
$query2 = "select * from USER where USER_ID='{$LOGIN_USER_ID}'";
$cursor2 = exequery( $connection, $query2 );
if ( $ROW = mysql_fetch_array( $cursor2 ) )
{
$SELLER1_NAME = $ROW['USER_NAME'];
}
if ( find_id( $MANAGERS, $LOGIN_USER_ID ) )
{
$query = "SELECT COUNT(*) from CUSTOMER";
}
else
{
$query = "SELECT COUNT(*) from CUSTOMER where SELLER='{$LOGIN_USER_ID}'";
}
$cursor = exequery( $connection, $query );
if ( $ROW = mysql_fetch_array( $cursor ) )
{
$CUSTOMER_COUNT = $ROW[0];
}
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/notify_new.gif\" align=\"absmiddle\">";
echo "<s";
echo "pan class=\"big3\"> 新建客户(客户总数 <font color=\"FF0000\">";
echo $CUSTOMER_COUNT;
echo " </font>)</span>\r\n </td>\r\n </tr>\r\n</table>\r\n<br>\r\n\r\n<table border=\"0\" cellspacing=\"1\" width=\"450\" class=\"small\" bgcolor=\"#000000\" cellpadding=\"3\" align=\"center\" >\r\n <form action=\"add.php\" method=\"post\" name=\"form1\" onsubmit=\"return CheckForm();\">\r\n <tr>\r\n <td nowrap class=\"TableContent\">销售员: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"TO_NAME\" size=\"10\" class=\"Bi";
echo "gStatic\" readonly value=\"";
echo $SELLER1_NAME;
echo "\"> \r\n";
if ( find_id( $MANAGERS, $LOGIN_USER_ID ) )
{
echo " <input type=\"button\" value=\"选择\" class=\"SmallButton\" onClick=\"LoadWindow()\" title=\"指定销售员\" name=\"button\">\r\n";
}
echo " <input type=\"hidden\" name=\"TO_ID\" value=\"";
echo $LOGIN_USER_ID;
echo "\">\r\n\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">是否为共享客户: </td>\r\n <td nowrap class=\"TableData\">\r\n ";
echo "<s";
echo "elect name=\"SHARE\" class=\"BigSelect\">\r\n <option value=\"1\">是</option>\r\n <option value=\"0\">否</option>\r\n </select>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">客户名称: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"CUSTOMER_NAME\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo $CUSTOMER_NAME;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">电话: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"TEL_NO\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo $TEL_NO;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">传真: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"FAX_NO\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo $FAX_NO;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">网址: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"CUSTOMER_WWW\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo $CUSTOMER_WWW;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">电子邮件: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"EMAIL\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo $EMAIL;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">地址: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"CUSTOMER_ADD\" class=\"BigInput\" size=\"33\" maxlength=\"100\" value=\"";
echo $CUSTOMER_ADD;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">邮政编码: </td>\r\n <td nowrap class=\"TableData\">\r\n <input type=\"text\" name=\"POSTALCODE\" class=\"BigInput\" size=\"33\" maxlength=\"25\" value=\"";
echo $POSTALCODE;
echo "\"> \r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableContent\">备注: </td>\r\n <td nowrap class=\"TableData\">\r\n <textarea cols=37 rows=3 name=\"MEMO\" class=\"BigInput\" wrap=\"yes\">";
echo $MEMO;
echo "</textarea>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td nowrap class=\"TableControl\" colspan=\"2\" align=\"center\">\r\n <input type=\"submit\" value=\"确定\" class=\"BigButton\" title=\"新建客户\" name=\"button\"> \r\n <input type=\"button\" value=\"返回\" class=\"BigButton\" onclick=\"location='index.php'\">\r\n </td>\r\n </tr>\r\n </form>\r\n</table>\r\n\r\n</body>\r\n</html>\r\n";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -