📄 index.php
字号:
<?
include_once("inc/auth.php");
?>
<html>
<head>
<title>客户联系人管理 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function set_page()
{
PAGE_START=PAGE_NUM.value;
location="index.php?CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&ORDERFIELD=<?=$ORDERFIELD?>&ORDERTYPE=<?=$ORDERTYPE?>&CUR_PAGE="+PAGE_START;
}
function delete_linkman(LINKMAN_ID)
{
msg='确认要删除该联系人?';
if(window.confirm(msg))
{
URL="delete.php?CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&CUR_PAGE=<?=$CUR_PAGE?>&ORDERFIELD=<?=$ORDERFIELD?>&ORDERTYPE=<?=$ORDERTYPE?>&LINKMAN_ID=" + LINKMAN_ID;
window.location=URL;
}
}
function check_one(el)
{
if(!el.checked)
document.all("allbox").checked=false;
}
function check_all()
{
for (i=0;i<document.all("email_select").length;i++)
{
if(document.all("allbox").checked)
document.all("email_select").item(i).checked=true;
else
document.all("email_select").item(i).checked=false;
}
if(i==0)
{
if(document.all("allbox").checked)
document.all("email_select").checked=true;
else
document.all("email_select").checked=false;
}
}
function delete_mail()
{
delete_str="";
for(i=0;i<document.all("email_select").length;i++)
{
el=document.all("email_select").item(i);
if(el.checked)
{ val=el.value;
delete_str+=val + ",";
}
}
if(i==0)
{
el=document.all("email_select");
if(el.checked)
{ val=el.value;
delete_str+=val + ",";
}
}
if(delete_str=="")
{
alert("请至少选择其中一个联系人");
return;
}
msg='确认要删除所选联系人?';
if(window.confirm(msg))
{
URL="delete.php?CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&CUR_PAGE=<?=$CUR_PAGE?>&ORDERFIELD=<?=$ORDERFIELD?>&ORDERTYPE=<?=$ORDERTYPE?>&delete_str=" + delete_str;
window.location=URL;
}
}
function mobile_sms(MOBIL_NO_STR)
{
URL="/general/mobile_sms/new/?TO_ID1="+MOBIL_NO_STR;
myleft=(screen.availWidth-650)/2;
window.open(URL,"mobile_sms","height=350,width=650,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
</script>
</head>
<body>
<div align="left">
<fieldset style="width:95%;padding-bottom:5px;">
<legend class="small" align=left>
<b> 查 询 </b>
</legend>
<table cellspacing="1" class="small" align="left" cellpadding="3">
<form action="index.php" method="post" name="form1">
<tr>
<td nowrap class="TableData"> 客户名称: </td>
<td nowrap class="TableData">
<input type="text" name="CUSTOMER_NAME" class="SmallInput" size="15" maxlength="100">
</td>
<td nowrap class="TableData">客户编码: </td>
<td nowrap class="TableData">
<input type="text" name="CUSTOMER_CODE" class="SmallInput" size="15" maxlength="100">
</td>
<td nowrap class="TableData">客户简称: </td>
<td nowrap class="TableData">
<input type="text" name="CUSTOMER_SHORT" class="SmallInput" size="15" maxlength="100">
</td>
</tr>
<tr>
<td nowrap class="TableData"> 联系人姓名: </td>
<td nowrap class="TableData">
<input type="text" name="LINKMAN_NAME" class="SmallInput" size="15" maxlength="100">
</td>
<td nowrap class="TableData">地址: </td>
<td nowrap class="TableData">
<input type="text" name="ADD_HOME" class="SmallInput" size="15" maxlength="100" >
</td>
<td nowrap class="TableData">性别: </td>
<td nowrap class="TableData">
<select name="SEX" class="SmallSelect">
<option value="" ></option>
<option value="0" <? if($SEX=="0") echo "selected";?>>男</option>
<option value="1" <? if($SEX=="1") echo "selected";?>>女</option>
</select>
<input value="查询" type="submit" class="SmallButton" title="模糊查询" name="button">
</td>
</tr>
</form>
</table>
</fieldset>
</div>
<br>
<?
//-----------先组织SQL语句-----------
if($CUSTOMER_NAME!="")
$WHERE_STR.=" and b.CUSTOMER_NAME like '%".$CUSTOMER_NAME."%'";
if($CUSTOMER_CODE!="")
$WHERE_STR.=" and b.CUSTOMER_CODE like '%".$CUSTOMER_CODE."%'";
if($CUSTOMER_SHORT!="")
$WHERE_STR.=" and b.CUSTOMER_SHORT like '%".$CUSTOMER_SHORT."%'";
if($LINKMAN_NAME!="")
$WHERE_STR.=" and a.LINKMAN_NAME like '%".$LINKMAN_NAME."%'";
if($ADD_HOME!="")
$WHERE_STR.=" and a.ADD_HOME like '%".$ADD_HOME."%'";
if($SEX!="")
$WHERE_STR.=" and a.SEX='".$SEX."'";
if($ORDERFIELD!="")
{
if($ORDERSIGN=="DOWN")
{
$ORDERTYPE="ASC";
}
if($ORDERSIGN=="UP")
{
$ORDERTYPE="DESC";
}
$OREDERBY=" ORDER BY ".$ORDERFIELD." ".$ORDERTYPE;
}
$query="SELECT count(*) FROM `LINKMAN` a LEFT OUTER JOIN CUSTOMER b ON a.`CUSTOMER_ID` = b.`CUSTOMER_ID` where a.SELLER='$LOGIN_USER_ID'";
$query.=$WHERE_STR;
$cursor= exequery($connection,$query);
$LINKMAN_COUNT=0;
if($ROW=mysql_fetch_array($cursor))
$LINKMAN_COUNT=$ROW[0];
$query="SELECT a.MOBILE FROM `LINKMAN` a LEFT OUTER JOIN CUSTOMER b ON a.`CUSTOMER_ID` = b.`CUSTOMER_ID` where a.SELLER='$LOGIN_USER_ID' ".$WHERE_STR.$OREDERBY;
$cursor= exequery($connection,$query);
while($ROW=mysql_fetch_array($cursor))
{
$MOBILE1=$ROW["MOBILE"];
if($MOBILE1!="")
$MOBIL_NO_STR.=$MOBILE1.",";
}
$PER_PAGE=10;
$PAGE_COUNT=ceil($LINKMAN_COUNT/$PER_PAGE);
if($CUR_PAGE<=0 || $CUR_PAGE=="")
$CUR_PAGE=1;
if($CUR_PAGE>$PAGE_COUNT)
$CUR_PAGE=$PAGE_COUNT;
$query1="SELECT a.LINKMAN_ID,b.CUSTOMER_ID,LINKMAN_NAME,SEX,a.TEL_NO_WORK,a.MOBILE,a.EMAIL as EMAIL,a.OICQ,a.ICQ,b.CUSTOMER_NAME FROM `LINKMAN` a LEFT OUTER JOIN CUSTOMER b ON a.`CUSTOMER_ID` = b.`CUSTOMER_ID` where a.SELLER='$LOGIN_USER_ID' ".$WHERE_STR.$OREDERBY;
$offest=($CUR_PAGE-1)*10;
$query1=$query1." LIMIT ". $offest." ,".$PER_PAGE;
$cursor1 = exequery($connection, $query1);
if($LINKMAN_COUNT==0)
{
Message("<br>提示","没有符合条件的联系人");
?>
<br>
<?
exit;
}
else
{
?>
<table border="0" cellspacing="1" width="95%" class="small" cellpadding="3">
<tr>
<td align="left">
<a href="index.php?CUR_PAGE=1&CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&ORDERFIELD=<?=$ORDERFIELD?>&ORDERTYPE=<?=$ORDERTYPE?>"><img src='/images/first02.gif' width='24' border='0' height='15' alt='首页'></a>
<a href="index.php?CUR_PAGE=<?=$CUR_PAGE-1?>&CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&ORDERFIELD=<?=$ORDERFIELD?>&ORDERTYPE=<?=$ORDERTYPE?>"><img src='/images/first01.gif' width='24' border='0' height='15' alt='上一页'></a>
<a href="index.php?CUR_PAGE=<?=$CUR_PAGE+1?>&CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&ORDERFIELD=<?=$ORDERFIELD?>&ORDERTYPE=<?=$ORDERTYPE?>"><img src='/images/last01.gif' width='24' border='0' height='15' alt='下一页' style="cursor:hand"></a>
<a href="index.php?CUR_PAGE=<?=$PAGE_COUNT?>&CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&ORDERFIELD=<?=$ORDERFIELD?>&ORDERTYPE=<?=$ORDERTYPE?>"><img src='/images/last02.gif' width='24' border='0' height='15' alt='末页' style="cursor:hand"></a>
到
<input type="text" name="PAGE_NUM" size="3" maxlength="4" class="SmallInput">
页
<img id="btnGotoPage" src="/images/menu/book.gif" onclick="set_page()" border="0" WIDTH="19" HEIGHT="17" style="cursor:hand" alt="转到相应页面">
</td>
<td align="right">
<?=$CUR_PAGE?>/<?=$PAGE_COUNT?>页 共 <?=$LINKMAN_COUNT?> 条
</td>
</tr>
</table>
<table border="0" cellspacing="1" width="95%" class="small" bgcolor="#000000" cellpadding="3">
<?
$LINKMAN_COUNT = 0;
while($ROW=mysql_fetch_array($cursor1))
{
$LINKMAN_COUNT++;
$LINKMAN_ID1=$ROW["LINKMAN_ID"];
$CUSTOMER_ID1=$ROW["CUSTOMER_ID"];
$LINKMAN_NAME1=$ROW["LINKMAN_NAME"];
$SEX1=$ROW["SEX"];
$TEL_NO_WORK1=$ROW["TEL_NO_WORK"];
$EMAIL1=$ROW["EMAIL"];
$OICQ1=$ROW["OICQ"];
$ICQ1=$ROW["ICQ"];
$MOBILE1=$ROW["MOBILE"];
$CUSTOMER_NAME1=$ROW["CUSTOMER_NAME"];
if($SEX1=="0")
$SEX_DESC="男";
else
$SEX_DESC="女";
if($LINKMAN_COUNT%2==1)
$TableLine="TableLine1";
else
$TableLine="TableLine2";
?>
<tr class="<?=$TableLine?>">
<td> <input type="checkbox" name="email_select" value="<?=$LINKMAN_ID1?>" onClick="check_one(self);"></td>
<td nowrap align="center"><?=$CUSTOMER_NAME1?></td>
<td nowrap align="center"><?=$LINKMAN_NAME1?></td>
<td nowrap align="center"><?=$SEX_DESC?></td>
<td nowrap align="center"><?=$OICQ1?>/<?=$ICQ1?></td>
<td nowrap align="center"><a href="/general/mobile_sms?TO_ID1=<?=$MOBILE1?>"><?=$MOBILE1?></a></td>
<td nowrap align="center"><?=$EMAIL1?></td>
<td nowrap align="center" width="80">
<a href="edit.php?LINKMAN_ID=<?=$LINKMAN_ID1?>&CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&CUR_PAGE=<?=$CUR_PAGE?>&ORDERFIELD=<?=$ORDERFIELD?>&ORDERTYPE=<?=$ORDERTYPE?>"> 编辑</a>
<a href="javascript:delete_linkman(<?=$LINKMAN_ID1?>);"> 删除 </a>
</td>
</tr>
<?
}
}
?>
<tr class="TableControl">
<td colspan="8">
<input type="checkbox" name="allbox" id="allbox_for" onClick="check_all();">
<label for="allbox_for">全选</label>
<input type="button" value="批量删除" class="SmallButton" onClick="delete_mail();" title="删除所选联系人">
</td>
</tr>
<thead class="TableHeader">
<td nowrap align="center">选择</td>
<td nowrap align="center"><a href="index.php?CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&&ORDERFIELD=b.CUSTOMER_NAME&ORDERSIGN=<? if($ORDERSIGN=="DOWN"){echo "UP";}if($ORDERSIGN=="UP"){echo "DOWN";} if($ORDERSIGN==""){if($ORDERTYPE=="ASC"){echo "UP";}else echo "DOWN";}?>&ORDERTYPE=<?=$ORDERTYPE?>&CUR_PAGE=<?=$CUR_PAGE?>">客户名称 <? if($ORDERTYPE=="DESC" and $ORDERFIELD=="b.CUSTOMER_NAME"){?><img src="/images/arrow_down.gif" align="absmiddle" border=0><?}if($ORDERTYPE=="ASC" and $ORDERFIELD=="b.CUSTOMER_NAME"){?><img src="/images/arrow_up.gif" align="absmiddle" border=0><?}?></a></td>
<td nowrap align="center"><a href="index.php?CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&&ORDERFIELD=LINKMAN_NAME&ORDERSIGN=<? if($ORDERSIGN=="DOWN"){echo "UP";}if($ORDERSIGN=="UP"){echo "DOWN";} if($ORDERSIGN==""){if($ORDERTYPE=="ASC"){echo "UP";}else echo "DOWN";}?>&ORDERTYPE=<?=$ORDERTYPE?>&CUR_PAGE=<?=$CUR_PAGE?>">联系人姓名 <? if($ORDERTYPE=="DESC" and $ORDERFIELD=="LINKMAN_NAME"){?><img src="/images/arrow_down.gif" align="absmiddle" border=0><?}if($ORDERTYPE=="ASC" and $ORDERFIELD=="LINKMAN_NAME"){?><img src="/images/arrow_up.gif" align="absmiddle" border=0><?}?></a></td>
<td nowrap align="center"><a href="index.php?CUSTOMER_NAME=<?=$CUSTOMER_NAME?>&CUSTOMER_CODE =<?=$CUSTOMER_CODE?>&CUSTOMER_SHORT=<?=$CUSTOMER_SHORT?>&LINKMAN_NAME=<?=$LINKMAN_NAME?>&ADD_HOME=<?=$ADD_HOME?>&SEX=<?=$SEX?>&&ORDERFIELD=SEX&ORDERSIGN=<? if($ORDERSIGN=="DOWN"){echo "UP";}if($ORDERSIGN=="UP"){echo "DOWN";} if($ORDERSIGN==""){if($ORDERTYPE=="ASC"){echo "UP";}else echo "DOWN";}?>&ORDERTYPE=<?=$ORDERTYPE?>&CUR_PAGE=<?=$CUR_PAGE?>">性别 <? if($ORDERTYPE=="DESC" and $ORDERFIELD=="SEX"){?><img src="/images/arrow_down.gif" align="absmiddle" border=0><?}if($ORDERTYPE=="ASC" and $ORDERFIELD=="SEX"){?><img src="/images/arrow_up.gif" align="absmiddle" border=0><?}?></a></td>
<td nowrap align="center">QQ/MSN</td>
<td nowrap align="center">手机 <a href="javascript:mobile_sms('<?=$MOBIL_NO_STR?>');">群发</a></td>
<td nowrap align="center">电子邮件</td>
<td nowrap align="center">操作</td>
</thead>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -