Viewing file: v_report_health.php (8.26 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<link rel="stylesheet" href="<?=base_url();?>/js/textboxlist_proto/textboxlist.css" type="text/css" media="screen" title="Test Stylesheet" charset="utf-8" /> <script src="<?=base_url();?>/js/textboxlist_proto/protoculous-effects-shrinkvars.js" type="text/javascript" charset="utf-8"></script> <script src="<?=base_url();?>/js/textboxlist_proto/textboxlist.js" type="text/javascript" charset="utf-8"></script> <script src="<?=base_url();?>/js/textboxlist_proto/textboxlistauto.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" src="<?=base_url()."fancybox/jquery.mousewheel-3.0.4.pack.js"?>"></script> <script type="text/javascript" src="<?=base_url()."fancybox/jquery.fancybox-1.3.4.pack.js"?>"></script> <link rel="stylesheet" type="text/css" href="<?=base_url()."fancybox/jquery.fancybox-1.3.4.css"?>" media="screen" /> <script type="text/javascript"> document.observe('dom:loaded', function() { // init tlist1 = new FacebookList('wk11_co', 'wk11_auto'); var get_user_list_url = "<?php echo site_url($this->config->item('sa_folder').'search/get_std_list')?>"; // fetch and feed new Ajax.Request(get_user_list_url, { onSuccess: function(transport) { transport.responseText.evalJSON(true).each(function(t){tlist1.autoFeed(t)}); } }); });
Element.addMethods({ onBoxDispose: function(item,obj) { obj.autoFeed(item.retrieveData('text')); }, onInputFocus: function(el,obj) { obj.autoShow(); }, onInputBlur: function(el,obj) { obj.lastinput = el; obj.blurhide = obj.autoHide.bind(obj).delay(0.1); }, filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B]);}}return C;} });
function do_submit (action) { if (action) { jQuery("#myform").attr('action', action); }
var hth_id = jQuery("#hth_id").val(); if (hth_id == '') { tlist1.update(); } if(jQuery("#bmi_set").val()==""){ alert("กรุณาเลือกชุดดัชนีมวลกาย"); return false; } var hi = parseFloat(jQuery("#hth_height").val())/100; var we = parseFloat(jQuery("#hth_weight").val()); var bmi = we/(hi*hi); var url = "<?php echo site_url($this->config->item('sa_folder').'health/check_bmi')?>"; var flash = 0; jQuery.ajax({ type: "POST", async: false, url: url, global: true, data: "ran="+Math.random()+"&bmi="+bmi+"&set="+jQuery("#bmi_set").val(), //dataType: "json", //dataCharset: 'json', success: function(res){ if(res=="N"){ flash++ } } }); if(flash!=0){ alert("ค่าดัชนีมวลกายเท่ากับ "+bmi+" ไม่ตรงกับข้อมูลในชุดดัชนีมวลกาย"); return false; }
jQuery("#myform").submit(); }
jQuery(function() { jQuery(".various1").fancybox({ 'autoDimensions' : false, 'width' : '50%', 'height' : 'auto', 'onStart' : function() { jQuery.ajax({ url: "<?echo site_url()."/".$this->config->item('sa_folder');?>health/loadBmiTB", global: false, type: "POST", data: "grp="+jQuery.trim(jQuery("#bmi_set").val())+"&ran="+Math.random(), dataType: "json", dataCharset: 'json', async:false, success: function(data) { if(data.length>0){ jQuery('#inline1').html(data[0].tb); }else{ alert("ไม่พบข้อมูลดัชนีมวลกาย"); } } }); } });
checkLoad(); jQuery("#bmi_set").change(function(){ if(this.value==""){ jQuery(".various1").hide(); }else{ jQuery(".various1").show(); } }); });
function checkLoad(){ if(this.value==null){ jQuery(".various1").hide(); } var bmi = "<?echo isset($qu_bmi2) ? "OK": NULL;?>"; if(bmi=="OK"){ jQuery(".various1").show(); } } </script> <?php $row_hth = isset($qu_hth) ? $qu_hth->row() : NULL; $row_bmi2 = isset($qu_bmi2) ? $qu_bmi2->row() : NULL;
$attributes = array('id' => 'myform', 'name' => 'myform'); echo form_open($this->config->item('sa_folder').'health/hth_insert_update', $attributes); ?> <table width="100%" border="0"> <tr> <td align="center"> <table width="60%" border="0"> <tr> <th colspan="2" align="center"><span>บันทึกประวัติสุขภาพและป่วยเป็นโรค</span></th> </tr> <tr> <td><br /></td> </tr> <tr> <td > <table class="szone2" width="100%" border="0"> <tr> <th>สถานะการนอนรักษาตัว <?echo getval('hth_pd', $row_hth);?></th> <td><input type="checkbox" id="hth_pd" name="hth_pd" value="IPD" <?php echo (getval('hth_pd', $row_hth)=="IPD")? "checked":set_checkbox('hth_pd', getval('hth_pd', $row_hth)); ?>> IPD</td> </tr> <tr> <th>ชุดดัชนีมวลกาย</th> <td><? $js = 'id="bmi_set"'; $re = (getval('hth_result_BMI', $row_hth)!=0)? set_value('bmi_set', getval('bmi_group', $row_bmi2)):set_value('bmi_set', 'bmi_set'); echo form_dropdown('bmi_set', $qu_bmi,$re ,$js);?> <a class="various1" href="#inline1" title="ตารางแสดงชุดดัชนีมวลกาย" target="top"><?php echo img($this->config->item('sa_image_show_health'));?></a><span class="error"><?php echo form_error('bmi_set');?></span></td> </tr> <tr> <th>วันที่เริ่มต้น</th> <td><script>DateInput('hth_fr_date', true, 'DD/MM/YYYY',"<?php echo set_value('hth_fr_date') ? set_value('hth_fr_date') : splitDateDb2(getval('hth_fr_date', $row_hth, getNowDate()), '/');?>");</script> <span class="error"><?php echo form_error('hth_fr_date');?></span></td> </tr> <tr> <th>วันที่สิ้นสุด</th> <td><script>DateInput('hth_to_date', true, 'DD/MM/YYYY',"<?php echo set_value('hth_to_date') ? set_value('hth_to_date') : splitDateDb2(getval('hth_to_date', $row_hth, getNowDate()), '/');?>");</script> <span class="error"><?php echo form_error('hth_to_date');?></span></td> </tr> <tr> <td colspan="2" align="center"><input type="button" id="btnSubmit" name="btnSubmit" value="แสดง" onClick="do_submit()" /> <input type="submit" id="btnCancel" name="btnCancel" value="ยกเลิก" /> <input type="hidden" id="hth_id" name="hth_id" value="<?php echo getval('hth_id', $row_hth);?>" /></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <table class="tb_1" width="100%"> <thead> <tr> <th>ลำดับ</th> <!--<th>รหัสนักศึกษา</th>!--> <th>ชื่อ-สกุลนักศึกษา</th> <th>ป่วยเป็นโรค</th> <!--<th>การรักษา</th> <th>วิธีการรักษา</th>!--> <th>สถานที่รักษา</th> <th>วันที่เริ่มต้น</th> <th>วันที่สิ้นสุด</th> <th>แก้ไข</th> <th>ลบ</th> </tr> </thead> <tbody> <?php $i = 1; if (isset($rs_hth)) { foreach ($rs_hth->result() as $row_hth) { ?> <tr > <td height="22" align="center"><?php echo $i;?></td> <!--<td align="center"><?php echo $row_hth->stdCode;?></td>!--> <td><?php echo $row_hth->stdCode.' '.$row_hth->prefixName.$row_hth->stdName.' '.$row_hth->stdSurname;?></td> <td><?php echo $row_hth->hth_disease.'/'.$row_hth->hth_symptom;?></td> <!--<td><?php echo $row_hth->hth_treatment;?></td> <td><?php echo $row_hth->hth_result_diagnose;?></td>!--> <td><?php echo $row_hth->hth_place;?></td> <td align="center"><?php echo abbreDate2($row_hth->hth_fr_date);?></td> <td align="center"><?php echo abbreDate2($row_hth->hth_to_date);?></td> <td align="center"><span class="hand" onClick="sendPost('myform', {'hth_id':<?php echo $row_hth->hth_id;?>}, 'hth_input')"><?php echo img($this->config->item('sa_image_reply'));?></span></td> <td align="center"><span class="hand" onClick="if (confirm('ต้องการลบใช่หรือไม่')) { sendPost('hidform', {'hth_id':<?php echo $row_hth->hth_id;?>}, 'hth_delete'); }"><?php echo img($this->config->item('sa_image_del'));?></span></td> </tr> <?php $i++; } }
if ($i == 1) { ?> <tr class="notfound"> <td colspan="11"><?php echo $this->config->item('sa_not_found');?></td> </tr> <?php } ?> </tbody> </table> <?php echo form_close();?> <!--dialog!--> <div style="display: none;"> <div id="inline1" align="center"> </div> </div>
|