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_test /
modules /
plan /
planproject /
[ HOME SHELL ]
Name
Size
Permission
Action
detail
[ DIR ]
drwxr-xr-x
Thumbs.db
5.5
KB
-rw-r--r--
dbconfig.inc.php
134
B
-rw-r--r--
javachkbox.html
1.09
KB
-rw-r--r--
plan_BudgetCategory.php
3.29
KB
-rw-r--r--
plan_addacti.php
2.35
KB
-rw-r--r--
plan_addstd.php
1.86
KB
-rw-r--r--
plan_adduser.php
2.24
KB
-rw-r--r--
plan_addyear.php
1.4
KB
-rw-r--r--
plan_allot.php
3.62
KB
-rw-r--r--
plan_authen.php
6.55
KB
-rw-r--r--
plan_authenfg.php
9
B
-rw-r--r--
plan_bstandard.php
4.76
KB
-rw-r--r--
plan_calendar.php
297
B
-rw-r--r--
plan_cancel_form.php
775
B
-rw-r--r--
plan_config.php
634
B
-rw-r--r--
plan_dbconnect.php
291
B
-rw-r--r--
plan_dbconnon.php
252
B
-rw-r--r--
plan_default.php
592
B
-rw-r--r--
plan_deleacti.php
423
B
-rw-r--r--
plan_deleproj.php
581
B
-rw-r--r--
plan_deleuser.php
395
B
-rw-r--r--
plan_detailacti.php
7.69
KB
-rw-r--r--
plan_detailproj.php
6.76
KB
-rw-r--r--
plan_editacti.php
7.23
KB
-rw-r--r--
plan_editacti_bak.php
16.4
KB
-rw-r--r--
plan_editcalendar.php
818
B
-rw-r--r--
plan_editproj.php
8.78
KB
-rw-r--r--
plan_estandard.php
4.7
KB
-rw-r--r--
plan_eval_detail.php
4.13
KB
-rw-r--r--
plan_function.php
2.43
KB
-rw-r--r--
plan_grouplistadd.php
1.42
KB
-rw-r--r--
plan_in_acti.php
14.25
KB
-rw-r--r--
plan_in_proj.php
58.07
KB
-rw-r--r--
plan_in_proj_2.php
59.06
KB
-rw-r--r--
plan_owner_report.php
9.41
KB
-rw-r--r--
plan_owner_report2.php
3.03
KB
-rw-r--r--
plan_owner_report3.php
2.56
KB
-rw-r--r--
plan_person.php
1.36
KB
-rw-r--r--
plan_projcalendar.php
715
B
-rw-r--r--
plan_projlistadd.php
1.85
KB
-rw-r--r--
plan_report_tegy.php
7.46
KB
-rw-r--r--
plan_report_upload.php
2.53
KB
-rw-r--r--
plan_return_ajax_proj.php
1015
B
-rw-r--r--
plan_setgic.php
4.8
KB
-rw-r--r--
plan_setgic_year.php
10.98
KB
-rw-r--r--
plan_setgicadd.php
1.23
KB
-rw-r--r--
plan_setgicedit.php
3.28
KB
-rw-r--r--
plan_setuser.php
7.22
KB
-rw-r--r--
plan_setuser.php.bak
11.21
KB
-rw-r--r--
plan_show_plan.php
9.35
KB
-rw-r--r--
plan_show_plan.php.bak
13.04
KB
-rw-r--r--
plan_show_plan2.php
8.01
KB
-rw-r--r--
plan_show_steg.php
11.33
KB
-rw-r--r--
plan_signin.php
336
B
-rw-r--r--
plan_standard.php
653
B
-rw-r--r--
plan_temp.php
86
B
-rw-r--r--
plan_updacti.php
1.34
KB
-rw-r--r--
plan_updproj.php
1.11
KB
-rw-r--r--
plan_upload.php
2.38
KB
-rw-r--r--
plan_upload_detail.php
3.74
KB
-rw-r--r--
plan_upload_eval.php
3.54
KB
-rw-r--r--
plan_upload_form.php
1.28
KB
-rw-r--r--
plan_writeproj.php
1.18
KB
-rw-r--r--
plan_year.php
10.79
KB
-rw-r--r--
plan_year1.php
1.25
KB
-rw-r--r--
plan_year1.php.bak
1.24
KB
-rw-r--r--
test.php
392
B
-rw-r--r--
test1.php
536
B
-rw-r--r--
test2.php
1.46
KB
-rw-r--r--
test3.php
1.67
KB
-rw-r--r--
xplan_authen.php
3.85
KB
-rw-r--r--
xplan_authenfg.php
2.45
KB
-rw-r--r--
xplan_return_ajax_proj.php
1.12
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : plan_in_proj_2.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["budget_year"]==""){ echo "<br>"; echo "<div align='center'>"; echo "ตรวจสอบการกำหนดปีงบประมาณให้ถูกต้องก่อนค่ะ"; echo "</div>"; exit(); } if(!(isset($code_proj))){ $code_proj=""; } require_once("plan_calendar.php"); require_once("dbconfig.inc.php"); $space=" "; $proj_year=$_SESSION["budget_year"]; if($index==1){ ?> <script type="text/javascript" src="./css/js/calendarDateInput.js"></script> <Center> <b> <Font Size=4 color='#000099'><BR>::: บันทึกข้อมูล งาน/โครงการ ปีงบประมาณ <?php echo $_SESSION['budget_year']?> :::</Font></b> <Br><BR><BR> <form id='frm1' name='frm1'> <TABLE width="80%" border="0" align="center" cellpadding="2" cellspacing="2" height="50"> <TR> <TD width="50%" valign="top"> <TABLE width="100%" border="0" borderColor=#FF0033 cellpadding="0" cellspacing="0"> <tr> <td align="right" width="40%"><b><font class="textfrm">กลุ่ม(งาน) :</font></b></td> <td align='left' > <?php $sql = "SELECT * FROM system_workgroup order by workgroup"; $dbquery =DBfieldQuery($sql); $num_rows = mysqli_num_rows($dbquery); echo "<Select name='vcode_clus' size='1'>"; echo "<Option value=''>--- เลือกกลุ่ม(งาน) ---</option>"; $i=0; while ($i < $num_rows) { $result = mysqli_fetch_array($dbquery); $code_clus = $result['workgroup']; $name_clus = $result['workgroup_desc']; $txtshows = $code_clus." ".$name_clus; echo "<Option value='$code_clus'>$code_clus $name_clus$space</option>"; $i++; } echo "</Select>"; ?> </td></tr> <tr> <td align="right" ><b><font class="textfrm">กลยุทธ์ :</font></b></td> <td align='left' > <?php $sql = "SELECT * FROM plan_stregic where budget_year='$_SESSION[budget_year]' order by id_tegic"; $dbquery=DBfieldQuery($sql); echo "<Select name='vcode_tegy' size='1'>"; echo "<Option value=''>--- เลือกกลยุทธ์ --- </option>"; while ($result = mysqli_fetch_array($dbquery)) { $id_tegic = $result['id_tegic']; $strategic = $result['strategic']; $strategic=substr($strategic,0,100); echo "<Option value='$id_tegic'>$id_tegic $strategic$space</option>"; } echo "</Select>"; ?> </td></tr> <tr> <td align="right"><b><font class="textfrm">รหัสโครงการ :</font></b></td> <td align='left' ><input size="4" type=text name="vcode_proj" maxlength="3" value=<?php echo $code_proj?>> </td></tr> <tr> <td align="right"><b><font class="textfrm">ปีงบประมาณ :</font></b></td> <td align='left' > <input type="text" readonly="readonly" name="vbudget_year" size=4 maxlength=4 value=<?php echo $proj_year?>> </td></tr> <tr> <td align="right"><b><font class="textfrm">ชื่อโครงการ :</font></b></td> <td align='left' > <textarea name='vname_proj' rows = '3' cols='50'></textarea> </td></tr> <tr> <td align="right"><b><font class="textfrm">วันเริ่มต้นโครงการ :</font></b></td> <td align='left' > <script> var Y_date=<?php echo $Ynum?> var m_date=<?php echo $mnum?> var d_date=<?php echo $dnum?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('mybeginday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font class="textfrm">วันสิ้นสุดโครงการ :</font></b></td> <td align='left' > <script> var Y_date=<?php echo $Ybudget?> var m_date=<?php echo $mbudget?> var d_date=<?php echo $dbudget?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('myfinishday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font class="textfrm">จำนวนเงินที่จัดสรร :</font></b></td> <td align='left' > <input size="9" type="text" name="vbudget_proj" maxlength=9> </td></tr> <tr> <td align="right"><b><font class="textfrm">หัวหน้าโครงการ :</font></b></td> <td align='left' > <?php $sql = "SELECT * FROM person_main where status='0' order by position_code,name"; $dbquery=DBfieldQuery($sql); echo "<Select name='vowner_proj' size='1'>"; echo "<Option value=''>--- เลือกบุคลากร --- </option>"; while ($result = mysqli_fetch_array($dbquery)) { echo "<Option value=$result[person_id]>$result[name] $result[surname]</option>"; $person_ar[$result['person_id']]=$result['prename'].$result['name']." ".$result['surname']; } echo "</Select>"; ?> </td></tr> </table> </TD> </table> <?php echo "<p align='center'>"; if($_SESSION["mpms_add"]=='1') { echo "<INPUT TYPE='button' name='smb' value='บันทึก' onclick='goto_url_update(1)'> <INPUT TYPE='button' name='smb' value='ยกเลิก' onclick='goto_url_update(0)'>"; } else{ echo "<div align='center'><font size='3' color='#FF0033'>คุณไม่ได้รับสิทธิ์บันทึกข้อมูล</font></div>"; } echo "</form>"; } //end if index==1 //ส่วนยืนยันการลบข้อมูล if($index==2) { echo "<br>"; 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=plan&task=planproject/plan_in_proj_2&index=3&vcode_proj=$_GET[vcode_proj]&page=$_GET[page]\"'> <INPUT TYPE='button' name='back' value='ยกเลิก' onclick='location.href=\"?option=plan&task=planproject/plan_in_proj_2&page=$_GET[page]\"'"; echo "</td></tr></table>"; } //ส่วนลบข้อมูล if($index==3){ $sql_acti = "SELECT * FROM plan_acti_2 where budget_year='$proj_year' and code_proj='$vcode_proj' "; $dbquery_acti =DBfieldQuery($sql_acti); while ($result_acti = mysqli_fetch_array($dbquery_acti)){ $sql = "delete FROM plan_acti_3 where budget_year='$proj_year' and code_acti= '$result_acti[code_acti]' "; $dbquery = DBfieldQuery($sql); $sql = "delete FROM plan_acti_2 where budget_year='$proj_year' and code_acti= '$result_acti[code_acti]' "; $dbquery = DBfieldQuery($sql); } $sql = "delete FROM plan_proj_2 where budget_year='$proj_year' and code_proj='$vcode_proj' " ; $dbquery = DBfieldQuery($sql); } if($index==4){ $dayseri =date("Y-m-d H:i:s"); $vcode_proj=$vcode_proj+1000; $sql = "SELECT * FROM plan_proj_2 where budget_year='$proj_year' and code_proj = '$vcode_proj' "; $result0 =DBfieldQuery($sql); $fetyear = mysqli_fetch_array($result0); $num=mysqli_num_rows($result0); if ($num==0){ $sql = "insert into plan_proj_2 (code_clus,code_tegy,code_proj,budget_year,budget_proj,name_proj,owner_proj,begin_date,finish_date,dayrec,budget_approve,file_detail,eval_tegy,eval_activity,eval_result,eval_obstacle,eval_particular,allow_edit) values ('$vcode_clus','$vcode_tegy','$vcode_proj','$vbudget_year','$vbudget_proj_2','$vname_proj','$vowner_proj','$mybeginday','$myfinishday','$dayseri','0','','','','','','','')"; $result0 = DBfieldQuery($sql); }else{ ?> <script> alert(" <?php echo $vcode_proj?> คุณใส่รหัสโครงการซ้ำ\nกรุณาบันทึกใหม่"); </script> <?php } } // end if index==4 if($index==5){ $sql = "SELECT * FROM plan_proj_2 where budget_year='$proj_year' and id='$_GET[plan_proj_id]' "; $dbquery =DBfieldQuery($sql); $result = mysqli_fetch_array($dbquery); $id =$result['id']; $budget_year =$result['budget_year']; $w_code_clus =$result['code_clus']; $w_code_tegy =$result['code_tegy']; $w_code_proj =$result['code_proj']; $w_name_proj = $result['name_proj']; $w_budget_proj =$result['budget_proj']; $w_owner_proj =$result['owner_proj']; $begin_date =$result['begin_date']; list($begin_year,$begin_month,$begin_day) = explode("-",$begin_date); $finish_date =$result['finish_date']; list($finish_year,$finish_month,$finish_day) = explode("-",$finish_date); ?> <script type="text/javascript" src="./css/js/calendarDateInput.js"></script> <p align="center"><font color="#FFCC00"></font><Center><b> <Font face="Tahoma" Size=4 color='#000099'><BR>::: แก้ไขโครงการเพิ่มเติมจากเงินเหลือจ่าย ปีงบประมาณ <?php echo $_SESSION['budget_year']?> :::</Font></b> <Br><BR><BR> <form id='frm1' name='frm1'> <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="2" height="50"> <TR> <TD width="50%" valign="top"> <TABLE width="100%" border="0" borderColor=#FF0033 cellpadding="0" cellspacing="0"> <tr> <td align="right" width="40%"><b><font size="3" face="MS Sans Serif" color="#009900">กลุ่ม(งาน) :</font></b></td> <td align='left' > <?php $sql = "SELECT * FROM system_workgroup"; $dbquery =DBfieldQuery($sql); $num_rows = mysqli_num_rows($dbquery); echo "<Select name='vcode_clus' size='1'>"; echo "<Option value=''>--- เลือกกลุ่ม(งาน) ---</option>"; $i=0; while ($i < $num_rows) { $result = mysqli_fetch_array($dbquery); $code_clus = $result['workgroup']; $name_clus = $result['workgroup_desc']; $txtshows = $code_clus." ".$name_clus; if ($code_clus==$w_code_clus){ echo "<Option value='$code_clus' selected>$code_clus $name_clus$space</option>"; }else{echo "<Option value='$code_clus'>$code_clus $name_clus$space</option>"; } $i++; } echo "</Select>"; ?> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">กลยุทธ์ :</font></b></td> <td align='left' > <?php $sql = "SELECT * FROM plan_stregic where budget_year='$_SESSION[budget_year]' order by id_tegic"; $dbquery=DBfieldQuery($sql); echo "<Select name='vcode_tegy' size='1'> "; echo "<Option value=''>--- เลือกกลยุทธ์ --- </option>"; while ($result = mysqli_fetch_array($dbquery)) { $id_tegic = $result['id_tegic']; $strategic = $result['strategic']; $strategic=substr($strategic,0,100); if($id_tegic==$w_code_tegy){ echo "<Option value='$id_tegic' selected>$id_tegic $strategic$space</option>"; } else{ echo "<Option value='$id_tegic'>$id_tegic $strategic$space</option>"; } } echo "</Select>"; ?> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">รหัสโครงการ :</font></b></td> <td align='left' > <input size="4" type=text readonly name="vcode_proj" maxlength=3 value=<?php echo $w_code_proj?>> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">ปีงบประมาณ :</font></b></td> <td align='left'> <input type=text readonly name="vbudget_year" size="4" maxlength="4" value=<?php echo $proj_year?> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">ชื่อโครงการ :</font></b></td> <td align='left' > <textarea name='vname_proj' rows = '3' cols='50'><?php echo $w_name_proj?></textarea> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">วันเริ่มต้นโครงการ :</font></b></td> <td align='left' > <script> var Y_date=<?php echo $begin_year?> var m_date=<?php echo $begin_month?> var d_date=<?php echo $begin_day?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('mybeginday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">วันสิ้นสุดโครงการ :</font></b></td> <td align='left' > <script> var Y_date=<?php echo $finish_year?> var m_date=<?php echo $finish_month?> var d_date=<?php echo $finish_day?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('myfinishday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">จำนวนเงินที่จัดสรร :</font></b></td> <td align='left' > <input size="9" type=text name="vbudget_proj" value=<?php echo $w_budget_proj?> maxlength="9"> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">หัวหน้าโครงการ :</font></b></td><td align="left"> <?php $sql = "SELECT * FROM person_main order by position_code,name"; $dbquery=DBfieldQuery($sql); echo "<Select name='vowner_proj' size='1'>"; echo "<Option value=''>--- เลือกบุคลากร --- </option>"; while ($result = mysqli_fetch_array($dbquery)) { if($w_owner_proj==$result['person_id']){ echo "<Option value=$result[person_id] selected>$result[name] $result[surname]</option>"; } else{ echo "<Option value=$result[person_id]>$result[name] $result[surname]</option>"; } } echo "</Select>"; ?> </td></tr> </table> </TD> </table> <?php echo "<INPUT TYPE='hidden' name='plan_proj_id' value='$id'>"; echo "<input type='hidden' name='page' value='$_GET[page]'>"; echo "<p align='center'>"; echo "<INPUT TYPE='button' name='smb' value='ตกลง' onclick='goto_url_update_proj(1)'> <INPUT TYPE='button' name='smb' value='ย้อนกลับ' onclick='goto_url_update_proj(0)'>"; echo "</p>"; } //end if index==5 if($index==6){ //ตรวจการซ้ำของรหัสโครงการ $sql = "SELECT * FROM plan_proj_2 where budget_year='$_SESSION[budget_year]' and code_proj = '$vcode_proj' and id!='$_POST[plan_proj_id]' "; $result0 =DBfieldQuery($sql); $fetyear = mysqli_fetch_array($result0); $num=mysqli_num_rows($result0); if ($num==0){ $sql = "update plan_proj_2 set code_clus='$vcode_clus',code_tegy='$vcode_tegy', code_proj='$vcode_proj', budget_proj= '$vbudget_proj_2',name_proj = '$vname_proj' ,owner_proj ='$vowner_proj' ,begin_date='$mybeginday',finish_date='$myfinishday' where id='$_POST[plan_proj_id]' " ; $dbquery = DBfieldQuery($sql); } else { echo "<br>"; echo "<div align='center'>"; echo "รหัสโครงการซ่ำ โปรดตรวจสอบค่ะ"; echo "</div>"; exit(); } } //end if index==6 if($index==7){ $sql = "SELECT * FROM plan_proj_2 where id='$_GET[plan_proj_id]' "; $dbquery =DBfieldQuery($sql); $result = mysqli_fetch_array($dbquery); $id =$result['id']; $budget_year =$result['budget_year']; $w_code_clus =$result['code_clus']; $w_code_tegy =$result['code_tegy']; $w_code_proj =$result['code_proj']; $w_name_proj = $result['name_proj']; $w_budget_proj =$result['budget_proj']; $w_owner_proj =$result['owner_proj']; $begin_date =$result['begin_date']; list($begin_year,$begin_month,$begin_day) = explode("-",$begin_date); $finish_date =$result['finish_date']; list($finish_year,$finish_month,$finish_day) = explode("-",$finish_date); ?> <script type="text/javascript" src="./css/js/calendarDateInput.js"></script> <p align="center"><font color="#FFCC00"></font><Center><b> <Font face="Tahoma" Size=4 color='#000099'><BR>::: รายละเอียดโครงการเพิ่มเติมจากเงินเหลือจ่าย ปีงบประมาณ <?php echo $_SESSION['budget_year']?> :::</Font></b> <Br><BR><BR> <form id='edit_form' name='frm1'> <TABLE width="100%" border="0" align="center" cellpadding="2" cellspacing="2" height="50"> <TR> <TD width="50%" valign="top"> <TABLE width="100%" border="0" borderColor=#FF0033 cellpadding="0" cellspacing="0"> <tr> <td align="right" width="50%"><b><font size="3" face="MS Sans Serif" color="#009900">กลุ่ม(งาน) :</font></b></td> <td align='left' > <?php $sql = "SELECT * FROM system_workgroup"; $dbquery =DBfieldQuery($sql); $num_rows = mysqli_num_rows($dbquery); echo "<Select name='vcode_clus' size='1'>"; echo "<Option value=''>--- เลือกกลุ่ม(งาน) ---</option>"; $i=0; while ($i < $num_rows) { $result = mysqli_fetch_array($dbquery); $code_clus = $result['workgroup']; $name_clus = $result['workgroup_desc']; $txtshows = $code_clus." ".$name_clus; if ($code_clus==$w_code_clus){ echo "<Option value='$code_clus' selected>$code_clus $name_clus$space</option>"; }else{echo "<Option value='$code_clus'>$code_clus $name_clus$space</option>"; } $i++; } echo "</Select>"; ?> </td></tr> <tr> <td align="right" width="50%"><b><font size="3" face="MS Sans Serif" color="#009900">กลยุทธ์ :</font></b></td> <td align='left' > <?php $sql = "SELECT * FROM plan_stregic where budget_year='$_SESSION[budget_year]' order by id_tegic"; $dbquery=DBfieldQuery($sql); echo "<Select name='vcode_tegy' size='1'> "; echo "<Option value=''>--- เลือกกลยุทธ์ --- </option>"; while ($result = mysqli_fetch_array($dbquery)) { $id_tegic = $result['id_tegic']; $strategic = $result['strategic']; $strategic=substr($strategic,0,80); if($id_tegic==$w_code_tegy){ echo "<Option value='$id_tegic' selected>$id_tegic $strategic$space</option>"; } else{ echo "<Option value='$id_tegic'>$id_tegic $strategic$space</option>"; } } echo "</Select>"; ?> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">รหัสโครงการ :</font></b></td> <td align='left' > <input size="4" type readonly name="vcode_proj" maxlength=3 value=<?php echo $w_code_proj?>> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">ปีงบประมาณ :</font></b></td> <td align='left'> <input type=text readonly name="vbudget_year" size="4" maxlength="4" value=<?php echo $proj_year ?> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">ชื่อโครงการ :</font></b></td> <td align='left' > <textarea name='vname_proj' rows = '3' cols='50' readonly="readonly"><?php echo $w_name_proj?></textarea> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">วันเริ่มต้นโครงการ :</font></b></td> <td align='left' > <script> var Y_date=<?php echo $begin_year?> var m_date=<?php echo $begin_month?> var d_date=<?php echo $begin_day?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('mybeginday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">วันสิ้นสุดโครงการ :</font></b></td> <td align='left' > <script> var Y_date=<?php echo $finish_year?> var m_date=<?php echo $finish_month?> var d_date=<?php echo $finish_day?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('myfinishday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">จำนวนเงินที่จัดสรร :</font></b></td> <?php $w_budget_proj=number_format($w_budget_proj,2) ?> <td align='left' > <input size="9" type=text name="vbudget_proj" value=<?php echo $w_budget_proj?> maxlength="9" readonly="readonly"> </td></tr> <tr> <td align="right"><b><font size="3" face="MS Sans Serif" color="#009900">หัวหน้าโครงการ :</font></b></td><td align="left"> <?php $sql = "SELECT * FROM person_main order by position_code,name"; $dbquery=DBfieldQuery($sql); echo "<Select name='vowner_proj' size='1'>"; while ($result = mysqli_fetch_array($dbquery)) { if($w_owner_proj==$result['person_id']){ echo "<Option value=$result[person_id] selected>$result[name] $result[surname]</option>"; } } echo "</Select>"; ?> </td></tr> </table> </TD> </table> <?php echo "<form id='frm1' name='frm1'>"; echo "<input type='hidden' name='page' value='$_GET[page]'>"; echo "<p align='center'>"; echo "<INPUT TYPE='button' name='smb' value='ย้อนกลับ' onclick='goto_url(0)'>"; echo "</p>"; echo "</form>"; } // end if index==7 if($index==11){ $sql = "SELECT * FROM plan_proj_2 where id='$_GET[plan_proj_id]'"; $dbquery=DBfieldQuery($sql); $result_proj = mysqli_fetch_array($dbquery); ?> <script type="text/javascript" src="./css/js/calendarDateInput.js"></script> <form id='frm1' name='frm1'> <br /> <p align="center"><Font Size='3' color='#000099'><B>กำหนดกิจกรรมของโครงการ ปีงบประมาณ <?php echo $_SESSION['budget_year']?></B></Font></p> <p align="center"><Font Size='3' color='#000099'><B>โครงการ <?php echo $result_proj['name_proj']?></B></Font></p> <TABLE width="80%" border="0" align="center" cellpadding="2" cellspacing="2" height="50"> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วัน- เดือน-ปี : </font></b></td> <td align="left" width="60%"> <script> var Y_date=<?php echo $Ynum?> var m_date=<?php echo $mnum?> var d_date=<?php echo $dnum?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('rec_date', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">รหัสกิจกรรม :</font></b></td> <td align="left"> <input size=4 type=text name="vcode_acti" maxlength=3 value=''> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">กิจกรรม :</font></b></td> <td align="left"> <textarea name='vname_acti' rows = '3' cols='40' ></textarea> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วันเริ่มต้นกิจกรรม :</font></b></td> <td align="left"> <script> var Y_date=<?php echo $Ynum?> var m_date=<?php echo $mnum?> var d_date=<?php echo $dnum?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('mybeginday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วันสิ้นสุดกิจกรรม :</font></b></td> <td align="left"> <script> var Y_date=<?php echo $Ybudget?> var m_date=<?php echo $mbudget?> var d_date=<?php echo $dbudget?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('myfinishday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">แหล่งเงิน :</font></b></td> <td align="left"> <?php echo "<br />"; echo "1 <Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $item_name = $result['item']; $item_name=substr($item_name,0,100); echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9'>"; echo "</td></tr>"; //รายการที่ 2 echo "<tr><td></td><td>2 "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $item_name = $result['item']; $item_name=substr($item_name,0,100); echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9'>"; echo "</td></tr>"; //รายการที่ 3 echo "<tr><td></td><td>3 "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $item_name = $result['item']; $item_name=substr($item_name,0,100); echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9'>"; echo "</td></tr>"; //รายการที่ 4 echo "<tr><td></td><td>4 "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $item_name = $result['item']; $item_name=substr($item_name,0,100); echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9'>"; echo "</td></tr>"; //รายการที่ 5 echo "<tr><td></td><td>5 "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $item_name = $result['item']; $item_name=substr($item_name,0,100); echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9'>"; echo "</td></tr>"; echo "<INPUT TYPE='hidden' name='vcode_proj' value='$result_proj[code_proj]'>"; echo "<INPUT TYPE='hidden' name='page' value='$_GET[page]'>"; echo "<tr><td colspan='2' align='center'><INPUT TYPE='button' name='smb' value='บันทึก' onclick='goto_insert_acti(1)'> <INPUT TYPE='button' name='smb' value='ยกเลิก' onclick='goto_insert_acti(0)'></td></tr>"; echo "</table>"; echo "</form>"; } //end if index==11 if($index==13){ $sql = "delete FROM plan_acti_3 where budget_year='$proj_year' and code_acti= '$_GET[code_acti]' "; $dbquery = DBfieldQuery($sql); $sql = "delete FROM plan_acti_2 where budget_year='$proj_year' and code_acti= '$_GET[code_acti]' "; $dbquery = DBfieldQuery($sql); } //end if index==13 if($index==14){ $rec_date =date("Y-m-d H:i:s"); $vcode_acti=$_POST['vcode_proj'].$_POST['vcode_acti']; $sql = "SELECT * FROM plan_acti_2 where budget_year='$proj_year' and code_acti = '$vcode_acti' "; $result0 =DBfieldQuery($sql); $fetyear = mysqli_fetch_array($result0); $num=mysqli_num_rows($result0); if ($num==0){ $sql = "insert into plan_acti_2 (budget_year,code_proj,code_acti,name_acti,rec_date,begin_date,finish_date,officer) values ('$proj_year','$_POST[vcode_proj]','$vcode_acti','$_POST[vname_acti]','$rec_date','$_POST[mybeginday]','$_POST[myfinishday]','$_SESSION[login_user_id]')"; $result0 = DBfieldQuery($sql); }else{ ?> <script> alert(" คุณใส่รหัสกิจกรรมซ้ำ\nกรุณาบันทึกใหม่"); </script> <?php echo "<script>document.location.href='?option=plan&task=planproject/plan_in_proj_2';</script>\n"; exit(); } for($i=0;$i<count($_POST['vcode_approve']);$i++){ $budget_acti=$_POST['vbudget_acti'][$i]; $code_approve=$_POST['vcode_approve'][$i]; if(($_POST['vcode_approve'][$i]!="") and ($_POST['vbudget_acti'][$i]!="")){ $sql = "insert into plan_acti_3 (budget_year,code_acti,budget_acti,code_approve) values ('$proj_year','$vcode_acti','$budget_acti','$code_approve')"; $result0 = DBfieldQuery($sql); } } } //end if index==14 if($index==15){ $sql = "SELECT *,plan_acti_2.begin_date,plan_acti_2.finish_date FROM plan_acti_2 left join plan_proj_2 on plan_acti_2.code_proj=plan_proj_2.code_proj where plan_acti_2.budget_year='$proj_year' and plan_proj_2.budget_year='$proj_year' and plan_acti_2.id='$_GET[acti_id]'"; $dbquery=DBfieldQuery($sql); $result_acti = mysqli_fetch_array($dbquery); $begin_date =$result_acti['begin_date']; list($begin_year,$begin_month,$begin_day) = explode("-",$begin_date); $finish_date =$result_acti['finish_date']; list($finish_year,$finish_month,$finish_day) = explode("-",$finish_date); ?> <script type="text/javascript" src="./css/js/calendarDateInput.js"></script> <form id='frm1' name='frm1'> <br /> <p align="center"><Font Size='3' color='#000099'><B>แก้ไขกิจกรรมโครงการ<?php echo $result_acti['name_proj']?> ปีงบประมาณ <?php echo $_SESSION['budget_year']?></B></Font></p> <TABLE width="80%" border="0" align="center" cellpadding="2" cellspacing="2" height="50"> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วัน- เดือน-ปี : </font></b></td> <td align="left" width="60%"> <script> var Y_date=<?php echo $Ynum?> var m_date=<?php echo $mnum?> var d_date=<?php echo $dnum?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('rec_date', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">รหัสกิจกรรม :</font></b></td> <td align="left"> <input size=4 type=text name="vcode_acti" maxlength=3 value='<?php echo $result_acti['code_acti']?>' readonly> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">กิจกรรม :</font></b></td> <td align="left"> <textarea name='vname_acti' rows = '3' cols='40' ><?php echo $result_acti['name_acti']?></textarea> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วันเริ่มต้นกิจกรรม :</font></b></td> <td align="left"> <script> var Y_date=<?php echo $begin_year?> var m_date=<?php echo $begin_month?> var d_date=<?php echo $begin_day?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('mybeginday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วันสิ้นสุดกิจกรรม :</font></b></td> <td align="left"> <script> var Y_date=<?php echo $finish_year?> var m_date=<?php echo $finish_month?> var d_date=<?php echo $finish_day?> Y_date= Y_date+'/'+m_date+'/'+d_date DateInput('myfinishday', true, 'YYYY-MM-DD', Y_date)</script> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">แหล่งเงิน :</font></b></td> <td align="left"> <?php echo "<br />"; //แสดงแหล่งเงิน $sql_budget = "SELECT * FROM plan_acti_3 where budget_year='$proj_year' and code_acti = '$result_acti[code_acti]' "; $query_budget =DBfieldQuery($sql_budget); $N=1; $X=0; $budget[1]=0; $budget[2]=0; $budget[3]=0; $budget[4]=0; $budget[5]=0; $approve[1]=""; $approve[2]=""; $approve[3]=""; $approve[4]=""; $approve[5]=""; while($result_budget= mysqli_fetch_array($query_budget)){ $budget[$N]=$result_budget['budget_acti']; $approve[$N]=$result_budget['code_approve']; $N++; } echo "1 <Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $num2="2_$num"; $item_name = $result['item']; $item_name=substr($item_name,0,100); if($num2==$approve[1]){ echo "<option value ='2_$num' selected>งวดที่ $num [$project]$item_name</option>"; } else{ echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9' value='$budget[1]'>"; echo "</td></tr>"; //รายการที่ 2 echo "<tr><td></td><td>2 "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $num2="2_$num"; $item_name = $result['item']; $item_name=substr($item_name,0,100); if($num2==$approve[2]){ echo "<option value ='2_$num' selected>งวดที่ $num [$project]$item_name</option>"; } else{ echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9' value='$budget[2]'>"; echo "</td></tr>"; //รายการที่ 3 echo "<tr><td></td><td>3 "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $num2="2_$num"; $item_name = $result['item']; $item_name=substr($item_name,0,100); if($num2==$approve[3]){ echo "<option value ='2_$num' selected>งวดที่ $num [$project]$item_name</option>"; } else{ echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9' value='$budget[3]'>"; echo "</td></tr>"; //รายการที่ 4 echo "<tr><td></td><td>4 "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $num2="2_$num"; $item_name = $result['item']; $item_name=substr($item_name,0,100); if($num2==$approve[4]){ echo "<option value ='2_$num' selected>งวดที่ $num [$project]$item_name</option>"; } else{ echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9' value='$budget[4]'>"; echo "</td></tr>"; //รายการที่ 5 echo "<tr><td></td><td>5 "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $num2="2_$num"; $item_name = $result['item']; $item_name=substr($item_name,0,100); if($num2==$approve[5]){ echo "<option value ='2_$num' selected>งวดที่ $num [$project]$item_name</option>"; } else{ echo "<option value ='2_$num'>งวดที่ $num [$project]$item_name</option>"; } } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b><input size='9' type='text' name='vbudget_acti[]' maxlength='9' value='$budget[5]'>"; echo "</td></tr>"; echo "<INPUT TYPE='hidden' name='acti_id' value='$_GET[acti_id]'>"; echo "<INPUT TYPE='hidden' name='code_acti' value='$result_acti[code_acti]'>"; echo "<INPUT TYPE='hidden' name='page' value='$_GET[page]'>"; echo "<tr><td colspan='2' align='center'><br><INPUT TYPE='button' name='smb' value='บันทึก' onclick='goto_update_acti(1)'> <INPUT TYPE='button' name='smb' value='ยกเลิก' onclick='goto_update_acti(0)'></td></tr>"; ?> </table> </form> <?php }//end if index==15 if($index==16){ $rec_date =date("Y-m-d H:i:s"); $sql = "update plan_acti_2 set name_acti='$_POST[vname_acti]', begin_date='$_POST[mybeginday]', finish_date='$_POST[myfinishday]', rec_date= '$rec_date', officer = '$_SESSION[login_user_id]' where budget_year='$proj_year' and id = '$_POST[acti_id]' "; $dbquery = DBfieldQuery($sql); $sql = "delete FROM plan_acti_3 where budget_year='$proj_year' and code_acti= '$_POST[code_acti]' "; $dbquery = DBfieldQuery($sql); for($i=0;$i<count($_POST['vcode_approve']);$i++){ $budget_acti=$_POST['vbudget_acti'][$i]; $code_approve=$_POST['vcode_approve'][$i]; if(($_POST['vcode_approve'][$i]!="") and ($_POST['vbudget_acti'][$i]!="")){ $sql = "insert into plan_acti_3 (budget_year,code_acti,budget_acti,code_approve) values ('$proj_year','$vcode_acti','$budget_acti','$code_approve')"; $result0 = DBfieldQuery($sql); } } } //end if index==16 if($index==17){ $sql_ref = "SELECT * FROM plan_acti_2 where budget_year='$proj_year' and id = '$_GET[acti_id]' "; $query_ref =DBfieldQuery($sql_ref); $result_ref = mysqli_fetch_array($query_ref); function thai_date_2($date){ if(!isset($date)){ return; } $thai_month_arr=array( "01"=>"มกราคม", "02"=>"กุมภาพันธ์", "03"=>"มีนาคม", "04"=>"เมษายน", "05"=>"พฤษภาคม", "06"=>"มิถุนายน", "07"=>"กรกฎาคม", "08"=>"สิงหาคม", "09"=>"กันยายน", "10"=>"ตุลาคม", "11"=>"พฤศจิกายน", "12"=>"ธันวาคม" ); $thai_date_return=""; $f_date=explode("-", $date); $f_date[2]=intval($f_date[2]); $thai_date_return.= "วันที่ ".$f_date[2]; $thai_date_return.=" เดือน".$thai_month_arr[$f_date[1]]; $thai_date_return.= " พ.ศ.".($f_date[0]+543); if($date!=""){ return $thai_date_return; } else{ $thai_date_return=""; return $thai_date_return; } } ?> <script type="text/javascript" src="./css/js/calendarDateInput.js"></script> <br /> <p align="center"><Font Size='3' color='#000099'><B>รายละเอียดกิจกรรม</B></Font></p> <TABLE width="80%" border="0" align="center" cellpadding="2" cellspacing="2" height="50" Bgcolor="#Fcf9d8"> <?php echo "<Tr ><Td colspan='2' align='right'><INPUT TYPE='button' name='smb' value='<<กลับหน้าก่อน' onclick='location.href=\"?option=plan&task=planproject/plan_in_proj_2&page=$_GET[page]\"'></Td></Tr>"; ?> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วัน- เดือน-ปี : </font></b></td> <td align="left" width="60%"> <?php echo thai_date_2($result_ref['rec_date']); ?> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">รหัสกิจกรรม :</font></b></td> <td align="left"> <?php echo $result_ref['code_acti']; ?> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">กิจกรรม :</font></b></td> <td align="left"> <?php echo $result_ref['name_acti']; ?> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วันเริ่มต้นกิจกรรม :</font></b></td> <td align="left"> <?php echo thai_date_2($result_ref['begin_date']); ?> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">วันสิ้นสุดกิจกรรม :</font></b></td> <td align="left"> <?php echo thai_date_2($result_ref['finish_date']); ?> </td></tr> <tr> <td align="right"><b><font color="#003333" size="2" face="MS Sans Serif">แหล่งเงิน :</font></b></td> <td align="left"></td></tr> <?php //แสดงแหล่งเงิน $sql_budget = "SELECT * FROM plan_acti_3 where budget_year='$proj_year' and code_acti = '$result_ref[code_acti]' "; $query_budget =DBfieldQuery($sql_budget); $N=1; while($result_budget= mysqli_fetch_array($query_budget)){ echo "<tr><td></td><td>$N "; echo "<Select name='vcode_approve[]' size='1'>"; $sql = "select num, item,project from budget_receive where budget_year='$proj_year' order by num"; $dbquery =DBfieldQuery($sql); echo "<option value = ''>เลือก</option>" ; echo "<optgroup label='งบประมาณ'>"; While ($result = mysqli_fetch_array($dbquery)) { $num = $result['num']; $project = $result['project']; $num2="2_$num"; echo $num2; $item_name = $result['item']; $item_name=substr($item_name,0,100); if($num2==$result_budget['code_approve']){ echo "<option value ='2_$num' selected>งวดที่ $num [$project]$item_name</option>"; } } echo "</optgroup>"; echo "</select>"; echo "<br><b><font color='#003333' size='2' face='MS Sans Serif'> จำนวนเงิน </font></b>"; echo number_format($result_budget['budget_acti'],2); echo " บาท"; echo "</td></tr>"; $N++; } //while echo "<tr><td> </td><td></td></tr>"; echo "</table>"; } //end if index==17 ?> <!-- Part2 --> <?php if(!($index==1 or $index==2 or $index==5 or $index==7 or $index==11 or $index==15 or $index==17)){ echo "<br>"; echo "<div align='center'><Font Size='4' color='#000099'>โครงการเพิ่มเติมจากเงินเหลือจ่าย ปีงบประมาณ $_SESSION[budget_year]</Font></div>"; $sql_page = "SELECT * FROM plan_proj_2 where budget_year='$proj_year' "; $dbquery_page = mysqli_query($connect,$sql_page); $num_rows=mysqli_num_rows($dbquery_page); $pagelen=10; // กำหนดแถวต่อหน้า $url_link="option=plan&task=planproject/plan_in_proj_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>"; } //จบแยกหน้า ?> <BR><BR> <?php echo "<table width='90%' align='center' border='0'>"; echo "<Tr><Td align='left'><INPUT TYPE='button' name='smb' value='เพิ่มข้อมูล' onclick='location.href=\"?option=plan&task=planproject/plan_in_proj_2&index=1\"'></Td>"; echo "</table>"; ?> <Table width="90%" Border="1" borderColor=#990000 text="#FFFFFF" align="center" style="border-collapse: collapse"> <?php echo "</Tr>"; echo "<Tr bgcolor='#EAECEE'>"; echo "<Th width='7%'>รหัสโครงการ</th>"; echo "<Th>โครงการ/กิจกรรม</th>"; echo "<Th width='15%'>งบประมาณ</th>"; echo "<Th width='18%'>หัวหน้าโครงการ</th>"; echo "<Th width='4%'>รายละเอียด</th>"; echo "<Th width='4%'>แก้ไข</th>"; echo "<Th width='4%'>ลบ</th>"; echo "<Th width='4%'>เพิ่ม<br>กิจกรรม</th>"; $sql = "SELECT *,plan_proj_2.id FROM plan_proj_2 left join person_main on plan_proj_2.owner_proj=person_main.person_id where budget_year='$proj_year' ORDER BY code_proj limit $start,$pagelen"; $dbquery =DBfieldQuery($sql); $i=0; $N=(($page-1)*$pagelen)+1; //*เกี่ยวข้องกับการแยกหน้า $M=1; $sum_budget_proj=0; while ($result = mysqli_fetch_array($dbquery)) { $id =$result['id']; $budget_year =$result['budget_year']; $code_clus =$result['code_clus']; $code_tegy =$result['code_tegy']; $code_proj =$result['code_proj']; $name_proj = $result['name_proj']; $budget_proj =$result['budget_proj']; $sum_budget_proj=$sum_budget_proj+$budget_proj; $owner_proj =$result['owner_proj']; if (empty($code_tegy)) { $code_tegy= chr(149); } $mcode_tegy =$code_tegy.'-'.$code_proj; $len=strlen($owner_proj); $point=strpos($owner_proj,' '); $long=$len-$point; $fname=substr($owner_proj,0,$point); $sname=substr($owner_proj,-$long,$long); $cname=trim($sname); $Fcredit1=number_format($budget_proj,2); echo "<Tr Bgcolor='#F8E874'>"; echo "<Td align='center'>$code_proj</td>"; echo "<Td align='left'> $name_proj</td>"; echo "<Td align='center'>$Fcredit1 </td>"; echo "<Td align='left'>$result[prename]$result[name] $result[surname]</td>"; echo "<Td><div align=center><a href=?option=plan&task=planproject/plan_in_proj_2&index=7&plan_proj_id=$id&page=$page><img src=\"./images/b_browse.png\" WIDTH='16' HEIGHT='16' BORDER=0 ALT='รายละเอียดโครงการ'></a></div></Td>"; if($_SESSION["mpms_edit"]=='1') { echo "<Td><div align='center'><a href=?option=plan&task=planproject/plan_in_proj_2&index=5&plan_proj_id=$id&page=$page><img src=\"./images/b_edit.png\" WIDTH='16' HEIGHT='16' BORDER=0 ALT='แก้ไขโครงการ'></a></div></Td>"; } else{ echo "<td></td>"; } if($_SESSION["mpms_dele"]=='1') { echo "<Td><div align=center><a href=?option=plan&task=planproject/plan_in_proj_2&vcode_proj=$code_proj&index=2&page=$page><img src=\"./images/b_drop.png\" WIDTH='16' HEIGHT='16' BORDER=0 ALT='ลบโครงการ'></a></div></Td>"; } else{ echo "<td></td>"; } echo "<Td><div align='center'><a href=?option=plan&task=planproject/plan_in_proj_2&index=11&plan_proj_id=$id&page=$page><img src=\"./images/b_edit.png\" WIDTH='16' HEIGHT='16' BORDER=0 ALT='เพิ่มกิจกรรม'></a></div></Td>"; echo "</tr>"; $sql_acti = "SELECT * FROM plan_acti_2 where budget_year='$proj_year' and code_proj='$code_proj' order by code_acti"; $dbquery_acti =DBfieldQuery($sql_acti); while ($result_acti = mysqli_fetch_array($dbquery_acti)){ //จำนวนเงิน $sql_budget = "SELECT sum(budget_acti) as budget_acti FROM plan_acti_3 where budget_year='$proj_year' and code_acti='$result_acti[code_acti]' "; $dbquery_budget =DBfieldQuery($sql_budget); $result_budget = mysqli_fetch_array($dbquery_budget); $budget_acti=$result_budget['budget_acti']; $budget_acti=number_format($budget_acti,2); // echo "<tr><td></td><td>"; echo $result_acti['code_acti']; echo " "; echo $result_acti['name_acti']; echo "</td><td align='right'>$budget_acti</td><td></td>"; echo "<Td><div align=center><a href=?option=plan&task=planproject/plan_in_proj_2&index=17&acti_id=$result_acti[id]&page=$page><img src=\"./images/b_browse.png\" WIDTH='16' HEIGHT='16' BORDER=0 ALT='รายละเอียดกิจกรรม'></a></div></Td>"; echo "<Td><div align='center'><a href=?option=plan&task=planproject/plan_in_proj_2&index=15&acti_id=$result_acti[id]&page=$page><img src=\"./images/b_edit.png\" WIDTH='16' HEIGHT='16' BORDER=0 ALT='แก้ไขกิจกรรม'></a></div></Td>"; echo "<Td><div align=center><a href=?option=plan&task=planproject/plan_in_proj_2&index=13&code_acti=$result_acti[code_acti]&page=$page><img src=\"./images/b_drop.png\" WIDTH='16' HEIGHT='16' BORDER=0 ALT='ลบกิจกรรม'></a></div></Td>"; echo "<td></td></tr>"; } $i++; $M++; $N++; } $sum_budget_proj=number_format($sum_budget_proj,2); echo "<tr bgcolor='#EAECEE'><td></td><td align='center'><b>รวม</b></td><td align='center'><b>$sum_budget_proj</b></td><td colspan='5'></td></tr>"; } //end if index ?> </Table> </Center> </form> <script> function goto_url(val){ if(val==0){ callfrm("?option=plan&task=planproject/plan_in_proj_2"); } } function goto_url_update(val){ if(val==0){ callfrm("?option=plan&task=planproject/plan_in_proj_2"); }else if(val==1){ var v1 = document.frm1.vcode_clus.value; var v2 = document.frm1.vcode_proj.value; var v3 = document.frm1.vname_proj.value; var v4 = document.frm1.vbudget_proj.value; var v5 = document.frm1.vowner_proj.value; if (v1.length=="0") { alert("กรุณาเลือกกลุ่มงาน"); document.frm1.vcode_clus.focus(); return false; } else if (v2.length!=3) { alert("กรุณาใส่รหัสโครงการ 3 หลัก เช่น 001 , 002 เป็นต้น"); document.frm1.vcode_proj.focus(); return false; } else if (v3.length==0) { alert("กรุณาใส่ชื่อโครงการ"); document.frm1.vname_proj.focus(); return false; } else if (v4.length==0) { alert("กรุณาใส่งบประมาณที่ได้รับจัดสรร") ; document.frm1.vbudget_proj.focus(); return false; } else if (v5.length==0) { alert("กรุณาใส่ชื่อหัวหน้าโครงการ"); document.frm1.vowner_proj.focus(); return false; } else{ callfrm("?option=plan&task=planproject/plan_in_proj_2&index=4"); } }// if(val==1) } function goto_url_update_proj(val){ if(val==0){ callfrm("?option=plan&task=planproject/plan_in_proj_2"); }else if(val==1){ var v1 = document.frm1.vcode_clus.value; var v2 = document.frm1.vcode_proj.value; var v3 = document.frm1.vname_proj.value; var v4 = document.frm1.vbudget_proj.value; var v5 = document.frm1.vowner_proj.value; if (v1.length=="0") { alert("กรุณาเลือกกลุ่มงาน"); document.frm1.vcode_clus.focus(); return false; } else if (v2.length!=4) { alert("กรุณาใส่รหัสโครงการ 4 หลัก เช่น 1001 , 1002 เป็นต้น"); document.frm1.vcode_proj.focus(); return false; } else if (v3.length==0) { alert("กรุณาใส่ชื่อโครงการ"); document.frm1.vname_proj.focus(); return false; } else if (v4.length==0) { alert("กรุณาใส่งบประมาณที่ได้รับจัดสรร") ; document.frm1.vbudget_proj.focus(); return false; } else if (v5.length==0) { alert("กรุณาใส่ชื่อหัวหน้าโครงการ"); document.frm1.vowner_proj.focus(); return false; } else{ callfrm("?option=plan&task=planproject/plan_in_proj_2&index=6"); } } } function goto_insert_acti(val){ if(val==0) { callfrm("?option=plan&task=planproject/plan_in_proj_2"); } if(val==1) { if(frm1.vcode_acti.value == ""){ alert("กรุณาป้อน รหัสกิจกรรม \n 001,002,..."); document.frm1.vcode_acti.focus(); } else if (frm1.vcode_acti.value.length!=3) { alert("กรุณาใส่รหัสกิจกรรม 3 หลัก เช่น 001 , 002 เป็นต้น"); document.frm1.vcode_acti.focus(); } else if(frm1.vname_acti.value == ""){ alert("กรุณาป้อน กิจกรรม"); document.frm1.vname_acti.focus(); } else { callfrm("?option=plan&task=planproject/plan_in_proj_2&index=14"); } } } function goto_update_acti(val){ if(val==0) { callfrm("?option=plan&task=planproject/plan_in_proj_2"); } if(val==1) { if(frm1.vname_acti.value == ""){ alert("กรุณาป้อน กิจกรรม"); document.frm1.vname_acti.focus(); } else { callfrm("?option=plan&task=planproject/plan_in_proj_2&index=16"); } } } </script>
Close