<?php
include_once(dirname(__FILE__).'.. /.. /Inc/Conn.php');
include_once(dirname(__FILE__).'.. /.. /photo/Inc/function.php');
?>
<! DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "HTTP://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="HTTP://www.w3.org/1999/xhtml">
<head>
<meta HTTP-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無標題文檔</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
height:17px;
padding:8px 0px 0px 0px;
text-align:center;
}
body {
margin-left: 0px;
margin-top: 10px;
margin-right: 0px;
margin-bottom: 0px;
}
td{
border:1px solid #333;
}
-->
</style></head>
<body>
<div style="height:26px;text-align:left; width:98%;font-size:16px; font-weight:bold; margin :0px auto;" ><a href="export.php" target="_blank">匯出Execel表格</a></div>
<table width="98%" border="0 " align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="8%" ><strong>帳號</strong></td>
<td width="14%"><strong>郵箱</ strong></td>
<td width="5%"><strong>性別</strong></td>
<td width="9%"><strong>寶寶出生日期</strong></td>
< td width="12%"><strong>省份</strong></td>
<td width="9%">< strong>真實姓名</strong></td>
<td width="12%"><strong>郵編</strong ></td>
<td width="10%"><strong>手機</strong></td>
<td width="21%"><strong>位址</strong></td>
</tr>
<?php
$sql ="Select * from tablename";
$result =mysql_query($sql) or die('fail1'.mysql_error());
$rs =mysql_fetch_array($result);
$rdcount =mysql_num_rows($result);
if($rdcount){
$pagesize =20;
$pagecount=($rdcount % $pagesize)? (int) ($rdcount / $pagesize)+1:$rdcount/$pagesize;//統計總頁面
$page =isset($_GET['page'])?$_GET['page']:1;//取得當前頁面
$start =($page>=1 && $page<=$pagecount)?$start=$pagesize*($page-1):$start=1;//取得超始記錄
$start =$start;
$sql =$sql." order by add_date desc limit $start,$pagesize";
$result =mysql_query($sql) or die(mysql_error());
while($rs =mysql_fetch_array($result) ){
echo"<tr>
<td>".$rs['User_Name']." </td>
<td>".$rs['User_Mail']." </td>
<td>".$rs['User_Baby_Sex']." </td>
<td>".$rs['User_Baby_Birth']." &nbsp;</td>
<td>".$rs['sheng']." &nbsp;</td>
<td>".$rs['User_rname']." &nbsp;</td>
<td>".$rs['User_Zip']." &nbsp;</td>
<td>".$rs['User_Hand']." &nbsp;</td>
<td>".$rs['User_Address']." &nbsp;</td>
</tr>
";
}
echo "<tr> <td colspan=9>";
pagelist1($page,$pagecount,$rdcount,'?page=',$pagesize);
echo "</td> </tr> ";
}else{
echo '暫時沒有資訊!';
}
function pagelist1($page,$pagecount,$totalrecord,$url,$pagesize)
{
if($page=="" || $page >$pagecount)
{
$page=1;
}
echo("記錄".$totalrecord." 條 每頁".$pagesize." 條 共".$pagecount." 頁 <a href=".$url." 1> <<</a> ");
if($page>1)
{
echo("<a href=".$url.( $page-1)." > < </a> ");
}
if($page+9>$pagecount)
{
$current = $pagecount;
}
else
{
$current = $page+9;
}
& nbsp;for($i=$page;$i<=$current;$i++)
{
echo("<a href=".$url." $i class='sf'>$i</a> ");
}
if($pagecount>$page)
{
echo("<a href=".$url.( $page+1)." > > </a> ");
}
echo("<a href=".$url.$pagecount." > >></a> ");
}
?>
</table>
</body>
</html>