|
|
|
ช่วยดูโค้ดทีผิดตรงไหน กด ให้ debug in browser ก็ขึ้นรายละเอียดมา แต่พอดูในหน้า design หายหมดเลย |
|
|
|
|
|
|
|
กด ให้ debug in browser
ก็ขึ้นรายละเอียดมา แต่พอดูในหน้า design หายหมดเลย
ไม่แน่ใจว่าใส่โค้ดผิดที่ตรงไหน
นี่คือโค้ด ที่ใช้เขียน
<?php require_once('Connections/dbconn.php'); ?>
<?php include "Language.php";?>
<?php include "dbconn.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_name'], "int"),
GetSQLValueString($_POST['Emp_name'], "int"),
GetSQLValueString($_POST['Lo_name'], "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'];
}
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "fmAdd")) {
$insertSQL = sprintf("INSERT INTO repairdescription (Rewa_des, Red_senddate) VALUES (%s, %s)",
GetSQLValueString($_POST['txtRewa_des'], "txt"),
GetSQLValueString($_POST['txtRed_senddate'], "date"));
mysql_select_db($database_dbconn, $dbconn);
$Result1 = mysql_query($insertSQL, $dbconn) or die(mysql_error());
}
mysql_select_db($database_dbconn, $dbconn);
$query_rsitem = "SELECT Item_ID FROM item ORDER BY Item_ID ASC";
$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 Emp_name FROM employee ORDER BY Emp_name ASC";
$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 Lo_name FROM location ORDER BY Lo_name ASC";
$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 Ca_name FROM category ORDER BY Ca_name ASC";
$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>ITSERVICES</title>
<style type="text/css">
<!--
.style3 {
font-size: x-large;
font-weight: bold;
}
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" width="1000" height="100" /></td>
</tr>
<tr>
<td><a href="Index.php">หน้าแรก</a>
| <a href="warsearch.php">ตรวจประกัน</a>
| <a href="RequestZone.php">แจ้งซ่อม</a>
| <a href="search.php">ค้นหาปัญหา</a>
| <a href="Login.php">เข้าสู่ระบบ</a> | </td>
</tr>
</table>
<hr />
<p> </p>
<div align="center">
<form action="<?php echo $editFormAction; ?>" method="POST" name="fmAdd" id="fmAdd">
<table width="722" border="1">
<tr>
<td height="33" colspan="3" bgcolor="#FFCC99"><div align="center" class="style3">Request Zone </div></td>
</tr>
<tr>
<td bgcolor="#FFCC99"><div align="center"><strong>รหัสอุปกรณ์</strong></div></td>
<td width="553" colspan="2" bgcolor="#FFCC99"><label>
<div align="left">
<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>
</div>
<label></label>
<div align="left"></div>
</label></td>
</tr>
<tr>
<td height="27" bgcolor="#FFCC99"><div align="center"><strong>ชื่อ - นามสกุล</strong></div></td>
<td colspan="2" bgcolor="#FFCC99"><div align="left">
<label>
<select name="Emp_name" id="Emp_name">
<?php
do {
?>
<option value="<?php echo $row_rsEmp['Emp_name']?>"><?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>
</div></td>
</tr>
<tr>
<td bgcolor="#FFCC99"><div align="center"><strong>สถานที่</strong></div></td>
<td colspan="2" bgcolor="#FFCC99"><label></label>
<label>
<label>
<div align="left"><select name="Lo_name" id="Lo_name">
<?php
do {
?>
<option value="<?php echo $row_rsLoca['Lo_name']?>"><?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>
</div>
</label>
<div align="left"></div>
</label></td>
</tr>
<tr>
<td bgcolor="#FFCC99"><div align="center"><strong>ประเภท</strong></div></td>
<td colspan="2" bgcolor="#FFCC99"><div align="left">
<select name="Ca_name" id="Ca_name">
<option value="">--- เลือกประเภท ---</option>
<?php
do {
?>
<option value="<?php echo $row_rsCate['Ca_name']?>"><?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>
</div></td>
</tr>
<tr>
<td bgcolor="#FFCC99"><div align="center"><strong>อาการเสีย</strong></div></td>
<td colspan="2" bgcolor="#FFCC99"><label>
<textarea name="txtRewa_des" cols="85" rows="6" id="txtRewa_des"></textarea>
</label></td>
</tr>
<tr>
<td bgcolor="#FFCC99"><div align="center"><strong>วันแจ้งซ่อม</strong></div></td>
<td colspan="2" bgcolor="#FFCC99"><label>
<div align="left">
<input name="txtRed_senddate" type="text" id="txtRed_senddate" size="88" maxlength="88" />
</div>
</label></td>
</tr>
</table>
<label>
<input name="submit" type="submit" id="submit" value="บันทึก" />
</label>
<label>
<input type="reset" name="reset" value="ยกเลิก" id="reset" />
</label>
<input type="hidden" name="MM_insert" value="fmAdd">
</form>
<label></label>
</div>
<p align="center">
<label></label>
</p>
</body>
</html>
<?php
mysql_free_result($rsitem);
mysql_free_result($rsEmp);
mysql_free_result($rsLoca);
mysql_free_result($rsCate);
?>
รูปที่หน้า design หายไป
Tag : - - - -
|
|
|
|
|
|
Date :
2010-01-14 15:02:33 |
By :
Atipat |
View :
1230 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลอง copy โค้ดไปวางไฟล์ใหม่ มันก็มี design นะคะ
|
|
|
|
|
Date :
2010-01-14 15:10:36 |
By :
ultrasiam |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 03
|