?? searchdevice.php
字號:
<?php
include('../admin_global.php');
if ($_GET['action']=='chaxun') //查詢
{
$type=$_POST['serchtype'];
$content=$_POST['serchcontent'];
switch($type)
{
case 1: //設備名稱
$sql = "SELECT * FROM device,device_brand,device_type,units,sector where device.device_brand=device_brand.brand_id and device.device_type=device_type.type_id and device.device_units=units.units_id and device.device_sector=sector.sector_id and device_name LIKE '%$content%' ";
break;
case 2: //設備狀態
$sql = "SELECT * FROM device,device_brand,device_type,units,sector where device.device_brand=device_brand.brand_id and device.device_type=device_type.type_id and device.device_units=units.units_id and device.device_sector=sector.sector_id and device_state LIKE '%$content%' ";
break;
case 3: //型號
$sql = "SELECT * FROM device,device_brand,device_type,units,sector where device.device_brand=device_brand.brand_id and device.device_type=device_type.type_id and device.device_units=units.units_id and device.device_sector=sector.sector_id and device_Specification LIKE '%$content%' ";
break;
case 4: //負責人
$sql = "SELECT * FROM device,device_brand,device_type,units,sector where device.device_brand=device_brand.brand_id and device.device_type=device_type.type_id and device.device_units=units.units_id and device.device_sector=sector.sector_id and device_duty LIKE '%$content%' ";
break;
}
}
else
{
$sql ="SELECT * FROM device,device_brand,device_type,units,sector where device.device_brand=device_brand.brand_id and device.device_type=device_type.type_id and device.device_units=units.units_id and device.device_sector=sector.sector_id";
}
$query=$db->query($sql);
$total=$db->num_rows($query);
pageft($total,$page_num);
if ($total>0)
{
$sql2=$sql." limit $firstcount,$displaypg";
$query=$db->query($sql2);
while($row=$db->fetch_array($query)) {
$rsdb[]=$row;
}
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文檔</title>
<link rel="stylesheet" type="text/css" href="../css/table.css">
<script language="javascript" type="text/javascript">
</script>
<script src="../js/admin.js"></script>
</head>
<body >
<table width="300" height="22" border="0" cellpadding="0" cellspacing="0" align="center"
style="margin-top:25px; color:#000000; font-size:12px" bgcolor="#ffffff">
<!--DWLayoutTable-->
<tr>
<td align="center" valign="middle" ><strong>設備調配查詢</strong> </td>
</tr>
</table>
<div id="data">
<form name="frmchanxun" action="searchdevice.php?action=chaxun" method="post">
<table width="400" height="22" border="0" cellpadding="0" cellspacing="0" align="center"
style="margin-top:25px; color:#000000; font-size:12px" bgcolor="#ffffff">
<!--DWLayoutTable-->
<tr>
<td align="center" valign="middle" >
<select name="serchtype">
<option value="1">設備名稱</option>
<option value="2">設備狀態</option>
<option value="3">設備型號</option>
<option value="4">設備負責人</option>
</select>
關鍵字
<input name="serchcontent" type="text" style="width:150px; height:22px;border: solid 1px #000000;" > <span style="font-size:12px;width:85px;height:22px;background:url(../images/anniu.jpg);padding-top:3px; color:#FFFFFF; cursor:hand " onClick="document.frmchanxun.submit();">查 詢</span>
</td>
</tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" align="center" bgcolor="#FFFFFF">
<!--DWLayoutTable-->
<tr>
<td width="31" height="29" align="center" valign="middle" bgcolor="e9e9e9">
行號</td>
<td width="100" align="center" valign="middle" bgcolor="e9e9e9"><strong>設備名稱</strong></td>
<td width="100" align="center" valign="middle" bgcolor="e9e9e9"><strong>品牌</strong></td>
<td width="100" align="center" valign="middle" bgcolor="e9e9e9"><strong>類型</strong></td>
<td width="100" align="center" valign="middle" bgcolor="e9e9e9"><strong>型號</strong></td>
<td width="100" align="center" valign="middle" bgcolor="e9e9e9"><strong>購買時間</strong></td>
<td width="100" align="center" valign="middle" bgcolor="e9e9e9"><strong>單位</strong></td>
<td width="100" align="center" valign="middle" bgcolor="e9e9e9"><strong>部門</strong></td>
<td width="50" align="center" valign="middle" bgcolor="e9e9e9"><strong>狀態</strong></td>
</tr>
<?php
if ($total>0)
{
foreach($rsdb as $rs) {
?>
<tr>
<td height="29" align="center" valign="middle">
<?=$rs[device_id]?>
</td>
<td align="center" valign="middle">
<?php echo $rs['device_name'] ?>
</td>
<td align="center" valign="middle">
<?php echo $rs['brand_name'] ?>
</td>
<td align="center" valign="middle">
<?php echo $rs['type_name'] ?>
</td>
<td align="center" valign="middle">
<?php echo $rs['device_Specification'] ?>
</td>
<td align="center" valign="middle">
<?php echo $rs['device_orderdate'] ?>
</td>
<td align="center" valign="middle">
<?php echo $rs['units_name'] ?>
</td>
<td align="center" valign="middle">
<?php echo $rs['sector_name'] ?>
</td>
<td align="center" valign="middle">
<?php echo $rs['device_state'] ?>
</td>
<?php
}
}
?>
</table>
</form>
</div>
<table width="470" height="22" border="0" cellpadding="0" cellspacing="0" align="center"
style="margin-top:12px" >
<!--DWLayoutTable-->
<tr>
<td width="35" height="21" ></td>
<td width="82" align="center" valign="middle" ></td>
<td width="12" valign="top" ></td>
<td width="82" align="center" valign="middle"
></td>
<td width="12" valign="top" ></td>
<td width="82" align="center" valign="middle"
></td>
<td width="150" > </td>
</tr>
</table>
<table width="400" height="25" border="0" cellpadding="0" cellspacing="0" align="center"
style="margin-top:12px; color:#FFFFFF; font-size:12px" bgcolor="#000000">
<!--DWLayoutTable-->
<tr>
<td align="center" valign="middle" >
<?php echo $pagenav ?> </td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -