把谁做为判断条件显示的时候谁就出错
<?php
include("../conn.php");
require("../mylib.inc.php");
authorize() ;
$ipadd = $_SERVER["REMOTE_ADDR"];
//echo $ipadd.$status;
if(($status<3)&&($ipadd!="218.247.170.214"))
err_exit("您只能在公司工作");
include("../page.class.php");
if($status<2)
err_exit("没权限或者登陆超时");
$condition = " id>0 ";
//选定gateway
if (($_REQUEST["gateway"])!="")
{ $gateway = $_REQUEST["gateway"];
$condition .= " and gateway='$gateway'";
}
//选定pingtai
if (($_REQUEST["pingtai"])!="")
{ $pingtai = $_REQUEST["pingtai"];
$condition .= " and pingtai='$pingtai'";
}
$sqlnum = "select count(*) from cr_xinrui_phone where ".$condition ;
$resultnum = mysql_query($sqlnum) or die("Query failed : " . mysql_error());
$rnum = mysql_fetch_array($resultnum);
$talnum = $runm[0];
$page = new ShowPage;
$page->PageSize = 30;
$page->Total = $talnum;
$page->LinkAry = array();
$sql = "select * from cr_xinrui_phone where ".$condition." order by gateway desc limit ".$page->OffSet();
$result = mysql_query($sql) or die("Query failed : " . mysql_error());
$num = mysql_num_rows($result);
if ($num == 0)
echo ("暂时没有记录");
for ($i=0;$i<$num;$i++)
{
$r = mysql_fetch_array($result);
$id[$i] = $r["id"];
$telarea[$i] = $r["telarea"];
$telnumber[$i] = $r["telnumber"];
$gateway[$i] = $r["gateway"];
$pingtai[$i] = $r["pingtai"];
$telpw[$i] = $r["telpw"];
$telstatus[$i] = $r["status"];
$tel[$i] = $telarea[$i].$telnumber[$i];
}
if (isset($del))
{
$sql="delete from cr_xinrui_phone where id='".$del."'";
$rs=mysql_query($sql);
echo "<script>location.replace('list.php');</script>";
}
?>
<link href="../css/wfabm.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
--></style>
<style type="text/css">
<!--
body {
background-color: #EEF2FB;
background-image: url();
}
.style1 {
color: #003366;
font-weight: bold;
}
-->
</style>
<script>
function del(id){
location.replace('list.php?del='+id);
}
</script>
<table width="100%" border="0">
<tr bgcolor="#CCCCCC">
<td>号码</td>
<td>网关</td>
<td>平台</td>
<td>密码</td>
<td>状态</td>
<td>操作</td>
</tr>
<?php
for ($i=0;$i<$num;$i++)
{
?>
<tr>
<td><?php echo $tel[$i]; ?></td>
<td><?php echo $gateway[$i]; ?></td>
<td><?php echo $pingtai[$i]; ?></td>
<td><?php echo $telpw[$i]; ?></td>
<td><?php echo $telstatus[$i]; ?></td>
<td><?php echo "<a href=javascript:del('$id[$i]') class=title>删除</a>"; ?>
<a href="insert.php?id=<?php echo $id[$i]; ?>">修改</a>
</td>
</tr>
<?php
}
?>
<form name="form1" method="post" action="">
<tr bgcolor="#CCCCCC">
<td colspan="1"><a href="insert.php"><strong>新号码添加</strong></a>
</td>
<td colspan="5">网关:
<select name="gateway">
<option></option>
<option value="北京">北京</option>
<option value="上海">上海</option>
<option value="山东">山东</option>
</select>
平台:
<select name="pingtai">
<option></option>
<option value="SD_huawei">山东华为</option>
<option value="SD_zhongxing">山东中兴</option>
<option value="SD_langxun">山东朗讯</option>
</select>
<input type="submit" name="Submit" value="提交">
</td>
</tr>
</form>
<tr>
<td colspan="6" align="right"><?php
$showpage = $page->ShowLink();
echo $showpage ;
?>
</td>
</table>