|
 |
|
พี่วิน และพี่ๆ ทุกคนช่วยน้องหน่อยนะค่ะ ยังแก้ไม่ได้เลยอะค่ะ |
|
 |
|
|
 |
 |
|
น่าจะมีcommentอธิบายด้วยเน๋อ
|
 |
 |
 |
 |
Date :
2010-02-28 16:05:40 |
By :
sirsnake_knight |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
น่าจะอย่างนี้นะครับ
<a href="show_asset.php?id_asset=$id_asset">แสดงรายละเอียด</a>
เอา $ ออกCode
 
|
 |
 |
 |
 |
Date :
2010-02-28 16:11:03 |
By :
io |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไม่ได้เลยอะค่ะ คุณ io
|
 |
 |
 |
 |
Date :
2010-02-28 16:13:10 |
By :
jiro_aaron |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
search8.php
<?php
session_start();
?>
<html><style type="text/css">
<!--
body {
background-image: url();
}
.style2 {
font-family: "2005_jannnnnJPG";
font-size: 24px;
color: #990000;
}
-->
</style>
<body bgcolor="#FFFFFF">
<form name="form1" method="post" action="search8.php">
<p align="center" class="style2"><script language="JavaScript">
var message = "++ ค้นหาข้อมูลครุภัณฑ์++";
var basecolor = "ffffff" ;
var changecolor = "#cc33ff" ;
var speed =80 ;
var againspeed = 1500 ;
var n = 0 ;
document.write('<font color="'+basecolor+'">');
for (m=0;m<message.length;m++)
{
document.write('<span id= "karaoke">'+message.charAt(m)+'</span>');
}
document.write('</font>');
var temp = document.all.karaoke ;
beginneon() ;
function beginneon()
{
time = setInterval("neon()",speed);
}
function neon()
{
if (n==0)
{
for (m=0;m<message.length;m++)
temp[m].style.color = basecolor ;
}
temp[n].style.color = changecolor ;
if (n<temp.length-1)
n++;
else
{
n=0 ;
clearInterval(time) ;
setTimeout("beginneon()",againspeed);
}
}
</script><BR>
<BR><BR></p>
<p>ชื่อที่ต้องการค้นหา
<input type="text" name="keyword" value="<? echo"$keyword"; ?>">
จาก Filed
<select name="fields">
<option value="<?echo "$fields"; ?>"><?echo "$fields"; ?></option>
<option value="id_asset">รหัสครุภัณฑ์</option>
<option value="name_asset">ชื่อครุภัณฑ์</option>
<option value="detail_asset">รายละเอียดครุภัณฑ์</option>
<option value="sum_asset">จำนวนครุภัณฑ์</option>
<option value="photo_asset">รูปภาพครุภัณฑ์</option>
<option value="status_asset">สถานะครุภัณฑ์</option>
<option value="input_date">วันที่นำเข้า</option>
<option value="id_type">รหัสประเภท</option>
<option value="id_unit">รหัสหน่วย</option>
</select>
<input type="submit" name="Submit" value="ค้นหา">
</p>
</form>
<hr>
<?
if ($keyword=="" || $fields=="")
{
echo"กรุณาเลือกรายการค้นหา ด้วยค่ะ";
exit();
}
else
{
$host="localhost";
$username="";
$password="";
$db="482651220";
$tb="asset";
mysql_connect( $host,$username,$password) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ ");
mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้");
$sql="SELECT * FROM $tb where $fields like '%$keyword%'";
$db_query=mysql_db_query($db,$sql);
$num_rows=mysql_num_rows($db_query);
if(empty($num_rows))
{
echo"<center><br>ไม่พบข้อมูล <b>$keyword</b> จาก Filed <b>$fields <b> </center>";
exit();
}
else
{
?>
<div align="center"><? echo " แสดงรายการคุรภัณฑ์ <b>$keyword</b> จาก Filed <b>$fields</b> พบ <b>$num_rows</b> Reccord "; ?><br><br>
</div>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="cc33ff">
<tr>
<td width="10%">
<div align="center">รหัสครุภัณฑ์</div>
</td>
<td width="15%">
<div align="center">ชื่อครุภัณฑ์</div>
</td>
<td width="15%">
<div align="center">รายละเอียดครุภัณฑ์</div>
</td>
<td width="5%">
<div align="center">จำนวน</div>
</td>
<td width="10%">
<div align="center">รูป</div>
</td>
<td width="5%">
<div align="center">สถานะ</div>
</td>
<td width="10%">
<div align="center">วันที่นำเข้า</div>
</td>
<td width="5%">
<div align="center">รหัสประเภท</div>
</td>
<td width="5%">
<div align="center">รหัสหน่วย</div>
</td>
<td width="5%">
<div align="center">แสดงรายละเอียด</div>
</td>
</tr>
</table>
<?
$a=0;
while($a < $num_rows)
{
$result = mysql_fetch_array($db_query);
$id_asset=$result[id_asset];
$name_asset=$result[name_asset];
$detail_asset=$result[detail_asset];
$sum_asset=$result[sum_asset];
$photo_asset=$result[photo_asset];
$status_asset=$result[status_asset];
$input_date=$result[input_date];
$id_type=$result[id_type];
$id_unit=$result[id_unit];
?>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="cc33ff">
<tr>
<td width="10%">
<?echo"$id_asset";?>
</td>
<td width="15%">
<?echo"$name_asset";?>
</td>
<td width="15%">
<?echo"$detail_asset";?>
</td>
<td width="5%">
<?echo"$sum_asset";?>
</td>
<td width="10%">
<?echo"$photo_asset";?>
</td>
<td width="5%">
<?echo"$status_asset";?>
</td>
<td width="10%">
<?echo"$input_date";?>
</td>
<td width="5%">
<?echo"$id_type";?>
</td>
<td width="5%">
<?echo"$id_unit";?>
</td>
<td width="5%">
<a href="show_asset.php?id_asset=<?php echo $id_asset; ?>">แสดงรายละเอียด</a>
</td>
</tr>
</table>
<?
$a++;
}
}
}
?>
</body>
</html>
show_asset.php
<?
$id_asset=$_GET[id_asset];
?>
</TD>
<TD WIDTH="770" VALIGN="top" BGCOLOR="#FFFFFF"><div align="center">
<TABLE WIDTH="100%" BORDER="0" CELLSPACING="4">
<?
$sql="select * from asset where id_asset=$id_asset";
$result=mysql_db_query($dbname,$sql);
$rs=mysql_fetch_array($result);
$id_asset=$rs[id_asset];
//$code=sprintf("%05d",$id_asset);
$name_asset=$rs[name_asset];
$detail_asset=$rs[detail_asset];
$sum_asset=$rs[sum_asset];
$photo_asset=$rs[photo_asset];
$status_asset=$rs[status_asset];
$input_date=$rs[input_date];
$id_type=$rs[id_type];
$id_unit=$rs[id_unit];
if ($photo_asset=="") {
$photo_asset="temp.jpg";
}
echo "<TR>
<TD WIDTH='20%' VALIGN='top'>
<IMG SRC='picture/$photo_asset' >
</TD>
<TD WIDTH='80%' VALIGN='top'>
<BR>
<BR>
<B>รหัสครุภัณฑ์ :</B> $id_asset<BR>
<B>ชื่อครุภัณฑ์ :</B> $name_asset<BR>
<B>รายละเอียด :</B> $detail_asset <BR><BR>
<B>จำนวน :</B> $sum_asset<BR>
<B>รูปภาพ:</B> $photo_asset<BR>
<B>สถานะ :</B> $status_asset <BR><BR>
<B>วันที่รับเข้า :</B><BR><BR>$input_date<BR><BR>
<B>รหัสประเภท :</B> $id_type บาท<BR><BR>
<B>รหัสหน่วย :</B><BR><BR>$id_unit<BR><BR>
</TD>
</TR>";
?>
</TABLE>
</TD>
</TR>
</BODY>
</HTML>
|
 |
 |
 |
 |
Date :
2010-02-28 22:39:05 |
By :
onedan |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 01
|