Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > สอบถามปัญหาPHPแสดงรายละเอียดแจ้งซ่อมแต่ละคนไม่ตรงลำดับที่เลือกจากฐานข้อมูล เมื่อเพิ่มข้อมูลแล้วข้อมูลไม่แสดงข้อมูลตามที่เพิ่มข้อมูลลงไป แสดงข้อมูลเดิม จะแก้ยังไงดีคะ



 

สอบถามปัญหาPHPแสดงรายละเอียดแจ้งซ่อมแต่ละคนไม่ตรงลำดับที่เลือกจากฐานข้อมูล เมื่อเพิ่มข้อมูลแล้วข้อมูลไม่แสดงข้อมูลตามที่เพิ่มข้อมูลลงไป แสดงข้อมูลเดิม จะแก้ยังไงดีคะ

 



Topic : 097453



โพสกระทู้ ( 26 )
บทความ ( 0 )



สถานะออฟไลน์




//โค้ดหน้าเพิ่มข้อมูลของadmin (admin_add.php)
Code (PHP)
<?php require_once('Connections/data.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $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"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO repairform_tb (`Date`, `Time`, `Prefix`, Name, Surname, Department, Phone, Need, Symptoms, `Sum`, DateR, TimeR, Status, Report) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['Date'], "date"),
                       GetSQLValueString($_POST['Time'], "date"),
                       GetSQLValueString($_POST['Prefix'], "text"),
                       GetSQLValueString($_POST['Name'], "text"),
                       GetSQLValueString($_POST['Surname'], "text"),
                       GetSQLValueString($_POST['Department'], "text"),
                       GetSQLValueString($_POST['Phone'], "text"),
                       GetSQLValueString($_POST['Need'], "text"),
                       GetSQLValueString($_POST['Symptoms'], "text"),
                       GetSQLValueString($_POST['Sum'], "text"),
                       GetSQLValueString($_POST['DateR'], "date"),
                       GetSQLValueString($_POST['TimeR'], "date"),
                       GetSQLValueString($_POST['Status'], "text"),
                       GetSQLValueString($_POST['Report'], "text"));

  mysql_select_db($database_data, $data);
  $Result1 = mysql_query($insertSQL, $data) or die(mysql_error());

  $insertGoTo = "showdetail.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_data, $data);
$query_Recordset1 = "SELECT * FROM repairform_tb";
$Recordset1 = mysql_query($query_Recordset1, $data) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

$query_Recordset1 = "SELECT * FROM repairform_tb";
$Recordset1 = mysql_query($query_Recordset1, $data) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!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=windows-874" />
<title>Untitled Document</title>
</head>

<body>
<form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
  <div align="center">
    <table width="1011" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="43" colspan="4" bgcolor="#98FF53"><label for="name">
          <blockquote>
            <blockquote>
              <blockquote>
                <blockquote>
                  <blockquote>
                    <blockquote>
                      <blockquote>
                        <blockquote>
                          <p align="center">เพิ่มข้อมูลการแจ้งซ่อมคอมพิวเตอร์</p>
                          <div align="center"></div>
                          <div align="center"></div>
                          <hr width="350" />
                        </blockquote>
                      </blockquote>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          </label></td>
      </tr>
      <tr>
        <td width="172" height="21" bgcolor="#AAFF71"><blockquote>
          <p align="left"> ผู้แจ้งซ่อม</p>
        </blockquote></td>
        <td width="307" bgcolor="#AAFF71"><label for="Date2"></label></td>
        <td width="139" bgcolor="#AAFF71">&nbsp;</td>
        <td width="404" bgcolor="#AAFF71"><label for="Time2"></label></td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">วันที่ :</p></td>
        <td bgcolor="#AAFF71"><label for="Prefix2">
          <label for="Date"></label>
          <div align="left">
            <label for="Date5"></label>
            <input type="text" name="Date" id="Date" />
