|
|
|
หน้า design หายครับ ไม่รู้ว่าผิดตรงไหน ได้ลอง copy ไปไว้ในหน้าใหม่แล้วพอ save ก็หายครับ |
|
|
|
|
|
|
|
นี่คือโค้ดน่ะครับ
Code (PHP)
<?php require_once('Connections/dbconn.php'); ?>
<?php include"init.inc.php";?>
<?php include"connectdatabase.php";?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "fmAdd")) {
$insertSQL = sprintf("INSERT INTO repairdescription (Ca_ID, Emp_ID, Lo_ID, Item_ID, Rewa_des, Red_senddate) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['Ca_ID'], "int"),
GetSQLValueString($_POST['Emp_ID'], "int"),
GetSQLValueString($_POST['Lo_ID'], "int"),
GetSQLValueString($_POST['Item_ID'], "int"),
GetSQLValueString($_POST['txtRewa_des'], "text"),
GetSQLValueString($_POST['txtRed_senddate'], "date"));
mysql_select_db($database_dbconn, $dbconn);
$Result1 = mysql_query($insertSQL, $dbconn) or die(mysql_error());
$insertGoTo = "Addsave.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
mysql_select_db($database_dbconn, $dbconn);
$query_rsItem = "SELECT * FROM item";
$rsItem = mysql_query($query_rsItem, $dbconn) or die(mysql_error());
$row_rsItem = mysql_fetch_assoc($rsItem);
$totalRows_rsItem = mysql_num_rows($rsItem);
mysql_select_db($database_dbconn, $dbconn);
$query_rsEmp = "SELECT * FROM employee";
$rsEmp = mysql_query($query_rsEmp, $dbconn) or die(mysql_error());
$row_rsEmp = mysql_fetch_assoc($rsEmp);
$totalRows_rsEmp = mysql_num_rows($rsEmp);
mysql_select_db($database_dbconn, $dbconn);
$query_rsLoca = "SELECT * FROM location";
$rsLoca = mysql_query($query_rsLoca, $dbconn) or die(mysql_error());
$row_rsLoca = mysql_fetch_assoc($rsLoca);
$totalRows_rsLoca = mysql_num_rows($rsLoca);
mysql_select_db($database_dbconn, $dbconn);
$query_rsCate = "SELECT * FROM category";
$rsCate = mysql_query($query_rsCate, $dbconn) or die(mysql_error());
$row_rsCate = mysql_fetch_assoc($rsCate);
$totalRows_rsCate = mysql_num_rows($rsCate);
?>
<!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>IT SERVICE</title>
<style type="text/css">
<!--
body,td,th {
font-family: Ms Sans Serif;
}
-->
</style></head>
<body>
<table width="100" border="1" cellpadding="1" cellspacing="1">
<tr>
<td><img src="img/IT_service.jpg" alt="" width="1000" height="100" /></td>
</tr>
<tr>
<td><a href="Index.php"> หน้าแรก</a> | <a href="warsearch.php"> ตรวจประกัน</a> |<a href="Insert.php"> แจ้งซ่อม</a> |<a href="search.php"> ค้นหาปัญหา</a> | <a href="Login.php"> ออกจากระบบ</a> | </td>
</tr>
</table>
<p> </p>
<form id="fmAdd" name="fmAdd" method="POST" action="<?php echo $editFormAction; ?>">
<table width="391" border="1">
<tr>
<td width="189"><div align="center"><strong>รหัสอุปกรณ์</strong></div></td>
<td width="186"><label>
<select name="Item_ID" id="Item_ID">
<?php
do {
?><option value="<?php echo $row_rsItem['Item_ID']?>"><?php echo $row_rsItem['Item_ID']?></option>
<?php
} while ($row_rsItem = mysql_fetch_assoc($rsItem));
$rows = mysql_num_rows($rsItem);
if($rows > 0) {
mysql_data_seek($rsItem, 0);
$row_rsItem = mysql_fetch_assoc($rsItem);
}
?>
</select>
</label></td>
</tr>
<tr>
<td><div align="center"><strong>ชื่อ-นามสกุล</strong></div></td>
<td><label>
<select name="Emp_ID" id="Emp_ID">
<?php
do {
?><option value="<?php echo $row_rsEmp['Emp_ID']?>"><?php echo $row_rsEmp['Emp_name']?></option>
<?php
} while ($row_rsEmp = mysql_fetch_assoc($rsEmp));
$rows = mysql_num_rows($rsEmp);
if($rows > 0) {
mysql_data_seek($rsEmp, 0);
$row_rsEmp = mysql_fetch_assoc($rsEmp);
}
?>
</select>
</label></td>
</tr>
<tr>
<td><div align="center"><strong>สถานที่</strong></div></td>
<td><label>
<select name="Lo_ID" id="Lo_ID">
<?php
do {
?><option value="<?php echo $row_rsLoca['Lo_ID']?>"><?php echo $row_rsLoca['Lo_name']?></option>
<?php
} while ($row_rsLoca = mysql_fetch_assoc($rsLoca));
$rows = mysql_num_rows($rsLoca);
if($rows > 0) {
mysql_data_seek($rsLoca, 0);
$row_rsLoca = mysql_fetch_assoc($rsLoca);
}
?>
</select>
</label></td>
</tr>
<tr>
<td><div align="center"><strong>ประเภท</strong></div></td>
<td><label>
<select name="Ca_ID" id="Ca_ID">
<?php
do {
?><option value="<?php echo $row_rsCate['Ca_ID']?>"><?php echo $row_rsCate['Ca_name']?></option>
<?php
} while ($row_rsCate = mysql_fetch_assoc($rsCate));
$rows = mysql_num_rows($rsCate);
if($rows > 0) {
mysql_data_seek($rsCate, 0);
$row_rsCate = mysql_fetch_assoc($rsCate);
}
?>
</select>
</label></td>
</tr>
<tr>
<td><div align="center"><strong>อาการเสีย</strong></div></td>
<td><label>
<textarea name="txtRewa_des" rows="5" id="txtRewa_des"></textarea>
</label></td>
</tr>
<tr>
<td><div align="center"><strong>วันที่แจ้งซ่อม</strong></div></td>
<td><label>
<input type="text" name="txtRed_senddate" id="txtRed_senddate" />
</label></td>
</tr>
<td colspan="2"><div align="center"><input type="submit" name="Submit" value="ตกลง">
<input type="reset" name="Submit2" value="ยกเลิก" onClick="history.back()">
</div></td>
</table>
<p></p>
<p>
<input type="hidden" name="MM_insert" value="fmAdd" />
</p>
</form>
<p> </p>
</body>
</html>
<?php
mysql_free_result($rsItem);
mysql_free_result($rsEmp);
mysql_free_result($rsLoca);
mysql_free_result($rsCate);
?>
ไม่รู้ว่าผิดตรงไหน
ได้ลอง copy ไปไว้ในหน้าใหม่แล้วพอ save ก็หายครับ
วานช่วยดูทีนะครับ
Tag : - - - -
|
|
|
|
|
|
Date :
2010-01-14 19:11:59 |
By :
Atipat |
View :
1421 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
หายตอนไหนครับ ตอนพรีวิวผ่าน บราวเซอร์ ใช่ไหมครับ ให้ลองเช็คพวก จาวาสคริปต์ดูดีๆ ครับ หรืออาจจะลองลบจาวาสคริปต์ออกไปก่อน แล้วลองสั่งแสดงผลดูว่าได้ไหม บางที จาวาสคริปต์วางไม่ถูกที่ ก็ไม่แสดงผลหน้านั้นไปเลยก็มีครับ
|
|
|
|
|
Date :
2010-01-14 22:40:51 |
By :
yomaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|