Viewing file:      v_add_strategic.php (4.28 KB)      -rwxr-xr-x Select action/file-type:    (+) |   (+) |   (+) | Code (+) | Session (+) |   (+) | SDB (+) |   (+) |   (+) |   (+) |   (+) |   (+) |
 
<script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" ></script>
 <script language="javascript" >
     $(document).ready(function(){
         var seq = $("#stg_seq").attr('value');
         if (seq =='') {
             var number = parseInt($("#table_show tr:last").children("td:first-child").text())+1 ;
             if(isNaN(number)){ number=1; }
             $("#stg_seq").attr('value',number);
         }
     });
 </script>
 <script language="javascript">
     function doSubmit(){
 
         for (var i=0; i < 2; i++)
         {
            if (document.myform.stg_status[i].checked)
            {
               var stg_status = document.myform.stg_status[i].value;
             }
         }
         document.myform.stg_status.value = stg_status;
         document.myform.submit();
     }
 
     function do_delete_stg(id,type){
         var answer = confirm("ต้องการลบใช่หรือไม่");
         alert(answer);
         if (answer){
             alert(document.myform.action);
             alert('answer='+answer);
             document.myform.action = 'esa/base_data/del_stg';
             document.myform.stg_id.value = id;
             document.myform.stg_type.value = type;
             document.myform.submit();
         }
 
         return false;
     }
 
     function do_submit (action) {
         if (action) {
             jQuery("#myform").attr('action', action);
         }
 
         jQuery("#myform").submit();
     }
 </script>
 <?php 
     $attributes = array('id' => 'myform', 'name' => 'myform');
     echo form_open($this->config->item('sa_folder').'base_data/add_strategic', $attributes);?>
 <table id="table_input" class='szone2' width="60%" border="0">
     <tr>
         <th >ปีงบประมาณ</th>
         <td><?=form_dropdown('stg_ib', $qu_ib, getval('stg_ib', $stg)); ?>
             <?php echo form_error('stg_ib'); ?>
         </td>
     </tr>
     <tr>
         <th>ประเด็นยุทธศาสตร์ที่</th>
         <td width="80%" >
             <input type="text" name="stg_seq" id="stg_seq" value="<?php echo getval('stg_seq', $stg);?>" size="4" />
             <input type="hidden" name="stg_id" value="<?php echo getval('stg_id', $stg);?>" />
             <input type="hidden" name="stg_type" value="1"/>
             <input type="text" name="stg_name" id="stg_name" value="<?php echo getval('stg_name', $stg);?>" size="70" /> <font color='red'>*</font>
             <?php echo form_error('stg_seq'); ?>
             <?php echo isset($error_seq)? $error_seq : '' ;?>
             <?php echo form_error('stg_name'); ?>
             <?php echo isset($error_name)? $error_name : '' ;?>
         </td>
         </td>
     </tr>
     <tr class='szone2'>
         <td colspan="2" align="center">
         <input type="submit" name="add" value="เพิ่ม" /></td>
     </tr>
 </table>
 <br>
 <div align='right'>ปีงบประมาณ : <?=form_dropdown('v_search', $qu_ib, $v_search); ?> <input type="button" id="btnSearch" name="btnSearch" value="ค้นหา" onClick="do_submit('<?php echo site_url($this->config->item('sa_folder').'base_data/strategic');?>')" /></div>
 <table id="table_show" class='tb_1' width="60%" border="0">
 
     <tr>
         <th >ประเด็นยุทธศาสตร์ที่</th>
         <th >ปีงบประมาณ</th>
         <th width="10%">แก้ไข</th>
         <th width="5%">ลบ</th>
     </tr>
 <?php 
 if ($rs_stg->num_rows > 0) {
     $index=1;
     foreach ($rs_stg->result() as $row) {
 ?>
     <tr>
         <td align="left"> <font size="2"><?php echo $row->stg_seq;?> <?php echo $row->stg_name;?></b></font></td>
         <td align="center"><?php echo $row->stg_ib;?></td>
         <td align="center"><span class="hand" onClick="sendPost('myform', {'stg_id':<?php echo $row->stg_id;?>}, 'strategic')"><?php echo img($this->config->item('sa_image_reply'));?></span></td>
         <td align="center"><span class="hand" onClick="if (confirm('ต้องการลบใช่หรือไม่')) { sendPost('hidform', {'stg_id':<?php echo $row->stg_id;?>}, 'del_stg'); }"><?php echo img($this->config->item('sa_image_del'));?></td>
     </tr>
 <?php 
         $index++;
     }
 } else {
 ?>
     <tr class="notfound">
         <td colspan="4" >ไม่พบประเด็นยุทธ์ศาสตร์</td>
     </tr>
 <?php 
 }
 ?>
 </table>
 <?php echo form_close();?>
 <br>
  |