(2013-07-01) </div>
          <div align="left"></div>
        </label></td>
        <td bgcolor="#AAFF71"><div align="right">เวลา :</div></td>
        <td bgcolor="#AAFF71"><div align="left">
          <input type="text" name="Time" id="Time2" />
        (12:30)</div></td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">คำนำหน้าชื่อ :</p></td>
        <td bgcolor="#AAFF71"><label for="Name2">
          <div align="left">
            <select name="Prefix" size="1" id="Prefix2">
              <option value="นาย" selected="selected">นาย</option>
              <option value="นาง">นาง</option>
              <option value="นางสาว">นางสาว</option>
            </select>
          </div>
        </label></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">ชื่อ :</p></td>
        <td bgcolor="#AAFF71"><label for="Surname2"></label>
          <div align="left">
            <input type="text" name="Name" id="Name2" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">นามสกุล :</p></td>
        <td bgcolor="#AAFF71"><div align="left">
          <input type="text" name="Surname" id="Surname2" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">ฝ่าย/แผนก :</p></td>
        <td bgcolor="#AAFF71"><label for="Department"></label>
          <div align="left">
            <select name="Department" id="Department">
              <option value="-กรุณาเลือกฝ่าย/แผนก-">-กรุณาเลือกฝ่าย/แผนก-</option>
              <option value="โรงงาน">โรงงาน</option>
              <option value="พืชสวน ">พืชสวน </option>
              <option value="บุคคล">บุคคล</option>
              <option value="ตลาด">ตลาด</option>
              <option value="บัญชี">บัญชี</option>
              <option value="Logistic">Logistic</option>
              <option value="จัดซื้อ">จัดซื้อ</option>
              <option value="ข้อมูลสถิติ">ข้อมูลสถิติ</option>
              <option value="สารสนเทศ">สารสนเทศ</option>
              <option value="รับน้ำยาง">รับน้ำยาง</option>
              <option value="หม้อปั่น ">หม้อปั่น </option>
            </select>
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">เบอร์โทรศัพท์ภายใน :</p></td>
        <td bgcolor="#AAFF71"><label for="Phone2"></label>
          <div align="left">
            <input type="text" name="Phone" id="Phone2" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><div align="right">อุปกรณ์/ความต้องการ :</div></td>
        <td bgcolor="#AAFF71"><label for="Need2"></label>
          <div align="left">
            <select name="Need" id="Need2">
              <option value="-กรุณาเลือกอุปกรณ์-">-กรุณาเลือกอุปกรณ์-</option>
              <option value="Monitor">Monitor</option>
              <option value="Printer">Printer</option>
              <option value="Scanner">Scanner</option>
              <option value="ระบบสำรองไฟ">ระบบสำรองไฟ</option>
              <option value="Software">Software</option>
              <option value="Accessories">Accessories</option>
              <option value="เครื่องคอมพิวเตอร์">เครื่องคอมพิวเตอร์</option>
              <option value="อื่นๆ">อื่นๆ</option>
            </select>
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="85" bgcolor="#AAFF71"><p align="right">อาการเสีย :</p></td>
        <td bgcolor="#AAFF71"><label for="Symptoms2"></label>
          <div align="left">
            <textarea name="Symptoms" id="Symptoms2" cols="45" rows="5"></textarea>
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">สถานะงาน:</div></td>
        <td bgcolor="#AAFF71"><p align="left">
          <label for="Status"></label>
          <select name="Status" size="1" id="Status">
            <option value="-กรุณาเลือกสถานะ-">-กรุณาเลือกสถานะ-</option>
            <option value="เสร็จเรียบร้อย">เสร็จเรียบร้อย</option>
            <option value="กำลังดำเนินการ">กำลังดำเนินการ</option>
            <option value="ส่งต่อแผนกอื่น">ส่งต่อแผนกอื่น</option>
            <option value="ส่งบริษัทนอก">ส่งบริษัทนอก</option>
            <option value="ซ่อมไม่ได้">ซ่อมไม่ได้</option>
            <option value="รอการตอบรับ">รอการตอบรับ</option>
          </select>
          <br />
        </p>
        <label for="status"></label></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">ผู้รับงาน :</div></td>
        <td bgcolor="#AAFF71"><p align="left">
          <label for="Worker"></label>
          <div align="left">
            <label for="Woker2"></label>
            <select name="Worker" size="1" id="Woker2">
              <option value="-กรุณาเลือกผู้รับงาน-">-กรุณาเลือกผู้รับงาน-</option>
              <option value="ผู้ดูแลคนที่1">ผู้ดูแลคนที่1</option>
              <option value="ผู้ดูแลคนที่2">ผู้ดูแลคนที่2</option>
              <option value="ผู้ดูแลคนที่3">ผู้ดูแลคนที่3</option>
            </select>
          </div>
          <label>
          <div align="left"></div>
          </label>
          <div align="left">
            </p>
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">วันที่เสร็จ :</div></td>
        <td bgcolor="#AAFF71"><div align="left">
          <input type="text" name="DateR" id="DateR" />
        (2013-07-01) </div></td>
        <td bgcolor="#AAFF71"><div align="right">เวลาที่เสร็จ :</div></td>
        <td bgcolor="#AAFF71"><label for="TimeR"></label>
          <div align="left">
            <input type="text" name="TimeR" id="TimeR" />
        (12:30)</div></td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">สรุปผลการซ่อม<strong>:</strong></div></td>
        <td bgcolor="#AAFF71"><label for="Sum"></label>
          <div align="left">
            <input type="text" name="Sum" id="Sum" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">หัวข้อออกรายงาน :</div></td>
        <td bgcolor="#AAFF71"><label for="Report"></label>
          <div align="left">
            <input type="text" name="Report" id="Report" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71"><p align="left">
          <input type="submit" name="Save" id="Save" value="เพิ่มข้อมูล" />
        </p></td>
        <td bgcolor="#AAFF71"><div align="center"></div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
    </table>
  </div>
  <div align="center">
    <input type="hidden" name="MM_insert" value="form1" />
  </div>
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>



