|
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/application/labor/ |
Upload File : |
<?
session_start();
set_time_limit(0);
include_once("../../config/config_epm.inc.php");
include_once("manage_user.inc.php");
include_once("../../inc/function.php");
include_once("function/function.inc.php");
//echo "<pre>"; print_r($_SESSION); echo "</pre>";
if ( $_SERVER['REQUEST_METHOD'] == "POST" ) {
$hdismissal_id = $_POST['hdismissal_id'];
$hid_card = str_replace("-", "", $_POST['hid_card']);
# ข้อมูลรายละเอียดลูกจ้าง
$id_card = str_replace("-", "", $_POST['id_card']);
$prename = $_POST['prename'];
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$id_card_source = $_POST['id_card_source'];
$id_card_begindate = dateFormat( $_POST['id_card_begindate'], "thaieng_slash" );
$id_card_expiredate = dateFormat( $_POST['id_card_expiredate'], "thaieng_slash" );
$nationality = $_POST['nationality'];
$work_permit_no = $_POST['work_permit_no'];
$birthdate = $_POST['Yy']."-".$_POST['Mm']."-".$_POST['Dd'];
$p_no = $_POST['p_no'];
$p_soi = $_POST['p_soi'];
$p_province_id = $_POST['p_province_id'];
$p_ampur_id = $_POST['p_ampur_id'];
$p_tambol_id = $_POST['p_tambol_id'];
$p_moo_id = $_POST['p_moo_id'];
$p_zipcode = $_POST['p_zipcode'];
$p_tel_h = $_POST['p_tel_h'];
$d_no = $_POST['d_no'];
$d_soi = $_POST['d_soi'];
$d_province_id = $_POST['d_province_id'];
$d_ampur_id = $_POST['d_ampur_id'];
$d_tambol_id = $_POST['d_tambol_id'];
$d_moo_id = $_POST['d_moo_id'];
$d_zipcode = $_POST['d_zipcode'];
$d_tel_h = $_POST['d_tel_h'];
# ๑. รายละเอียดลูกจ้าง
$register_place = $_POST['register_place'];
$register_date = dateFormat( $_POST['register_date'], "thaieng_slash" );
$protest_agent = $_POST['protest_agent'];
$d_idcard = str_replace("-", "", $_POST['d_idcard']);
$d_prename = $_POST['d_prename'];
$d_name = $_POST['d_name'];
$d_surname = $_POST['d_surname'];
$death_certificate = $_POST['death_certificate'];
$dc_source = $_POST['dc_source'];
$d_nationality = $_POST['d_nationality'];
$d_workpermit = $_POST['d_workpermit'];
$concerned = $_POST['concerned'];
# ๒. สถานที่ทำงานของลูกจ้าง
$company = $_POST['company'];
$owner_prename = $_POST['owner_prename'];
$owner_name = $_POST['owner_name'];
$owner_surname = $_POST['owner_surname'];
$business_type = $_POST['business_type'];
$c_address_no = $_POST['c_address_no'];
$c_soi = $_POST['c_soi'];
$c_province_id = $_POST['c_province_id'];
$c_ampur_id = $_POST['c_ampur_id'];
$c_tambol_id = $_POST['c_tambol_id'];
$c_moo_id = $_POST['c_moo_id'];
$c_postcode = $_POST['c_postcode'];
$c_tel_h = $_POST['c_tel_h'];
$c_nearby = $_POST['c_nearby'];
$e_no = $_POST['e_no'];
$e_soi = $_POST['e_soi'];
$e_province_id = $_POST['e_province_id'];
$e_ampur_id = $_POST['e_ampur_id'];
$e_tambol_id = $_POST['e_tambol_id'];
$e_moo_id = $_POST['e_moo_id'];
$e_postcode = $_POST['e_postcode'];
$e_tel_h = $_POST['e_tel_h'];
$e_nearby = $_POST['e_nearby'];
# ๓. รายละเอียดการทำงาน
$e_fromdate = dateFormat( $_POST['e_fromdate'], "thaieng_slash" );
$e_todate = dateFormat( $_POST['e_todate'], "thaieng_slash" );
$e_job_position_group = $_POST['e_job_position_group'];
$e_job_position = $_POST['e_job_position'];
$e_division = $_POST['e_division'];
$e_boss_prename = $_POST['e_boss_prename'];
$e_boss_name = $_POST['e_boss_name'];
$e_boss_surname = $_POST['e_boss_surname'];
$e_pay_status = $_POST['e_pay_status'];
$e_pay = $_POST['e_pay'];
$e_pay_unit = $_POST['e_pay_unit'];
$e_pay_per_unit = $_POST['e_pay_per_unit'];
$e_pay_other = $_POST['e_pay_other'];
$e_pay_other2 = $_POST['e_pay_other2'];
$e_pay_other2_unit = $_POST['e_pay_other2_unit'];
# ๔. รายละเอียดเวลาทำงาน
$work_week = $_POST['work_week'];
$work_hour = $_POST['work_hour'];
$fromtime = $_POST['fromtime1'].":".$_POST['fromtime2'].":".$_POST['fromtime3'];
$totime = $_POST['totime1'].":".$_POST['totime2'].":".$_POST['totime3'];
$break_fromtime = $_POST['break_fromtime1'].":".$_POST['break_fromtime2'].":".$_POST['break_fromtime3'];
$break_totime = $_POST['break_totime1'].":".$_POST['break_totime2'].":".$_POST['break_totime3'];
# ๕. กำหนดเวลาในการจ่ายเงิน
$pay_time = $_POST['pay_time'];
$pay_ot_time = $_POST['pay_ot_time'];
$pay_holiday_time = $_POST['pay_holiday_time'];
$pay_holiday_ot_time = $_POST['pay_holiday_ot_time'];
# ๖. สาเหตุการยื่นคำร้อง
$request_reason = $_POST['request_reason'];
# ๗. รายละเอียดการเรียกร้อง
$request_choice_1 = ( $_POST['request_choice_1'] == "Y" ) ? "Y" : "N";
$request_choice_2 = ( $_POST['request_choice_2'] == "Y" ) ? "Y" : "N";
$request_choice_3 = ( $_POST['request_choice_3'] == "Y" ) ? "Y" : "N";
$request_choice_4 = ( $_POST['request_choice_4'] == "Y" ) ? "Y" : "N";
$request_choice_5 = ( $_POST['request_choice_5'] == "Y" ) ? "Y" : "N";
$request_choice_6 = ( $_POST['request_choice_6'] == "Y" ) ? "Y" : "N";
$request_choice_7 = ( $_POST['request_choice_7'] == "Y" ) ? "Y" : "N";
$request_choice_8 = ( $_POST['request_choice_8'] == "Y" ) ? "Y" : "N";
$request_choice_9 = ( $_POST['request_choice_9'] == "Y" ) ? "Y" : "N";
$request_choice_10 = ( $_POST['request_choice_10'] == "Y" ) ? "Y" : "N";
$request_choice_11 = ( $_POST['request_choice_11'] == "Y" ) ? "Y" : "N";
$request_choice_12 = ( $_POST['request_choice_12'] == "Y" ) ? "Y" : "N";
$request_choice_13 = ( $_POST['request_choice_13'] == "Y" ) ? "Y" : "N";
$request_choice_14 = ( $_POST['request_choice_14'] == "Y" ) ? "Y" : "N";
$request_fromdate = dateFormat( $_POST['request_fromdate'], "thaieng_slash" );
$request_todate = dateFormat( $_POST['request_todate'], "thaieng_slash" );
$request_cost = $_POST['request_cost'];
$minimum_wage = $_POST['minimum_wage'];
$standard_wage = $_POST['standard_wage'];
$retire_wage = $_POST['retire_wage'];
$ot_fromdate = dateFormat( $_POST['ot_fromdate'], "thaieng_slash" );
$ot_todate = dateFormat( $_POST['ot_todate'], "thaieng_slash" );
$ot_cost = $_POST['ot_cost'];
$holiday_wage_fromdate = dateFormat( $_POST['holiday_wage_fromdate'], "thaieng_slash" );
$holiday_wage_todate = dateFormat( $_POST['holiday_wage_todate'], "thaieng_slash" );
$holiday_cost = $_POST['holiday_cost'];
$holiday_ot_fromdate = dateFormat( $_POST['holiday_ot_fromdate'], "thaieng_slash" );
$holiday_ot_todate = dateFormat( $_POST['holiday_ot_todate'], "thaieng_slash" );
$holiday_ot_cost = $_POST['holiday_ot_cost'];
$compensation_fromdate = dateFormat( $_POST['compensation_fromdate'], "thaieng_slash" );
$compensation_todate = dateFormat( $_POST['compensation_todate'], "thaieng_slash" );
$compensation = $_POST['compensation'];
$extra_compensation_fromdate = dateFormat( $_POST['extra_compensation_fromdate'], "thaieng_slash" );
$extra_compensation_todate = dateFormat( $_POST['extra_compensation_todate'], "thaieng_slash" );
$extra_compensation = $_POST['extra_compensation'];
$retire_compensation_day = $_POST['retire_compensation_day'];
$retire_compensation = $_POST['retire_compensation'];
$secutity_cost = $_POST['secutity_cost'];
$other_cost = $_POST['other_cost'];
$interest_cost = $_POST['interest_cost'];
$plus_cost = $_POST['plus_cost'];
# ๘. ลูกจ้างประสงค์ให้นายจ้างจ่ายเงินตามที่เรียกร้อง ณ สถานที่
$place_of_pay = $_POST['place_of_pay'];
$org_site = $_POST['org_site'];
$org_province = $_POST['org_province'];
$other_identify = $_POST['other_identify'];
$add_date=date("Y-m-d H:m:s");
$add_staffid=$session_staffid;
$update_date=date("Y-m-d H:m:s");
$update_staffid=$session_staffid;
$add_status = "KEY";
if ( $hid_card ) { # UPDATE CASE
$strSQL = "UPDATE `labor_personal` SET
`id_card`='".$id_card."',
`prename`='".$prename."',
`fname`='".$fname."',
`lname`='".$lname."',
`id_card_source`='".$id_card_source."',
`id_card_begindate`='".$id_card_begindate."',
`id_card_expiredate`='".$id_card_expiredate."',
`nationality`='".$nationality."',
`work_permit_no`='".$work_permit_no."',
`birthdate`='".$birthdate."',
`p_no`='".$p_no."',
`p_soi`='".$p_soi."',
`p_province_id`='".$p_province_id."',
`p_ampur_id`='".$p_ampur_id."',
`p_tambol_id`='".$p_tambol_id."',
`p_moo_id`='".$p_moo_id."',
`p_zipcode`='".$p_zipcode."',
`p_tel_h`='".$p_tel_h."',
`d_no`='".$d_no."',
`d_soi`='".$d_soi."',
`d_province_id`='".$d_province_id."',
`d_ampur_id`='".$d_ampur_id."',
`d_tambol_id`='".$d_tambol_id."',
`d_moo_id`='".$d_moo_id."',
`d_zipcode`='".$d_zipcode."',
`d_tel_h`='".$d_tel_h."',
`update_date`='".$update_date."',
`update_staffid`='".$update_staffid."'
WHERE `id_card`='".$hid_card."'
"; #echo $strSQL; exit();
mysql_query($strSQL);
} else { # INSERT CASE
$strSQL = "INSERT INTO `labor_personal` SET
`id_card`='".$id_card."',
`prename`='".$prename."',
`fname`='".$fname."',
`lname`='".$lname."',
`id_card_source`='".$id_card_source."',
`id_card_begindate`='".$id_card_begindate."',
`id_card_expiredate`='".$id_card_expiredate."',
`nationality`='".$nationality."',
`work_permit_no`='".$work_permit_no."',
`birthdate`='".$birthdate."',
`p_no`='".$p_no."',
`p_soi`='".$p_soi."',
`p_province_id`='".$p_province_id."',
`p_ampur_id`='".$p_ampur_id."',
`p_tambol_id`='".$p_tambol_id."',
`p_moo_id`='".$p_moo_id."',
`p_zipcode`='".$p_zipcode."',
`p_tel_h`='".$p_tel_h."',
`d_no`='".$d_no."',
`d_soi`='".$d_soi."',
`d_province_id`='".$d_province_id."',
`d_ampur_id`='".$d_ampur_id."',
`d_tambol_id`='".$d_tambol_id."',
`d_moo_id`='".$d_moo_id."',
`d_zipcode`='".$d_zipcode."',
`d_tel_h`='".$d_tel_h."',
`add_date`='".$add_date."',
`add_staffid`='".$add_staffid."'
"; #echo $strSQL; exit();
mysql_query($strSQL);
}
if ( $hdismissal_id ) { # UPDATE CASE
$strSQL = "UPDATE `labor_dismissal` SET
`id_card`='".$id_card."',
`register_date`='".$register_date."',
`register_place`='".$register_place."',
`protest_agent`='".$protest_agent."',
`d_idcard`='".$d_idcard."',
`d_prename`='".$d_prename."',
`d_name`='".$d_name."',
`d_surname`='".$d_surname."',
`death_certificate`='".$death_certificate."',
`dc_source`='".$dc_source."',
`d_nationality`='".$d_nationality."',
`d_workpermit`='".$d_workpermit."',
`concerned`='".$concerned."',
`company`='".$company."',
`owner_prename`='".$owner_prename."',
`owner_name`='".$owner_name."',
`owner_surname`='".$owner_surname."',
`business_type`='".$business_type."',
`c_address_no`='".$c_address_no."',
`c_soi`='".$c_soi."',
`c_province_id`='".$c_province_id."',
`c_ampur_id`='".$c_ampur_id."',
`c_tambol_id`='".$c_tambol_id."',
`c_moo_id`='".$c_moo_id."',
`c_postcode`='".$c_postcode."',
`c_tel_h`='".$c_tel_h."',
`c_nearby`='".$c_nearby."',
`e_no`='".$e_no."',
`e_soi`='".$e_soi."',
`e_province_id`='".$e_province_id."',
`e_ampur_id`='".$e_ampur_id."',
`e_tambol_id`='".$e_tambol_id."',
`e_moo_id`='".$e_moo_id."',
`e_postcode`='".$e_postcode."',
`e_tel_h`='".$e_tel_h."',
`e_nearby`='".$e_nearby."',
`e_fromdate`='".$e_fromdate."',
`e_todate`='".$e_todate."',
`e_job_position_group`='".$e_job_position_group."',
`e_job_position`='".$e_job_position."',
`e_division`='".$e_division."',
`e_boss_prename`='".$e_boss_prename."',
`e_boss_name`='".$e_boss_name."',
`e_boss_surname`='".$e_boss_surname."',
`e_pay_status`='".$e_pay_status."',
`e_pay`='".$e_pay."',
`e_pay_unit`='".$e_pay_unit."',
`e_pay_per_unit`='".$e_pay_per_unit."',
`e_pay_other`='".$e_pay_other."',
`e_pay_other2`='".$e_pay_other2."',
`e_pay_other2_unit`='".$e_pay_other2_unit."',
`work_week`='".$work_week."',
`work_hour`='".$work_hour."',
`fromtime`='".$fromtime."',
`totime`='".$totime."',
`break_fromtime`='".$break_fromtime."',
`break_totime`='".$break_totime."',
`pay_time`='".$pay_time."',
`pay_ot_time`='".$pay_ot_time."',
`pay_holiday_time`='".$pay_holiday_time."',
`pay_holiday_ot_time`='".$pay_holiday_ot_time."',
`request_reason`='".$request_reason."',
`request_choice_1`='".$request_choice_1."',
`request_choice_2`='".$request_choice_2."',
`request_choice_3`='".$request_choice_3."',
`request_choice_4`='".$request_choice_4."',
`request_choice_5`='".$request_choice_5."',
`request_choice_6`='".$request_choice_6."',
`request_choice_7`='".$request_choice_7."',
`request_choice_8`='".$request_choice_8."',
`request_choice_9`='".$request_choice_9."',
`request_choice_10`='".$request_choice_10."',
`request_choice_11`='".$request_choice_11."',
`request_choice_12`='".$request_choice_12."',
`request_choice_13`='".$request_choice_13."',
`request_choice_14`='".$request_choice_14."',
`request_fromdate`='".$request_fromdate."',
`request_todate`='".$request_todate."',
`request_cost`='".$request_cost."',
`minimum_wage`='".$minimum_wage."',
`standard_wage`='".$standard_wage."',
`retire_wage`='".$retire_wage."',
`ot_fromdate`='".$ot_fromdate."',
`ot_todate`='".$ot_todate."',
`ot_cost`='".$ot_cost."',
`holiday_wage_fromdate`='".$holiday_wage_fromdate."',
`holiday_wage_todate`='".$holiday_wage_todate."',
`holiday_cost`='".$holiday_cost."',
`holiday_ot_fromdate`='".$holiday_ot_fromdate."',
`holiday_ot_todate`='".$holiday_ot_todate."',
`holiday_ot_cost`='".$holiday_ot_cost."',
`compensation_fromdate`='".$compensation_fromdate."',
`compensation_todate`='".$compensation_todate."',
`compensation`='".$compensation."',
`extra_compensation_fromdate`='".$extra_compensation_fromdate."',
`extra_compensation_todate`='".$extra_compensation_todate."',
`extra_compensation`='".$extra_compensation."',
`retire_compensation_day`='".$retire_compensation_day."',
`retire_compensation`='".$retire_compensation."',
`secutity_cost`='".$secutity_cost."',
`other_cost`='".$other_cost."',
`interest_cost`='".$interest_cost."',
`plus_cost`='".$plus_cost."',
`place_of_pay`='".$place_of_pay."',
`org_site`='".$org_site."',
`org_province`='".$org_province."',
`other_identify`='".$other_identify."',
`update_date`='".$update_date."',
`update_staffid`='".$update_staffid."'
WHERE `dismissal_id`='".$hdismissal_id."'
"; echo #$strSQL; exit();
mysql_query($strSQL);
} else { # INSERT CASE
$strSQL = "INSERT INTO `labor_dismissal` SET
`id_card`='".$id_card."',
`register_date`='".$register_date."',
`register_place`='".$register_place."',
`protest_agent`='".$protest_agent."',
`d_idcard`='".$d_idcard."',
`d_prename`='".$d_prename."',
`d_name`='".$d_name."',
`d_surname`='".$d_surname."',
`death_certificate`='".$death_certificate."',
`dc_source`='".$dc_source."',
`d_nationality`='".$d_nationality."',
`d_workpermit`='".$d_workpermit."',
`concerned`='".$concerned."',
`company`='".$company."',
`owner_prename`='".$owner_prename."',
`owner_name`='".$owner_name."',
`owner_surname`='".$owner_surname."',
`business_type`='".$business_type."',
`c_address_no`='".$c_address_no."',
`c_soi`='".$c_soi."',
`c_province_id`='".$c_province_id."',
`c_ampur_id`='".$c_ampur_id."',
`c_tambol_id`='".$c_tambol_id."',
`c_moo_id`='".$c_moo_id."',
`c_postcode`='".$c_postcode."',
`c_tel_h`='".$c_tel_h."',
`c_nearby`='".$c_nearby."',
`e_no`='".$e_no."',
`e_soi`='".$e_soi."',
`e_province_id`='".$e_province_id."',
`e_ampur_id`='".$e_ampur_id."',
`e_tambol_id`='".$e_tambol_id."',
`e_moo_id`='".$e_moo_id."',
`e_postcode`='".$e_postcode."',
`e_tel_h`='".$e_tel_h."',
`e_nearby`='".$e_nearby."',
`e_fromdate`='".$e_fromdate."',
`e_todate`='".$e_todate."',
`e_job_position_group`='".$e_job_position_group."',
`e_job_position`='".$e_job_position."',
`e_division`='".$e_division."',
`e_boss_prename`='".$e_boss_prename."',
`e_boss_name`='".$e_boss_name."',
`e_boss_surname`='".$e_boss_surname."',
`e_pay_status`='".$e_pay_status."',
`e_pay`='".$e_pay."',
`e_pay_unit`='".$e_pay_unit."',
`e_pay_per_unit`='".$e_pay_per_unit."',
`e_pay_other`='".$e_pay_other."',
`e_pay_other2`='".$e_pay_other2."',
`e_pay_other2_unit`='".$e_pay_other2_unit."',
`work_week`='".$work_week."',
`work_hour`='".$work_hour."',
`fromtime`='".$fromtime."',
`totime`='".$totime."',
`break_fromtime`='".$break_fromtime."',
`break_totime`='".$break_totime."',
`pay_time`='".$pay_time."',
`pay_ot_time`='".$pay_ot_time."',
`pay_holiday_time`='".$pay_holiday_time."',
`pay_holiday_ot_time`='".$pay_holiday_ot_time."',
`request_reason`='".$request_reason."',
`request_choice_1`='".$request_choice_1."',
`request_choice_2`='".$request_choice_2."',
`request_choice_3`='".$request_choice_3."',
`request_choice_4`='".$request_choice_4."',
`request_choice_5`='".$request_choice_5."',
`request_choice_6`='".$request_choice_6."',
`request_choice_7`='".$request_choice_7."',
`request_choice_8`='".$request_choice_8."',
`request_choice_9`='".$request_choice_9."',
`request_choice_10`='".$request_choice_10."',
`request_choice_11`='".$request_choice_11."',
`request_choice_12`='".$request_choice_12."',
`request_choice_13`='".$request_choice_13."',
`request_choice_14`='".$request_choice_14."',
`request_fromdate`='".$request_fromdate."',
`request_todate`='".$request_todate."',
`request_cost`='".$request_cost."',
`minimum_wage`='".$minimum_wage."',
`standard_wage`='".$standard_wage."',
`retire_wage`='".$retire_wage."',
`ot_fromdate`='".$ot_fromdate."',
`ot_todate`='".$ot_todate."',
`ot_cost`='".$ot_cost."',
`holiday_wage_fromdate`='".$holiday_wage_fromdate."',
`holiday_wage_todate`='".$holiday_wage_todate."',
`holiday_cost`='".$holiday_cost."',
`holiday_ot_fromdate`='".$holiday_ot_fromdate."',
`holiday_ot_todate`='".$holiday_ot_todate."',
`holiday_ot_cost`='".$holiday_ot_cost."',
`compensation_fromdate`='".$compensation_fromdate."',
`compensation_todate`='".$compensation_todate."',
`compensation`='".$compensation."',
`extra_compensation_fromdate`='".$extra_compensation_fromdate."',
`extra_compensation_todate`='".$extra_compensation_todate."',
`extra_compensation`='".$extra_compensation."',
`retire_compensation_day`='".$retire_compensation_day."',
`retire_compensation`='".$retire_compensation."',
`secutity_cost`='".$secutity_cost."',
`other_cost`='".$other_cost."',
`interest_cost`='".$interest_cost."',
`plus_cost`='".$plus_cost."',
`place_of_pay`='".$place_of_pay."',
`org_site`='".$org_site."',
`org_province`='".$org_province."',
`other_identify`='".$other_identify."',
`add_date`='".$add_date."',
`add_staffid`='".$add_staffid."',
`add_status`='".$add_status."'
"; #echo $strSQL; exit();
mysql_query($strSQL);
}
print"<script language='JavaScript'> alert('บันทึกข้อมูลเรียบร้อยแล้ว') </script> ";
print"<meta http-equiv=\"refresh\" content=\"0;URL=?p=labor_layoff_index\">\n";
exit();
}
if ( $_SERVER['REQUEST_METHOD'] == "GET" && $_GET['hAction'] == "Update" && $_GET['hid_card'] && $_GET['hdismissal_id'] ) {
$strSQL = "SELECT *
FROM
labor_personal INNER JOIN labor_dismissal ON labor_personal.id_card=labor_dismissal.id_card
WHERE
labor_personal.id_card='".$_GET['hid_card']."' AND
labor_dismissal.dismissal_id='".$_GET['hdismissal_id']."'
"; #echo $strSQL;
$rsConn = mysql_query($strSQL);
$objResult = mysql_fetch_object($rsConn);
# ข้อมูลรายละเอียดลูกจ้าง
$hid_card = $objResult->id_card;
$hdismissal_id = $objResult->dismissal_id;
$prename = $objResult->prename;
$fname = $objResult->fname;
$lname = $objResult->lname;
$id_card_source = $objResult->id_card_source;
$id_card_begindate = $objResult->id_card_begindate;
$id_card_expiredate = $objResult->id_card_expiredate;
$nationality = $objResult->nationality;
$work_permit_no = $objResult->work_permit_no;
$birthdate = $objResult->birthdate;
$p_no = $objResult->p_no;
$p_soi = $objResult->p_soi;
$p_province_id = $objResult->p_province_id;
$p_ampur_id = $objResult->p_ampur_id;
$p_tambol_id = $objResult->p_tambol_id;
$p_moo_id = $objResult->p_moo_id;
$p_zipcode = $objResult->p_zipcode;
$p_tel_h = $objResult->p_tel_h;
$d_no = $objResult->d_no;
$d_soi = $objResult->d_soi;
$d_province_id = $objResult->d_province_id;
$d_ampur_id = $objResult->d_ampur_id;
$d_tambol_id = $objResult->d_tambol_id;
$d_moo_id = $objResult->d_moo_id;
$d_zipcode = $objResult->d_zipcode;
$d_tel_h = $objResult->d_tel_h;
# ๑. รายละเอียดลูกจ้าง
$register_date = $objResult->register_date;
$register_place = $objResult->register_place;
$protest_agent = $objResult->protest_agent;
$d_idcard = $objResult->d_idcard;
$d_prename = $objResult->d_prename;
$d_name = $objResult->d_name;
$d_surname = $objResult->d_surname;
$death_certificate = $objResult->death_certificate;
$dc_source = $objResult->dc_source;
$d_nationality = $objResult->d_nationality;
$d_workpermit = $objResult->d_workpermit;
$concerned = $objResult->concerned;
# ๒. สถานที่ทำงานของลูกจ้าง
$company = $objResult->company;
$owner_prename = $objResult->owner_prename;
$owner_name = $objResult->owner_name;
$owner_surname = $objResult->owner_surname;
$business_type = $objResult->business_type;
$c_address_no = $objResult->c_address_no;
$c_soi = $objResult->c_soi;
$c_province_id = $objResult->c_province_id;
$c_ampur_id = $objResult->c_ampur_id;
$c_tambol_id = $objResult->c_tambol_id;
$c_moo_id = $objResult->c_moo_id;
$c_postcode = $objResult->c_postcode;
$c_tel_h = $objResult->c_tel_h;
$c_nearby = $objResult->c_nearby;
$e_no = $objResult->e_no;
$e_soi = $objResult->e_soi;
$e_province_id = $objResult->e_province_id;
$e_ampur_id = $objResult->e_ampur_id;
$e_tambol_id = $objResult->e_tambol_id;
$e_moo_id = $objResult->e_moo_id;
$e_postcode = $objResult->e_postcode;
$e_tel_h = $objResult->e_tel_h;
$e_nearby = $objResult->e_nearby;
# ๓. รายละเอียดการทำงาน
$e_fromdate = $objResult->e_fromdate;
$e_todate = $objResult->e_todate;
$e_job_position_group = $objResult->e_job_position_group;
$e_job_position = $objResult->e_job_position;
$e_division = $objResult->e_division;
$e_boss_prename = $objResult->e_boss_prename;
$e_boss_name = $objResult->e_boss_name;
$e_boss_surname = $objResult->e_boss_surname;
$e_pay_status = $objResult->e_pay_status;
$e_pay = $objResult->e_pay;
$e_pay_unit = $objResult->e_pay_unit;
$e_pay_per_unit = $objResult->e_pay_per_unit;
$e_pay_other = $objResult->e_pay_other;
$e_pay_other2 = $objResult->e_pay_other2;
$e_pay_other2_unit = $objResult->e_pay_other2_unit;
# ๔. รายละเอียดเวลาทำงาน
$work_week = $objResult->work_week;
$work_hour = $objResult->work_hour;
$fromtime = $objResult->fromtime;
$totime = $objResult->totime;
$break_fromtime = $objResult->break_fromtime;
$break_totime = $objResult->break_totime;
# ๕. กำหนดเวลาในการจ่ายเงิน
$pay_time = $objResult->pay_time;
$pay_ot_time = $objResult->pay_ot_time;
$pay_holiday_time = $objResult->pay_holiday_time;
$pay_holiday_ot_time = $objResult->pay_holiday_ot_time;
# ๖. สาเหตุการยื่นคำร้อง
$request_reason = $objResult->request_reason;
# ๗. รายละเอียดการเรียกร้อง
$request_choice_1 = $objResult->request_choice_1;
$request_choice_2 = $objResult->request_choice_2;
$request_choice_3 = $objResult->request_choice_3;
$request_choice_4 = $objResult->request_choice_4;
$request_choice_5 = $objResult->request_choice_5;
$request_choice_6 = $objResult->request_choice_6;
$request_choice_7 = $objResult->request_choice_7;
$request_choice_8 = $objResult->request_choice_8;
$request_choice_9 = $objResult->request_choice_9;
$request_choice_10 = $objResult->request_choice_10;
$request_choice_11 = $objResult->request_choice_11;
$request_choice_12 = $objResult->request_choice_12;
$request_choice_13 = $objResult->request_choice_13;
$request_choice_14 = $objResult->request_choice_14;
$request_fromdate = $objResult->request_fromdate;
$request_todate = $objResult->request_todate;
$request_cost = $objResult->request_cost;
$minimum_wage = $objResult->minimum_wage;
$standard_wage = $objResult->standard_wage;
$retire_wage = $objResult->retire_wage;
$ot_fromdate = $objResult->ot_fromdate;
$ot_todate = $objResult->ot_todate;
$ot_cost = $objResult->ot_cost;
$holiday_wage_fromdate = $objResult->holiday_wage_fromdate;
$holiday_wage_todate = $objResult->holiday_wage_todate;
$holiday_cost = $objResult->holiday_cost;
$holiday_ot_fromdate = $objResult->holiday_ot_fromdate;
$holiday_ot_todate = $objResult->holiday_ot_todate;
$holiday_ot_cost = $objResult->holiday_ot_cost;
$compensation_fromdate = $objResult->compensation_fromdate;
$compensation_todate = $objResult->compensation_todate;
$compensation = $objResult->compensation;
$extra_compensation_fromdate = $objResult->extra_compensation_fromdate;
$extra_compensation_todate = $objResult->extra_compensation_todate;
$extra_compensation = $objResult->extra_compensation;
$retire_compensation_day = $objResult->retire_compensation_day;
$retire_compensation = $objResult->retire_compensation;
$secutity_cost = $objResult->secutity_cost;
$other_cost = $objResult->other_cost;
$interest_cost = $objResult->interest_cost;
$plus_cost = $objResult->plus_cost;
# ๘. ลูกจ้างประสงค์ให้นายจ้างจ่ายเงินตามที่เรียกร้อง ณ สถานที่
$place_of_pay = $objResult->place_of_pay;
$org_site = $objResult->org_site;
$org_province = $objResult->org_province;
$other_identify = $objResult->other_identify;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620" />
<title><?=$title_name?></title>
<link href="common/style.css" rel=stylesheet>
<script language="javascript" src="common/functions.js"></script>
<link rel="STYLESHEET" type="text/css" href="codebase/dhtmlxtabbar.css">
<script src="codebase/dhtmlxcommon.js"></script>
<script src="codebase/dhtmlxtabbar.js"></script>
<script src="codebase/dhtmlxtabbar_start.js"></script>
<script language="javascript">
function mOvr(src,clrOver){
if (!src.contains(event.fromElement)) src.bgColor = clrOver;
}
function mOut(src,clrIn){
if (!src.contains(event.toElement)) src.bgColor = clrIn;
}
</script>
<script src="js/daily_popcalendar.js"></script>
<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;
}
.style1 {color: #FF0000}
.style2 {font-size: 24px}
.h_menu {color:#FF9900}
-->
.bg_th{
background-image:url(images/horiz-bg.png);
background-repeat:repeat-x;
font-weight:bold;
color:#FFFFFF;
text-align:center;
}
.container .pusher{
cursor:pointer;
padding:3px 10px 3px 7px;
font-weight:900;
font-size:12px;
margin:0;
background:url(img/bgheader-2.PNG);
color:#FFFFFF;
}
.container .mover{
border:1px solid #3399CC;
padding:3px 10px 3px 7px;
margin: 0;
background-color:#E1F0FF;
}
.container {
padding:6px;
margin-top:5px;
width: auto;
font-size:11px;
}
.container2 .pusher2{
cursor:pointer;
padding:3px 10px 3px 7px;
font-weight:900;
font-size:12px;
margin:0;
background:url(img/bgheader-2.PNG);
color:#FFFFFF;
}
.container2 .mover2{
border:1px solid #3399CC;
padding:3px 10px 3px 7px;
margin: 0;
background-color:#E1F0FF;
}
.container2 {
padding:6px;
margin-top:5px;
width: auto;
font-size:11px;
}
.container3 .pusher3{
cursor:pointer;
padding:3px 10px 3px 7px;
font-weight:900;
font-size:12px;
margin:0;
background:url(img/bgheader-2.PNG);
color:#FFFFFF;
}
.container3 .mover3{
border:1px solid #3399CC;
padding:3px 10px 3px 7px;
margin: 0;
background-color:#E1F0FF;
}
.container3 {
padding:6px;
margin-top:5px;
width: auto;
font-size:11px;
}
.container4 .pusher4{
cursor:pointer;
padding:3px 10px 3px 7px;
font-weight:900;
font-size:12px;
margin:0;
background:url(img/bgheader-2.PNG);
color:#FFFFFF;
}
.container4 .mover4{
border:1px solid #3399CC;
padding:3px 10px 3px 7px;
margin: 0;
background-color:#E1F0FF;
}
.container4 {
padding:6px;
margin-top:5px;
width: auto;
font-size:11px;
}
</style>
<script type="text/javascript" charset="utf-8" src="js/jquery-1.2.3.pack.js"></script>
</head>
<body>
<form id="form1" name="form1" method="POST" onsubmit="return saveAction()" enctype="multipart/form-data" >
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td align="center"><strong style="color:#000000; font-size:12px;">แบบคำร้องต่อพนักงานตรวจแรงงาน <br />
ตามพระราชบัญญัติคุ้มครองแรงงาน พ.ศ. ๒๕๔๑ (แบบ คร.๗)</strong></td>
</tr>
<tr>
<td align="right">เขียนที่
<input name="register_place" type="text" id="register_place" value="<?=$register_place?>" size="50" />
วันที่ <span class="style1">*</span>
<input name="register_date" type="text" id="register_date" size="10" value="<?=( $register_date != "0000-00-00" && $register_date ) ? dateFormat($register_date, 'engthai_slash') : "";?>" maxlength="10" onkeypress="return fmtDate(this, event);"/>
<img src="js/calendar/calendar2.gif" align="top" border="0" onClick="popUpCalendar(this, form1.register_date, 'dd/mm/yyyy')" title="วัน เดือน ปี" style="cursor:pointer;" /> </td>
</tr>
<tr>
<td><table width="100%" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td></td>
</tr>
<tr>
<td bgcolor="#B4B4B4">
<table width="100%" border="0" cellpadding="5" cellspacing="1">
<tr>
<td bgcolor="#FFFFFF">
<table width="99%" border="0" align="center" bgcolor="#FFFFFF" cellpadding="3" cellspacing="1">
<tr>
<td class="style1"> </tr>
<tr>
<td>
<div class="container">
<div class="pusher" id="slideToggle1"><img src="../../images/dash_icon/bookmark.png" width="16" height="16" align="absmiddle" /> ๑. รายละเอียดลูกจ้าง</div>
<div class="mover1"><? include("labor_layoff_keyin.part1.php"); ?></div><hr>
<div class="pusher" id="slideToggle2"><img src="../../images/dash_icon/bookmark.png" width="16" height="16" align="absmiddle" /> ๒. สถานที่ทำงานของลูกจ้าง</div>
<div class="mover2"><? include("labor_layoff_keyin.part2.php"); ?></div><hr>
<div class="pusher" id="slideToggle3"><img src="../../images/dash_icon/bookmark.png" width="16" height="16" align="absmiddle" /> ๓. รายละเอียดการทำงาน</div>
<div class="mover3"><? include("labor_layoff_keyin.part3.php"); ?></div><hr>
<div class="pusher" id="slideToggle4"><img src="../../images/dash_icon/bookmark.png" width="16" height="16" align="absmiddle" /> ๔. รายละเอียดเวลาทำงาน</div>
<div class="mover4"><? include("labor_layoff_keyin.part4.php"); ?></div><hr>
<div class="pusher" id="slideToggle5"><img src="../../images/dash_icon/bookmark.png" width="16" height="16" align="absmiddle" /> ๕. กำหนดเวลาในการจ่ายเงิน</div>
<div class="mover5"><? include("labor_layoff_keyin.part5.php"); ?></div><hr>
<div class="pusher" id="slideToggle6"><img src="../../images/dash_icon/bookmark.png" width="16" height="16" align="absmiddle" /> ๖. สาเหตุการยื่นคำร้อง</div>
<div class="mover6"><? include("labor_layoff_keyin.part6.php"); ?></div><hr>
<div class="pusher" id="slideToggle7"><img src="../../images/dash_icon/bookmark.png" width="16" height="16" align="absmiddle" /> ๗. รายละเอียดการเรียกร้อง</div>
<div class="mover7"><? include("labor_layoff_keyin.part7.php"); ?></div><hr>
<div class="pusher" id="slideToggle8"><img src="../../images/dash_icon/bookmark.png" width="16" height="16" align="absmiddle" /> ๘. ลูกจ้างประสงค์ให้นายจ้างจ่ายเงินตามที่เรียกร้อง ณ สถานที่</div>
<div class="mover8"><? include("labor_layoff_keyin.part8.php"); ?></div><hr>
</div></td>
</tr>
<tr>
<td align="right">
<input type="hidden" name="hAction" value="" />
<input type="submit" name="submit" value="บันทึก" style="width:100px"/>
<input type="reset" name="Submit2" value="ยกเลิก" style="width:100px"/>
<input type="button" name="back_main" value="ย้อนกลับ" onclick="location.href='?p=labor_layoff_index'" style="width:100px"/> </td>
</tr>
<tr>
<td align="right"> </td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</form>
</body>
</html>
<script type="text/javascript" charset="utf-8" src="js/jquery-1.2.3.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//$('.mover1').hide();
$('.mover2').hide();
$('.mover3').hide();
$('.mover4').hide();
$('.mover5').hide();
$('.mover6').hide();
$('.mover7').hide();
$('.mover8').hide();
$('#slideToggle1').click(function(){
$(this).siblings('.mover1').slideToggle();
});
$('#slideToggle2').click(function(){
$(this).siblings('.mover2').slideToggle();
});
$('#slideToggle3').click(function(){
$(this).siblings('.mover3').slideToggle();
});
$('#slideToggle4').click(function(){
$(this).siblings('.mover4').slideToggle();
});
$('#slideToggle5').click(function(){
$(this).siblings('.mover5').slideToggle();
});
$('#slideToggle6').click(function(){
$(this).siblings('.mover6').slideToggle();
});
$('#slideToggle7').click(function(){
$(this).siblings('.mover7').slideToggle();
});
$('#slideToggle8').click(function(){
$(this).siblings('.mover8').slideToggle();
});
});
</script>
<script language="JavaScript">
function CreateXmlHttp() {
//Creating object of XMLHTTP in IE
try {
XmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch( e ) {
try {
XmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch( oc ) {
XmlHttp = null;
}
}
//Creating object of XMLHTTP in Mozilla and Safari
if ( !XmlHttp && typeof XMLHttpRequest != "undefined" ) XmlHttp = new XMLHttpRequest();
} // End Function CreateXmlHttp
// แสดงข้อมูลส่วนบุคคล
function getVal ( IDCard ) {
if ( IDCard ) {
CreateXmlHttp();
XmlHttp.open("get", "ajax.get_personal.layoff.php?IDCard="+IDCard, true);
XmlHttp.onreadystatechange=function() {
if (XmlHttp.readyState==4) {
if (XmlHttp.status==200) {
var res = XmlHttp.responseText;
//alert(res);
shwVal(res);
} else if (XmlHttp.status==404) {
alert("ไม่สามารถทำการดึงข้อมูลได้");
} else {
alert("Error : "+XmlHttp.status);
}
}
};
XmlHttp.send(null);
}
}
function shwVal ( res ) {
var hid_card = document.getElementById("hid_card");
var id_card = document.getElementById("id_card");
var prename = document.getElementById("prename");
var fname = document.getElementById("fname");
var lname = document.getElementById("lname");
var id_card_source = document.getElementById("id_card_source");
var id_card_begindate = document.getElementById("id_card_begindate");
var id_card_expiredate = document.getElementById("id_card_expiredate");
var nationality = document.getElementById("nationality");
var work_permit_no = document.getElementById("work_permit_no");
var Dd = document.getElementById("Dd");
var Mm = document.getElementById("Mm");
var Yy = document.getElementById("Yy");
var p_no = document.getElementById("p_no");
var p_soi = document.getElementById("p_soi");
var p_zipcode = document.getElementById("p_zipcode");
var p_tel_h = document.getElementById("p_tel_h");
var d_no = document.getElementById("d_no");
var d_soi = document.getElementById("d_soi");
var d_zipcode = document.getElementById("d_zipcode");
var d_tel_h = document.getElementById("d_tel_h");
Val = res.split("||"); //alert(res);
//hid_card.value = Val[0];
//id_card.value = Val[0];
prename.value = Val[1];
fname.value = Val[2];
lname.value = Val[3];
id_card_source.value = Val[4];
if ( Val[5] != "0000-00-00" && Val[5] ) { var e = Val[5].split("-"); id_card_begindate.value = e[2]+"/"+e[1]+"/"+((e[0]*1)+543); } else { id_card_begindate.value = ""; }
if ( Val[6] != "0000-00-00" && Val[6] ) { var e = Val[6].split("-"); id_card_expiredate.value = e[2]+"/"+e[1]+"/"+((e[0]*1)+543); } else { id_card_expiredate.value = ""; }
nationality.value = Val[7];
work_permit_no.value = Val[8];
var e = Val[9].split("-");
if ( e[2] != "00" && e[2] ) { Dd.value = e[2]; } else { Dd.value = "00"; }
if ( e[1] != "00" && e[1] ) { Mm.value = e[1]; } else { Mm.value = "00"; }
if ( e[0] != "0000" && e[0] ) { Yy.value = e[0]; } else { Yy.value = "0000"; }
/*ข้อมูลที่อยู่ปัจจุบัน และที่อยู่ตามทะเบียนบ้าน*/
p_no.value = Val[10];
p_soi.value = Val[11];
p_zipcode.value = Val[16];
p_tel_h.value = Val[17];
d_no.value = Val[18];
d_soi.value = Val[19];
d_zipcode.value = Val[24];
if ( Val[25] ) { d_tel_h.value = Val[25]; } else { d_tel_h.value = ""; }
<? include("js.get_p_addr.php"); ?>
}
// แสดงข้อมูลตำแหน่งงาน
function getPosition ( PositionGroupID, objID, TargetID ) {
if ( PositionGroupID ) {
CreateXmlHttp();
XmlHttp.open("get", "ajax.get_position.layoff.php?PositionGroupID="+PositionGroupID+"&objID="+objID, true);
XmlHttp.onreadystatechange=function() {
if (XmlHttp.readyState==4) {
if (XmlHttp.status==200) {
var res = XmlHttp.responseText;
document.getElementById(TargetID).innerHTML = res; //alert(res);
} else if (XmlHttp.status==404) {
alert("ไม่สามารถทำการดึงข้อมูลได้");
} else {
alert("Error : "+XmlHttp.status);
}
}
};
XmlHttp.send(null);
} else {
document.getElementById(TargetID).innerHTML = "(กรุณาเลือกกลุ่มตำแหน่งงานก่อน)";
}
}
// แสดงข้อมูลที่อยู่
function getAmphur ( provinceID, amphur, tambol, moo, Slted ) {
if ( provinceID ) {
CreateXmlHttp();
XmlHttp.open("get", "ajax.get_amphur.php?provinceID="+provinceID+"&hur="+amphur+"&tambol="+tambol+"&moo="+moo+"&valSlted="+Slted, true);
XmlHttp.onreadystatechange=function() {
if (XmlHttp.readyState==4) {
if (XmlHttp.status==200) {
var res = XmlHttp.responseText;
if ( res ) {
document.getElementById("lbl_"+amphur).innerHTML = res; //alert(res);
document.getElementById("lbl_"+tambol).innerHTML = "(กรุณาเลือกอำเภอก่อน)";
document.getElementById("lbl_"+moo).innerHTML = "(กรุณาเลือกตำบลก่อน)";
}
} else if (XmlHttp.status==404) {
alert("ไม่สามารถทำการดึงข้อมูลได้");
} else {
alert("Error : "+XmlHttp.status);
}
}
};
XmlHttp.send(null);
} else {
document.getElementById("lbl_"+amphur).innerHTML = "(กรุณาเลือกจังหวัดก่อน)";
document.getElementById("lbl_"+tambol).innerHTML = "(กรุณาเลือกอำเภอก่อน)";
document.getElementById("lbl_"+moo).innerHTML = "(กรุณาเลือกตำบลก่อน)";
}
} // end
function getTambol ( amphurID, tambol, moo, Slted ) {
if ( amphurID ) {
CreateXmlHttp();
XmlHttp.open("get", "ajax.get_tambol.php?amphurID="+amphurID+"&tambol="+tambol+"&moo="+moo+"&valSlted="+Slted, true);
XmlHttp.onreadystatechange=function() {
if (XmlHttp.readyState==4) {
if (XmlHttp.status==200) {
var res = XmlHttp.responseText;
if ( res ) {
document.getElementById("lbl_"+tambol).innerHTML = res;
document.getElementById("lbl_"+moo).innerHTML = "(กรุณาเลือกตำบลก่อน)";
}
} else if (XmlHttp.status==404) {
alert("ไม่สามารถทำการดึงข้อมูลได้");
} else {
alert("Error : "+XmlHttp.status);
}
}
};
XmlHttp.send(null);
} else {
document.getElementById("lbl_"+tambol).innerHTML = "(กรุณาเลือกอำเภอก่อน)";
document.getElementById("lbl_"+moo).innerHTML = "(กรุณาเลือกตำบลก่อน)";
}
} // end
function getMoo ( tambolID, moo, Slted ) {
if ( tambolID ) {
CreateXmlHttp();
XmlHttp.open("get", "ajax.get_moo.php?tambolID="+tambolID+"&moo="+moo+"&valSlted="+Slted, true);
XmlHttp.onreadystatechange=function() {
if (XmlHttp.readyState==4) {
if (XmlHttp.status==200) {
var res = XmlHttp.responseText;
if ( res ) {
document.getElementById("lbl_"+moo).innerHTML = res;
}
} else if (XmlHttp.status==404) {
alert("ไม่สามารถทำการดึงข้อมูลได้");
} else {
alert("Error : "+XmlHttp.status);
}
}
};
XmlHttp.send(null);
} else {
document.getElementById("lbl_"+moo).innerHTML = "(กรุณาเลือกตำบลก่อน)";
}
} // end
</script>
<script language="javascript1.2">
function IsNumeric(input){
var RE = /^-?(0|INF|(0[1-7][0-7]*)|(0x[0-9a-fA-F]+)|((0|[1-9][0-9]*|(?=[\.,]))([\.,][0-9]+)?([eE]-?\d+)?))$/;
return (RE.test(input));
}
function Script_checkID(id) {
if(!IsNumeric(id)) return false;
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;
}else{
return true;
}
}
//รูปแบบของเลขประจำตัวประชาชน
function fmtPIN(Obj, event) {
var charCode = (event.which) ? event.which : event.keyCode;
if(charCode!=8){
if ( Obj.value.length == 1 || Obj.value.length == 6 || Obj.value.length == 12 || Obj.value.length == 15 ) {
Obj.value = Obj.value + "-";
}
}
}
function chkRude( data ) {
var wordrude = new Array ( "-" );
var wordchange = "";
for ( n = 0 ; n < wordrude.length ; n++ ) {
pattern = new RegExp( wordrude[n] , "gi" );
data = data.replace( pattern , wordchange );
}
return data;
}
function chgPin(pin, label){
var chg_pin = document.getElementById(label);
var pin = chkRude(pin);
if ( pin ) {
if(Script_checkID(pin)==false){
chg_pin.innerHTML = '<font color=\"#CC0000\">ไม่ถูกต้องตามหลักกรมการปกครอง</font>';
}else{
chg_pin.innerHTML = '<font color=\"#339900\">ถูกต้องตามหลักกรมการปกครอง</font>';
}
} else {
chg_pin.innerHTML = '';
}
}
/* ฟังก์ชั่นการตรวจสอบให้อนุญาตกรอกตัวเลขเท่านั้น (สำหรับเลขบัตรประชาชน) Modified By : Aussy [2553-06-30 02:32] */
function isNumber(o, evt){
var id=o;
var charCode = (evt.which) ? evt.which : event.keyCode;
if ( ( (charCode > 47 && charCode < 58) || charCode == 8 || charCode == 127 ) && id ) {
fmtPIN(o, evt);
} else {
return false;
}
}
/* ฟังก์ชั่นการตรวจสอบให้อนุญาตกรอกตัวเลขเท่านั้น Modified By : Aussy [2553-06-30 02:32] */
function fmtNumber(o, evt){
var id=o;
var charCode = (evt.which) ? evt.which : event.keyCode;
if ( ( (charCode > 47 && charCode < 58) || charCode == 8 || charCode == 127 ) && id ) {
return true;
} else {
return false;
}
}
/* ฟังก์ชั่นการตรวจสอบให้อนุญาตกรอกตัวเลขเท่านั้น Modified By : Aussy [2553-06-30 02:32] */
function fmtDate(o, evt){
var id=o;
var charCode = (evt.which) ? evt.which : event.keyCode;
if ( ( (charCode > 47 && charCode < 58) || charCode == 8 || charCode == 127 ) && id ) {
if ( charCode != 8 ) {
if ( o.value.length == 2 || o.value.length == 5 ) {
o.value = o.value + "/";
}
} else {
return false;
}
} else {
return false;
}
}
function getPaymentSum () {
document.getElementById("txtResult").value =
(
(document.getElementById("request_cost").value*1) +
(document.getElementById("minimum_wage").value*1) +
(document.getElementById("standard_wage").value*1) +
(document.getElementById("retire_wage").value*1) +
(document.getElementById("ot_cost").value*1) +
(document.getElementById("holiday_cost").value*1) +
(document.getElementById("holiday_ot_cost").value*1) +
(document.getElementById("compensation").value*1) +
(document.getElementById("extra_compensation").value*1) +
(document.getElementById("retire_compensation").value*1) +
(document.getElementById("secutity_cost").value*1) +
(document.getElementById("other_cost").value*1) +
(document.getElementById("interest_cost").value*1) +
(document.getElementById("plus_cost").value*1)
)*1;
}
<? if ( $hid_card ) { echo "chgPin(document.getElementById(\"id_card\").value, 'chg_pin');"; } ?>
<? if ( $d_idcard ) { echo "chgPin(document.getElementById(\"d_idcard\").value, 'd_chg_pin');"; } ?>
getPaymentSum();
</script>
<script language="javascript1.2">
function switchWage() {
if ( document.getElementById("e_pay_status_a").checked == true ) {
document.getElementById("e_pay").disabled = false;
document.getElementById("e_pay_unit").disabled = false;
document.getElementById("e_pay_per_unit").disabled = true;
} else if ( document.getElementById("e_pay_status_b").checked == true ) {
document.getElementById("e_pay").disabled = true;
document.getElementById("e_pay_unit").disabled = true;
document.getElementById("e_pay_per_unit").disabled = false;
} else {
document.getElementById("e_pay").disabled = true;
document.getElementById("e_pay_unit").disabled = true;
document.getElementById("e_pay_per_unit").disabled = true;
}
}
function switchRequest() {
document.getElementById("request_fromdate").disabled = true;
document.getElementById("request_todate").disabled = true;
document.getElementById("request_cost").disabled = true;
document.getElementById("minimum_wage").disabled = true;
document.getElementById("standard_wage").disabled = true;
document.getElementById("retire_wage").disabled = true;
document.getElementById("ot_fromdate").disabled = true;
document.getElementById("ot_todate").disabled = true;
document.getElementById("ot_cost").disabled = true;
document.getElementById("holiday_wage_fromdate").disabled = true;
document.getElementById("holiday_wage_todate").disabled = true;
document.getElementById("holiday_cost").disabled = true;
document.getElementById("holiday_ot_fromdate").disabled = true;
document.getElementById("holiday_ot_todate").disabled = true;
document.getElementById("holiday_ot_cost").disabled = true;
document.getElementById("compensation_fromdate").disabled = true;
document.getElementById("compensation_todate").disabled = true;
document.getElementById("compensation").disabled = true;
document.getElementById("extra_compensation_fromdate").disabled = true;
document.getElementById("extra_compensation_todate").disabled = true;
document.getElementById("extra_compensation").disabled = true;
document.getElementById("retire_compensation_day").disabled = true;
document.getElementById("retire_compensation").disabled = true;
document.getElementById("secutity_cost").disabled = true;
document.getElementById("other_cost").disabled = true;
document.getElementById("interest_cost").disabled = true;
document.getElementById("plus_cost").disabled = true;
if ( document.getElementById("request_choice_1").checked == true ) {
document.getElementById("request_fromdate").disabled = false;
document.getElementById("request_todate").disabled = false;
document.getElementById("request_cost").disabled = false;
}
if ( document.getElementById("request_choice_2").checked == true ) {
document.getElementById("minimum_wage").disabled = false;
}
if ( document.getElementById("request_choice_3").checked == true ) {
document.getElementById("standard_wage").disabled = false;
}
if ( document.getElementById("request_choice_4").checked == true ) {
document.getElementById("retire_wage").disabled = false;
}
if ( document.getElementById("request_choice_5").checked == true ) {
document.getElementById("ot_fromdate").disabled = false;
document.getElementById("ot_todate").disabled = false;
document.getElementById("ot_cost").disabled = false;
}
if ( document.getElementById("request_choice_6").checked == true ) {
document.getElementById("holiday_wage_fromdate").disabled = false;
document.getElementById("holiday_wage_todate").disabled = false;
document.getElementById("holiday_cost").disabled = false;
}
if ( document.getElementById("request_choice_7").checked == true ) {
document.getElementById("holiday_ot_fromdate").disabled = false;
document.getElementById("holiday_ot_todate").disabled = false;
document.getElementById("holiday_ot_cost").disabled = false;
}
if ( document.getElementById("request_choice_8").checked == true ) {
document.getElementById("compensation_fromdate").disabled = false;
document.getElementById("compensation_todate").disabled = false;
document.getElementById("compensation").disabled = false;
}
if ( document.getElementById("request_choice_9").checked == true ) {
document.getElementById("extra_compensation_fromdate").disabled = true;
document.getElementById("extra_compensation_todate").disabled = true;
document.getElementById("extra_compensation").disabled = false;
}
if ( document.getElementById("request_choice_10").checked == true ) {
document.getElementById("retire_compensation_day").disabled = false;
document.getElementById("retire_compensation").disabled = false;
}
if ( document.getElementById("request_choice_11").checked == true ) {
document.getElementById("secutity_cost").disabled = false;
}
if ( document.getElementById("request_choice_12").checked == true ) {
document.getElementById("other_cost").disabled = false;
}
if ( document.getElementById("request_choice_13").checked == true ) {
document.getElementById("interest_cost").disabled = false;
}
if ( document.getElementById("request_choice_14").checked == true ) {
document.getElementById("plus_cost").disabled = false;
}
}
function switchPlaceOfPlay() {
if ( document.getElementById("place_of_pay_a").checked == true ) {
document.getElementById("org_site").disabled = true;
document.getElementById("org_province").disabled = true;
document.getElementById("other_identify").disabled = true;
} else if ( document.getElementById("place_of_pay_b").checked == true ) {
document.getElementById("org_site").disabled = false;
document.getElementById("org_province").disabled = false;
document.getElementById("other_identify").disabled = true;
} else if ( document.getElementById("place_of_pay_c").checked == true ) {
document.getElementById("org_site").disabled = true;
document.getElementById("org_province").disabled = true;
document.getElementById("other_identify").disabled = false;
} else {
document.getElementById("org_site").disabled = true;
document.getElementById("org_province").disabled = true;
document.getElementById("other_identify").disabled = true;
}
getPaymentSum();
}
switchWage();
switchRequest();
switchPlaceOfPlay();
</script>
<script language=JavaScript>
function saveAction() {
var register_date = document.getElementById("register_date");
var id_card = document.getElementById("id_card");
var prename = document.getElementById("prename");
var fname = document.getElementById("fname");
var protest_agent_a = document.getElementById("protest_agent_a");
var protest_agent_b = document.getElementById("protest_agent_b");
if ( register_date.value == "" ) {
alert("กรุณาระบุวันที่ยื่นคำร้อง");
register_date.focus();
return false;
} else if ( id_card.value == "" ) {
alert("กรุณาระบุเลขประจำตัวประชาชน");
id_card.focus();
return false;
} else if ( prename.value == "" ) {
alert("กรุณาระบุคำนำหน้าชื่อ");
prename.focus();
return false;
} else if( fname.value == "" ) {
alert("กรุณาระบุชื่อ");
fname.focus();
return false;
} else if ( protest_agent_a.checked == false && protest_agent_b.checked == false ) {
alert("กรุณาระบุฐานะของผู้ยื่นคำร้อง");
protest_agent_a.focus();
return false;
} else if ( confirm("คุณต้องการบันทึกข้อมูล จริงหรือไม่?") == true ) {
return true;
} else {
return false;
}
}
</script>