 |
|
พอดีทำระบบแจ้งซ่อมนะค่ะ แล้วเจ้าหน้าที่จะป้อนข้อมูลการดำเนินการซ่อมพอป้อนข้อมูลแล้ว พอคนอื่นloginมาก้อจะไม่สามารถกรอกข้อมูลได้แล้ว แต่จะให้แสดงข้อมูลที่คนแรกกรอกไป แต่ไม่รู้ทำไมคนแรกรอกแล้วแล้วพอคนที่สองมาดูอีมันก้อจะให้กรอกได้อีก พอเข้าใจไหมค่ะ ช่วยหน่อยนะค่ะ ดูโค๊ดให้หน่อยนะค่ะ
Code (PHP)
<?php
<?
$year = date("Y");
$y = $year+543;
$date_e= date("$y-m-d");//วันที่โพส
$time_e = date("H:i:s");//เวลาที่โพส
if($save){
if($testinput2 == ""){
$sql1="INSERT INTO per_repair(re_no, username, date_e, time_e, cause, correct) VALUES('$re_no', '$username', '$date_e', '$time_e', '$detail', '$comment')";
$query1 = mysql_query($sql1);
$sql2 = "UPDATE repair SET status = 1 WHERE re_no='$re_no'";
$query2 = mysql_query($sql2);
echo "<script language='javascript'>alert('เพิ่มข้อมูลการดำเนินการซ่อมเรียบร้อยแล้ว');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;url=../staff_re/showstaff_repair.php?per_no='$per_no' \"> ";
}else{
$sql1="INSERT INTO per_repair(re_no, username, date_e, time_e, date_out, cause, correct) VALUES('$re_no', '$username', '$date_e', '$time_e', '$testinput2', '$detail', '$comment')";
$query1 = mysql_query($sql1);
$sql2 = "UPDATE repair SET status = 2 WHERE re_no='$re_no'";
$query2 = mysql_query($sql2);
echo "<script language='javascript'>alert('เพิ่มข้อมูลการดำเนินการซ่อมเรียบร้อยแล้ว');</script>";
echo "<meta http-equiv=\"refresh\" content=\"0;url=../staff_re/showstaff_repair.php?per_no='$per_no' \"> ";
}
}
?>
?>
พอดีโค๊ดนี้พี่เค้าเขียนให้แต่ก้อไม่ได้
ช่วยหน่อยนะค่ะ จะขอบคุณมากเลยค่ะ
Tag : - - - -
|
|
 |
 |
 |
 |
Date :
2009-03-27 01:15:22 |
By :
meepooh_poonglo |
View :
1068 |
Reply :
3 |
|
 |
 |
 |
 |
|
|
|
 |