日期:2014-05-17 浏览次数:20410 次
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>搜索页面</title> </head> <body> <form name="form2" method="post" action="search.php"> <div align="center"> <table width="1230" height="103" border="0" align="left" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <!-- 将要列出的内容--> <th width="4" height="38" bgcolor="#E3E3E3" scope="col">登记</th> <th width="30" bgcolor="#E3E3E3" scope="col">NO.</th> <th width="80" bgcolor="#E3E3E3" scope="col">用户号码</th> <th width="80" bgcolor="#E3E3E3" scope="col">地址</th> <th width="80" bgcolor="#E3E3E3" scope="col">行动</th> <th width="80" bgcolor="#E3E3E3" scope="col">到达时间</th> <th width="80" bgcolor="#E3E3E3" scope="col">出发时间</th> <th width="80" bgcolor="#E3E3E3" scope="col">距离</th> <th width="80" bgcolor="#E3E3E3" scope="col">邮件</th> <th width="80" bgcolor="#E3E3E3" scope="col">接到邮件用时</th> <th width="80" bgcolor="#E3E3E3" scope="col">误发邮件</th> <th width="80" bgcolor="#E3E3E3" scope="col">发信邮箱</th> <th width="80" bgcolor="#E3E3E3" scope="col">机器</th> </tr> <?php $link=mysql_connect('localhost','root','mysql'); //数据库用户名及数据库密码 mysql_select_db('BERecord'); //数据库名称 mysql_query('set names utf8'); $Page_size=10; //设置每页显示个数 if(!empty($date1) || !empty($date2)){ $result=mysql_query("select * from record where searchtime between '$date1' and '$date2'"); }//record为表名 else if(!empty($date1)){ $result=mysql_query("select * from record where searchtime > '$date1'"); } else if(!empty($date2)){ $result=mysql_query("select * from record where searchtime < '$date2'"); } else { $result=mysql_query("select * from record"); } $count = mysql_num_rows($result); $page_count = ceil($count/$Page_size); $init = 1; $page_len = 7; $max_p=$page_count; $pages=$page_count; //判断当前页码 if(empty($_GET['page'])||$_GET['page']<0){ $page=1; } else{ $page=$_GET['page']; } $offset=$Page_size*($page-1); //if(!$date1 || !$date2) if($date1 != "" && $date2 != ""){ $sql="select * from record where searchtime between '$date1' and '$date2' limit $offset,$Page_size"; } else if($date1 != "" ){ $sql="select * from record where searchtime > '$date1'"; } else if($date2 != ""){ $sql="select * from record where searchtime < '$date2'"; } else{ $sql="select * from record limit $offset,$Page_size"; } $result=mysql_query($sql,$link); //$row=mysql_fetch_array($result); while($row=mysql_fetch_array($result)){ ?> <tr> <td bgcolor="#E0EEE0" height="25px"><div align="center"> <?php echo