//โค้ดหน้าแสดงข้อมูลแจ้งซ่อม(เมื่อบันทึกข้อมูล) showdetail.php
Code (PHP)
<?php require_once('Connections/data.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $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;
}
}

mysql_select_db($database_data, $data);
$query_Recordset1 = "SELECT * FROM repairform_tb WHERE ID";
$Recordset1 = mysql_query($query_Recordset1, $data) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>


<form id="form1" name="form1" method="post" action="">
  <div align="center">
    <table width="780" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="57" colspan="4" bgcolor="#A9FC81"><div align="center">
          <p>&nbsp;</p>
          <p><strong>แบบฟอร์มแจ้งซ่อมคอมพิวเตอร์ออนไลน์</strong></p>
          <hr width="350" />
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0">&nbsp;</td>
        <td colspan="3" bgcolor="#C9FDB0">&nbsp;</td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">
        ลำดับที่ :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><?php echo $row_Recordset1['ID']; ?></td>
      </tr>
      <tr>
        <td width="372" bgcolor="#C9FDB0"><div align="right">
      วันที่ เวลาที่แจ้ง :</div></td>
        <td width="408" colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Date']; ?>[<?php echo $row_Recordset1['Time']; ?>]</div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">แจ้งซ่อมโดย :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Prefix']; ?><?php echo $row_Recordset1['Name']; ?> <?php echo $row_Recordset1['Surname']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">ฝ่าย/แผนก :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Department']; ?></div></td>
      </tr>
      <tr>
        <td height="22" colspan="4" bgcolor="#C9FDB0"><hr width="350" /></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">เบอร์โทร :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Phone']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">อุปกรณ์/ความต้องการ :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Need']; ?></div></td>
      </tr>
      <tr>
        <td height="22" bgcolor="#C9FDB0"><div align="right">อาการเสีย :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Symptoms']; ?></div></td>
      </tr>
      <tr>
        <td height="21" colspan="4" bgcolor="#C9FDB0"><hr width="350" /></td>
      </tr>
      <tr>
        <td height="22" bgcolor="#C9FDB0"><div align="right">สถานะงาน :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Status']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">ผู้รับงาน :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Worker']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">วันที่ เวลาที่เสร็จ :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['DateR']; ?>[<?php echo $row_Recordset1['TimeR']; ?>]</div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">สรุปผลการซ่อม :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Sum']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">หัวข้อออกรายงาน :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Report']; ?></div></td>
      </tr>
      
      <tr>
        <td colspan="4" bgcolor="#C9FDB0"><div align="center"><input name="Print this page" type="button" id="Print this page" onclick="window.print()" value="พิมพ์หน้านี้">  </div></td>
      </tr>
    </table>
  </div>
