Viewing file: v_add_bmi.php (5.65 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<script type="text/javascript" src="<?php echo base_url();?>js/auto_cp/jquery.autocomplete.js"></script> <?php echo link_tag('js/auto_cp/jquery.autocomplete.css');?> <script type="text/javascript"> function do_submit (action) { if (action) { jQuery("#myform").attr('action', action); } jQuery("#myform").submit(); } function direct(){ window.location.href = "<?echo site_url()."/".$this->config->item('sa_folder').'base_data/input_bmi';?>"; } /*jQuery(function($) { var aurl = "<?php echo site_url($this->config->item("sa_folder"));?>/borrow/getBrw_source/"; jQuery(":text[id^='brw_source']").autocomplete(aurl, { selectFirst: false }); });*/ </script> <?php $row_bmi = isset($qu_bmi) ? $qu_bmi->row() : NULL;
$attributes = array('id' => 'myform', 'name' => 'myform'); echo form_open($this->config->item('sa_folder').'base_data/bmi_insert_update', $attributes); ?> <table width="60%" border="0" align="center"> <tr> <th colspan="2" align="center">บันทึกกลุ่มดัชนีมวลกาย</th> </tr> <tr> <td colspan="2" align="center"> </td> </tr> <tr> <td ><table class="szone2" width="100%" border="0"> <tr> <th>ชื่อกลุ่มดัชนีมวลกาย</th> <td colspan="2"><input type="text" id="bmi_group" name="bmi_group" value="<?php echo (isset($bmi_group))? $bmi_group:"";?>" /> <font color="red">* <?php echo form_error('bmi_group');?></font></td> </tr> <tr> <th>วันที่เริ่มใช้</th> <td colspan="2"><script>DateInput('bmi_fr_date', true, 'DD/MM/YYYY',"<?php echo ($bmi_fr_date!="")? $bmi_fr_date : splitDateDb2(getNowDate(), '/');?>");</script> <?php echo form_error('bmi_fr_date');?></td> </tr> <tr> <th>วันที่สิ้นสุด</th> <td><table> <tr> <td><input type="radio" name="check_end" id="check_end" value="now" <?echo ($bmi_to_date=="00/00/0000" or $check_end=="now" or $bmi_to_date=="")? "checked":""?> /> ปัจจุบัน</td> </tr> <tr> <td><input type="radio" name="check_end" id="check_end" value="define" <?echo ($bmi_to_date!="00/00/0000" and $bmi_to_date!="" and $check_end!="now")? "checked":""?> /> ระบุวันที่ <script>DateInput('bmi_to_date', true, 'DD/MM/YYYY',"<?php echo ($bmi_to_date!="00/00/0000" and $bmi_to_date!="") ? $bmi_to_date : splitDateDb2(getNowDate(), '/');?>");</script> <?php echo form_error('bmi_to_date');?></td> </tr> </table></td> </tr> <tr> <td colspan="2" align="center"> <?if($edit!=""){?> <input type="hidden" id="update" name="update" value="update" /> <input type="hidden" name="bmi_id" id="bmi_id" value="<?php echo setValue('bmi_id',$row_bmi);?>" /> <input type="hidden" id="old" name="old" value="<?php echo (isset($bmi_group))? $bmi_group:"";?>" /> <input type="button" id="btnSearch" name="btnSearch" value="บันทึก" onClick="do_submit('<?php echo site_url($this->config->item('sa_folder').'base_data/edit_bmi');?>')" /> <?}else{?> <input type="button" id="btnSubmit" name="btnSubmit" value="บันทึก" onClick="do_submit('<?php echo site_url($this->config->item('sa_folder').'base_data/input_bmi_tb');?>')" /> <?}?> <input type="hidden" id="edit" name="edit" value="<?php echo (isset($edit))? $edit:"";?>" /></td> </tr> </table></td> </tr> </table><?php echo form_close();?>
<table class="tb_1" width="100%"> <thead> <tr> <th>ลำดับ</th> <th>ชุดของดัชนีมวลกาย</th> <th>วันที่เริ่มใช้</th> <th>วันที่สิ้นสุด</th> <th width="15%">จัดการเกณฑ์ดัชนีมวลกาย</th> <th>แก้ไข</th> <th>ลบ</th> </tr> </thead> <tbody> <?php $i = 1; if (isset($rs_bmi)) { foreach ($rs_bmi->result() as $row_bmi) { $fr = explode("-",$row_bmi->bmi_fr_date); $to = explode("-",$row_bmi->bmi_to_date); ?> <tr > <td height="22" align="center"><?php echo $i;?></td> <td align="center"><?php echo $row_bmi->bmi_group;?></td> <td align="center"><?php echo abbreDate2($row_bmi->bmi_fr_date);?></td> <td align="center"><?php echo ($row_bmi->bmi_to_date=="0000-00-00")? "ปัจจุบัน":abbreDate2($row_bmi->bmi_to_date);?></td> <!--<td align="center"><span class="hand" onClick="sendPost('myform', {'brw_id':<?php echo $row_bmi->bmi_id;?>}, 'brw_input')"><?php echo img($this->config->item('sa_image_view'));?></td>!--> <td align="center"> <span class="hand" onClick="sendPost('myform', {'bmi_group':'<?php echo $row_bmi->bmi_group;?>','bmi_fr_date':'<?php echo $row_bmi->bmi_fr_date;?>','bmi_to_date':'<?php echo $row_bmi->bmi_to_date;?>','mng':'mng'}, 'input_bmi_tb')"> <?php echo img($this->config->item('sa_image_mng'));?></td> <td align="center"><span class="hand" onClick="sendPost('myform3', {'bmi_group':'<?php echo $row_bmi->bmi_group;?>','bmi_fr_date':'<?php echo $fr[2]."/".$fr[1]."/".$fr[0];?>','bmi_to_date':'<?php echo $to[2]."/".$to[1]."/".$to[0];?>','edit':'edit', 'bmi_id':<?php echo $row_bmi->bmi_id;?>}, 'input_bmi')"><?php echo img($this->config->item('sa_image_reply'));?></span></td> <td align="center"><span class="hand" onClick="if(confirm('ต้องการลบใช่หรือไม่')) { sendPost('hidform9', {'bmi_group':'<?php echo $row_bmi->bmi_group;?>'}, 'del_bmi'); }"><?php echo img($this->config->item('sa_image_del'));?></span></td> </tr> <?php $i++; } }
if ($i == 1) { ?> <tr class="notfound"> <td colspan="12"><?php echo $this->config->item('sa_not_found');?></td> </tr> <?php } ?> </tbody> </table>
|