<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>

<style type="text/css">
<!--
.colleague_STYLE1 {font-size: 12px}
-->
</style>
</head>

<body>
<table width="780" border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#EBEBEB">
  <tr>
    <td width="15%" height="20" align="center" bgcolor="#E9F7FD"><span class="colleague_STYLE1">姓名</span></td>
    <td width="15%" align="center" bgcolor="#E9F7FD"><span class="colleague_STYLE1">电话</span></td>
    <td width="15%" align="center" bgcolor="#E9F7FD"><span class="colleague_STYLE1">邮箱</span></td>
    <td width="15%" align="center" bgcolor="#E9F7FD"><span class="colleague_STYLE1">生日</span></td>
    <td width="22%" align="center" bgcolor="#E9F7FD"><span class="colleague_STYLE1">地址</span></td>
    <td width="18%" align="center" bgcolor="#E9F7FD"><a href="#" class="colleague_STYLE1" onClick="MM_openBrWindow('insert_colleague.php','','toolbar=yes,width=440,height=235')">添加联系人</a></td>
  </tr>

<?php
include_once ('conn/conn.php');						//载入adodb.ini.php文件

	$sql = "select * from tb_colleague where tb_colleague_category='$_GET[lmlb]'";				//查询语句
	$num = 5;										//每页显示的记录数
	if(isset($_GET['n_page'])){						//判断当前页码
		$c_page = $_GET[n_page];					//将$n_page赋给变量$c_apge
	}else{
		$c_page = 1;								//初始化变量$c_page
	}	
	$rst = $conn -> PageExecute($sql,$num,$c_page);	//执行pageExecute函数

	$ret=$conn->Execute($sql);
	$record=count($ret->GetRows());					//统计总的记录数

if($rst->EOF){
	
?>
<tr><td colspan="6" align="center" class="colleague_STYLE1">没有数据</td></tr>
<?php 
}else{
while(!$rst -> EOF){							//配合wihle语句循环输出结果

?>
<tr>
<td align="center" bgcolor="#F8F8F8" class="colleague_STYLE1"><span class="colleague_STYLE1">
      <?php echo $rst->fields[1];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8" class="colleague_STYLE1"><span class="colleague_STYLE1">
        <?php echo $rst->fields[3];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8" class="colleague_STYLE1"><span class="colleague_STYLE1">
       <?php echo $rst->fields[4];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8" class="colleague_STYLE1"><span class="colleague_STYLE1">
       <?php echo $rst->fields[5];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8" class="colleague_STYLE1"><span class="colleague_STYLE1">
     <?php echo $rst->fields[2];?>
    </span></td>
    <td align="center" bgcolor="#F8F8F8" class="colleague_STYLE1"><a href="delete_colleague_customer.php?lmbs=<?php echo $_GET[lmbs];?>&colleague=  <?php echo $rst->fields[0];?>" class="colleague_STYLE1">删除</a></td>
</tr>
<?php 
	$rst -> movenext();										//指针下移
}
?>
<tr><td colspan="7">

    <table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="143" class="colleague_STYLE1">总计<?php echo $record; ?>条记录</td>
        <td width="150" class="colleague_STYLE1">&nbsp;当前页<?php echo $rst-> RecordCount();?>条记录</td>
       <td width="186" class="colleague_STYLE1">
<font color='#999999'>当前是第<?php echo $rst -> absolutePage(); ?>页/合计是<?php echo $rst -> LastPageNo(); ?>页</font></td>
<td width="271" class="colleague_STYLE1">
<?php


		if(!$rst -> AtfirstPage()){					//如果当前页不是首页
?>



<!--  输出向上翻页超链接  -->
		<a href ="<?php echo '?n_pge=1' ?>"> 首页 </a>
		<a href ="<?php echo '?n_page='.($rst -> absolutePage() - 1); ?>"> 上一页 </a>
<!--  ----------------------------  -->
<?php
		}
		if(!$rst -> AtlastPage()){					//如果当前页不是尾页
?>
<!--  输出向下翻页超链接  -->
		<a href = "<?php echo '?n_page='.($rst -> absolutePage() + 1); ?>"> 下一页 </a>
		<a href ="<?php echo '?n_page='.($rst -> LastPageNo());?>"> 尾页 </a>	
<!--  -----------------------------  -->

<?php
		}

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