Viewing file: v_infoAm_3.php (7.62 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<SCRIPT language=JavaScript type="text/JavaScript">
function showCalendar(val) {
if(val.value=='P') {
document.getElementById("div1").style.display = "none";
} else if(val.value=='F') {
document.getElementById("div1").style.display = "";
}
}
</SCRIPT>
<?php
$row_hw = (isset($qu_hw) && $qu_hw!=NULL) ? $qu_hw->row() : NULL;
// แสดงปฏิทินตอนที่ check validate
if(set_value('fDate')=='P') {
$flg_show = "display:none";
} else if(set_value('fDate')=='F') {
$flg_show = "display:''";
} else if(set_value('fDate')=='') {
$flg_show = "display:none";
}
// แสดงปฏิทินตอนที่แก้ไขข้อมูล
if($row_hw!=NULL) {
if($row_hw->companyEndDate=="0000-00-00")
$flg_show = "display:none";
else
$flg_show = "display:''";
}
?>
<table width="100%">
<tr>
<td><table class="szone"><?php echo form_open($this->config->item("ea_folder")."info_alumni/process_infoAm_3", array("name" => "myform", "id" => "myform"));?>
<tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
<td height="25px" class="indent" colspan="2"><span class="h error">ข้อมูลการทำงาน</span></td>
</tr>
<tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
<td class="coltd_szone2">ชื่อหน่วยงาน ภาษาไทย</td>
<td><input type="text" name="companyNameT" id="companyNameT" value="<?php echo set_value('companyNameT',setValue('companyNameT',$row_hw));?>" size="70" maxlength="70" />
<span class="error"> * <?php echo form_error('companyNameT');?></span></td>
</tr>
<tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
<td class="coltd_szone2">ชื่อหน่วยงาน ภาษาอังกฤษ</td>
<td><input type="text" name="companyNameE" id="companyNameE" value="<?php echo set_value('companyNameE',setValue('companyNameE',$row_hw));?>" size="70" maxlength="70" /></td>
</tr>
<tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
<td class="coltd_szone2">ที่อยู่ของหน่วยงาน</td>
<td><input type="text" name="companyAddr" id="companyAddr" value="<?php echo set_value('companyAddr',setValue('companyAddr',$row_hw));?>" size="70" maxlength="100" />
<span class="error"> * <?php echo form_error('companyAddr');?></span></td>
</tr>
<tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
<td class="coltd_szone2">ตำแหน่งในหน่วยงาน</td>
<td><input type="text" name="companyPosition" id="companyPosition" value="<?php echo set_value('companyPosition',setValue('companyPosition',$row_hw));?>" size="30" maxlength="50" />
<span class="error"> * <?php echo form_error('companyPosition');?></span></td>
</tr>
<tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
<td class="coltd_szone2">วันเริ่มต้นการเข้ารับตำแหน่ง</td>
<td><script>DateInput('companyStartDate', true, 'DD/MM/YYYY', "<?php echo set_value('companyStartDate') ? set_value('companyStartDate') : ((setValue('companyStartDate',$row_hw)=='') ? getNowDateFw2() : splitDateDb2(setValue('companyStartDate',$row_hw),'/'));?>")</script></td>
</tr>
<tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
<td class="coltd_szone2">วันสิ้นสุดการเข้ารับตำแหน่ง</td>
<td><table>
<tr>
<td height="25px"><input type="radio" id="fDate" name="fDate" value="P" onClick="showCalendar(this)" <?php echo (set_value('fDate')=='P') ? "checked" : '';?> checked /> <b>ปัจจุบัน</b></td>
</tr>
<tr>
<td height="25px"><input type="radio" id="fDate" name="fDate" value="F" onClick="showCalendar(this)" <?php echo (set_value('fDate')=='F' || ($row_hw!=NULL && $row_hw->companyEndDate!="0000-00-00")) ? "checked" : "";?> /> <b>ระบุวันที่</b>
<!-- แสดงปฏิทิน -->
<div id="div1" style="<?php echo $flg_show;?>"><script>DateInput('companyEndDate', true, 'DD/MM/YYYY', "<?php echo set_value('companyEndDate') ? set_value('companyEndDate') : ((setValue('companyEndDate',$row_hw)=='' || setValue('companyEndDate', $row_hw)=='0000-00-00') ? getNowDateFw2() : splitDateDb2(setValue('companyEndDate',$row_hw),'/'));?>")</script></div>
<!-- จบแสดงปฏิทิน -->
<span class="error"><?php echo form_error('companyEndDate');?></span></td>
</tr>
</table></td>
</tr>
<tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
<td colspan="2" align="center">
<input type="submit" name="add" id="add" value="บันทึก" />
<input type="reset" name="clear" id="clear" value="เคลียร์ข้อมูล" />
<input type="hidden" name="seqId" id="seqId" value="<?php echo setValue('seqId',$row_hw);?>" />
<input type="hidden" name="hwId" id="hwId" value="<?php echo setValue('alumniId',$row_hw);?>" />
<input type="hidden" name="tab" id="tab" value="<?php echo $tab;?>" />
<input type="hidden" name="alumniId" id="alumniId" value="<?php echo $alumniId;?>" />
</td>
</tr>
<?php echo form_close();?></table></td>
</tr>
<tr>
<td><br /></td>
</tr>
<tr>
<td><table class="headCol">
<tr bgcolor="<?php echo $this->config->item('table_c_even');?>">
<th class="seqCol">ลำดับที่</th>
<th class="date">ระยะเวลาที่เข้ารับตำแหน่ง</th>
<th>ชื่อตำแหน่ง ภาษาไทย</th>
<th>ชื่อหน่วยงาน</th>
<th class="editCol">แก้ไข</th>
<th class="deleteCol">ลบ</th>
</tr>
<?php
$i = 0;
if(isset($rs_hw) && $rs_hw->num_rows()) {
foreach($rs_hw->result() as $row_hw) {
echo "<tr onmouseover=\"bgColor='".$this->config->item('tr_c_even')."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">";
$startDate = ($row_hw->companyStartDate=='0000-00-00') ? "ไม่ระบุ" : abbreDate2($row_hw->companyStartDate);
$endDate = ($row_hw->companyEndDate=='0000-00-00') ? "ปัจจุบัน" : abbreDate2($row_hw->companyEndDate);
?>
<td align="center"><?php echo $i+1;?></td>
<td class="indent"><?php echo $startDate.' - '.$endDate;?></td>
<td class="indent"><?php echo $row_hw->companyPosition;?></td>
<td class="indent"><?php echo $row_hw->companyNameT;?></td>
<td align="center"><img class="hand" src="<?php echo base_url().$this->config->item('ea_edit');?>" align="absmiddle" border="0"
onClick="sendPost('hidform',
{'alumniId':<?php echo $row_hw->alumniId;?>,
'tab':<?php echo $tab;?>,
'seqId':<?php echo $row_hw->seqId;?>},
'<?php echo site_url($this->config->item('ea_folder').'info_alumni/main_infoAm');?>')" />
</td>
<td align="center"><img class="hand" src="<?php echo base_url().$this->config->item('ea_delete');?>" align="absmiddle" border="0"
onClick="sendPost('hidform',
{'alumniId':<?php echo $row_hw->alumniId;?>,
'tab':<?php echo $tab;?>,
'seqId':<?php echo $row_hw->seqId;?>},
'<?php echo site_url($this->config->item('ea_folder').'info_alumni/process_deleteInfoAm_3');?>')" /></td>
</tr>
<?php
$i++;
}
} else {
?>
<tr>
<td colspan="6" align="center"><span class="error">** ไม่ปรากฏรายการในฐานข้อมูล **</span></td>
</tr>
<?php
}
?>
</table></td>
</tr>
<tr>
<td align="right">รวม <?php echo $i;?> รายการ</td>
</tr>
</table>
|