📄 search_customer.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/function_page_01.php" );
include_once( "ikernel/utility.php" );
include_once( "inc/utility_all.php" );
if ( $_REQUEST['cur_page'] == "" )
{
$cur_page = 1;
}
else
{
$cur_page = $_REQUEST['cur_page'];
}
$page_purview = 45;
echo "<html>\r\n<head>\r\n<title>客户资料 - 查询结果</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n</head>\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
$SAFE_CHECK_OK = 0;
if ( find_id( $USER_FUNC_ID_STR, $page_purview ) )
{
$SAFE_CHECK_OK = 1;
}
if ( $SAFE_CHECK_OK == 0 )
{
message( "警告", "无该模块使用权限!如需使用该模块,请联系管理员重新设置本角色权限!" );
exit( );
}
echo "<table border=\"0\" width=\"100%\" cellspacing=\"1\" cellpadding=\"0\" class=\"small\">\r\n <tr>\r\n <td class=\"tablehead1\"><img src=\"/images/menu/inbox.gif\" align=\"absmiddle\"> 客户资料 - 查询结果</td>\r\n </tr>\r\n <tr class=\"tablehead2\">\r\n <td><br></td>\r\n </tr>\r\n</table>\r\n<br>\r\n<table border=\"0\" cellspacing=\"1\" width=\"100%\" class=\"small\" cellpadding=\"3\">\r\n <tr class=\"TableHeader\">\r\n ";
$sens = $_REQUEST['sens'] ? 0 : 1;
$sensimg = $_REQUEST['sens'] ? "arrow_up.gif" : "arrow_down.gif";
$sensimg = "/images/".$sensimg;
$sufurl = $_SERVER['PHP_SELF']."?sens=".$sens."&keyword=".$_REQUEST['keyword'];
echo " \r\n \r\n <td width=\"12%\" nowrap ><a href=\"";
echo $sufurl;
echo "&order=customer\">客户名称</a> ";
if ( $_REQUEST['order'] == "customer" )
{
echo "<img src='".$sensimg."'>";
}
echo "</td>\r\n <td width=\"15%\" nowrap ><a href=\"";
echo $sufurl;
echo "&order=tel\">电话</a> ";
if ( $_REQUEST['order'] == "tel" )
{
echo "<img src='".$sensimg."'>";
}
echo "</td>\r\n <td width=\"15%\" nowrap ><a href=\"";
echo $sufurl;
echo "&order=fax\">传真</a> ";
if ( $_REQUEST['order'] == "fax" )
{
echo "<img src='".$sensimg."'>";
}
echo "</td>\r\n <td nowrap ><a href=\"";
echo $sufurl;
echo "&order=www\">网址</a> ";
if ( $_REQUEST['order'] == "www" )
{
echo "<img src='".$sensimg."'>";
}
echo "</td>\r\n <td width=\"15%\" nowrap ><a href=\"";
echo $sufurl;
echo "&order=email\">电子邮件</a> ";
if ( $_REQUEST['order'] == "email" )
{
echo "<img src='".$sensimg."'>";
}
echo "</td>\r\n <td width=\"15%\" nowrap >操作</td>\r\n </tr>\r\n ";
$sql = "\r\n SELECT * FROM customer\r\n\t\t WHERE 1 \r\n ";
if ( $_REQUEST['keyword'] != "" )
{
$sql .= " \r\n\t\t\t AND (CUSTOMER_NAME LIKE '%".$_REQUEST['keyword']."%' \r\n\t\t\t OR CUSTOMER_ADD LIKE '%".$_REQUEST['keyword']."%' \r\n\t\t\t OR MEMO LIKE '%".$_REQUEST['keyword']."%' \r\n\t\t )\r\n\t ";
}
switch ( $_REQUEST['order'] )
{
case "customer" :
$sql .= "ORDER BY CUSTOMER_NAME ";
break;
case "tel" :
$sql .= "ORDER BY TEL_NO ";
break;
case "fax" :
$sql .= "ORDER BY FAX_NO ";
break;
case "www" :
$sql .= "ORDER BY CUSTOMER_WWW ";
break;
case "email" :
$sql .= "ORDER BY EMAIL ";
break;
default :
$sql .= "ORDER BY CUSTOMER_NAME ";
}
$sql .= $_REQUEST['sens'] ? " ASC" : " DESC";
$sql = page( $sql, 12 );
$res = exequery( $connection, $sql );
$customer_count = 0;
while ( $row = mysql_fetch_array( $res ) )
{
++$customer_count;
$customer_add = substrgb( strip_tags( $row['CUSTOMER_ADD'] ), 50, "..." );
$memo = substrgb( strip_tags( $row['MEMO'] ), 100, "..." );
if ( $_REQUEST['keyword'] != "" )
{
$customer_name = replacestr( substrgb( strip_tags( $row['CUSTOMER_NAME'] ), 20, "..." ), "red", $_REQUEST['keyword'] );
}
else
{
$customer_name = substrgb( strip_tags( $row['CUSTOMER_NAME'] ), 20, "..." );
}
$customer_id = $row['CUSTOMER_ID'];
$tel_no = $row['TEL_NO'];
$fax_no = $row['FAX_NO'];
$customer_www = $row['CUSTOMER_WWW'];
$email = $row['EMAIL'];
$postalcode = $row['POSTALCODE'];
$customer_name_title = "邮编:".$postalcode." \r\n"."地址:".$customer_add." \r\n"."备注:".$memo;
if ( $customer_count % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
echo " <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap><a href=\"javascript:customer_detail('";
echo $customer_id;
echo "');\" title=\"";
echo $customer_name_title;
echo "\">\r\n ";
echo $customer_name;
echo " </a> </td>\r\n <td>";
echo $tel_no;
echo " <td>";
echo $fax_no;
echo "</td>\r\n <td nowrap ><a href=\"";
echo $customer_www;
echo "\" target=\"_blank\" title=\"";
echo $customer_www;
echo "\">\r\n ";
echo $customer_www;
echo " </a></td>\r\n <td nowrap >";
echo $email;
echo "</td>\r\n <td nowrap > <a href=\"javascript:linkman('";
echo $customer_id;
echo "');\">联系人 </a> <a href=\"javascript:contact('";
echo $customer_id;
echo "');\">交往记录 </a> <a href=\"javascript:product('";
echo $customer_id;
echo "');\">销售记录 </a> </td>\r\n </tr>\r\n ";
}
echo "</table>\r\n<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n <tr class=\"TableLine2\">\r\n <td align=\"right\">";
disp( "keyword=".$_REQUEST['keyword']."&order=".$_REQUEST['order']."&sens=".$_REQUEST['sens'] );
echo "</td>\r\n <td width=\"2%\" align=\"right\"></td>\r\n </tr>\r\n</table>\r\n</body>\r\n</html>\r\n";
echo "<s";
echo "cript>\r\nfunction detail(CUSTOMER_ID)\r\n{\r\n URL=\"/general/crm/customer/query/detail.php?CUSTOMER_ID=\"+CUSTOMER_ID;\r\n myleft=(screen.availWidth-500)/2;\r\n window.open(URL,\"\",\"height=250,width=500,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\n\r\nfunction linkman(CUSTOMER_ID)\r\n{\r\n URL=\"/general/crm/linkman/query/list.php?BE_CALLED=YES&CUSTOMER_ID2=";
echo "\"+CUSTOMER_ID;\r\n myleft=(screen.availWidth-800)/2;\r\n window.open(URL,\"\",\"height=400,width=600,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\n\r\nfunction contact(CUSTOMER_ID)\r\n{\r\n URL=\"/general/crm/contact/query/list.php?BE_CALLED=YES&CUSTOMER_ID2=\"+CUSTOMER_ID;\r\n myleft=(screen.availWidth-800)/2;\r\n window.open(URL,\"\",\"height=400,width=600,stat";
echo "us=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\");\r\n}\r\n\r\nfunction product(CUSTOMER_ID)\r\n{\r\n URL=\"/general/sale/sale_history/query/list.php?BE_CALLED=YES&CUSTOMER_ID2=\"+CUSTOMER_ID;\r\n myleft=(screen.availWidth-800)/2;\r\n window.open(URL,\"\",\"height=400,width=600,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left=\"+myleft+\",resizable=yes\"";
echo ");\r\n}\r\n\r\n\r\n/*2007-7-3 sun 把客户信息在新的地方打开,用customer_detail(CUSTOMER_ID)代替原来的detail(CUSTOMER_TD)*/\r\n\r\nfunction customer_detail(CUSTOMER_ID)\r\n{\r\n\tvar url\t= \"/general/crm/customer/detail.php?CUSTOMER_ID=\"+CUSTOMER_ID;\r\n\twindow.open(url,\"\",\"height=650,width=900,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=30,left=30,resizable=yes\");\r\n}\r\n</script>\r\n";
if ( 0 < ( $n = $_REQUEST['cur_page'] - $total_page_nums ) )
{
$cur_page = $_REQUEST['cur_page'] - $n;
header( "location:".$_SERVER['PHP_SELF']."?&keyword=".$_REQUEST['keyword']."&order=".$_REQUEST['order']."&sens=".$_REQUEST['sens']."&cur_page=".$cur_page );
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -