|
|
|
รบกวนดูให้หน่อยคะพอดีว่าใช้ java กัย phpแล้วข้อมุลมันไม่เก็บอะคะ |
|
|
|
|
|
|
|
อันนี้หน้าที่ 2 คะ
Code (PHP)
<?php include('../include/config.php'); ?>
<?php @session_start();?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style3 {
font-size: 18px;
height: 100%;
width: 100%;
}
.style4 {
font-family: AngsanaUPC, AngsanaNew;
height: 100%;
width: 100%;
}
body {
background-color: #D9ECEC;
height: 100%;
width: 100%;
}
-->
</style>
</head>
<body>
<div align="center">
<table width="800" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<!--DWLayoutTable-->
<tr>
<td width="381" height="24" valign="top" background="../image/banner_02.jpg"><div align="left"><img src="../image/banner_01.jpg" width="384" height="26" /></div></td>
<td width="419" valign="top" background="../image/banner_02.jpg"><div align="right" class="style3"><?php
echo"<font size=2 >ยินดีตอนรับคุณ</font> ".$_SESSION['name'];?> <span class="style4"><a href="../member/editmember.php">แก้ไขข้อมูล</a> <a href="../Intro.php">(ออกจากระบบ)</a></span></div></td>
</tr>
<tr>
<td height="106" colspan="2" valign="top" background="../image/gbban_02.jpg"><div align="center"><img src="../image/banner12_02.jpg" alt="" width="800" height="106" /></div></td>
</tr>
<tr>
<td height="32" colspan="2" valign="top" background="../image/banner12_03.jpg"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="590" colspan="2" valign="top">
<p> </p><input name="radio" type="hidden" value="<?=$_POST["radio"]?>" />
<input name="radio2" type="hidden" value="<?=$_POST["radio2"]?>" />
<input name="radio3" type="hidden" value="<?=$_POST["radio3"]?>" />
<input name="ch" type="hidden" value="<?=$_POST["ch"]?>" />
<p><?php
for($i=1;$i<=$num1;$i++){
$asset_sub=$_POST["asset_sub$i"]; echo $asset_sub;
$asset_y=$_POST["asset_y$i"]; echo $asset_y;
$assetname=$_POST["assetname$i"]; echo $assetname;
$room_Id=$_POST["room_Id$i"]; echo $room_Id;
$roomname=$_POST["roomname$i"]; echo $roomname;
$floor=$_POST["floor$i"]; echo $floor;
$building=$_POST["building$i"]; echo $building;
$radio=$_POST["radio$i"]; echo $radio;
$radio2=$_POST["radio2$i"]; echo $radio2;
$radio3=$_POST["radio3$i"]; echo $radio3;
$ch=$_POST['check$i']; echo $ch;
$date=date("ํY-m-d H:i:s");
$sql = "select * from asset where asset_sub='$asset_sub'";//ไม่ต้องเเปลี่ยน
$result = mysql_query($sql);
$read=mysql_fetch_array($result);
if($radio=="")
{
$a="ไม่ใช้งาน";
}
else
{
$a="ใช้งาน";
}
if($radio2=="")
{
$b="ไม่พบ";
}
else
{
$b="พบ";
}
if($radio3=="")
{
$c="ไม่ชำรุด";
}
else
{
$c="ชำรุด";
}
if($ch=="")
{
echo'<script>alert("กรุณาติ๊กสถานะการตรวจสอบ");window.location="chasset.php";</script>';
}
elseif($asset_sub==$read['asset_sub'])
{$d='1';
$sql = "UPDATE `asset` SET `ch`='$d' ";
$sqlquery=mysql_query($sql)or die(mysql_error());
$sql1 = "INSERT INTO check_asset (asset_sub,asset_y,assetname,room_id,roomname,floor,building,`check`,check1,check2,date) values ('$asset_sub','$asset_y','$assetname','$room_Id','$roomname','$floor','$building','$a','$b','$c','$date')"; //กำหนดค่าตัวแปลที่เราส่งมา
$sqlquery1=mysql_query($sql1)or die(mysql_error());
}
if($sqlquery1&&$sqlquery){echo $sql1; echo $sql;
echo'<script>alert("เก็บข้อมูลเรีัยบร้อยแล้ว");window.location="chasset.php";</script>';
}
else { echo $sql1;
echo'<script>alert("ผิดพลาด");window.location="chasset.php";</script>';}}
?>
</p></td>
</tr>
<tr>
<td height="48" colspan="2" valign="top" background="../image/footter2 copy.jpg"><!--DWLayoutEmptyCell--> </td>
</tr>
</table>
</div>
</body>
</html>
|
|
|
|
|
Date :
2010-08-25 19:34:50 |
By :
ผู้หญิงสีดำ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|