📄 list.php
字号:
<?
include_once("inc/auth.php");
$PAGE_SIZE=10;
?>
<html>
<head>
<title>供应商查询 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">
function delete_PROVIDER(PROVIDER_ID)
{
msg='确认要删除该供应商么?';
if(window.confirm(msg))
{
URL="delete.php?PROVIDER_NAME=<?=$PROVIDER_NAME?>&TEL_NO=<?=$TEL_NO?>&FAX_NO=<?=$FAX_NO?>&PROVIDER_WWW=<?=$PROVIDER_WWW?>&EMAIL=<?=$EMAIL?>&PROVIDER_ADD=<?=$PROVIDER_ADD?>&POSTALCODE=<?=$POSTALCODE?>&MEMO=<?=$MEMO?>&BANK=<?=$BANK?>&ACCOUNT=<?=$ACCOUNT?>&PAGE_START=<?=$PAGE_START?>&PROVIDER_ID=" + PROVIDER_ID;
window.location=URL;
}
}
function set_page()
{
PAGE_START=(PAGE_NUM.value-1)*<?=$PAGE_SIZE?>+1;
location="list.php?PROVIDER_NAME=<?=$PROVIDER_NAME?>&TEL_NO=<?=$TEL_NO?>&FAX_NO=<?=$FAX_NO?>&PROVIDER_WWW=<?=$PROVIDER_WWW?>&EMAIL=<?=$EMAIL?>&PROVIDER_ADD=<?=$PROVIDER_ADD?>&POSTALCODE=<?=$POSTALCODE?>&MEMO=<?=$MEMO?>&BANK=<?=$BANK?>&ACCOUNT=<?=$ACCOUNT?>&PAGE_START="+PAGE_START;
}
function detail(PROVIDER_ID)
{
URL="detail.php?PROVIDER_ID="+PROVIDER_ID;
myleft=(screen.availWidth-500)/2;
window.open(URL,"read_notify","height=300,width=500,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
function product(PROVIDER_ID)
{
URL="../../sale/product/query/list.php?BE_CALLED=YES&PROVIDER_ID="+PROVIDER_ID;
myleft=(screen.availWidth-800)/2;
window.open(URL,"read_notify","height=400,width=650,status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top=150,left="+myleft+",resizable=yes");
}
</script>
</head>
<body class="bodycolor" topmargin="5" >
<?
//-----------先组织SQL语句-----------
if($PROVIDER_NAME!="")
if($WHERE_STR=="")
$WHERE_STR.=" where PROVIDER_NAME like '%".$PROVIDER_NAME."%'";
else
$WHERE_STR.=" and PROVIDER_NAME like '%".$PROVIDER_NAME."%'";
if($TEL_NO!="")
if($WHERE_STR=="")
$WHERE_STR.=" where TEL_NO like '%".$TEL_NO."%'";
else
$WHERE_STR.=" and TEL_NO like '%".$TEL_NO."%'";
if($FAX_NO!="")
if($WHERE_STR=="")
$WHERE_STR.=" where FAX_NO like '%".$FAX_NO."%'";
else
$WHERE_STR.=" and FAX_NO like '%".$FAX_NO."%'";
if($PROVIDER_WWW!="")
if($WHERE_STR=="")
$WHERE_STR.=" where PROVIDER_WWW like '%".$PROVIDER_WWW."%'";
else
$WHERE_STR.=" and PROVIDER_WWW like '%".$PROVIDER_WWW."%'";
if($EMAIL!="")
if($WHERE_STR=="")
$WHERE_STR.=" where EMAIL like '%".$EMAIL."%'";
else
$WHERE_STR.=" and EMAIL like '%".$EMAIL."%'";
if($PROVIDER_ADD!="")
if($WHERE_STR=="")
$WHERE_STR.=" where PROVIDER_ADD like '%".$PROVIDER_ADD."%'";
else
$WHERE_STR.=" and PROVIDER_ADD like '%".$PROVIDER_ADD."%'";
if($POSTALCODE!="")
if($WHERE_STR=="")
$WHERE_STR.=" where POSTALCODE like '%".$POSTALCODE."%'";
else
$WHERE_STR.=" and POSTALCODE like '%".$POSTALCODE."%'";
if($MEMO!="")
if($WHERE_STR=="")
$WHERE_STR.=" where MEMO like '%".$MEMO."%'";
else
$WHERE_STR.=" and MEMO like '%".$MEMO."%'";
if($WHERE_STR!="")
$query="SELECT count(*) from PROVIDER ".$WHERE_STR;
else
$query="SELECT count(*) from PROVIDER";
//echo $query;
$cursor= exequery($connection,$query);
$PROVIDER_COUNT=0;
if($ROW=mysql_fetch_array($cursor))
$PROVIDER_COUNT=$ROW[0];
$PAGE_TOTAL=$PROVIDER_COUNT/$PAGE_SIZE;
$PAGE_TOTAL=ceil($PAGE_TOTAL);
//--- 计算,末页 ---
if($PROVIDER_COUNT<=$PAGE_SIZE)
$LAST_PAGE_START=1;
else if($PROVIDER_COUNT%$PAGE_SIZE==0)
$LAST_PAGE_START=$PROVIDER_COUNT-$PAGE_SIZE+1;
else
$LAST_PAGE_START=$PROVIDER_COUNT-$PROVIDER_COUNT%$PAGE_SIZE+1;
//--- 智能分页 ---
//-- 页首 --
if($PAGE_START=="")
$PAGE_START=1;
if($PAGE_START>$PROVIDER_COUNT)
$PAGE_START=$LAST_PAGE_START;
if($PAGE_START<1)
$PAGE_START=1;
//-- 页尾 --
$PAGE_END=$PAGE_START+$PAGE_SIZE-1;
if($PAGE_END>$PROVIDER_COUNT)
$PAGE_END=$PROVIDER_COUNT;
//--- 计算当前页 ---
$PAGE_NUM=($PAGE_START-1)/$PAGE_SIZE+1;
$query1=str_replace("count(*)","*",$query);
$cursor1 = exequery($connection, $query1);
if($PROVIDER_COUNT==0)
{
Message("<br>提示","没有符合条件的供应商");
Button_Back();
exit;
}
?>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_open.gif" align="absmiddle"><span class="big3"> 供应商查询结果 </span>
</td>
<td valign="bottom">
<span class="small1">当前为第<b><?=$PAGE_START?></b>至<b><?=$PAGE_END?></b>条 (第<?=$PAGE_NUM?>页,共<?=$PAGE_TOTAL?>页,每页最多<?=$PAGE_SIZE?>条)</small>
</td>
</tr>
</table>
<table border="0" cellspacing="1" width="95%" class="small" bgcolor="#000000" cellpadding="3">
<tr class="TableHeader">
<td nowrap align="center">供应商名称</td>
<td nowrap align="center">电话</td>
<td nowrap align="center">传真</td>
<td nowrap align="center">网址</td>
<td nowrap align="center">电子邮件</td>
<td nowrap align="center">地址</td>
<td nowrap align="center">邮政编码</td>
<td nowrap align="center">操作</td>
</tr>
<?
$PROVIDER_COUNT = 0;
while($ROW=mysql_fetch_array($cursor1))
{
$PROVIDER_COUNT++;
if($PROVIDER_COUNT<$PAGE_START)
continue;
else if($PROVIDER_COUNT>$PAGE_END)
break;
$PROVIDER_ID=$ROW["PROVIDER_ID"];
$PROVIDER_NAME1=$ROW["PROVIDER_NAME"];
$TEL_NO1=$ROW["TEL_NO"];
$FAX_NO1=$ROW["FAX_NO"];
$PROVIDER_WWW1=$ROW["PROVIDER_WWW"];
$EMAIL1=$ROW["EMAIL"];
$PROVIDER_ADD1=$ROW["PROVIDER_ADD"];
$POSTALCODE1=$ROW["POSTALCODE"];
$MEMO1=$ROW["MEMO"];
if($PROVIDER_COUNT%2==1)
$TableLine="TableLine1";
else
$TableLine="TableLine2";
?>
<tr class="<?=$TableLine?>">
<td nowrap align="center"><?=$PROVIDER_NAME1?></td>
<td nowrap align="center"><?=$TEL_NO1?></td>
<td nowrap align="center"><?=$FAX_NO1?></td>
<td nowrap align="center"><?=$PROVIDER_WWW1?></td>
<td nowrap align="center"><?=$EMAIL1?></td>
<td align="center"><?=$PROVIDER_ADD1?></td>
<td nowrap align="center"><?=$POSTALCODE1?></td>
<td nowrap align="center">
<a href="javascript:detail('<?=$PROVIDER_ID?>');">详情 </a>
<a href="javascript:product('<?=$PROVIDER_ID?>');">相关产品 </a>
</td>
</tr>
<?
$PROVIDER_NAME1="";
$TEL_NO1="";
$FAX_NO1="";
$PROVIDER_WWW1="";
$EMAIL1="";
$PROVIDER_ADD1="";
$POSTALCODE1="";
$MEMO1="";
}
?>
<tr class="TableControl">
<td colspan="9" align="right">
<input type="button" value="首页" class="SmallButton" <?if($PAGE_START==1)echo "disabled";?> onclick="location='list.php?PROVIDER_NAME=<?=$PROVIDER_NAME?>&TEL_NO=<?=$TEL_NO?>&FAX_NO=<?=$FAX_NO?>&PROVIDER_WWW=<?=$PROVIDER_WWW?>&EMAIL=<?=$EMAIL?>&PROVIDER_ADD=<?=$PROVIDER_ADD?>&POSTALCODE=<?=$POSTALCODE?>&MEMO=<?=$MEMO?>&BANK=<?=$BANK?>&ACCOUNT=<?=$ACCOUNT?>'">
<input type="button" value="上一页" class="SmallButton" <?if($PAGE_START==1)echo "disabled";?> onclick="location='list.php?PROVIDER_NAME=<?=$PROVIDER_NAME?>&TEL_NO=<?=$TEL_NO?>&FAX_NO=<?=$FAX_NO?>&PROVIDER_WWW=<?=$PROVIDER_WWW?>&EMAIL=<?=$EMAIL?>&PROVIDER_ADD=<?=$PROVIDER_ADD?>&POSTALCODE=<?=$POSTALCODE?>&MEMO=<?=$MEMO?>&BANK=<?=$BANK?>&ACCOUNT=<?=$ACCOUNT?>&PAGE_START=<?=($PAGE_START-$PAGE_SIZE)?>'">
<input type="button" value="下一页" class="SmallButton" <?if($PAGE_END>=$PROVIDER_COUNT)echo "disabled";?> onclick="location='list.php?PROVIDER_NAME=<?=$PROVIDER_NAME?>&TEL_NO=<?=$TEL_NO?>&FAX_NO=<?=$FAX_NO?>&PROVIDER_WWW=<?=$PROVIDER_WWW?>&EMAIL=<?=$EMAIL?>&PROVIDER_ADD=<?=$PROVIDER_ADD?>&POSTALCODE=<?=$POSTALCODE?>&MEMO=<?=$MEMO?>&BANK=<?=$BANK?>&ACCOUNT=<?=$ACCOUNT?>&PAGE_START=<?=($PAGE_END+1)?>'">
<input type="button" value="末页" class="SmallButton" <?if($PAGE_END>=$PROVIDER_COUNT)echo "disabled";?> onclick="location='list.php?PROVIDER_NAME=<?=$PROVIDER_NAME?>&TEL_NO=<?=$TEL_NO?>&FAX_NO=<?=$FAX_NO?>&PROVIDER_WWW=<?=$PROVIDER_WWW?>&EMAIL=<?=$EMAIL?>&PROVIDER_ADD=<?=$PROVIDER_ADD?>&POSTALCODE=<?=$POSTALCODE?>&MEMO=<?=$MEMO?>&BANK=<?=$BANK?>&ACCOUNT=<?=$ACCOUNT?>&PAGE_START=<?=$LAST_PAGE_START?>'">
页数
<input type="text" name="PAGE_NUM" value="<?=$PAGE_NUM?>" class="SmallInput" size="2"> <input type="button" value="转到" class="SmallButton" onclick="set_page();" title="转到指定的页面">
</td>
</tr>
</table>
<?
if($BE_CALLED=="YES")
{
?>
<br>
<div align="center">
<input type="button" value="关闭" class="BigButton" onClick="javascript:window.close();">
</div>
<?
}
else
{
?>
<br>
<div align="center">
<input type="button" value="返回" class="BigButton" onClick="location='index.php';">
</div>
<?
}
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -