<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>

<script type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
//-->
</script>

</head>

<body>
<table width="100%" border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#EBEBEB">
  <tr>
    <td width="15%" height="20" align="center" bgcolor="#E9F7FD"><span class="STYLE1">姓名</span></td>
    <td width="15%" align="center" bgcolor="#E9F7FD"><span class="STYLE1">电话</span></td>
    <td width="15%" align="center" bgcolor="#E9F7FD"><span class="STYLE1">邮箱</span></td>
    <td width="15%" align="center" bgcolor="#E9F7FD"><span class="STYLE1">生日</span></td>
    <td width="22%" align="center" bgcolor="#E9F7FD"><span class="STYLE1">地址</span></td>
    <td width="18%" align="center" bgcolor="#E9F7FD"><a href="#" class="STYLE1" onClick="MM_openBrWindow('insert_colleague.php','','toolbar=yes,width=440,height=219')">添加同事</a></td>
  </tr>
    <?php
       include("conn/conn.php");
	  $sql=mysql_query("select count(*) as total from tb_colleague",$conn);
	  $info=mysql_fetch_array($sql);
	  $total=$info[total];
	 if($total==0){
	?>
	<tr>
        <td height="20" colspan="6" align="center" bgcolor="#F8F8F8"><div align="center" class="STYLE1">没有信息！</div></td>
  </tr>
	
	<?php
		}else{		
		  if(empty($_GET[page])==true || is_numeric($_GET[page])==false){
		     $page=1;
		   }else{
		     $page=intval($_GET[page]);
		   }
		   
		   $pagesize=1;
		   
		   if($total<$pagesize){
		     $pagecount=1;
		   }else{
		     if($total%$pagesize==0){
			    $pagecount=intval($total/$pagesize);
			  }else{
			    $pagecount=intval($total/$pagesize)+1;
			  } 
		   }
	   $sql=mysql_query("select * from tb_colleague order by tb_colleague_id desc limit ".($page-1)*$pagesize.",$pagesize",$conn);
	   while($info=mysql_fetch_array($sql)){  			   
	 ?>
  <tr>
    <td align="center" bgcolor="#F8F8F8"><span class="STYLE1">
      <?php echo $info[tb_colleague_name];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8"><span class="STYLE1">
      <?php echo $info[tb_colleague_tel];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8"><span class="STYLE1">
      <?php echo $info[tb_colleague_mail];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8"><span class="STYLE1">
      <?php echo $info[tb_colleague_birthday];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8"><span class="STYLE1">
      <?php echo $info[tb_colleague_address];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8"><a href="delete_colleague_customer.php?colleague=<?php echo $info[tb_colleague_id];?>" class="STYLE1">删除</a></td>
  </tr>
  <?php }?>
  <tr>
    <td colspan="6" align="center" bgcolor="#F8F8F8">


<table width="95%" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><div align="left">&nbsp;&nbsp;共有&nbsp;<?php echo $total;?>&nbsp;条记录&nbsp;每页显示&nbsp;<?php echo $pagesize;?>&nbsp;条&nbsp;第&nbsp;<?php echo $page;?>&nbsp;页/共&nbsp;<?php echo $pagecount;?>&nbsp;页</div></td>
              <td><a href="indexs.php?lmlb=同事信息管理&page=1" class="a1">


<?php
	
		 for($i=1;$i<=$pagecount;$i++)
		  {	 
?>
          <a href="indexs.php?lmlb=同事信息管理&page=<?php echo $i;?>" ><?php echo $i;?></a>

         
<?php 
          }
  ?>

</td>
            </tr>
      </table>
  

</td>
  </tr>
  <?php  }?>
</table>
</body>
</html>
