|
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_news/ |
Upload File : |
<?
session_start();
include "config/config.inc.php";
include("function/function.php");
if(!isset($session_username)){
header("Location: login.php");
}
include("header_menu.php");
if($action == "SAVE"){
//-------------------------------------------------------------
$strSQL_in = "SELECT * FROM tbl_request ORDER BY runid DESC LIMIT 0,1";
$Result_in = mysql_db_query($dbname,$strSQL_in);
$Rs_in = mysql_fetch_object($Result_in);
if((($Rs_in->attach_sb_in != "" or $Rs_in->attach_sb_in != NULL) OR ($Rs_in->attach_sb_out != "" or $Rs_in->attach_sb_out != NULL)) AND ($Rs_in>subject == "" or $Rs_in->subject == NULL)){
$strSQL_add = "UPDATE tbl_request SET subject='$subject', subject_no_in='$subject_no_in', subject_form='$subject_form', person_res='$person_res', subject_no_out='$subject_no_out', date_start='$date_start', date_end='$date_end', status_ceo='$status_offer', date_ceosing='$date_ceosing', depart='$depart_receive' WHERE runid='".$Rs_in->runid."'";
}else{
//-------------------------------------------------------------
$strSQL_add = "INSERT INTO tbl_request(subject, subject_no_in, subject_no_out, subject_form, person_res,date_start,date_end,status_ceo,date_ceosing,depart)VALUES('$subject','$subject_no_in','$subject_no_out','$subject_form','$person_res','$date_start','$date_end','$status_offer','$date_ceosing','$depart_receive')";
}
//echo $strSQL_add;die;
$Result_add = mysql_db_query($dbname,$strSQL_add);
if($Result_add){
echo "
<script language=\"javascript\">
alert(\"ทำการบันทึกข้อมูลเสร็จสิ้น\\n \");
location.href='report_index.php?action=report_group&num=$num';
</script>
";
exit();
}
}
if($action == "SAVE_EDIT"){
$strSQL_up = "UPDATE tbl_request SET subject='$subject', subject_no_in='$subject_no_in', subject_no_out='$subject_no_out', subject_form='$subject_form', person_res='$person_res', date_start='$date_start', date_end='$date_end', status_ceo='$status_offer', date_ceosing='$date_ceosing', depart='$depart_receive', date_complate='$date_complate', detail='$detail' WHERE runid='$key_id'";
$Result_up = mysql_db_query($dbname,$strSQL_up);
if($Result_up){
echo "
<script language=\"javascript\">
alert(\"ทำการบันทึกข้อมูลเสร็จสิ้น\\n \");
location.href='report_index.php?action=report_group&num=$num';
</script>
";
exit();
}
}
?><html>
<head>
<title><?=$show_title?></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}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
function CheckForm(){
missinginfo = "";
missinginfo1 = "";
if (document.form.subject.value == "") {missinginfo1 += "\n- กรุณากรอก เรื่องร้องเรียน "; }
if (document.form.subject_no_in.value == "") {missinginfo1 += "\n- กรุณากรอก เลขที่หนังสือ "; }
if (document.form.date_start.value == "") {missinginfo1 += "\n- กรุณากรอก วันเริ่มต้น "; }
if (document.form.date_end.value == "") {missinginfo1 += "\n- กรุณากรอก สิ้นสุด "; }
if (missinginfo1 != "") {
missinginfo += "ไม่สามารถบันทึกข้อมูลได้ เนื่องจาก \n";
missinginfo +="_____________________________\n";
missinginfo = missinginfo + missinginfo1 ;
missinginfo += "\n___________________________";
missinginfo += "\nกรุณาตรวจสอบ อีกครั้ง";
alert(missinginfo);
return false;
}
}
</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 clearselect()
{
document.post.salary_day.disabled=true;
document.post.salary_month.disabled=true;
document.post.salary_year.disabled=true;
document.post.label_date.disabled=true;
if (document.post.salary_day.value!="")
{
document.post.salary_day.value="";
document.post.salary_day.disabled=true;
}
if (document.post.salary_month.value!="")
{
document.post.salary_month.value="";
document.post.salary_month.disabled=true;
}
if (document.post.salary_year.value!="")
{
document.post.salary_year.value="";
document.post.salary_year.disabled=true;
}
if (document.post.label_date.value!="")
{
document.post.label_date.value="";
document.post.label_date.disabled=true;
}
}
</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" >
<?
if($action == "ADD"){
?>
<form action = "?" method ="post" enctype="multipart/form-data" name="form" onSubmit="return CheckForm();" >
<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 align="right" valign="middle" class="link_back">เรื่องร้องเรียน</td>
<td align="left"><label>
<input type="text" name="subject" size="30" id="subject">
</label></td>
</tr>
<tr>
<td height="24" align="right" valign="middle" class="link_back">เลขที่หนังสือ</td>
<td align="left" valign="middle"><label>
<input type="text" name="subject_no_in" size="30" id="subject_no_in">
<a href="#" onClick="popWindow('attach_file.php?attach_file=add_in','450','350')"><font color="#003399"><img src="images/attach16.gif" width="16" height="16" border="0">แนบไฟล์</font></a></label></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">เสนอผู้ว่าราชการจังหวัด</td>
<td align="left" valign="top"><label>
<input name="status_offer" type="radio" value="0" onClick="clearselect();" checked>
ไม่เสนอ
<input name="status_offer" type="radio" value="1">
เสนอ</label></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">วันที่ลงนาม</td>
<td align="left" valign="top"><input name="date_ceosing" type="text" onFocus="blur();" value="" size="20" readonly>
<input name="button2" type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_ceosing, 'yyyy-mm-dd')" value='วัน เดือน ปี'></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">ผู้รับเรื่อง</td>
<td align="left" valign="top"><label>
<input type="text" name="subject_form" size="30" id="subject_form">
</label></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">ผู้รับผิดชอบ</td>
<td align="left" valign="top"><label>
<input name="person_res" type="text" size="30">
</label></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">เลขที่หนังสือออก</td>
<td align="left" valign="top"><label>
<input name="subject_no_out" type="text" id="subject_no_out" size="30">
<a href="#" onClick="popWindow1('attach_file.php?attach_file=add_out','450','350')"><font color="#003399"><img src="images/attach16.gif" width="16" height="16" border="0">แนบไฟล์</font></a></label></td>
</tr>
<tr>
<td align="right" valign="top" class="link_back">วันเดือนปีหนังสือเข้า</td>
<td align="left" valign="top">
<input name="date_start" type="text" onFocus="blur();" value="" size="20" readonly>
<input type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_start, 'yyyy-mm-dd')" value='วัน เดือน ปี'></td>
</tr>
<tr>
<td align="right" valign="top" class="link_back">วันเดือนปีสิ้นสุด</td>
<td align="left" valign="top"><input name="date_end" type="text" onFocus="blur();" value="" size="20" readonly>
<input type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_end, 'yyyy-mm-dd')" value='วัน เดือน ปี'></td>
</tr>
<tr>
<td height="24" align="right" valign="top" bgcolor="#BDC9F9"><span class="link_back">หน่วยงานที่รับเรื่อง</span></td>
<td align="left" valign="middle" bgcolor="#BDC9F9" class="link_back"><label>
<input name="depart_receive" type="text" id="depart_receive" size="30">
</label></td>
</tr>
<tr>
<td height="24" align="right" valign="top" bgcolor="#BDC9F9"><strong>วันเดือนปีที่ดำเนินการเสร็จ</strong></td>
<td align="left" valign="middle" bgcolor="#BDC9F9" class="link_back">
<input name="date_complate" type="text" onFocus="blur();" value="" size="20" readonly>
<input type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_complate, 'yyyy-mm-dd')" value='วัน เดือน ปี' disabled="disabled"> </td>
</tr>
<tr>
<td height="24" align="right" valign="top" bgcolor="#BDC9F9"><strong>รายละเอียด</strong></td>
<td align="left" valign="middle" bgcolor="#BDC9F9" class="link_back"><label>
<textarea name="detail" cols="40" rows="3" disabled="disabled"></textarea>
</label></td>
</tr>
<tr>
<td height="24" align="right" valign="top" bgcolor="#BDC9F9"></td>
<td align="left" valign="middle" bgcolor="#BDC9F9" class="link_back"> </td>
</tr>
<tr>
<td width="18%" align="right" valign="top" bgcolor="#BDC9F9"> </td>
<td width="82%" align="left" valign="top" bgcolor="#BDC9F9">
<input type="hidden" name="num" value="<?=$num?>">
<input type="hidden" name="action" value="SAVE">
<input type="submit" name="Submit" value=" บันทึก ">
<input type="reset" name="Submit2" value="ล้างข้อมูล">
<input type="button" name="button" value="ยกเลิก" ONCLICK="location.href='report_index.php?action=report_group&num=<?=$num?>'"></td>
</tr>
</table>
</form>
<?
}
?></td>
</tr>
<tr>
<td>
<?
if($action == "EDIT"){
$strSQL_edit = "SELECT * FROM tbl_request WHERE runid = '$runid'";
$Result_edit = mysql_db_query($dbname,$strSQL_edit);
$Rs_e = mysql_fetch_object($Result_edit);
?>
<form action = "?" method="post" enctype="multipart/form-data" name="form1">
<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 align="right" valign="middle" class="link_back">เรื่องร้องเรียน</td>
<td align="left"><label>
<input type="text" name="subject" size="30" id="subject" value="<?=$Rs_e->subject?>">
</label></td>
</tr>
<tr>
<td height="24" align="right" valign="middle" class="link_back">เลขที่หนังสือ</td>
<td align="left" valign="top"><label>
<input type="text" name="subject_no_in" size="30" id="subject_no_in" value="<?=$Rs_e->subject_no_in?>">
<a href="#" onClick="popWindow('attach_file.php?runid=<?=$runid?>&attach_file=xin','450','350')"><font color="#003399"><img src="images/attach16.gif" width="16" height="16" border="0">แนบไฟล์</font></a></label></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">เสนอผู้ว่าราชการจังหวัด</td>
<td align="left" valign="top"><input name="status_offer" type="radio" value="0" <? if($Rs_e->status_ceo==0){ echo "checked";}?>>
ไม่เสนอ
<input name="status_offer" type="radio" value="1" <? if($Rs_e->status_ceo == 1){ echo "checked";}?>>
เสนอ</td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">วันที่ลงนาม</td>
<td align="left" valign="top"><input name="date_ceosing" type="text" onFocus="blur();" value="<?=$Rs_e->date_ceosing?>" size="20" readonly>
<input name="button22" type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_ceosing, 'yyyy-mm-dd')" value='วัน เดือน ปี'></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">ผู้รับเรื่อง</td>
<td align="left" valign="top"><label>
<input type="text" name="subject_form" size="30" id="subject_form" value="<?=$Rs_e->subject_form?>">
</label></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">ผู้รับผิดชอบ</td>
<td align="left" valign="top"><label>
<input name="person_res" type="text" size="30" value="<?=$Rs_e->person_res?>">
</label></td>
</tr>
<tr>
<td align="right" valign="middle" class="link_back">เลขที่หนังสือออก</td>
<td align="left" valign="top"><label>
<input name="subject_no_out" type="text" id="subject_no_out" value="<?=$Rs_e->subject_no_out?>" size="30">
<a href="#" onClick="popWindow1('attach_file.php?runid=<?=$runid?>&attach_file=xout','450','350')"><font color="#003399"><img src="images/attach16.gif" width="16" height="16" border="0">แนบไฟล์</font></a></label></td>
</tr>
<tr>
<td align="right" valign="top" class="link_back">วันเดือนปีเริ่มต้น</td>
<td align="left" valign="top">
<input name="date_start" type="text" onFocus="blur();" value="<?=$Rs_e->date_start?>" size="20" readonly>
<input type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_start, 'yyyy-mm-dd')" value='วัน เดือน ปี'></td>
</tr>
<tr>
<td align="right" valign="top" class="link_back">วันเดือนปีสิ้นสุด</td>
<td align="left" valign="top"><input name="date_end" type="text" onFocus="blur();" value="<?=$Rs_e->date_end?>" size="20" readonly>
<input type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_end, 'yyyy-mm-dd')" value='วัน เดือน ปี'></td>
</tr>
<tr>
<td height="24" align="right" valign="top"><span class="link_back">หน่วยงานที่รับเรื่อง</span></td>
<td align="left" valign="middle" class="link_back"><label>
<input name="depart_receive" type="text" id="depart_receive" value="<?=$Rs_e->depart?>" size="30">
</label></td>
</tr>
<tr>
<td height="24" align="right" valign="top"><strong>วันเดือนปีที่ดำเนินการเสร็จ</strong> </td>
<td align="left" valign="middle" class="link_back"><input name="date_complate" type="text" onFocus="blur();" value="<?=$Rs_e->date_complate?>" size="20" readonly>
<input name="button3" type="button" class="index2" style='font-size:11px; width:80px;' onClick="popUpCalendar(this, form.date_complate, 'yyyy-mm-dd')" value='วัน เดือน ปี'>
<a href="#" onClick="popWindow2('attach_file.php?runid=<?=$runid?>&attach_file=xcomp','450','350')"><font color="#003399"><img src="images/attach16.gif" width="16" height="16" border="0">แนบไฟล์</font></a></td>
</tr>
<tr>
<td height="24" align="right" valign="top"><strong>รายละเอียด</strong></td>
<td align="left" valign="middle" class="link_back">
<textarea name="detail" cols="40" rows="3"><?=$Rs_e->detail?></textarea></td>
</tr>
<tr>
<td height="24" align="right" valign="top"></td>
<td align="left" valign="middle" class="link_back"> </td>
</tr>
<tr>
<td align="right" valign="top" width="18%"> </td>
<td align="left" valign="top" width="82%">
<input type="hidden" name="action" value="SAVE_EDIT">
<input type="hidden" name="key_id" value="<?=$Rs_e->runid?>">
<input type="hidden" name="num" value="<?=$num?>">
<input type="submit" name="Submit" value=" บันทึก ">
<input type="reset" name="Submit2" value="ล้างข้อมูล">
<input type="button" name="button" value="ยกเลิก" ONCLICK="location.href='report_index.php?action=report_group&num=<?=$num?>'"></td>
</tr>
</table>
</form>
<?
}
?>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>