Viewing file: v_addDomitoryFeeTp.php (6.44 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php $row_dft = (isset($qu_dft) && $qu_dft!=NULL) ? $qu_dft->row() : NULL; $row_sp = (isset($qu_sp) && $qu_sp!=NULL) ? $qu_sp->row() : NULL; $tmp = $this->input->post('dmRmId'); ?> <script> jQuery(document).ready(function(){ change_dm (); });
function change_dm () { var dmId = jQuery("#dmId").val(); var tmp_rm = '<?echo $tmp;?>'; if(dmId!=""){ var url = "<?php echo site_url($this->config->item('rg_folder'));?>/fee/getDmRm/"+dmId; xmlhttp = newXmlHttp(); xmlhttp.open("GET", url, false); xmlhttp.send(null); if (xmlhttp.readyState==4 && xmlhttp.status==200) { var ret_text = xmlhttp.responseText; document.getElementById('showDmRm').innerHTML= ret_text; if(tmp_rm!=''){ jQuery("#dmRmId").val(tmp_rm); } } } } </script> <table width="100%"> <tr> <td><div align="center"> <table width="100%"> <tr> <td colspan="2"><?php echo form_open($this->config->item("rg_folder")."fee/dft_insert_update", array("name" => "myform", "id" => "myform"));?> <table class="szone"> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">ปีการศึกษา</td> <td><input type="text" name="acY" id="acY" value="<?php echo $acY;?>" class="input2" /></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">ภาคการศึกษา</td> <td><input type="text" name="tmId" id="tmId" value="<?php echo $tmId;?>" class="input2" /></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">หอพัก</td> <td> <?php if ($row_dft==NULL){ $js = "id=\"dmId\" onChange=\"change_dm()\""; echo form_dropdown('dftDmId', $rs_dm, setValue('dftDmId', $row_dft, $flg), $js); ?> <span class="error"> *<?php echo form_error('dftDmId');?></span> <?php }else{ echo (setValue('plBuilding', $row_dft)=="")? setValue('hwName1', $row_dft):setValue('hwName', $row_sp); ?> <input type="hidden" name="dftDmId" id="dmId" value="<?php echo (setValue('plBuilding', $row_dft)=="")? setValue('dftDmId', $row_dft):setValue('dftDmId', $row_sp);?>" /> <?php } ?> </td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">ห้องพัก</td> <td> <?if ($row_dft==NULL) {?> <div id="showDmRm"></div><span class="error"><?php echo form_error('dmRmId');?></span> <input type="checkbox" id="eq" name="eq" value="1" /> ราคาเท่ากันทุกห้องพักในหอพักนี้ <?} else if(!is_null($type)){ echo setValue('hwName2', $row_dft); ?> <input type="hidden" name="dftDmId" id="dmId" value="<?php echo setValue('dftDmId', $row_dft);?>" /> <input type="hidden" name="method" id="method" value="edit" /> <?}?></td> <tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">จำนวนเงิน (บาท/เดือน)</td> <td><input type="text" name="dftAmt" id="dftAmt" size="5" maxlength="5" class="required-int" value="<?php echo setValue('dftAmt',$row_dft,$flg);?>"/> <span class="error"> <?php echo form_error('dftAmt');?></span></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td colspan="3" align="center"> <input type="submit" name="add" id="add" value="บันทึก" /> <input type="reset" name="clear" id="clear" value="เคลียร์ข้อมูล" /> <input type="hidden" name="flg_update" id="flg_update" value="<?php echo ($row_dft!=NULL) ? 1 : '';?>" /></td> </tr> </table><?php echo form_close();?></td> <tr> <tr> <td colspan="2"><table class="headCol"> <tr> <th class="seqCol"><font color="<?php echo $font_color_table;?>">ลำดับที่</font></th> <th><font color="<?php echo $font_color_table;?>">หอพัก/ห้องพัก</font></th> <th class="amtCol"><font color="<?php echo $font_color_table;?>">จำนวนเงิน<br />(บาท/เดือน)</font></th> <th class="editCol"><font color="<?php echo $font_color_table;?>">แก้ไข</font></th> <th class="deleteCol"><font color="<?php echo $font_color_table;?>">ลบ</font></th> </tr> <?php $i = 0; if(isset($rs_dft) && $rs_dft->num_rows()) { foreach($rs_dft->result() as $row_dft) { echo "<tr onmouseover=\"bgColor='".$tr_color_even."'\" onmouseout=\"bgColor='".$this->config->item("rg_mouseout")."'\">"; ?> <td align="center"><font size="2"><?php echo $i+1;;?></font></td> <td class="indent"><font size="2"><?php echo $row_dft->hwName2.' '.$row_dft->hwName1;?></font></td> <td align="right"><font size="2"><?php echo number_format($row_dft->dftAmt, 2);?></font></td> <td align="center"><img src="<?php echo base_url().$this->config->item("rg_edit");?>" align="absmiddle" border="0" class="hand" onClick="sendPost('hidform', {'acY':<?php echo $row_dft->dftAcY;?>, 'tmId':<?php echo $row_dft->dftTmId;?>, 'dmId':<?php echo $row_dft->dftDmId;?>}, '<?php echo site_url($this->config->item('rg_folder').'fee/dft_input');?>')" /></td> <td align="center"> <span onClick="confirmDel2( {'acY':<?php echo $row_dft->dftAcY;?>, 'tmId':<?php echo $row_dft->dftTmId;?>, 'dmId':<?php echo $row_dft->dftDmId;?>}, 'm_form1','<?php echo site_url($this->config->item('rg_folder').'fee/dft_delete');?>')" /><img src="<?php echo base_url().$this->config->item("rg_delete");?>" align="absmiddle" border="0" width="16" height="19" class="hand"/></span></td> </tr> <?php $i++; } } else { ?> <tr> <td colspan="5" align="center"><font size="2" color="<?php echo $font_color_err;?>">** ไม่ปรากฏรายการในฐานข้อมูล **</font></td> </tr> <?php } ?> </table></td> </tr> <tr> <td><input type="button" name="back" id="back" value="ย้อนกลับ" onclick="location.href='<?php echo site_url($this->config->item('rg_folder')).'/fee/showDomitoryFeeTp';?>'"/></td> <td align="right"><font size="2">รวม <?php echo $i;?> รายการ</font></td> </tr> </table></div> <br><font size="2" color="<?php echo $font_color_err;?>"><b>หมายเหตุ : </b>* หมายถึง ต้องกรอกข้อมูลให้สมบูรณ์</font></td> </tr> </table>
|