Viewing file: v_add_borrow.php (11.41 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="<?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"> 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 (id,action) { if(id!="btnSearch"){ if(jQuery("ul.holder li.bit-box").size()>1){ alert("สามารถเพิ่มข้อมูลได้ทีละ 1 คนเท่านั้น"); jQuery("#anonymous_element_2").focus(); jQuery("#anonymous_element_2").select(); return false; } } if (action) { jQuery("#myform").attr('action', action); }
var brw_id = jQuery("#brw_id").val(); if (brw_id == '') { tlist1.update(); }
if(action==undefined){ jQuery("#myform").submit(); }else{ jQuery("#myform2").submit(); } } jQuery(function($) { var aurl = "<?php echo site_url($this->config->item("sa_folder"));?>/borrow/getBrw_source/"; jQuery(":text[id^='brw_source']").autocomplete(aurl+'2', { selectFirst: false }); jQuery(":text[id^='brw_scholarship']").autocomplete(aurl+'1', { selectFirst: false }); jQuery(":text[id^='brw_type']").autocomplete(aurl+'3', { selectFirst: false }); /*$("form").submit(function() { if(jQuery("ul.holder li.bit-box").size()>1){ alert("สามารถเพิ่มข้อมูลได้ทีละ 1 คนเท่านั้น"); jQuery("#anonymous_element_2").focus(); jQuery("#anonymous_element_2").select(); return false; } });*/ });
</script> <?php $row_brw = isset($qu_brw) ? $qu_brw->row() : NULL;
$attributes = array('id' => 'myform', 'name' => 'myform'); echo form_open($this->config->item('sa_folder').'borrow/brw_insert_update', $attributes); ?> <table width="100%" border="0"> <tr> <td align="center"> <table width="60%" border="0"> <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"> <?php if (isset($qu_brw)) { ?> <tr> <th>รหัส/ชื่อ-สกุลนักศึกษา</th> <td><?php echo getval('stdCode', $row_brw).': '.getval('stdName', $row_brw).' '.getval('stdSurname', $row_brw);?> <input type="hidden" id="std" name="std" value="<?php echo getval('stdCode', $row_brw).': '.getval('stdName', $row_brw).' '.getval('stdSurname', $row_brw).'###';?>" /></td> </tr> <?php } else { ?> <tr> <th>รหัส/ชื่อ-สกุลนักศึกษา</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>เลขที่คำร้องขอรับทุน</th> <td ><input type="text" id="brw_req_no" name="brw_req_no" value="<?php echo set_value('brw_req_no', getval('brw_req_no', $row_brw));?>" /> <span class="error">* <?php echo form_error('brw_req_no');?></span></td> </tr> <tr> <th>เลขที่สัญญา</th> <td ><input type="text" id="brw_no" name="brw_no" value="<?php echo set_value('brw_no', getval('brw_no',$row_brw));?>" /></td> </tr> <tr> <th>ชื่อทุน</th> <td ><input type="text" id="brw_scholarship" name="brw_scholarship" value="<?php echo set_value('brw_scholarship', getval('brw_scholarship', $row_brw));?>" /> <span class="error">* <?php echo form_error('brw_scholarship');?></span></td> </tr> <tr> <th>แหล่งทุน/หน่วยงาน</th> <td ><input type="text" id="brw_source" name="brw_source" value="<?php echo set_value('brw_source', getval('brw_source', $row_brw));?>" /> <span class="error">* <?php echo form_error('brw_source');?></span></td> </tr> <tr> <th>ประเภททุน</th> <td ><input type="text" id="brw_type" name="brw_type" value="<?php echo set_value('brw_type', getval('brw_type', $row_brw));?>" /> <span class="error">* <?php echo form_error('brw_type');?></span></td> </tr> <tr> <th>จำนวนเงิน</th> <td ><input type="text" id="brw_amt" name="brw_amt" value="<?php echo set_value('brw_amt', getval('brw_amt', $row_brw));?>" class="required-float" /> <span class="error"> <?php echo form_error('brw_amt');?></span></td> </tr> <tr> <th>ปีการศึกษาที่ขอกู้ยืม</th> <td ><input type="text" id="brw_acY" name="brw_acY" size="5" maxlength="4" value="<?php echo set_value('brw_acY', (getval('brw_acY', $row_brw)!="")? getval('brw_acY', $row_brw):$this->session->userdata('acY'));?>" /> <span class="error">* <?php echo form_error('brw_acY');?></span></td> </tr> <tr> <th>ภาคการศึกษาที่ขอกู้ยืม</th> <td ><?echo form_dropdown('brw_tmId', $rs_tm, set_value('brw_tmId', (getval('brw_tmId', $row_brw)!="")? getval('brw_tmId', $row_brw):$this->session->userdata('tmId')));?> <span class="error">* <?php echo form_error('brw_tmId');?></span></td> </tr> <tr> <th>วันที่ได้รับทุน</th> <td ><script>DateInput('brw_receive_date', true, 'DD/MM/YYYY',"<?php echo set_value('brw_receive_date') ? set_value('brw_receive_date') : splitDateDb2(getval('brw_receive_date', $row_brw, getNowDate()), '/');?>");</script> <span class="error"><?php echo form_error('brw_receive_date');?></span></td> </tr> <tr> <th>สถานะการได้รับทุน</th> <td ><input type="text" id="brw_status" name="brw_status" value="<?php echo set_value('brw_status', getval('brw_status', $row_brw));?>" /> <span class="error">* <?php echo form_error('brw_status');?></span></td> </tr> <tr> <th>หมายเหตุ</th> <td ><input type="text" id="brw_note" name="brw_note" value="<?php echo set_value('brw_note', getval('brw_note', $row_brw));?>" /></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="brw_id" name="brw_id" value="<?php echo getval('brw_id', $row_brw);?>" /></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').'borrow/brw_input', $attributes); ?> <div align='right'>ปีการศึกษาที่ขอกู้ยืม: <input type="text" id="acY_search" name="acY_search" size="5" maxlength="4" value="<?php echo $acY_search ? $acY_search : $this->session->userdata('acY');?>" /> ภาคการศึกษาที่ขอกู้ยืม: <?echo form_dropdown('tmId_search', $rs_tm, $tmId_search ? $tmId_search : $this->session->userdata('tmId'));?> รหัส/ชื่อ-สกุลนักศึกษา : <input type="text" id="v_search" name="v_search" value="<?=$v_search;?>" /><input type="button" id="btnSearch" name="btnSearch" value="ค้นหา" onClick="do_submit('btnSearch','<?php echo site_url($this->config->item('sa_folder').'borrow/brw_input');?>')" /></div> <?php echo form_close();?> <table class="tb_1" width="100%" onload="do_submit('btnSearch','<?php echo site_url($this->config->item('sa_folder').'borrow/brw_input');?>')"> <thead> <tr> <th>ลำดับ</th> <th>รหัสนักศึกษา</th> <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_brw)) { foreach ($rs_brw->result() as $row_brw) { ?> <tr > <td height="22" align="center"><?php echo $i;?></td> <td align="center"><?php echo $row_brw->stdCode;?></td> <td><?php echo $row_brw->prefixName.$row_brw->stdName.' '.$row_brw->stdSurname;?></td> <td><?php echo $row_brw->brw_req_no;?></td> <td><?php echo $row_brw->brw_no;?></td> <td><?php echo $row_brw->brw_scholarship;?></td> <td><?php echo $row_brw->brw_source;?></td> <td><?php echo $row_brw->brw_type;?></td> <td align="right"><?php echo number_format($row_brw->brw_amt, 2);?></td> <td align="center"><?php echo abbreDate2($row_brw->brw_receive_date);?></td> <td><?php echo $row_brw->brw_status;?></td> <td align="center"><span class="hand" onClick="sendPost('myform', {'brw_id':'<?php echo $row_brw->brw_id;?>','brw_receive_date':'<?php echo $row_brw->brw_receive_date;?>'}, 'brw_input')"><?php echo img($this->config->item('sa_image_reply'));?></span></td> <td align="center"><span class="hand" onClick="if (confirm('ต้องการลบใช่หรือไม่')) { sendPost('hidform', {'brw_id':<?php echo $row_brw->brw_id;?>}, 'brw_delete'); }"><?php echo img($this->config->item('sa_image_del'));?></span></td> </tr> <?php $i++; } }
if ($i == 1) { ?> <tr class="notfound"> <td colspan="13"><?php echo $this->config->item('sa_not_found');?></td> </tr> <?php } ?> <tr> <td colspan="8" align="center"><strong>ผลรวมจำนวนเงินการกู้ยืม<strong></td> <td colspan="5" align="right"><span><?php echo number_format($qu_brw->row()->sumAmt, 2);?></span></td> <tr> </tbody> </table>
|