</form>

<?php
mysql_free_result($Recordset1);
?>





Tag : PHP, MySQL, HTML/CSS, jQuery









ประวัติการแก้ไข
2013-07-05 16:32:58
2013-07-06 13:32:35
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-07-05 15:31:17 By : Kanjana33 View : 981 Reply : 5
 

 

No. 1



โพสกระทู้ ( 1,095 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ตาลายยยยยยยยยย

สงสัยไปก็อปคนอื่นมา
เอาที่เนื้อๆ สิครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-07-05 16:18:32 By : compiak
 


 

No. 2



โพสกระทู้ ( 26 )
บทความ ( 0 )



สถานะออฟไลน์


พอดีดิฉันก็อปจากโค้ดมาเลยอ่ะค่ะ ไม่รู้ว่าจุดที่ผิดอยู่ตรงไหน รบกวนช่วยชี้แนะหน่อยนะคะ พอดีไม่รู้จะแก้ตรงไหนอ่ะค่ะ


ประวัติการแก้ไข
2013-07-05 17:12:55
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-07-05 16:35:38 By : Kanjana33
 

 

No. 3



โพสกระทู้ ( 2,249 )
บทความ ( 5 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook Hi5 Blogger

ขอดู code หน้า form ที่ กรอกข้อมูล , บันทึกข้อมูล , และแสดงข้อมูลครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-07-05 17:32:44 By : Manussawin
 


 

No. 4



โพสกระทู้ ( 26 )
บทความ ( 0 )



สถานะออฟไลน์


//โค้ดหน้าฟอร์มadminบันทึกข้อมูลนะคะ admin_add.php
Code (PHP)
<?php require_once('Connections/data.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $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"] == "form1")) {
  $insertSQL = sprintf("INSERT INTO repairform_tb (`Date`, `Time`, `Prefix`, Name, Surname, Department, Phone, Need, Symptoms, `Sum`, DateR, TimeR, Status, Report) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['Date'], "date"),
                       GetSQLValueString($_POST['Time'], "date"),
                       GetSQLValueString($_POST['Prefix'], "text"),
                       GetSQLValueString($_POST['Name'], "text"),
                       GetSQLValueString($_POST['Surname'], "text"),
                       GetSQLValueString($_POST['Department'], "text"),
                       GetSQLValueString($_POST['Phone'], "text"),
                       GetSQLValueString($_POST['Need'], "text"),
                       GetSQLValueString($_POST['Symptoms'], "text"),
                       GetSQLValueString($_POST['Sum'], "text"),
                       GetSQLValueString($_POST['DateR'], "date"),
                       GetSQLValueString($_POST['TimeR'], "date"),
                       GetSQLValueString($_POST['Status'], "text"),
                       GetSQLValueString($_POST['Report'], "text"));

  mysql_select_db($database_data, $data);
  $Result1 = mysql_query($insertSQL, $data) or die(mysql_error());

  $insertGoTo = "showdetail.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_data, $data);
$query_Recordset1 = "SELECT * FROM repairform_tb";
$Recordset1 = mysql_query($query_Recordset1, $data) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);

$query_Recordset1 = "SELECT * FROM repairform_tb";
$Recordset1 = mysql_query($query_Recordset1, $data) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!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=windows-874" />
<title>Untitled Document</title>
</head>

<body>
<form action="<?php echo $editFormAction; ?>" id="form1" name="form1" method="POST">
  <div align="center">
    <table width="1011" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="43" colspan="4" bgcolor="#98FF53"><label for="name">
          <blockquote>
            <blockquote>
              <blockquote>
                <blockquote>
                  <blockquote>
                    <blockquote>
                      <blockquote>
                        <blockquote>
                          <p align="center">เพิ่มข้อมูลการแจ้งซ่อมคอมพิวเตอร์</p>
                          <div align="center"></div>
                          <div align="center"></div>
                          <hr width="350" />
                        </blockquote>
                      </blockquote>
                    </blockquote>
                  </blockquote>
                </blockquote>
              </blockquote>
            </blockquote>
          </blockquote>
          </label></td>
      </tr>
      <tr>
        <td width="172" height="21" bgcolor="#AAFF71"><blockquote>
          <p align="left"> ผู้แจ้งซ่อม</p>
        </blockquote></td>
        <td width="307" bgcolor="#AAFF71"><label for="Date2"></label></td>
        <td width="139" bgcolor="#AAFF71">&nbsp;</td>
        <td width="404" bgcolor="#AAFF71"><label for="Time2"></label></td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">วันที่ :</p></td>
        <td bgcolor="#AAFF71"><label for="Prefix2">
          <label for="Date"></label>
          <div align="left">
            <label for="Date5"></label>
            <input type="text" name="Date" id="Date" />
(2013-07-01) </div>
          <div align="left"></div>
        </label></td>
        <td bgcolor="#AAFF71"><div align="right">เวลา :</div></td>
        <td bgcolor="#AAFF71"><div align="left">
          <input type="text" name="Time" id="Time2" />
        (12:30)</div></td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">คำนำหน้าชื่อ :</p></td>
        <td bgcolor="#AAFF71"><label for="Name2">
          <div align="left">
            <select name="Prefix" size="1" id="Prefix2">
              <option value="นาย" selected="selected">นาย</option>
              <option value="นาง">นาง</option>
              <option value="นางสาว">นางสาว</option>
            </select>
          </div>
        </label></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">ชื่อ :</p></td>
        <td bgcolor="#AAFF71"><label for="Surname2"></label>
          <div align="left">
            <input type="text" name="Name" id="Name2" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">นามสกุล :</p></td>
        <td bgcolor="#AAFF71"><div align="left">
          <input type="text" name="Surname" id="Surname2" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">ฝ่าย/แผนก :</p></td>
        <td bgcolor="#AAFF71"><label for="Department"></label>
          <div align="left">
            <select name="Department" id="Department">
              <option value="-กรุณาเลือกฝ่าย/แผนก-">-กรุณาเลือกฝ่าย/แผนก-</option>
              <option value="โรงงาน">โรงงาน</option>
              <option value="พืชสวน ">พืชสวน </option>
              <option value="บุคคล">บุคคล</option>
              <option value="ตลาด">ตลาด</option>
              <option value="บัญชี">บัญชี</option>
              <option value="Logistic">Logistic</option>
              <option value="จัดซื้อ">จัดซื้อ</option>
              <option value="ข้อมูลสถิติ">ข้อมูลสถิติ</option>
              <option value="สารสนเทศ">สารสนเทศ</option>
              <option value="รับน้ำยาง">รับน้ำยาง</option>
              <option value="หม้อปั่น ">หม้อปั่น </option>
            </select>
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><p align="right">เบอร์โทรศัพท์ภายใน :</p></td>
        <td bgcolor="#AAFF71"><label for="Phone2"></label>
          <div align="left">
            <input type="text" name="Phone" id="Phone2" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="24" bgcolor="#AAFF71"><div align="right">อุปกรณ์/ความต้องการ :</div></td>
        <td bgcolor="#AAFF71"><label for="Need2"></label>
          <div align="left">
            <select name="Need" id="Need2">
              <option value="-กรุณาเลือกอุปกรณ์-">-กรุณาเลือกอุปกรณ์-</option>
              <option value="Monitor">Monitor</option>
              <option value="Printer">Printer</option>
              <option value="Scanner">Scanner</option>
              <option value="ระบบสำรองไฟ">ระบบสำรองไฟ</option>
              <option value="Software">Software</option>
              <option value="Accessories">Accessories</option>
              <option value="เครื่องคอมพิวเตอร์">เครื่องคอมพิวเตอร์</option>
              <option value="อื่นๆ">อื่นๆ</option>
            </select>
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="85" bgcolor="#AAFF71"><p align="right">อาการเสีย :</p></td>
        <td bgcolor="#AAFF71"><label for="Symptoms2"></label>
          <div align="left">
            <textarea name="Symptoms" id="Symptoms2" cols="45" rows="5"></textarea>
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">สถานะงาน:</div></td>
        <td bgcolor="#AAFF71"><p align="left">
          <label for="Status"></label>
          <select name="Status" size="1" id="Status">
            <option value="-กรุณาเลือกสถานะ-">-กรุณาเลือกสถานะ-</option>
            <option value="เสร็จเรียบร้อย">เสร็จเรียบร้อย</option>
            <option value="กำลังดำเนินการ">กำลังดำเนินการ</option>
            <option value="ส่งต่อแผนกอื่น">ส่งต่อแผนกอื่น</option>
            <option value="ส่งบริษัทนอก">ส่งบริษัทนอก</option>
            <option value="ซ่อมไม่ได้">ซ่อมไม่ได้</option>
            <option value="รอการตอบรับ">รอการตอบรับ</option>
          </select>
          <br />
        </p>
        <label for="status"></label></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">ผู้รับงาน :</div></td>
        <td bgcolor="#AAFF71"><p align="left">
          <label for="Worker"></label>
          <div align="left">
            <label for="Woker2"></label>
            <select name="Worker" size="1" id="Woker2">
              <option value="-กรุณาเลือกผู้รับงาน-">-กรุณาเลือกผู้รับงาน-</option>
              <option value="ผู้ดูแลคนที่1">ผู้ดูแลคนที่1</option>
              <option value="ผู้ดูแลคนที่2">ผู้ดูแลคนที่2</option>
              <option value="ผู้ดูแลคนที่3">ผู้ดูแลคนที่3</option>
            </select>
          </div>
          <label>
          <div align="left"></div>
          </label>
          <div align="left">
            </p>
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">วันที่เสร็จ :</div></td>
        <td bgcolor="#AAFF71"><div align="left">
          <input type="text" name="DateR" id="DateR" />
        (2013-07-01) </div></td>
        <td bgcolor="#AAFF71"><div align="right">เวลาที่เสร็จ :</div></td>
        <td bgcolor="#AAFF71"><label for="TimeR"></label>
          <div align="left">
            <input type="text" name="TimeR" id="TimeR" />
        (12:30)</div></td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">สรุปผลการซ่อม<strong>:</strong></div></td>
        <td bgcolor="#AAFF71"><label for="Sum"></label>
          <div align="left">
            <input type="text" name="Sum" id="Sum" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71"><div align="right">หัวข้อออกรายงาน :</div></td>
        <td bgcolor="#AAFF71"><label for="Report"></label>
          <div align="left">
            <input type="text" name="Report" id="Report" />
        </div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
      <tr>
        <td height="26" bgcolor="#AAFF71">&nbsp;</td>
        <td bgcolor="#AAFF71"><p align="left">
          <input type="submit" name="Save" id="Save" value="เพิ่มข้อมูล" />
        </p></td>
        <td bgcolor="#AAFF71"><div align="center"></div></td>
        <td bgcolor="#AAFF71">&nbsp;</td>
      </tr>
    </table>
  </div>
  <div align="center">
    <input type="hidden" name="MM_insert" value="form1" />
  </div>
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>



//โค้ดหน้าแสดงข้อมูลที่เพิ่งบันทึก showdetail.php

Code (PHP)
<?php require_once('Connections/data.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $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;
}
}

mysql_select_db($database_data, $data);
$query_Recordset1 = "SELECT * FROM repairform_tb WHERE repairform_tb.ID ORDER BY repairform_tb.ID";
$Recordset1 = mysql_query($query_Recordset1, $data) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>


<form id="form1" name="form1" method="post" action="">
  <div align="center">
    <table width="780" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="57" colspan="4" bgcolor="#A9FC81"><div align="center">
          <p>&nbsp;</p>
          <p><strong>แบบฟอร์มแจ้งซ่อมคอมพิวเตอร์ออนไลน์</strong></p>
          <hr width="350" />
        </div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0">&nbsp;</td>
        <td colspan="3" bgcolor="#C9FDB0">&nbsp;</td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">
        ลำดับที่ :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><?php echo $row_Recordset1['ID']; ?></td>
      </tr>
      <tr>
        <td width="372" bgcolor="#C9FDB0"><div align="right">
      วันที่ เวลาที่แจ้ง :</div></td>
        <td width="408" colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Date']; ?>[<?php echo $row_Recordset1['Time']; ?>]</div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">แจ้งซ่อมโดย :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Prefix']; ?><?php echo $row_Recordset1['Name']; ?> <?php echo $row_Recordset1['Surname']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">ฝ่าย/แผนก :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Department']; ?></div></td>
      </tr>
      <tr>
        <td height="22" colspan="4" bgcolor="#C9FDB0"><hr width="350" /></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">เบอร์โทร :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Phone']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">อุปกรณ์/ความต้องการ :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Need']; ?></div></td>
      </tr>
      <tr>
        <td height="22" bgcolor="#C9FDB0"><div align="right">อาการเสีย :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Symptoms']; ?></div></td>
      </tr>
      <tr>
        <td height="21" colspan="4" bgcolor="#C9FDB0"><hr width="350" /></td>
      </tr>
      <tr>
        <td height="22" bgcolor="#C9FDB0"><div align="right">สถานะงาน :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Status']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">ผู้รับงาน :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Worker']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">วันที่ เวลาที่เสร็จ :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['DateR']; ?>[<?php echo $row_Recordset1['TimeR']; ?>]</div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">สรุปผลการซ่อม :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Sum']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#C9FDB0"><div align="right">หัวข้อออกรายงาน :</div></td>
        <td colspan="3" bgcolor="#C9FDB0"><div align="left"><?php echo $row_Recordset1['Report']; ?></div></td>
      </tr>
      <tr>
        <td colspan="4" bgcolor="#C9FDB0"><div align="center"></div></td>
      </tr>
    </table>
  </div>
