/administrator/pages/enroll_credit_bank_charge.php
PHP | 250 lines | 219 code | 17 blank | 14 comment | 13 complexity | a89eea9676af9f83d5649f32bc50242f MD5 | raw file
Possible License(s): LGPL-2.1
- <?php
- /*
- * @package ACCIT
- * @author Paperlink Softwares Team
- * @copyright Copyright (c) 2016 , Paperlink Softwares Pvt. Ltd. (http://www.paperlinksoftwares.com/)
- * @since Version 1.0.0
- * @filesource
- * Code for Pay fees amount with receipt
- * This data are send to the (pay_amount.php) page for final payment
- */
- if($_POST['enrol_no'])
- {
- foreach(array_keys($_POST['IND_NO']) as $i)
- {
- $i + 1;
- if($_POST['inp'][$i]!=0)
- {
- $due_amount=$_POST['AMOUNT'][$i]-$_POST['inp'][$i];
- //echo "DATE=".$_POST['DUE_DATE'][$i]."INVOICE NO=".$_POST['INVOICE_NO'][$i]."IND NO=".$_POST['IND_NO'][$i]."AMOUNT=".$_POST['RECEIPT_AMOUNT'][$i]."</br>";
- 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`=''");
- if($due_amount==0)
- {
- 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
- }
- mysql_query("update `due` set `AMOUNT`='".$due_amount."' where `IND_NO`='".$_POST['IND_NO'][$i]."'");
- $_SESSION['s_msg']="<strong>Fine!</strong>Payment Credited Successfully";
- }
- }
-
- }
- // $_SESSION['s_msg']="<strong>Fine!</strong>Payment Receipt Added Successfully";
- //echo $_SESSION['enrol_no']."</br>";
- //echo $_SESSION['offer_item_no']."</br>";
- //echo $_SESSION['cust_no']."</br>";
-
-
- ?>
- <script type="text/javascript">
- function getVal(chk, adto){
- if (chk.checked) document.getElementById(adto).value = chk.value;
- }
- </script>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
- <div class="col-md-12 col-sm-12 col-xs-12">
- <div class="page-title">
- <div class="title_left">
- <?php
- if($_SESSION['s_msg'] || $_SESSION['e_msg'])
- {
- ?>
- <div class="alert <?=($_SESSION['s_msg'])?'alert-success':'alert-error'?> fade in">
- <button data-dismiss="alert" class="close" type="button">×</button>
- <?=($_SESSION['s_msg'])?$_SESSION['s_msg']:$_SESSION['e_msg']?>
- </div>
- <?php
- unset($_SESSION['s_msg']);
- unset($_SESSION['e_msg']);
- }
- ?>
- <h3>Enter Bank Charge Credit Amount</h3>
- </div>
- </div>
- </div>
- <div class="clearfix"></div>
- <div class="row">
- <div class="col-md-12 col-sm-12 col-xs-12">
- <div class="x_panel">
- <div class="clearfix"></div>
- <div class="x_content">
- <div class="row">
- <div class="col-md-12 col-sm-12 col-xs-12">
- <div class="x_panel recent-app">
- <div class="x_content">
- <div class="student-account-page edit-faculty-page">
- <!-- Nav tabs -->
- <div class="card">
- <div class="all-students-list add student">
- <div class="add-student-section">
- <form method="post" action="" onload="check();" class="form-horizontal form-label-left">
- <?php date_default_timezone_set('Australia/Melbourne');
- $date = date('d/m/Y h:i:s a', time());
- ?>
- <button type="submit" class="btn btn-success">Submit</button>
- <input id="who" name="WHO_DATE" type="hidden" value="<?php echo $date?>">
- <input id="when" name="user" type="hidden" value="<?php echo $_SESSION['user_no']?>">
- <input id="when" name="enrol_no" type="hidden" value="<?=$_GET['enrol_no']?>">
- <div role="tabpanel" class="tab-pane active" id="instalment">
- <div class="table-responsive">
- <table class="table table-striped jambo_table bulk_action">
- <thead>
- <tr class="headings">
- <th class="column-title">Invoice No</th>
- <th class="column-title">Due Date</th>
- <th class="column-title">Fee</th>
- <th class="column-title">Due</th>
- <th class="column-title">Full</th>
- <th class="column-title">Amount</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $i=1;
- $cond20="where `ENROL_NO`=".$_GET['enrol_no'];
- $std_row20=getRows($cond20,'invoice');
- foreach($std_row20 as $std_row21)
- {
- $cond22="where `INVOICE_NO`=".$std_row21['INVOICE_NO'];
- $std_row22=getRows($cond22,'invoice_details');
- foreach($std_row22 as $std_row23)
- {
- $i++;
- $add1a=mysql_query("SELECT * from due where `IND_NO`=".$std_row23['IND_NO']);
- while($row2a = mysql_fetch_array($add1a))
- {
- if($row2a['AMOUNT']!=0 and $row2a['FEE_NO']!=76)
- {
- ?>
-
- <tr>
-
- <td class="">
- <input type="hidden" name="INVOICE_NO[]" value="<?= $row2a['INVOICE_NO']?>"/>
- <input type="text" value="<?= $row2a['INVOICE_NO']?>" disabled="disabled"/></td>
- <input type="hidden" name="IND_NO[]" value="<?= $row2a['IND_NO']?>"/>
- <input type="hidden" name="DUE_NO[]" value="<?= $row2a['DUE_NO']?>"/>
- <input type="hidden" name="FEE_NO[]" value="<?= $row2a['FEE_NO']?>"/>
- <?php
- $due_his="where `DUE_NO`=".$row2a['DUE_NO'];
- $due_his_row=getRows($due_his,'due_history');
- ?>
- <input type="hidden" name="FEE_DEF_NO[]" value="<?= $due_his_row[0]['FEE_DEF_NO']?>"/>
- <td class="">
- <input type="hidden" name="DUE_DATE[]" value="<?=$row2a['DUE_DATE']?>" />
- <input type="text" value="<?= date('d/m/Y',strtotime($row2a['DUE_DATE']))?>" disabled="disabled"/>
- </td>
-
- <td class=" ">
- <?php
- if($std_row23['OFFER_INSTALMENT_NO']){ $cond202="where `OFFER_INSTALMENT_NO`=".$std_row23['OFFER_INSTALMENT_NO'];
- $std_row202=getRows($cond202,'offer_instalment'); }
- if($std_row202[0]['OFFER_ITEM_NO']){ $cond_off_it="where `OFFER_ITEM_NO`=".$std_row202[0]['OFFER_ITEM_NO'];
- $std_row_off_it=getRows($cond_off_it,'offer_item');}
-
- if($std_row_off_it[0]['PRODUCT_NO']){ $cond_off_it_pr="where `PRODUCT_NO`=".$std_row_off_it[0]['PRODUCT_NO'];
- $std_row_off_it_pr=getRows($cond_off_it_pr,'product');}
- if($std_row23['FEE_NO']=='76')
- {
- $name="Agent Fee";
- }
- else
- {
- $name=$std_row_off_it_pr[0]['NAME'];
- }
- ?>
- <?php echo $name;?>
- </td>
-
- <td class="">
- <input id="sutract_amount1" type="hidden" name="AMOUNT[]" value="<?= $row2a['AMOUNT']?>"/>
- <input type="text" value="<?= $row2a['AMOUNT']?>" disabled="disabled"/>
- </td>
- <td><input type="checkbox" name="chk[]" value="<?= $row2a['AMOUNT']?>" id="chk<?php echo $i;?>" onClick="getVal(this, 'inp<?php echo $i;?>')" ></td>
- <td><input class="sum1" type="text" name="inp[]" id="inp<?php echo $i;?>" onmousemove="add1()"></td>
- <!--<td class=""><input id="sutract_amount2" type="text" name="RECEIPT_AMOUNT[]" class="sum1" onchange="add1()" /></td>
- <td class=""><p id='sutract_result'></p></td> -->
-
- </tr>
-
- <?php
-
- } } } } ?>
- <script>
- function add1(){
- total1= 0;
- diff= 0;
- sum1 =document.getElementsByClassName("sum1");
- for(a1=0;a1<sum1.length;a1++)
- {
- console.log(sum1[a1].value);
- total1 += parseFloat(sum1[a1].value || 0);
- }
- document.getElementById("total1").value = parseFloat(total1.toFixed(2));
- var difval=<?= $_POST['n1']?> - total1;
- document.getElementById("diff").value = parseFloat(difval.toFixed(2));
- }
- </script>
- <script>
- $("#sutract_amount2").keyup(function(){
- $("#sutract_result").html('');
- var n1 = $("#sutract_amount1").val();
- var n2 = $("#sutract_amount2").val();
- var ans = n1 - n2;
- $("#sutract_result").html(ans);
- });
- $("#sutract_amount1").keyup(function(){
- $("#sutract_result").html('');
- var n1 = $("#sutract_amount1").val();
- var n2 = $("#sutract_amount2").val();
- var ans = n1 - n2;
- $("#sutract_result").html(ans);
- });
- </script>
-
- </tbody>
- </table>
- </div>
- </div>
- <div class="row">
- <div class="col-md-2 col-sm-2 col-xs-2">
- <div class="form-group">
- <label class="control-label col-md-12 col-sm-12 col-xs-12" for="name"> Totals
- </label>
- </div>
- </div>
- <div class="col-md-4 col-sm-4 col-xs-4">
- <div class="form-group">
- <input class="control-label col-md-12 col-sm-12 col-xs-12" id="total1" name="TOTAL_AMOUNT" type="text">
- </div>
- </div>
- </div>
- </div>
- <div class="item form-group">
- <label for="name" class="control-label col-md-3 col-sm-3 col-xs-12"></label>
- <div class="col-md-9 col-sm-9 col-xs-12">
- <div class="row">
- <div class="col-md-6 col-sm-4 col-xs-12">
- <p class="pull-left">
-
- </p>
- </div>
- </div>
- </div>
- </div>
- </form>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>