Viewing file: v_paymentRegis.php (13.12 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<script language="JavaScript1.2"> function calLF() { var fref = document.myform; var payDate2 = fref.payDate2.value.split("/"); var payEDate = fref.payEDate.value.split("-"); var sDate = new Date(payDate2[2], payDate2[1]-1, payDate2[0]); var eDate = new Date(payEDate[0]-543, payEDate[1]-1, payEDate[2]); var miliSec = sDate.getTime() - eDate.getTime(); if(miliSec > 0) { var numDateDiff = Math.floor(miliSec / 86400000); var lateFine = 0; if(fref.lateFineUnit.value == "B") lateFine = numDateDiff * fref.lateFineRate.value; else if(fref.lateFineUnit.value == "P") lateFine = ((fref.payAmount.value * fref.lateFineRate.value) / 100) * numDateDiff; if(lateFine > fref.maxLateFine.value) lateFine = fref.maxLateFine.value;
fref.lateFine2.value = Math.floor((lateFine * 100) + 0.5) / 100; } }
function checkFormat(txtStart, txtEnd) { var mx = "<?php echo $this->config->item('rg_refNoPmNo_max');?>";
if(document.myform.refNoPmBook.value=="" || document.myform.refNoPmBook.value==0){ alert("กรุณากรอกเล่มที่ !!"); document.myform.refNoPmBook.focus(); return false; } if(document.myform.refNoPmNo.value=="" || document.myform.refNoPmNo.value==0){ alert("กรุณากรอกเลขที่ !!"); document.myform.refNoPmNo.focus(); return false; } if(document.myform.refNoPmNo.value > mx){ alert("กรุณากรอกเลขที่ 0-" + mx + " เท่านั้น !!"); document.myform.refNoPmNo.focus(); return false; } if (txtStart && txtEnd) { var oblen = txtStart.length; for (var i = 0; i < oblen; i++) { if (!isvaliddate(txtStart[i], txtEnd[i])) { return false; } } } return true; }
function isvaliddate (txtStart, txtEnd) { var retval = true; var ArrayStartDay = txtStart.split("/"); var ArrayStopDay = txtEnd.split("/"); var StartDay = ArrayStartDay[2] + ArrayStartDay[1] + ArrayStartDay[0]; var StopDay = ArrayStopDay[2] + ArrayStopDay[1] + ArrayStopDay[0]; if (StartDay > StopDay) { alert("วันที่ไม่ถูกต้อง"); retval = false; } return retval; } </script> <table width="100%"> <tr> <td><div align="center"> <?php echo form_open($this->config->item("rg_folder").'payment/'.(isset($action) ? $action : 'paymentRegis'), array("name" => "myform", "id" => "myform"));?> <table width="100%"> <tr> <td colspan='2' align="center"><span class="h error">ชำระค่าลงทะเบียนเรียนรายนักศึกษา</span></td> </tr> <tr> <td colspan='2'><br /></td> </tr> <tr> <td colspan='2'><table class='szone'> <?php $i=0; if (!isset($refNo)) { ?> <tr> <td colspan="4"><font size="2"><b>เลขที่ใบลงทะเบียน : </b></font> <input type="text" name="refNo" size="16" maxlength="16" /> <input type="submit" name="btnSearch" value="ค้นหา" /></td> </tr> <?php } else { if ($refNo == "") { ?> <tr> <td align="center"><span class='error'>** กรุณาตรวจสอบเลขที่ใบลงทะเบียนอีกครั้ง <a href="<?php //echo $PHP_SELF;?>">คลิกที่นี่ย้อนกลับ</a> **</span></td> </tr> <?php } else { $row_rf = $qu_rf->row(); $row_std = $qu_std->row(); $row_sd = isset($qu_sd) ? $qu_sd->row() : NULL; $row_crft = isset($qu_crft) ? $qu_crft->row() : NULL; ?> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">เลขที่ใบลงทะเบียน</td> <td colspan="3"><?php echo $refNo;?> <input type="hidden" name="rfId" value="<?php echo $row_rf->rfId;?>"></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">รหัสนักศึกษา</td> <td width="200"><?php echo $row_std->stdCode;?> <input type="hidden" name="stdId" value="<?php echo $row_std->stdId;?>" /></td> <td class="coltd_szone">ชื่อ-สกุล</td> <td width="230"><?php echo $row_std->prefixName.$row_std->stdName.' '.$row_std->stdSurname;?></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">หลักสูตร</td> <td colspan="3"><?php echo $row_std->curName;?> <input type="hidden" name="curId" value="<?php echo $row_std->stdCurId;?>" /></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">ระดับการศึกษา</td> <td><?php echo $row_std->levelName;?></td> <td class="coltd_szone">ชั้นปี</td> <td><?php echo $row_std->syCode;?></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone">ปีการศึกษา</td> <td><?php echo $acY_R;?> <input type="hidden" name="acY" value="<?php echo $acY;?>" /></td> <td class="coltd_szone">ภาคการศึกษา</td> <td><?php echo $tmId_R;?> <input type="hidden" name="tmId" value="<?php echo $tmId;?>" /></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td colspan="2" class="coltd_szone">ช่วงชำระค่าลงทะเบียนเรียน <?php if(!is_null($row_sd)) { echo abbreDate2(getval('sdPaySDate', $row_sd)).' - '.abbreDate2(getval('sdPayEDate', $row_sd)); }else echo 'ยังไม่กำหนดช่วงชำระค่าลงทะเบียนเรียน';?> <input type="hidden" name="sdPayEDate" value="<?php echo getval('sdPayEDate', $row_sd);?>" /></td> <td class="coltd_szone">เล่มที่/เลขที่</td> <td> <input type="text" name="refNoPmBook" size="<?php echo $this->config->item('rg_refNoPmBook_length');?>" maxlength="<?php echo $this->config->item('rg_refNoPmBook_length');?>" class="required-int" /> / <input type="text" name="refNoPmNo" size="<?php echo strlen($this->config->item('rg_refNoPmNo_max'));?>" maxlength="<?php echo strlen($this->config->item('rg_refNoPmNo_max'));?>" class="required-int" /></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td class="coltd_szone"><span style="color:<?=$this->config->item('rg_font_color_err');?>">จำนวนเงินค้างชำระ</s</td> <td colspan="3"><span style="color:<?=$this->config->item('rg_font_color_err');?>"> : <?php if ($row_rf->rfBalance != 0) { echo number_format($row_rf->rfTotalAmt, 2).' <b>บาท</b>'; } else { echo '** ชำระหนี้ค่าลงทะเบียนเรียนหมดแล้ว **'; } ?> </span> <input type="hidden" name="pmAmt" value="<?php echo $row_rf->rfTotalAmt;?>"></td> </tr> </table></td> </tr> <tr> <td colspan='2'><input type="hidden" name="lateFineUnit" value="<?php echo getval('crftLateFineUnit', $row_crft);?>" /> <input type="hidden" name="lateFineRate" value="<?php echo getval('crftLateFine', $row_crft);?>" /> <input type="hidden" name="maxLateFine" value="<?php echo getval('crftMaxLateFine', $row_crft);?>" /></td> </tr> <tr> <td colspan='2' bgcolor="<?php echo $tr_color_even;?>"><fieldset><table width="100%"> <tr> <td colspan="3"><input type="radio" name="pmType" value="1" id="rad1" checked /> เงินสด</td> </tr> <tr> <td width='5%'></td> <td width='15%'><b>วันที่ชำระ</b></td> <td><?php echo abbreDate2(getNowDate());?> <input type="hidden" name="pmDate1" value="<?php echo getNowDate();?>"></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td></td> <td><b>ค่าปรับค้างชำระ</b></td> <td><input type="text" name="lateFine1" class='input2' value="<?php echo number_format($lateFine, 2);?>" size="5" class="input1" readonly> <b>บาท</b> </td> </tr> </table></fieldset></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td colspan='2'><fieldset><table width="100%"> <tr> <td colspan="4"><input type="radio" name="pmType" value="2" id="rad2" /> ทางธนาคาร</td> </tr> <tr> <td width="5%"></td> <td width="15%"><b>วันที่ชำระ</b></td> <td><script>DateInput('pmDate2', true, 'DD/MM/YYYY','<?php echo getNowDateFw2();?>');</script></td> <td width="45%"><input type="button" name="calLateFine" value="คำนวณ" onClick="calLF()"></td> </tr> <tr bgcolor="<?php echo $tr_color_even;?>"> <td></td> <td><b>ค่าปรับค้างชำระ</b></td> <td colspan="2"><input type="text" class='input2' name="lateFine2" value="<?php echo number_format($lateFine, 2);?>" size="5" readonly> <b>บาท</b> </td> </tr> </table></fieldset></td> </tr> <tr> <td colspan='2'><input type="submit" name="add" value="บันทึก" onClick="return checkFormat(new Array(this.form.pmDate2.value), new Array('<?php echo getNowDateFw2();?>'))" <?php if (($row_rf->rfBalance == 0) || ($row_rf->rfTotalAmt != $row_rf->rfBalance)) { echo "disabled"; }?> /></td> </tr> <tr> <td colspan='2'><br><table class="headCol"> <tr> <th>ลำดับ</th> <th>วันที่ชำระ</th> <th>ประเภทการชำระ</th> <th>จำนวนเงินที่ชำระ</b></font></th> <th>ค่าปรับ</th> <th>เล่มที่</th> <th>เลขที่</th> <th>พิมพ์ใบเสร็จรับเงิน</th> <th>พิมพ์ใบสำคัญรับเงิน</th> <th>ลบ</th> </tr> <?php $i = 0; if ($rs_pm->num_rows()) { foreach ($rs_pm->result() as $row_pm) { $tmp = explode('|', $row_pm->pmRefNo, 2); ?> <tr> <td align="center"><?php echo $i+1;?></td> <td align="center"><?php echo abbreDate2($row_pm->pmDate);?></td> <td class="indent"><?php if ($row_pm->pmType == 1) echo 'เงินสด'; else if ($row_pm->pmType == 2) echo 'ทางธนาคาร';?></td> <td align="right"><?php echo number_format($row_pm->pmAmt, 2);?></td> <td align="right"><?php echo number_format($row_pm->pmLateFine, 2);?></td> <td align="center"><?php echo $tmp[0];?></td> <td align="center"><?php echo $tmp[1];?></td> <td align="center"> <?php if (($row_rf->rfBalance == 0) && ($row_rf->rfTotalAmt == $row_pm->pmAmt)) { ?> <span class="hand" onClick="sendPost('hidform', {'pmId[]':<?php echo $row_pm->pmId;?>,'stdId[]':<?php echo $row_std->stdId;?>,'acY[]':<?php echo $row_rf->rfAcY;?>,'tmId[]':<?php echo $row_rf->rfTmId;?>,'syId[]':<?php echo $row_rf->rfSyId;?>}, 'prePrintPaymentRegisAllPDF', {})"><img src="<?php echo base_url().$this->config->item("rg_print");?>" align="absmiddle" alt="พิมพ์ใบเสร็จรับเงิน" border="0" /></span> <?php } else { echo '-'; } ?> </td> <td align="center"> <?php if (($row_rf->rfBalance == 0) && ($row_rf->rfTotalAmt == $row_pm->pmAmt)) { ?> <span class="hand" onClick="sendPost('hidform', {'pmId[]':<?php echo $row_pm->pmId;?>,'stdId':<?php echo $row_std->stdId;?>,'acY':<?php echo $row_rf->rfAcY;?>,'tmId':<?php echo $row_rf->rfTmId;?>}, 'printPaymentRegis2AllPDF', {})"><img src="<?php echo base_url().$this->config->item("rg_print");?>" align="absmiddle" alt="พิมพ์ใบสำคัญรับเงิน" border="0" /></span> <?php } else { echo '-'; } ?> </td> <td align="center"> <?php if (($row_rf->rfBalance == 0) && ($row_rf->rfTotalAmt == $row_pm->pmAmt) && ($row_pm->pmRefNo == $maxRefNo)) { ?> <span class="hand" onClick="sendPost('hidform', {'pmId':<?php echo $row_pm->pmId;?>,'refNo':'<?php echo $refNo;?>','action':'paymentRegis'}, 'pm_delete')" onClick="return confirmSubmit('คุณต้องการลบรายการชำระค่าลงทะเบียนแน่นอนใช่หรือไม่ ?')"><img src="<?php echo base_url().$this->config->item("rg_delete");?>" width="16" height="19" align="absmiddle" border="0" /></span> <?php } else { echo '-'; } ?> </td> </tr> <?php $i++; } } else { ?> <tr> <td colspan="10" align="center"><span class='error'>** ไม่ปรากฏรายการในฐานข้อมูล **</span></td> </tr> <?php } } } ?> </table></td> </tr> <? if(isset($refNo)){ ?> <tr> <td><input type="button" name="cancel" value="ยกเลิก" onClick="location.href = '<?php //echo $PHP_SELF;?>'"><input type="hidden" name="refNo" value="<?php echo $refNo;?>"></td> <td align="right">รวม <?php echo $i;?> รายการ</td> </tr> <? }?> </table><?php echo form_close();?></div><br> <br></td> </tr> </table>
|