?? liulan.php
字號:
<?
$MAXROWS=15;
session_start();
if(isset($cata)&&(($cata%1000))!=0)
{
$which=$cata;
if(!session_is_registered("which"))
{
session_register("which");
}
$db=@mysql_connect("localhost","root","307910");
if($db==false)
{
print "Database failed!";
exit();
}
$res=@mysql_db_query("bookseller","select * from books where class=$which;",$db);
if($res==false)
{
print "Database failed!";
exit();
}
$rows=mysql_num_rows($res);
$goto="location:$PHP_SELF?total=$rows&from=0";
if(count($HTTP_GET_VARS)==2)
{
for($i=0;$i<2;$i++)
{
$argv=each($HTTP_GET_VARS);
if(strstr($argv[0],"action")!=false)
{
$goto=$goto."&$argv[0]=$argv[1]";
}
else if(strstr($argv[0],"cata")!=false)
{
$goto=$goto."&$argv[0]=".($argv[1]-$argv[1]%1000);
}
}
}
header($goto);
}
if(!session_is_registered("wenyi_action"))
{
$wenyi_action=0;
session_register("wenyi_action");
}
if(!session_is_registered("sheke_action"))
{
$wenyi_action=0;
session_register("sheke_action");
}
if(!session_is_registered("keji_action"))
{
$wenyi_action=0;
session_register("keji_action");
}
if(!session_is_registered("shenghuo_action"))
{
$wenyi_action=0;
session_register("shenghuo_action");
}
if(!session_is_registered("jiaoyu_action"))
{
$wenyi_action=0;
session_register("jiaoyu_action");
}
if(!session_is_registered("gongju_action"))
{
$wenyi_action=0;
session_register("gongju_action");
}
$wenyi=array('骨科','小兒科','婦產科','內科','外科','神經科','眼科','扭傷科','中風科','牙科','腦科','皮膚科');
$sheke=array('小兒科','婦產科','內科','外科','神經科','眼科','扭傷科','中風科','牙科','腦科','皮膚科','護士長','......');
$keji=array('器械10','器械1','器械2','器械3','器械4','器械5','器械6','器械7','器械8','器械9');
$jiaoyu=array('高級床位','中級床位','普通床位','輔助設施','床位1');
$shenghuo=array('西藥','中藥','保健藥.性','心理','醫藥1','醫藥2','醫藥3','醫藥4','醫藥5','醫藥6','醫藥7','醫藥8');
$gongju=array('院長.副院長','主治醫師','教授.副教授','專家');
?>
<html><head><title>醫院概況瀏覽</title>
<meta content="text/html;charset=gb2312" http-equiv=Content-Type></head>
<?
require("index.html.inc");
?>
<body>
<table border=0 width="100%" bgcolor=#8cc9ec cellpadding=1 cellspacing=1>
<tbody>
<tr>
<td width=180 bgcolor=#8cc9ec>
<table>
<tr><td><FONT class=font6>概況瀏覽</FONT></td></tr>
<tr><td><A href=<?
if($cata==1000)
{
$wenyi_action=1-$wenyi_action;
}
print "\"$PHP_SELF?cata=1000&wenyi_action=$wenyi_action\"";
?>>醫生</A><br>
<?
if($wenyi_action==1)
{
print "<table>\n<tbody>\n<tr>\n";
for($i=0;$i<count($wenyi);$i++)
{
print "<td>    |-";
print "<A href=\"$PHP_SELF?cata=".(1005+$i*5);
print "\">$wenyi[$i]</A></br></td></tr>";
}
print "</tbody></table>\n";
}
?>
</td></tr>
<tr><td><A href=<?
if($cata==2000)
{
$sheke_action=1-$sheke_action;
}
print "\"$PHP_SELF?cata=2000&sheke_action=$sheke_action\"";
?>>護士</A><br>
<?
if($sheke_action==1)
{
print "<table>\n<tbody>\n<tr>\n";
for($i=0;$i<count($sheke);$i++)
{
print "<td>    |-";
print "<A href=\"$PHP_SELF?cata=".(2005+$i*5);
print "\">$sheke[$i]</A></br></td></tr>";
}
print "</tbody></table>\n";
}
?>
</td></tr>
<tr><td><A href=<?
if($cata==3000)
{
$keji_action=1-$keji_action;
}
print "\"$PHP_SELF?cata=3000&keji_action=$keji_action\"";
?>>醫療器械</A><br>
<?
if($keji_action==1)
{
print "<table>\n<tbody>\n<tr>\n";
for($i=0;$i<count($keji);$i++)
{
print "<td>    |-";
print "<A href=\"$PHP_SELF?cata=".(3005+$i*5);
print "\">$keji[$i]</A></br></td></tr>";
}
print "</tbody></table>\n";
}
?>
</td></tr>
<tr><td><A href=<?
if($cata==4000)
{
$jiaoyu_action=1-$jiaoyu_action;
}
print "\"$PHP_SELF?cata=4000&jiaoyu_action=$jiaoyu_action\"";
?>>床位</A><br>
<?
if($jiaoyu_action==1)
{
print "<table>\n<tbody>\n<tr>\n";
for($i=0;$i<count($jiaoyu);$i++)
{
print "<td>    |-";
print "<A href=\"$PHP_SELF?cata=".(4005+$i*5);
print "\">$jiaoyu[$i]</A></br></td></tr>";
}
print "</tbody></table>\n";
}
?>
</td></tr>
<tr><td><A href=<?
if($cata==5000)
{
$shenghuo_action=1-$shenghuo_action;
}
print "\"$PHP_SELF?cata=5000&shenghuo_action=$shenghuo_action\"";
?>>醫藥</A><br>
<?
if($shenghuo_action==1)
{
print "<table>\n<tbody>\n<tr>\n";
for($i=0;$i<count($shenghuo);$i++)
{
print "<td>    |-";
print "<A href=\"$PHP_SELF?cata=".(5005+$i*5);
print "\">$shenghuo[$i]</A></br></td></tr>";
}
print "</tbody></table>\n";
}
?>
</td></tr>
<tr><td><A href=<?
if($cata==6000)
{
$gongju_action=1-$gongju_action;
}
print "\"$PHP_SELF?cata=6000&gongju_action=$gongju_action\"";
?>>領導簡介</A><br>
<?
if($gongju_action==1)
{
print "<table>\n<tbody>\n<tr>\n";
for($i=0;$i<count($gongju);$i++)
{
print "<td>    |-";
print "<A href=\"$PHP_SELF?cata=".(6005+$i*5);
print "\">$gongju[$i]</A></br></td></tr>";
}
print "</tbody></table>\n";
}
?>
</td></tr>
</td></tr></table></td>
<td>
<table width="100%" height="100%" bgcolor=#FFFFFF>
<tr>
<td>
<table border=1 width="100%" bgcolor=#FFFFFF>
<tbody>
<?
print "<tr valign=top><th align=center>書名</th><th align=center>作者</th><th align=center>出版社</th><th align=center>頁數</th><th align=center>售價</th><th align=center>庫存量</th><th align=center>action</th></tr>\n";
if(isset($which)&&isset($from)&&isset($total))
{
$db=@mysql_connect("localhost","root","307910");
if($db==false)
{
print "Connect failed!";
exit();
}
$to=($total<($from+$MAXROWS))?($total-$from):$MAXROWS;
$query=@mysql_select_db("bookseller",$db);
$res=@mysql_query($query,$db);
if(res==false)
{
print "Switch to \"bookseller\"database failed";
exit();
}
$query="select isdn,title,author,publisher,page,price,quantity from books where class=$which order by publishday limit ".($from+0).",".$to.";";
//$query="select isdn,title,author,publisher,page,price,quantity from books where class=$which;";
$res=@mysql_query("set names 'gb2312'");//("SET NAMES 'utf8'");
$res=@mysql_query($query,$db);//
$num=mysql_num_rows($res);
if($num==0)
{
print "沒有此類的記載!";
exit();
}
// $res=@mysql_db_query("bookseller",$query,$db);
// if($res==false)
// {
// print "Query failed!";
// exit();
// }
if($total!=0)
{
print "顯示記錄".($from+0)."-";
print $to+$from-1;
print "(總共 $total)\n<tr>";
// $num=mysql_num_rows($res);
for($i=0;$i<$num;$i++)
{
$row=mysql_fetch_row($res);
$publisher=mysql_query("select fullname from publishers where id=$row[3];",$db);
$publisher=mysql_fetch_row($publisher);
$row[3]=$publisher[0];
print "<td align=center>";
print "<A href=\"detail.php?isdn=$row[0]\">";
print "$row[1]</A></td>";
for($j=2;$j<7;$j++)
{
print "<td align=center>$row[$j]</td>";
}
print "<td align=center>";
print "<A href=\"order.php?isdn=$row[1]\">";
print "<img border=0 src=\"car.gif\"></A></td></tr>\n";
}
print "<tr><td colspan=7 align=center>";
print "<A href=\"$PHP_SELF?from=0&total=$total\">";
print "首頁</A> ";
if($from>=2*$MAXROWS)
{
print "<A href=\"$PHP_SELF?from=";
print ($from-$to)."&total=$total\">上一頁</A> ";
}
if(($from+$to)<$total)
{
print "<A href=\"$PHP_SELF?from=";
print ($from+$to)."&total=$total\">下一頁</A> ";
}
if($total>$MAXROWS)
{
print "<A href=\"$PHP_SELF?from=";
print ($total-$total%$MAXROWS);
print "&total=$total\">末頁</A>";
}
print "</td></tr>\n";
}
}
?>
</tbody></table>
</td>
</tr></table></td>
</tr>
</tbody>
</table>
<p align=center>這是您第..<?require("counter.php");?>..次訪問本站</p>
<?
require("foot.html.inc");
?>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -