|
 |
|
ถาม tarorio หน่อยค่ะ เค้าเปลี่ยนวันที่เลยเดือนซัมเมอร์ไปแล้ว ตอนนี้มันเป็น เทอม 1 |
|
 |
|
|
 |
 |
|
สร้างตารางสอบปลายภาคใหม่
เปลี่ยนเป็นวันที่อยู่เทอม S
update TBExam SET index_table = 0 where index_table = เลขที่ตารางสอบปลายภาคที่โครงงานนั้นอยู่
|
 |
 |
 |
 |
Date :
2009-08-15 14:00:38 |
By :
tarorio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เวลาที่ต้อง Logout ก่อนค่อย Login ใหม่นั้น เราใช้ตัวแปร Cookies เก็บค่าไว้ มันจะเก็บชื่อ รหัสคนที่ Login ไว้ตลอดเวลา จนกว่าจะ logout แต่เวลาปิดหน้าเว็บไปทั้งหมดค่าตัวแปร Cookies จะเป็นค่าว่าง
|
 |
 |
 |
 |
Date :
2009-08-15 14:04:06 |
By :
tarorio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Create_Date_requesExam.php จะเก็บค่ากำหนดวันขอสอบปลายภาค
ตัวเปรียบเทียบเทียบอยู่ใน function compareDate บรรทัดที่ 189
Code (PHP)
<?php
function compareDate($date1,$date2,$date3) {
$arrDate1 = explode("-",$date1);
$arrDate2 = explode("-",$date2);
$arrDate3 = explode("-",$date3);
$timStmp1 = mktime(0,0,0,$arrDate1[1],$arrDate1[2],$arrDate1[0]);
$timStmp2 = mktime(0,0,0,$arrDate2[1],$arrDate2[2],$arrDate2[0]);
$timStmp3 = mktime(0,0,0,$arrDate3[1],$arrDate3[2],$arrDate3[0]);
if ($timStmp1 > $timStmp2 & $timStmp1 < $timStmp3) {
echo "อยู่ในช่วงเวลาขอสอบ";
}else if($timStmp1 == $timStmp2){
echo "วันเริ่มขอสอบ";
}else if($timStmp1 == $timStmp3){
echo "ขอสอบวันสุดท้าย";
}else if ($timStmp1 > $timStmp3) {
echo "หมดเวลาขอสอบแล้ว";
} else if ($timStmp1 < $timStmp2) {
echo "ยังไม่ถึงเวลาขอสอบ";
}
}
echo compareDate("$TodayNow","$date_start","$date_end");
?>
?>
|
 |
 |
 |
 |
Date :
2009-08-15 14:07:26 |
By :
tarorio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อีกที่นึง อยู่ที่ไฟล์ request_Exam.php บรรทัดที่ 150
Code (PHP)
<?php
if(empty($date_start)){$date_start="0000-00-00";}else{
$strDate = " $date_start";
echo "เริ่มขอสอบปลายภาคตั้งแต่วันที่ ".DateThai($strDate); }
echo "<br>";
if(empty($date_end)){$date_end="0000-00-00";}else{ $strDate = " $date_end";
echo "ถึงวันที่ ".DateThai($strDate);}
echo "<br>";
//function compareDate($date1,$date2,$date3) {
$arrDate1 = explode("-",$TodayNow);
$arrDate2 = explode("-",$date_start);
$arrDate3 = explode("-",$date_end);
$timStmp1 = mktime(0,0,0,$arrDate1[1],$arrDate1[2],$arrDate1[0]);
$timStmp2 = mktime(0,0,0,$arrDate2[1],$arrDate2[2],$arrDate2[0]);
$timStmp3 = mktime(0,0,0,$arrDate3[1],$arrDate3[2],$arrDate3[0]);
if ($timStmp1 > $timStmp2 & $timStmp1 < $timStmp3) {
echo "อยู่ในช่วงเวลาขอสอบปลายภาค";
$dateExam=1;
}else if($timStmp1 == $timStmp2){
echo "วันนี้เริ่มขอสอบปลายภาค";
$dateExam=1;
}else if($timStmp1 == $timStmp3){
echo "ขอสอบปลายภาควันสุดท้าย";
$dateExam=1;
}else if ($timStmp1 > $timStmp3) {
echo "หมดเวลาขอสอบปลายภาคแล้ว";
$dateExam=0;
} else if ($timStmp1 < $timStmp2) {
echo "";
$dateExam=0;
}
?>
|
 |
 |
 |
 |
Date :
2009-08-15 14:11:12 |
By :
tarorio |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|