MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /home/pathumthani_integration/requirement/application/ecomplain/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/pathumthani_integration/requirement/application/ecomplain/process_complain.php
<?
session_start();
include "../../config/config.inc.php";
include("function/function.php");
if(!isset($session_username)){
header("Location: ../document/login.php");
}
include("header_menu.php");
//insert timeQuery
include("../../common/common_system.inc.php"); 
$ApplicationName="ecomplain"; 
$time_start = getmicrotime();  
//insert timeQuery
$month_arr=array('','มกราคม','กุมภาพันธ์','มีนาคม','เมษายน','พฤษภาคม','มิถุนายน','กรกฏาคม','สิงหาคม','กันยายน','ตุลาคม','พฤศจิกายน','ธันวาคม');
if($action == "SAVE"){
$sql_up = "select * from tbl_complain_sent where runid='$key_id'";
$result_up = mysql_db_query($dbname,$sql_up);
$rs_u = mysql_fetch_assoc($result_up);

	if($process_date_finish != ""){
		$arr_d1 = explode("/",$process_date_finish);
		$process_date_finish = ($arr_d1[2]-543)."-".$arr_d1[1]."-".$arr_d1[0];
	}
if($process_c1 == "c1_1" or $process_c1_1 == "c1" ){
	$p1= "c1";
}
if($process_c1 == "c1_1"){
	$p1_1 = "c1_1";
}
if($process_c1 == "c1_2"){
	$p1_2 = "c1_2";
}
$bookcode=$_POST[bookcode];
if(bookcode_date!=""){
$arrdate= explode("/", $bookcode_date);
$datebook=$arrdate[2]-543 ."-".$arrdate[1]."-".$arrdate[0];
}else{
	$datebook=="0000-00-00";
	}
$strSQL_up = "UPDATE tbl_complain_sent  SET process_c1='$p1', process_c1_1='$p1_1',process_c1_2='$p1_2',process_c2='$process_c2',process_c3_other='$process_c3_other',process_date_finish='$process_date_finish',note='$note',bookcode='$bookcode',bookcode_date='$datebook'  WHERE runid='$key_id'";
$Result_up = mysql_db_query($dbname,$strSQL_up); // update ข้อมูลติดตามความต้องการ
addlog("แก้ไขข้อมูลเรื่องราวร้องทุกข์",$app_id,$act2,$key_id); // บันทึกความก้าวหน้าเรื่องราวร้องทุกข์

$sql_up1 = "UPDATE tbl_complain_approve SET date_complate='$process_date_finish' WHERE runid='$key_main'";
@mysql_db_query($dbname,$sql_up1);
addlog("บันทึกการดำเนินการเรื่องราวร้องทุกข์",$app_id,$act6,$key_main); // บันทึกความก้าวหน้าเรื่องราวร้องทุกข์
		
		if(!empty($file_in)){
							$file_n = (date("Ymd"))."_complate_".randigit(5);
							$path_name = "../../attach_file/";
							$arrfileext = explode("." , $file_in_name) ; 
							$nmcount = count($arrfileext) - 1 ; 
							$file1ext = $arrfileext[$nmcount]  ;
							$server_filename = $file_n.".$file1ext" ;  
							$save_path = $path_name.$server_filename;
							if($rs_u[attach_file_complate] != "" and $rs_u[attach_file_complate] != NULL){
								@unlink($rs_u[attach_file_complate]);
							}
							if (copy( $file_in , $save_path )){
							$sql_up1 = "UPDATE tbl_complain_sent SET attach_file_complate='$save_path' WHERE runid='$key_id'";
							mysql_db_query($dbname,$sql_up1);
							}
		}// end if(!empty($file_in)){
		if($feedback=="on"){
		?>
				<script language="javascript">
				alert("ทำการบันทึกข้อมูลเรียบร้อยแล้ว");
				window.open ("sms_feedback.php?runid=<?=$key_id?>","mywindow","location=1,status=1,scrollbars=1,resizable=1,width=600,height=500"); 
				location.href='report_index.php?senttab=3';
				</script>
		<?			
		}else{
		echo "
				<script language=\"javascript\">
				alert(\"ทำการบันทึกข้อมูลเรียบร้อยแล้ว\\n \");
				location.href='report_index.php?senttab=3';
				</script>
				";
		}
		exit();

} // end if($action == "SAVE"){


if($action == "del_img_in"){
	$sql_img_in  = "SELECT attach_file_complate FROM tbl_complain_sent WHERE runid='$key_id'";		
	$result_img_in = mysql_db_query($dbname,$sql_img_in);
	$rs_in = mysql_fetch_assoc($result_img_in);
		if($rs_in[attach_file_complate] != "" and $rs_in[attach_file_complate] != NULL){
			@unlink($rs_in[attach_file_complate]);
			$sql_cl = "update tbl_complain_sent SET attach_file_complate = ''  WHERE  runid='$key_id'";
			@mysql_db_query($dbname,$sql_cl);
		}
			addlog("ลบไฟล์แนบบันทึกความก้าวหน้าความต้องการ-ร้องทุกข์",$app_id,$act3,$key_id); // add log
		echo "
				<script language=\"javascript\">
				location.href='process_complain.php?senttab=3&runid=$key_id';
				</script>
				";
		exit();

}



?><html>
<head>
<title><?=$show_title_comp?></title>
<META http-equiv=Content-Type content="text/html; charset=windows-874">
<link href="../../common/style.css" type="text/css" rel="stylesheet" />
<script language='javascript' src='daily_popcalendar.js'></script>
<script language='javascript' src='displayelement.js'></script>
<style type="text/css">
<!--
body {  margin: 0px  0px; padding: 0px  0px}
a:link { color: #005CA2; text-decoration: none}
a:visited { color: #005CA2; text-decoration: none}
a:active { color: #0099FF; text-decoration: underline}
a:hover { color: #0099FF; text-decoration: underline}
.style2 {color: #000000}
.style3 {color: #FF0000}
-->
</style>

<SCRIPT LANGUAGE="JavaScript">
function CheckForm(){
	if(document.form.process_date_finish.value == ""){
		alert("วันที่ดำเนินการเสร็จสิ้น ต้องไม่เป็นค่าว่าง");
		document.form.process_date_finish.focus();
		return false;
	}else{
		return true;
	}
}
</SCRIPT>
<script language="javascript">
function popWindow(url, w, h){

	var popup		= "Popup"; 
	if(w == "") 	w = 420;
	if(h == "") 	h = 300;
	var newwin 	= window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
	newwin.focus();

}
function popWindow1(url, w, h){

	var popup		= "Popup"; 
	if(w == "") 	w = 420;
	if(h == "") 	h = 300;
	var newwin 	= window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
	newwin.focus();

}
function popWindow2(url, w, h){

	var popup		= "Popup"; 
	if(w == "") 	w = 420;
	if(h == "") 	h = 300;
	var newwin 	= window.open(url, popup,'location=0,status=no,scrollbars=no,resizable=no,width=' + w + ',height=' + h + ',top=20');
	newwin.focus();

}

</script>
<script language="javascript">


function MM_openBrWindow(theURL,winName,features) { //v2.0
		window.open(theURL,winName,features);
}


</script>
</head>
<body >
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" style="filter:progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr='#144C85', EndColorStr='#ffffff');">
  <tr>
    <td valign="top" background="bimg/bg1.gif" style="background-repeat: no-repeat; background-position:right bottom "><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td valign="top"></td></tr>
      <tr>
        <td valign="top" >
<form  action = "?" method ="post" enctype="multipart/form-data"  name="form" onSubmit="return CheckForm();" >
<?
	$sql_sel = "SELECT
	tbl_complain_approve.runid as key_main,
tbl_complain_approve.subject,
tbl_complain_approve.subject_no_in,
tbl_complain_approve.subject_no_out,
tbl_complain_approve.attach_sb_in,
tbl_complain_approve.attach_sb_out,
tbl_complain_sent.process_c1,
tbl_complain_sent.process_c1_1,
tbl_complain_sent.process_c1_2,
tbl_complain_sent.process_c2,
tbl_complain_sent.process_c3_other,
tbl_complain_sent.process_date_finish,
tbl_complain_sent.note,
tbl_complain_sent.attach_file_complate,
tbl_complain_sent.runid,
tbl_complain_approve.bookcode,
tbl_complain_approve.bookcode_date,
tbl_complain.feedback
FROM
tbl_complain_sent
Inner Join tbl_complain_approve ON tbl_complain_sent.com_app_id = tbl_complain_approve.runid
Inner Join tbl_complain ON tbl_complain.complain_id = tbl_complain_approve.complain_id
where tbl_complain_sent.runid = '$runid'
";
//	echo "<pre>".$sql_sel."</pre>"; 
	$result_sel = mysql_db_query($dbname,$sql_sel);
	$rs = mysql_fetch_assoc($result_sel);
		
		if($rs[process_date_finish] != "0000-00-00" and $rs[process_date_finish] != "" and $rs[process_date_finish] != NULL){
			$arr1 = explode("-",$rs[process_date_finish]);
			$txt_process_date_finish =$arr1[2]."/".$arr1[1]."/".($arr1[0]+543);
		}

			if($rs[bookcode_date] != "0000-00-00" and $rs[bookcode_date] != "" and $rs[bookcode_date] != NULL){
			$arr1 = explode("-",$rs[bookcode_date]);
			$txt_bookcode_date =$arr1[2]."/".$arr1[1]."/".($arr1[0]+543);
		}	
		
?>
              <table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
                <tr>
                  <td colspan=3 align="left" valign="top" bgcolor="#8DA0C0"><B class="plink style2">ระบบติดตามความต้องการ</B></td>
                </tr>
                <tr>
                  <td width="24%" align="right" valign="top" class="link_back">ความต้องการ</td>
                  <td width="76%" align="left"><?=$rs[subject]?></td>
                </tr>
                <tr style="display:none">
                  <td height="24" align="right" valign="top" class="link_back">เลขที่หนังสือ</td>
                  <td align="left" valign="middle"><?=$rs[subject_no_in]?>
                  <? if($rs[attach_sb_in] != "" or $rs[attach_sb_in] !=  NULL ){ echo "<a href='$rs[attach_sb_in]' target='_blank'><img src=\"../../images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}?></td>
                </tr>
                <tr>
                  <td height="24" align="right" valign="top" class="link_back">อ้างอิงเลขที่หนังสือ</td>
                  <td align="left" valign="middle"><? if($rs[bookcode]!=""||$rs[bookcode_date]!="0000-00-00"){
							$arr_d2 = explode("-",$rs[bookcode_date]);
							$dd= intval($arr_d2[2])." ".$month_arr[intval($arr_d2[1])]." ".($arr_d2[0]+543);
							echo $rs[bookcode]." ลว ".$dd; 
				}
                     if($rs[attach_sb_out] != "" or $rs[attach_sb_out] != NULL ){ echo "<a href='$rs[attach_sb_out]' target='_blank'><img src=\"../../images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}?></td>
                </tr>
                <tr>
                  <td height="24" align="right" valign="top" class="link_back">ดำเนินการสอบสวนทางวินัย</td>
                  <td align="left" valign="middle"><label>
                    <input name="process_c1" type="radio" value="c1_1" <? if($rs[process_c1_1] == "c1_1"){ echo " checked='checked'";}?>>
                  อยู่ระหว่างการสอบสวน 
                  <input name="process_c1" type="radio" value="c1_2" <? if($rs[process_c1_2] == "c1_2"){ echo " checked='checked'";}?>>
                  สอบสวนเสร็จแล้ว</label></td>
                </tr>
                <tr>
                  <td height="24" align="right" valign="top" class="link_back">ร้องทุกข์กล่าวโทษเพื่อดำเนินคดีอาญา</td>
                  <td align="left" valign="middle"><label>
<!--<input name="process_c2bak" type="radio" value="c2" <?// if($rs[process_c2] == "c2"){ echo " checked='checked'";}?>>-->
<input name="process_c2" type="checkbox" id="process_c2" value="c2">                  
ร้องทุกข์กล่าวโทษเพื่อดำเนินคดีอาญา</label></td>
                </tr>
                <tr>
                  <td height="24" align="right" valign="top" class="link_back">เลขที่หนังสือตอบกลับ</td>
                  <td align="left" valign="middle"><input name="bookcode" type="text" id="bookcode" size="10" value="<?=$rs[bookcode]?>">
                    ลว.
                    <input name="bookcode_date" type="text" onFocus="blur();" size="15" readonly  value="<?=$txt_bookcode_date?>" id="bookcode_date">                    <input type="button" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.bookcode_date, 'dd/mm/yyyy')" value='วัน เดือน ปี'></td>
                </tr>
                <tr>
                  <td height="24" align="right" valign="top" class="link_back">ดำเนินการอื่นๆ</td>
                  <td align="left" valign="middle"><label>
                    <textarea name="process_c3_other" cols="50" rows="4" id="process_c3_other"><?=$rs[process_c3_other]?></textarea>
                  </label></td>
                </tr>
                <tr>
                  <td align="right" valign="top" class="link_back">แนบไฟล์ประกอบการดำเนินการ</td>
                  <td align="left" valign="top"><label>
                    <input type="file" name="file_in" id="file_in">
</label>
                    <? if($rs[attach_file_complate] != "" and $rs[attach_file_complate] != NULL){
				  	echo "<a href='$rs[attach_file_complate]' target='_blank'><img src=\"../../images/attach.gif\" width=\"13\" height=\"12\" border=\"0\" alt=\"ไฟล์แนบเอกสารหนังสือเข้า\">เอกสารประกอบการดำเนินการ</a>&nbsp;&nbsp; <a href='?action=del_img_in&key_id=$rs[runid]'><img src=\"../../images/delete.gif\" width=\"20\" height=\"18\" border=\"0\" alt=\"ลบเอกสารไฟล์แนบ\"></a>";
				  }?></td>
                </tr>
                <tr>
                  <td align="right" valign="top" class="link_back">วันที่ดำเนินการเสร็จสิ้น</td>
                  <td align="left" valign="top">
<?
### ต้องการ ========================>  21/10/2552
if ($txt_process_date_finish == ""){ 
	$th_yy = date("Y")+543 ; 
	$txt_process_date_finish1 = date("d") ."/". date("m")  ."/".$th_yy  ; 
} else{
	$txt_process_date_finish1 = $txt_process_date_finish  ;
}  ########## END if ($txt_process_date_finish == ""){ 
#date("d") ."/". date("m")  ."/". date("Y")  ; 
#$month_nm = date("n") ; 
#$timenow = date("j") ." ". smonth($month_nm) ." ". $th_yy   ." (". (int)date("H")   .":". (int)date("i")   .":". (int)date("s")   .")"    ;  # 20 พ.ค. 2549 (12:30:41)
#$timenow2 = date("Y") ."-".   date("m")   ."-".  date("j")    ; #2006-05-20 12:07:01 
?>				  
				  <input name="process_date_finish" type="text" onFocus="blur();" value="<?=$txt_process_date_finish1?>" size="20" readonly>
<input type="button" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.process_date_finish, 'dd/mm/yyyy')" value='วัน เดือน ปี'></td>
                </tr>
                <tr>
                  <td align="right" valign="top" class="link_back">หมายเหตุ</td>
                  <td align="left" valign="top"><label>
                    <textarea name="note" cols="50" rows="4" id="note"><?=$rs[note]?></textarea>
                  </label></td>
                </tr>
                <tr>
                  <td align="right" valign="top" class="link_back">สถานะการแจ้งผลดำเนินการ</td>
                  <td align="left" valign="top"><?=($rs[feedback]==1)?"ต้องการให้แจ้งผลการดำเนินกา่ร":"ไม่ต้องการให้แจ้งผลการดำเนินกา่ร"?></td>
                </tr>				
                <tr>
                  <td colspan="2" align="center" valign="top" bgcolor="#BDC9F9">
                    <input type="hidden" name="action" value="SAVE">
					<input type="hidden" name="feedback" value="">
                    <input type="hidden" name="key_id" value="<?=$rs[runid]?>">
                    <input type="hidden" name="key_main" value="<?=$rs[key_main]?>">
                    <input type="submit" name="Submit" value=" บันทึก ">
					<input type="button" name="smsfeddback" value=" บันทึก และแจ้งผลแก่ผู้ร้องเรียน" onClick="clickSMS();">
                    <input type="reset" name="Submit2" value="ล้างข้อมูล">
                  <input type="button" name="button" value="ยกเลิก" ONCLICK="location.href='report_index.php?senttab=3'">
				  <script language="javascript">
				  	function clickSMS(){
							document.form.feedback.value="on";
							window.form.submit();
					}
				  </script>
				  </td>
                </tr>
              </table>
            </form>
</td>
      </tr>
	  <tr>
	  <td>&nbsp;</td>
	  </tr>
    </table></td>
  </tr>
</table>
</body>
</html>
<?
//insert timeQuery
 $time_end = getmicrotime();
  writetime2db($timestart,$timeend);
//insert timeQuery
?>

Anon7 - 2021