<?
require"ygl.php";
if(!isset($ses_user_id)||!isset($ses_user_psd)){errorview("对不起，你没有登陆！！");exit;}
$user_login_id=$ses_user_id;
$user_login_psd=$ses_user_psd;
if(!ynjoinclass($user_login_id)){errorview("对不起，你没有加入该班！！");exit;}
read_user_zl($user_login_id);
readclass();
$ynhead1="1";
$ynhead2="1";
$ynhead3="1";
$title="班级名片";
include"header.php";
if(file_exists("user/list"))
$card_file=file("user/list");
$size=count($card_file);
$ii=1; $j=$size;
while ($j>0) {
 $j=$j-$perpage;
}
?>
<table width="750" border="0" cellspacing="0" cellpadding="0" height=5>
 <tr>
  <td>&nbsp;</td>
 </tr>
</table>
<table width="750" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#B5E1F7" bordercolordark="#FFFFFF">
 <tr>
  <td colspan="2">
   <div align="center"><b><font color="#000066">班级名片册</font></b></div>
  </td>
 </tr>
 <tr>
  <td align="center">
   <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<?
if ($page == "") {$page=$ii;}
$pages=$page-1;
$pages=$page*$perpage-$perpage;
for($i=$pages; $i<$pages+$perpage; $i++) {
 $linea=$card_file[$i];
 $linea=ereg_replace("\n", "", $linea);
 if ($linea != "") {
 $lines1a=file("user/list");
 while (list($tmpkey, $line1a) = each($lines1a))
  {
  $line1=ereg_replace("\n", "", $line1);
  list($cus_id)=split("\t",$linea);
  }
if(file_exists("user/$cus_id.crd"))
{read_card($cus_id);
print"<td align=center><table width=220 border=0 cellspacing=0 cellpadding=3 align=center>
 <tr> <td bgcolor=#f2f2f2> <table width=100% border=0 cellspacing=0 cellpadding=0>
<tr>
 <td width=68% align=center class=3dfont>$my_name</td>
<td width=32% align=right><img src=image/card.gif width=34 height=34></td>
</tr><tr><td colspan=2><table width=100% border=0 cellspacing=0 cellpadding=2>
<tr><td>工作单位:$w_addr</td></tr>
<tr><td>TEL:$gu_tel</td></tr><tr>
<td>MP:$m_phone</td> </tr><tr>
<td>E-mail:$my_mail</td> </tr></table> </td> </tr> </table> </td> </tr>
</table><p>&nbsp;</p></td>
";
}if($i%2==1)print"</tr><tr>";
}}
?>
</tr></table>
  </td>
 </tr>
 <tr align="center">
  <td colspan="2">&nbsp;</td>
 </tr>
</table>
<? print"<div align=center>";
 $j=$size;
while ($j>0) {
 if ($page != $ii) {print "<a href=classcard.php?page=$ii>";};
 print "[$ii]";
 if ($page != $ii) {print "</a>";};
 $j=$j-$perpage;
 $ii++;
}
 print"</div>";
 ?>