</form>

<?php
mysql_free_result($Recordset1);
?>



***รบกวนช่วยดูให้หน่อยนะคะ ขอบคุณมากค่ะ***
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-07-06 09:51:04 By : Kanjana33
 


 

No. 5



โพสกระทู้ ( 26 )
บทความ ( 0 )



สถานะออฟไลน์


ดิฉันแก้ได้แล้วค่ะ แก้ไขที่ ใส่ Hidden Field ชื่อ ID ไว้ที่หน้า show_detail.php แล้วใส่ Go to php หน้าที่จะเรียกดูข้อมูล แค่นี้ ID รายละเอียดข้อมูลที่เรียกดูก็จะตรงแล้วค่ะ ขอบคุณคนที่ตอบและเปิดอ่านค่ะ อิอิ

***ฝากไว้สำหรับคนที่อาจจะมีปัญหาเหมือนดิฉัน ลองแก้ดูนะคะ***


//โค้ดหน้าแสดงข้อมูล show_detail.php ที่แก้ไขแล้วค่ะ
Code (PHP)
<?php require_once('Connections/data.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
{
  if (PHP_VERSION < 6) {
    $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;
}
}

if ((isset($_POST['ID'])) && ($_POST['ID'] != "")) {
  $deleteSQL = sprintf("DELETE FROM repairform_tb WHERE ID=%s",
                       GetSQLValueString($_POST['ID'], "int"));

  mysql_select_db($database_data, $data);
  $Result1 = mysql_query($deleteSQL, $data) or die(mysql_error());

  $deleteGoTo = "admin_home.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $deleteGoTo));
}

$colname_Recordset1 = "-1";
if (isset($_GET['ID'])) {
  $colname_Recordset1 = $_GET['ID'];
}
mysql_select_db($database_data, $data);
$query_Recordset1 = sprintf("SELECT * FROM repairform_tb WHERE ID = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $data) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!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=windows-874" />
<title>Untitled Document</title>
</head>

<body>

<form id="form1" name="form1" method="post" action="">
  
 <div align="center">
 <DIV id="report">
    <table width="68%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td height="30" colspan="2" bgcolor="#9EFF5E"><input name="ID" type="hidden" id="ID" value="<?php echo $row_Recordset1['ID']; ?>" /></td>
      </tr>
      <tr>
        <td height="46" colspan="2" bgcolor="#9EFF5E"><div align="center"><strong>แบบฟอร์มการแจ้งซ่อมคอมพิวเตอร์ออนไลน์</strong></div></td>
      </tr>
      <tr>
        <td width="47%" bgcolor="#B3FF80"><div align="right">ลำดับที่ :</div></td>
        <td width="53%" bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['ID']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">วัน เวลาที่แจ้ง :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Date']; ?> [<?php echo $row_Recordset1['Time']; ?>]</div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">ผู้แจ้ง :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Prefix']; ?><?php echo $row_Recordset1['Name']; ?> <?php echo $row_Recordset1['Surname']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">ฝ่าย/แผนก :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Department']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">เบอร์โทรศัพท์ภายใน :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Phone']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">อุปกรณ์/ความต้องการ :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Need']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">อาการเสีย :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Symptoms']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">สถานะงาน :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Status']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">ผู้รับงาน :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Worker']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">วัน เวลาที่เสร็จ :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['DateR']; ?> [<?php echo $row_Recordset1['TimeR']; ?>]</div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">สรุปผลการซ่อม :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Sum']; ?></div></td>
      </tr>
      <tr>
        <td bgcolor="#B3FF80"><div align="right">หัวข้อออกรายงาน :</div></td>
        <td bgcolor="#B3FF80"><div align="left"><?php echo $row_Recordset1['Report']; ?></div></td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#B3FF80"><div align="center">
          <div align="center">
            <input name="button6" type="button" style="width:60px; height:28px;"  value=" Print " id="print"   onClick="printSelection(document.getElementById('report'))"/>
      </div></td></td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#B3FF80">&nbsp;</td>
      </tr>
    </table>
    <!--#include file="include/css_div_print.inc" -->

</DIV>
  <div align="center"></div>
  <div align="center"></div>
   
<p>&nbsp;</p>
</form>

</body>
</html>
<?php
mysql_free_result($Recordset1);
?>


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-07-08 09:19:02 By : Kanjana33
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : สอบถามปัญหาPHPแสดงรายละเอียดแจ้งซ่อมแต่ละคนไม่ตรงลำดับที่เลือกจากฐานข้อมูล เมื่อเพิ่มข้อมูลแล้วข้อมูลไม่แสดงข้อมูลตามที่เพิ่มข้อมูลลงไป แสดงข้อมูลเดิม จะแก้ยังไงดีคะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 03
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่