Viewing file: v_add_rodo.php (7.72 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"> 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 rd_id = jQuery("#rd_id").val(); if (rd_id == '') { tlist1.update(); }
if(action==undefined){ jQuery("#myform").submit(); }else{ jQuery("#myform2").submit(); } } </script> <?php $row_rd = isset($qu_rd) ? $qu_rd->row() : NULL;
$attributes = array('id' => 'myform', 'name' => 'myform'); echo form_open($this->config->item('sa_folder').'military/rd_insert_update', $attributes); ?> <table width="100%" border="0"> <tr> <td align="center"> <table width="60%" border="0"> <tr> <th align="center">บันทึกประวัติการศึกษาวิชาทหาร</th> </tr> <tr> <td align="center"><br /> <table class="szone2" width="100%" border="0">
<?php if (isset($qu_rd)) { ?> <tr> <th align="left">รหัส/ชื่อ-สกุลนักศึกษา</th> <td><?php echo getval('stdCode', $row_rd).': '.getval('stdName', $row_rd).' '.getval('stdSurname', $row_rd);?> <input type="hidden" id="std" name="std" value="<?=getval('stdCode', $row_rd).': '.getval('stdName', $row_rd).' '.getval('stdSurname', $row_rd).'###';?>" /> <span class="error"><?php echo form_error('std');?></span> </td> </tr> <?php } else { ?> <tr> <th align="left">รหัส/ชื่อ-สกุลนักศึกษา</th> <td><input type="text" id="wk11_co" name="wk11_co" value="" /> <div id="wk11_auto"> <div class="default">กรุณากรอกรหัส/ชื่อ-สกุลนักศึกษา</div> <ul class="feed"></ul> </div> <span class="error"><?php echo form_error('wk11_co');?></span></td> </tr> <?php } ?> <tr> <th align="left">ชั้นปีที่ศึกษาวิชาทหาร</th> <td align="left"><input type="text" id="rd_grade" name="rd_grade" value="<?php echo getval('rd_grade', $row_rd);?>" size="1" maxlength="1" class="required-int" /> <span class="error">* <?php echo form_error('rd_grade');?></span></td> </tr> <tr> <th align="left">วันที่ศึกษา</th> <td align="left"><script>DateInput('rd_date', true, 'DD/MM/YYYY',"<?php echo set_value('rd_date') ? set_value('rd_date') : splitDateDb2(getval('rd_date', $row_rd, getNowDate()), '/');?>");</script> <span class="error"><?php echo form_error('rd_date');?></span></td> </tr> <tr> <th align="left">เวลาศึกษา</th> <td align="left"><input type="text" id="hh_fr_time" name="hh_fr_time" value="<?php echo set_value('hh_fr_time', substr(getval('rd_fr_time', $row_rd), 0, 2));?>" size="2" maxlength="2" class="required-int" />:<input type="text" id="ii_fr_time" name="ii_fr_time" value="<?php echo set_value('ii_fr_time', substr('00'.substr(getval('rd_fr_time', $row_rd), 3, 2), -2));?>" size="2" maxlength="2" class="required-int" /> - <input type="text" id="hh_to_time" name="hh_to_time" value="<?php echo set_value('hh_to_time', substr(getval('rd_to_time', $row_rd), 0, 2));?>" size="2" maxlength="2" class="required-int" />:<input type="text" id="ii_to_time" name="ii_to_time" value="<?php echo set_value('ii_to_time', substr('00'.substr(getval('rd_to_time', $row_rd), 3, 2), -2));?>" size="2" maxlength="2" class="required-int" /> <span class="error">* <?php echo form_error('hh_fr_time') ? form_error('hh_fr_time') : form_error('hh_to_time'); echo form_error('ii_fr_time') ? form_error('ii_fr_time') : form_error('ii_to_time');?></span></td> </tr> <tr> <th align="left">สถานที่ศึกษา</th> <td align="left"><input type="text" id="rd_place" name="rd_place" value="<?php echo getval('rd_place', $row_rd);?>" /> <span class="error">* <?php echo form_error('rd_place');?></span></td> </tr> <tr> <td colspan="2" align="center"> <input type="hidden" id="rd_id" name="rd_id" value="<?php echo getval('rd_id', $row_rd);?>" /> <input type="button" id="btnSubmit" name="btnSubmit" value="บันทึก" onClick="do_submit();" /> <input type="submit" id="btnCancel" name="btnCancel" value="ยกเลิก" /> </td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <?php echo form_close();
$attributes = array('id' => 'myform2', 'name' => 'myform2'); echo form_open($this->config->item('sa_folder').'military/rd_input', $attributes); ?> <div align='right'>รหัส/ชื่อ-สกุลนักศึกษา : <input type="text" id="v_search" name="v_search" value="<?=$v_search;?>" /><input type="button" id="btnSearch" name="btnSearch" value="ค้นหา" onClick="do_submit('<?php echo site_url($this->config->item('sa_folder').'military/rd_input');?>')" /></div> <?php echo form_close();?> <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> </tr> </thead> <tbody> <?php $i = 1; if (isset($rs_rd)) { foreach ($rs_rd->result() as $row_rd) { ?> <tr > <td height="22" align="center"><?php echo $i;?></td> <td align="center"><?php echo $row_rd->stdCode;?></td> <td><?php echo $row_rd->prefixName.$row_rd->stdName.' '.$row_rd->stdSurname;?></td> <td align="center"><?php echo $row_rd->rd_grade;?></td> <td align="center"><?php echo abbreDate2($row_rd->rd_date);?></td> <td align="center"><?php echo substr($row_rd->rd_fr_time, 0, 5).' - '.substr($row_rd->rd_to_time, 0, 5);?></td> <td><?php echo $row_rd->rd_place;?></td> <td align="center"><span class="hand" onClick="sendPost('myform', {'rd_id':<?php echo $row_rd->rd_id;?>}, 'rd_input')"><?php echo img($this->config->item('sa_image_reply'));?></span></td> <td align="center"><span class="hand" onClick="if (confirm('ต้องการลบใช่หรือไม่')) { sendPost('hidform', {'rd_id':<?php echo $row_rd->rd_id;?>}, 'rd_delete'); }"><?php echo img($this->config->item('sa_image_del'));?></span></td> </tr> <?php $i++; } }
if ($i == 1) { ?> <tr class="notfound"> <td colspan="9" align="center"><?php echo $this->config->item('sa_not_found');?></td> </tr> <?php } ?> </tbody> </table>
|