Viewing file:      v_addBaseSalary.php (8.2 KB)      -rwxr-xr-x 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_bs = (isset($qu_bs) && $qu_bs!=NULL) ? $qu_bs->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_bs!=NULL) {
     if(set_value('fDate')=='F') {
         $flg_show = "display:''";
     } else if($row_bs->bsFinishUse=="0000-00-00") {
         $flg_show = "display:none";
     } else {
         $flg_show = "display:''";
     }
 }
 ?>
 <table width="100%">
     <tr>
         <td align="center"><span class="h error">ข้อมูลเกณฑ์เงินเดือนขั้นต่ำ</span></td>
     </tr>
     <tr>
         <td><br /></td>
     </tr>
 <?php
     if($this->session->flashdata('flgSave')) {
 ?>
     <tr>
         <td align="center"><?php echo $this->session->flashdata('flgSave');?></td>
     </tr>
 <?php
     }
 ?>
     <tr>
         <td><table class="szone"><?php echo form_open($this->config->item("ea_folder")."basedata/basesalary_insert_update", array("name" => "myform", "id" => "myform"));?>
             <tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
                 <td class="coltd_szone">ชื่อวุฒิการศึกษา</td>
                 <td>
 <?php
             if(is_null($row_bs)) {
                 echo form_dropdown('bsEdgId', $rs_edg, set_value('bsEdgId', setValue('bsEdgId', $row_bs)));
 ?>
                 <span class="error"> *<?php echo form_error('bsEdgId');?></span>
 <?php
             } else {
                 echo setValue('edgName',$row_bs);
 ?>
                 <input type="hidden" name="bsEdgId" id="bsEdgId" value="<?php echo setValue('bsEdgId',$row_bs);?>" />
 <?php
             }
 ?>
                 </td>
             </tr>
             <tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
                 <td class="coltd_szone">ชื่อระดับการศึกษา</td>
                 <td>
 <?php
             if(is_null($row_bs)) {
                 echo form_dropdown('bsLevelId', $rs_lev, set_value('bsLevelId',setValue('bsLevelId', $row_bs)));
 ?>
                 <span class="error"> *<?php echo form_error('bsLevelId');?></span>
 <?php
             } else {
                 echo setValue('levelName',$row_bs);
 ?>
                 <input type="hidden" name="bsLevelId" id="bsLevelId" value="<?php echo setValue('bsLevelId',$row_bs);?>" />
 <?php
             }
 ?>
                 </td>
             </tr>
             <tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
                 <td class="coltd_szone">เงินเดือนขั้นต่ำ</td>
                 <td><input type="text" name="bsAmount" id="bsAmount" value="<?php echo set_value('bsAmount',setValue('bsAmount',$row_bs));?>" size="8" maxlength="7" class="required-int" /> บาท/เดือน<span class="error"> * </span><?php echo form_error('bsAmount');?></td>
             </tr>
             <tr bgcolor="<?php echo $this->config->item('tr_c_even');?>">
                 <td class="coltd_szone">วันที่เริ่มต้นประกาศใช้</td>
                 <td>
 <?php
             if(is_null($row_bs)) {
 ?>
                 <script>DateInput('bsStartUse', true, 'DD/MM/YYYY', "<?php echo set_value('bsStartUse') ? set_value('bsStartUse') : ((setValue('bsStartUse',$row_bs)=='') ? getNowDateFw2() : splitDateDb2(setValue('bsStartUse',$row_bs),'/'));?>")</script>
 <?php
                 echo form_error('bsStartUse');
             } else {
                 echo abbreDate2(setValue('bsStartUse',$row_bs));
 ?>
                 <input type="hidden" name="bsStartUse" id="bsStartUse" value="<?php echo setValue('bsStartUse',$row_bs);?>" />
 <?php
             }
 ?>
                 </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" name="fDate" id="fDate" value="P" onClick="showCalendar(this)" <?php echo (set_value('fDate')=='P') ? "checked" : '';?> checked /> <b>ปัจจุบัน</b></td>
                     </tr>
                     <tr>
                         <td><input type="radio" name="fDate" id="fDate" value="F" onClick="showCalendar(this)" <?php echo (set_value('fDate')=='F' || ($row_bs!=NULL && $row_bs->bsFinishUse!="0000-00-00")) ? "checked" : "";?> /> <b>ระบุวันที่</b>
 
                         <!-- แสดงปฏิทิน -->
                         <div id="div1" style="<?php echo $flg_show;?>">
                         <script>DateInput('bsFinishUse', true, 'DD/MM/YYYY', "<?php echo set_value('bsFinishUse') ? set_value('bsFinishUse') : ((setValue('bsFinishUse',$row_bs)=='' || setValue('bsFinishUse', $row_bs)=='0000-00-00') ? getNowDateFw2() : splitDateDb2(setValue('bsFinishUse',$row_bs),'/'));?>")</script>
                         </div>
                         <!-- จบแสดงปฏิทิน -->
 
                         <?php echo form_error('bsFinishUse');?></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="bsId" id="bsId" value="<?php echo setValue('bsId',$row_bs);?>" />
                 </td>
             </tr>
         <?php echo form_close();?></table></td>
     </tr>
     <tr>
         <td><br /></td>
     </tr>
     <tr>
         <td align="right">ส่งออก <img class="hand" title="ส่งออกเป็น excel" src="<?php echo base_url().$this->config->item('rg_excel_exp');?>" align="absmiddle" border="0" onClick="sendPost('hidform',{},
         '<?php echo site_url($this->config->item('ea_folder').'basedata/basesalary_ex');?>')" />
         </td>
     </tr>
     <tr>
         <td><table class="headCol">
             <tr bgcolor="<?php echo $this->config->item('table_c_even');?>">
                 <th class="seqCol">ลำดับที่</th>
                 <th>ชื่อวุฒิการศึกษา</th>
                 <th>ชื่อระดับการศึกษา</th>
                 <th>เงินเดือนขั้นต่ำ</th>
                 <th>ระยะเวลาประกาศใช้</th>
                 <th class="editCol">แก้ไข</th>
                 <th class="deleteCol">ลบ</th>
             </tr>
 <?php
     $i = 0;
     if(isset($rs_bs) && $rs_bs->num_rows()) {
         foreach($rs_bs->result() as $row_bs) {
             echo "<tr onmouseover=\"bgColor='".$this->config->item('tr_c_even')."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">";
             $startDate = abbreDate2($row_bs->bsStartUse);
             $endDate = ($row_bs->bsFinishUse=="0000-00-00") ? "ปัจจุบัน" : abbreDate2($row_bs->bsFinishUse);
 ?>
                 <td align="center"><?php echo $i+1;?></td>
                 <td class="indent"><?php echo $row_bs->edgName;?></td>
                 <td class="indent"><?php echo $row_bs->levelName;?></td>
                 <td class="indent"><?php echo number_format($row_bs->bsAmount,2)." บาท/เดือน";?></td>
                 <td class="indent"><?php echo $startDate.' - '.$endDate;?></td>
                 <td align="center">
                 <img class="hand" src="<?php echo base_url().$this->config->item("rg_edit");?>" align="absmiddle" border="0" onClick="sendPost('hidform',{'bsId':<?php echo $row_bs->bsId;?>},'<?php echo site_url($this->config->item('ea_folder').'basedata/basesalary_input');?>')" /></td>
                 <td align="center">
                 <img class="hand" src="<?php echo base_url().$this->config->item("rg_delete");?>" align="absmiddle" border="0" onClick="confirmDel2({bsId:<?php echo $row_bs->bsId;?>}, 'm_form1','<?php echo site_url($this->config->item('ea_folder').'basedata/basesalary_delete');?>')" /></td>
 <?php
             $i++;
         }
     } else {
 ?>
             <tr>
                 <td colspan="7" align="center"><span class="error">** ไม่ปรากฏรายการในฐานข้อมูล **</span></td>
             </tr>
 <?php
     }
 ?>
         </table></td>
     </tr>
     <tr>
         <td align="right">รวม <?php echo $i;?> รายการ</td>
     </tr>
     <tr>
         <td><table class="mark">
             <tr>
                 <td class="coltd_mark"><span class="error"><b>หมายเหตุ :</b></span></td>
                 <td><span class="error">* หมายถึง ต้องกรอกข้อมูลให้สมบูรณ์</span></td>
             </tr>
         </table></td>
     </tr>
 </table>
  |