 |
|
หน้ารับข้อมูลค่ะ
Code (PHP)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/xhtml4/DTD/xhtml4-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-874" />
<title>ระบบช่วยเหลือปัญหาคอมพิวเตอร์ส่วนบุคคล</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="js/data.js"></script>
<script type="text/javascript" src="js/fwk_service.js"></script>
<div id="page">
<!-- start content -->
<form id="frmmainn" method="post" action="" name = "frmmainn">
<table width="100%">
<tr>
<td colspan="2"><div align="center" class="style1">บันทึก รายงานปัญหา</div></td>
</tr>
<tr>
<td><div align="right"><span class="style2">เครื่องคอมพิวเตอร์ที่มีปัญหา</span></div></td>
<td><select name = "Id_Computer" id = "Id_Computer">
<option value = "">--เลือกเครื่อง--</option>
<?php
while ($rs3=mysql_fetch_array($result3)){ ?>
<option value = "<?=$rs3['Id_Computer'];?>">
<?=$rs3['Int_Computer'];?>
</option>
<? } ?>
</select></td>
</tr>
<script type="text/javascript">
function search_tb_knowledgebase()
{
if($("Detail").value==""){document.getElementById("result_search_txt").innerHTML="";return;}
var key_text=$("Detail").value;
search_data2(key_text);
}
</script>
<tr>
<td valign="top"></td>
<td align="center">
<div id="result_search_txt"></div>
</td>
</tr>
<tr>
<td valign="top"><div align="right"><span class="style2" >รายละเอียดปัญหา</span></div></td>
<td align="center"><textarea name="Detail" cols="50" id= "Detail" rows="10" class="style3" onkeyup="search_tb_knowledgebase();"></textarea>
</td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2" align="right"><div align="center">
<button onclick="return chkSave();" style="cursor:hand; width:105px; height:31px; cursor:hand">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/button/button_save.gif" width="100" height="26" border="0" /></td>
</tr>
</table>
</button>
<button type="reset" style="cursor:hand; width:105px; height:31px; cursor:hand">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/button/button_reset.gif" width="100" height="26" border="0" /></td>
</tr>
</table>
</button>
<button type="reset" style="cursor:hand; width:105px; height:31px; cursor:hand" onclick="Cancel()">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/button/button_cancle.gif" width="100" height="26" border="0" /></td>
</tr>
</table>
</button>
</div></td>
</tr>
<!-- end content -->
</table>
</form>
</div>
</body>
</html>
หน้าfwk_service.js
Code (PHP)
function chkSave()
{
if(document.frmmainn.Id_Computer.value==""){alert("กรุณาเลือกเครื่องคอมพิวเตอร์ ด้วยค่ะ");document.frmmainn.Id_Computer.focus();return false;}
if(document.frmmainn.Detail.value==""){alert("กรุณากรอกรายละเอียดปัญหา ด้วยค่ะ");document.frmmainn.Detail.focus();return false;}
document.frmmainn.method = "post";
document.frmmainn.action = "process.service.save.php?action=save";
document.frmmainn.submit();
}
หน้าprocess.service.save.php
Code (PHP)
<?php
$DateSent= date('Y-m-d');
$TimeSent= date('H:i:s');
if(isset($_GET['action'])&&$_GET['action']=="save"){
$insert = mysql_query("insert into tb_servicerequest(Id_ServiceRequest,Id_StatusRequest,Detail_ServiceRequest,Id_Computer,Id_UserGeneral,Date_ServiceRequest,Time_ServiceRequest,New_ServiceRequest) values ('$Id_ServiceRequest','ST0001','".$_POST['Detail']."','".$_POST['Id_Computer']."','". $_SESSION['MM_Idcard']."','$DateSent','$TimeSent','0') ") or die (mysql_error());
Tag : PHP, MySQL
|
|
 |
 |
 |
 |
Date :
2011-01-02 03:07:43 |
By :
SonakO |
View :
960 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |