PageRenderTime 72ms CodeModel.GetById 35ms RepoModel.GetById 1ms app.codeStats 0ms

/administrator/pages/enroll_credit_bank_charge.php

https://bitbucket.org/deba666/accitsoftware
PHP | 250 lines | 219 code | 17 blank | 14 comment | 13 complexity | a89eea9676af9f83d5649f32bc50242f MD5 | raw file
Possible License(s): LGPL-2.1
  1. <?php
  2. /*
  3. * @package ACCIT
  4. * @author Paperlink Softwares Team
  5. * @copyright Copyright (c) 2016 , Paperlink Softwares Pvt. Ltd. (http://www.paperlinksoftwares.com/)
  6. * @since Version 1.0.0
  7. * @filesource
  8. * Code for Pay fees amount with receipt
  9. * This data are send to the (pay_amount.php) page for final payment
  10. */
  11. if($_POST['enrol_no'])
  12. {
  13. foreach(array_keys($_POST['IND_NO']) as $i)
  14. {
  15. $i + 1;
  16. if($_POST['inp'][$i]!=0)
  17. {
  18. $due_amount=$_POST['AMOUNT'][$i]-$_POST['inp'][$i];
  19. //echo "DATE=".$_POST['DUE_DATE'][$i]."INVOICE NO=".$_POST['INVOICE_NO'][$i]."IND NO=".$_POST['IND_NO'][$i]."AMOUNT=".$_POST['RECEIPT_AMOUNT'][$i]."</br>";
  20. insert_record("insert into `credit` set `IND_NO`='".$_POST['IND_NO'][$i]."',`INVOICE_NO`='".$_POST['INVOICE_NO'][$i]."',`FEE_NO`='".$_POST['FEE_NO'][$i]."',`RECEIPT_NO`=' ',`CREDIT_DATE`='".date('Y-m-d')."',`AMOUNT`='".$_POST['inp'][$i]."',`USER_NO`='".$_POST['user']."',`CREDIT_TYPE_NO`='3',`DUE_NO`='".$_POST['DUE_NO'][$i]."',`STATUS`='',`WHO_DATE`='".$_POST['WHO_DATE']."',`ENROL_NO`='".$_POST['enrol_no']."',`TRANS_GROUP_NO`='',`FEE_DEF_NO`='".$_POST['FEE_DEF_NO'][$i]."',`DEBIT_NO`=''");
  21. if($due_amount==0)
  22. {
  23. mysql_query("update `due_history` set `DELETE_DATE`='".date('Y-m-d')."' where `IND_NO`='".$_POST['IND_NO'][$i]."'");//update due history table after make psayment
  24. }
  25. mysql_query("update `due` set `AMOUNT`='".$due_amount."' where `IND_NO`='".$_POST['IND_NO'][$i]."'");
  26. $_SESSION['s_msg']="<strong>Fine!</strong>Payment Credited Successfully";
  27. }
  28. }
  29. }
  30. // $_SESSION['s_msg']="<strong>Fine!</strong>Payment Receipt Added Successfully";
  31. //echo $_SESSION['enrol_no']."</br>";
  32. //echo $_SESSION['offer_item_no']."</br>";
  33. //echo $_SESSION['cust_no']."</br>";
  34. ?>
  35. <script type="text/javascript">
  36. function getVal(chk, adto){
  37. if (chk.checked) document.getElementById(adto).value = chk.value;
  38. }
  39. </script>
  40. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  41. <div class="col-md-12 col-sm-12 col-xs-12">
  42. <div class="page-title">
  43. <div class="title_left">
  44. <?php
  45. if($_SESSION['s_msg'] || $_SESSION['e_msg'])
  46. {
  47. ?>
  48. <div class="alert <?=($_SESSION['s_msg'])?'alert-success':'alert-error'?> fade in">
  49. <button data-dismiss="alert" class="close" type="button">×</button>
  50. <?=($_SESSION['s_msg'])?$_SESSION['s_msg']:$_SESSION['e_msg']?>
  51. </div>
  52. <?php
  53. unset($_SESSION['s_msg']);
  54. unset($_SESSION['e_msg']);
  55. }
  56. ?>
  57. <h3>Enter Bank Charge Credit Amount</h3>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="clearfix"></div>
  62. <div class="row">
  63. <div class="col-md-12 col-sm-12 col-xs-12">
  64. <div class="x_panel">
  65. <div class="clearfix"></div>
  66. <div class="x_content">
  67. <div class="row">
  68. <div class="col-md-12 col-sm-12 col-xs-12">
  69. <div class="x_panel recent-app">
  70. <div class="x_content">
  71. <div class="student-account-page edit-faculty-page">
  72. <!-- Nav tabs -->
  73. <div class="card">
  74. <div class="all-students-list add student">
  75. <div class="add-student-section">
  76. <form method="post" action="" onload="check();" class="form-horizontal form-label-left">
  77. <?php date_default_timezone_set('Australia/Melbourne');
  78. $date = date('d/m/Y h:i:s a', time());
  79. ?>
  80. <button type="submit" class="btn btn-success">Submit</button>
  81. <input id="who" name="WHO_DATE" type="hidden" value="<?php echo $date?>">
  82. <input id="when" name="user" type="hidden" value="<?php echo $_SESSION['user_no']?>">
  83. <input id="when" name="enrol_no" type="hidden" value="<?=$_GET['enrol_no']?>">
  84. <div role="tabpanel" class="tab-pane active" id="instalment">
  85. <div class="table-responsive">
  86. <table class="table table-striped jambo_table bulk_action">
  87. <thead>
  88. <tr class="headings">
  89. <th class="column-title">Invoice No</th>
  90. <th class="column-title">Due Date</th>
  91. <th class="column-title">Fee</th>
  92. <th class="column-title">Due</th>
  93. <th class="column-title">Full</th>
  94. <th class="column-title">Amount</th>
  95. </tr>
  96. </thead>
  97. <tbody>
  98. <?php
  99. $i=1;
  100. $cond20="where `ENROL_NO`=".$_GET['enrol_no'];
  101. $std_row20=getRows($cond20,'invoice');
  102. foreach($std_row20 as $std_row21)
  103. {
  104. $cond22="where `INVOICE_NO`=".$std_row21['INVOICE_NO'];
  105. $std_row22=getRows($cond22,'invoice_details');
  106. foreach($std_row22 as $std_row23)
  107. {
  108. $i++;
  109. $add1a=mysql_query("SELECT * from due where `IND_NO`=".$std_row23['IND_NO']);
  110. while($row2a = mysql_fetch_array($add1a))
  111. {
  112. if($row2a['AMOUNT']!=0 and $row2a['FEE_NO']!=76)
  113. {
  114. ?>
  115. <tr>
  116. <td class="">
  117. <input type="hidden" name="INVOICE_NO[]" value="<?= $row2a['INVOICE_NO']?>"/>
  118. <input type="text" value="<?= $row2a['INVOICE_NO']?>" disabled="disabled"/></td>
  119. <input type="hidden" name="IND_NO[]" value="<?= $row2a['IND_NO']?>"/>
  120. <input type="hidden" name="DUE_NO[]" value="<?= $row2a['DUE_NO']?>"/>
  121. <input type="hidden" name="FEE_NO[]" value="<?= $row2a['FEE_NO']?>"/>
  122. <?php
  123. $due_his="where `DUE_NO`=".$row2a['DUE_NO'];
  124. $due_his_row=getRows($due_his,'due_history');
  125. ?>
  126. <input type="hidden" name="FEE_DEF_NO[]" value="<?= $due_his_row[0]['FEE_DEF_NO']?>"/>
  127. <td class="">
  128. <input type="hidden" name="DUE_DATE[]" value="<?=$row2a['DUE_DATE']?>" />
  129. <input type="text" value="<?= date('d/m/Y',strtotime($row2a['DUE_DATE']))?>" disabled="disabled"/>
  130. </td>
  131. <td class=" ">
  132. <?php
  133. if($std_row23['OFFER_INSTALMENT_NO']){ $cond202="where `OFFER_INSTALMENT_NO`=".$std_row23['OFFER_INSTALMENT_NO'];
  134. $std_row202=getRows($cond202,'offer_instalment'); }
  135. if($std_row202[0]['OFFER_ITEM_NO']){ $cond_off_it="where `OFFER_ITEM_NO`=".$std_row202[0]['OFFER_ITEM_NO'];
  136. $std_row_off_it=getRows($cond_off_it,'offer_item');}
  137. if($std_row_off_it[0]['PRODUCT_NO']){ $cond_off_it_pr="where `PRODUCT_NO`=".$std_row_off_it[0]['PRODUCT_NO'];
  138. $std_row_off_it_pr=getRows($cond_off_it_pr,'product');}
  139. if($std_row23['FEE_NO']=='76')
  140. {
  141. $name="Agent Fee";
  142. }
  143. else
  144. {
  145. $name=$std_row_off_it_pr[0]['NAME'];
  146. }
  147. ?>
  148. <?php echo $name;?>
  149. </td>
  150. <td class="">
  151. <input id="sutract_amount1" type="hidden" name="AMOUNT[]" value="<?= $row2a['AMOUNT']?>"/>
  152. <input type="text" value="<?= $row2a['AMOUNT']?>" disabled="disabled"/>
  153. </td>
  154. <td><input type="checkbox" name="chk[]" value="<?= $row2a['AMOUNT']?>" id="chk<?php echo $i;?>" onClick="getVal(this, 'inp<?php echo $i;?>')" ></td>
  155. <td><input class="sum1" type="text" name="inp[]" id="inp<?php echo $i;?>" onmousemove="add1()"></td>
  156. <!--<td class=""><input id="sutract_amount2" type="text" name="RECEIPT_AMOUNT[]" class="sum1" onchange="add1()" /></td>
  157. <td class=""><p id='sutract_result'></p></td> -->
  158. </tr>
  159. <?php
  160. } } } } ?>
  161. <script>
  162. function add1(){
  163. total1= 0;
  164. diff= 0;
  165. sum1 =document.getElementsByClassName("sum1");
  166. for(a1=0;a1<sum1.length;a1++)
  167. {
  168. console.log(sum1[a1].value);
  169. total1 += parseFloat(sum1[a1].value || 0);
  170. }
  171. document.getElementById("total1").value = parseFloat(total1.toFixed(2));
  172. var difval=<?= $_POST['n1']?> - total1;
  173. document.getElementById("diff").value = parseFloat(difval.toFixed(2));
  174. }
  175. </script>
  176. <script>
  177. $("#sutract_amount2").keyup(function(){
  178. $("#sutract_result").html('');
  179. var n1 = $("#sutract_amount1").val();
  180. var n2 = $("#sutract_amount2").val();
  181. var ans = n1 - n2;
  182. $("#sutract_result").html(ans);
  183. });
  184. $("#sutract_amount1").keyup(function(){
  185. $("#sutract_result").html('');
  186. var n1 = $("#sutract_amount1").val();
  187. var n2 = $("#sutract_amount2").val();
  188. var ans = n1 - n2;
  189. $("#sutract_result").html(ans);
  190. });
  191. </script>
  192. </tbody>
  193. </table>
  194. </div>
  195. </div>
  196. <div class="row">
  197. <div class="col-md-2 col-sm-2 col-xs-2">
  198. <div class="form-group">
  199. <label class="control-label col-md-12 col-sm-12 col-xs-12" for="name"> Totals
  200. </label>
  201. </div>
  202. </div>
  203. <div class="col-md-4 col-sm-4 col-xs-4">
  204. <div class="form-group">
  205. <input class="control-label col-md-12 col-sm-12 col-xs-12" id="total1" name="TOTAL_AMOUNT" type="text">
  206. </div>
  207. </div>
  208. </div>
  209. </div>
  210. <div class="item form-group">
  211. <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
  212. <div class="col-md-9 col-sm-9 col-xs-12">
  213. <div class="row">
  214. <div class="col-md-6 col-sm-4 col-xs-12">
  215. <p class="pull-left">
  216. </p>
  217. </div>
  218. </div>
  219. </div>
  220. </div>
  221. </form>
  222. </div>
  223. </div>
  224. </div>
  225. </div>
  226. </div>
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. </div>
  233. </div>