<? include('include.php');//包含信息?>
<?
$action=$_GET["action"];
switch($action)
{
case "del";
{
$delid=$_GET["delid"];
if($delid) {
$dbquery="delete from $tbdbg where id=".$delid;
$db->query($dbquery);
}
break;
}

}


$dbquery="select id,xm,sex,nl,jcbw,yxh,jcfsid,djys,braddtime from $tbdbg order by id desc";
//echo $dbquery;
$cnum=$db->num_rows($dbquery);
$psize=$_SESSION["fycount"]; $ptj="";
$result=showfy("listbrmain.php",$dbquery,$ptj,$cnum,$psize);
$_GET['page']=$_GET['page']?$_GET['page']:1;

?>
<link href="css/bc.css" rel="stylesheet" type="text/css">

<TABLE class=gridView id=ctl00_ContentPlaceHolder2_GridView1
      style="WIDTH: 100%; BORDER-COLLAPSE: collapse" cellSpacing=0 rules=all
      border=1>
  <tr>
    <td width="93" class=gridViewHeader scope=col>
      <div align="center"><b><strong>姓名</strong></b></div>
    </td>
    <td width="47" class=gridViewHeader scope=col>
      <div align="center"><b><strong>性别</strong></b></div>
    </td>
    <td width="57" class=gridViewHeader scope=col>
      <div align="center"><b><strong>年龄</strong></b></div>
    </td>
    <td width="112" class=gridViewHeader scope=col>
      <div align="center"><b><strong>影像号</strong></b></div>
    </td>
    <td width="90" class=gridViewHeader scope=col>
      <div align="center"><b><strong>检查部位</strong></b></div>
    </td>
    <td width="90" class=gridViewHeader scope=col>
      <div align="center"><b><strong>检查方式</strong></b></div>
    </td>
    <td width="88" class=gridViewHeader scope=col>
      <div align="center"><b><strong>登记医生</strong></b></div>
    </td>
    <td width="296" class=gridViewHeader scope=col>
      <div align="center"><b><strong>登记时间</strong></b></div>
    </td>
    <td width="92"  class=gridViewHeader scope=col>
      <div align="center"><b><strong>操作</strong></b></div>
    </td>
  </tr>
  <?
                         while($arr=$db->result_query($result))
                         {
                         $id=$arr["id"];
                         $xm=$arr["xm"];
                         $sex=$arr["sex"];
                         $sex=($sex=='0')?'男':'女';
                         $nl=$arr["nl"];
                         $yxh=$arr["yxh"];
                         $jcbw=$arr["jcbw"];
                         $jcfsid=$arr["jcfsid"];
                         $djys=$arr["djys"];
                         $djaddtime=substr($arr["braddtime"],0,10);

                         $tdbquery="select * from $tbdjcfs where id=$kdys limit 0,1";
                         $tresult=$db->query($tdbquery);
                         while($tarr=$db->result_query($tresult)){$kdysname=$tarr['username'];}


                         $cdbquery="select * from $tbduser where id=$djys limit 0,1";
                         $cresult=$db->query($cdbquery);
                         while($carr=$db->result_query($cresult)){$djysname=$carr['username'];}
                         ?>
  <tr class="tr_southidc">
    <td  class=gridViewItem width="93" nowrap height="30">
      <div align="center">
        <?=$xm?>
      </div>
    </td>
    <td  class=gridViewItem width="47" nowrap height="30">
      <div align="center">
        <?=$sex?>
      </div>
    </td>
    <td  class=gridViewItem width="57" nowrap height="30">
      <div align="center">
        <?=$nl?>
      </div>
    </td>
    <td  class=gridViewItem width="112" nowrap height="30">
      <div align="center">
        <?=$yxh?>
      </div>
    </td>
    <td  class=gridViewItem width="90" nowrap height="30">
      <div align="center">
        <?=$jcbw?>
      </div>
    </td>
    <td  class=gridViewItem width="90" nowrap height="30">
      <div align="center">
        <?=$kdysname?>
      </div>
    </td>
    <td  class=gridViewItem width="88" nowrap height="30">
      <div align="center">
        <?=$djysname?>
      </div>
    </td>
    <td  class=gridViewItem width="296" height="30">
      <div align="center">
        <?=$djaddtime?>
      </div>
    </td>
    <td class=gridViewItem width="92" nowrap height="30">
      <div align="center" style='font-size:12px'>
      <?
      if($djys==$_SESSION['loginid'] || $_SESSION['mytype'][5]==3 || $_SESSION['logsup']=='yes')
      {
      ?>
      <a href=# title='删除此病人信息' onclick="return del('<?=$xm?>',<?=$id?>,<?=$_GET['page']?>)">删</a>
      &nbsp;<a href=editbr.php?thisid=<?=$id?> title='修改此病人资料信息'>编</a>
      <?
      }
      ?>



      &nbsp;<a href=showbr.php?thisid=<?=$id?> title='显示此病人详细资料信息'>详</a>

    </td>
  </tr>
  <?

                          }
                          ?>
</table>