D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
skyconb
/
bak time
/
client
/
Filename :
fees.php
back
Copy
<?php $page='fees'; include("php/dbconnect.php"); include("php/checklogin.php"); $errormsg= ''; if(isset($_POST['save'])) { $paid = mysqli_real_escape_string($conn,$_POST['paid']); $submitdate = mysqli_real_escape_string($conn,$_POST['submitdate']); $transcation_remark = mysqli_real_escape_string($conn,$_POST['transcation_remark']); $sid = mysqli_real_escape_string($conn,$_POST['sid']); $sql = "select fees,balance from student where id = '$sid'"; $sq = $conn->query($sql); $sr = $sq->fetch_assoc(); $totalfee = $sr['fees']; if($sr['balance']>0) { $sql = "insert into fees_transaction(stdid,submitdate,transcation_remark,paid) values('$sid','$submitdate','$transcation_remark','$paid') "; $conn->query($sql); $sql = "SELECT sum(paid) as totalpaid FROM fees_transaction WHERE stdid = '$sid'"; $tpq = $conn->query($sql); $tpr = $tpq->fetch_assoc(); $totalpaid = $tpr['totalpaid']; $tbalance = $totalfee - $totalpaid; $sql = "update student set balance='$tbalance' where id = '$sid'"; $conn->query($sql); echo '<script type="text/javascript">window.location="fees.php?act=1";</script>'; } } if(isset($_REQUEST['act']) && @$_REQUEST['act']=="1") { $errormsg = "<div class='alert alert-success'><a href='#' class='close' data-dismiss='alert' aria-label='close'>×</a><strong>Success!</strong> Fees has been submitted</div>"; } ?> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Gestion de Caisse TIME</title> <!-- BOOTSTRAP STYLES--> <link href="css/bootstrap.css" rel="stylesheet" /> <!-- FONTAWESOME STYLES--> <link href="css/font-awesome.css" rel="stylesheet" /> <!--CUSTOM BASIC STYLES--> <link href="css/basic.css" rel="stylesheet" /> <!--CUSTOM MAIN STYLES--> <link href="css/custom.css" rel="stylesheet" /> <!-- GOOGLE FONTS--> <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' /> <link href="css/ui.css" rel="stylesheet" /> <link href="css/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" /> <link href="css/datepicker.css" rel="stylesheet" /> <link href="css/datatable/datatable.css" rel="stylesheet" /> <script src="js/jquery-1.10.2.js"></script> <script type='text/javascript' src='js/jquery/jquery-ui-1.10.1.custom.min.js'></script> <script type="text/javascript" src="js/validation/jquery.validate.min.js"></script> <script src="js/dataTable/jquery.dataTables.min.js"></script> </head> <?php include("php/header.php"); ?> <div id="page-wrapper"> <div id="page-inner"> <div class="row"> <div class="col-md-12"> <h1 class="page-head-line">Frais Tarif </h1> </div> </div> <?php echo $errormsg; ?> <div class="row" style="margin-bottom:20px;"> <div class="col-md-12"> <fieldset class="scheduler-border" > <legend class="scheduler-border">Recherche:</legend> <form class="form-inline" role="form" id="searchform"> <div class="form-group"> <label for="email">Nom et Prenom</label> <input type="text" class="form-control" id="student" name="student"> </div> <div class="form-group"> <label for="email"> Date </label> <input type="text" class="form-control" id="doj" name="doj" > </div> <div class="form-group"> <label for="email"> Class </label> <select class="form-control" id="grade" name="grade" > <option value="" >Select Class</option> <?php $sql = "select * from grade where delete_status='0' order by grade.grade asc"; $q = $conn->query($sql); while($r = $q->fetch_assoc()) { echo '<option value="'.$r['id'].'" '.(($grade==$r['id'])?'selected="selected"':'').'>'.$r['grade'].'</option>'; } ?> </select> </div> <button type="button" class="btn btn-success btn-sm" style="border-radius:0%" id="find" > Filter </button> <button type="reset" class="btn btn-danger btn-sm" style="border-radius:0%" id="clear" > Reset </button> </form> </fieldset> </div> </div> <script type="text/javascript"> $(document).ready( function() { /* $('#doj').datepicker( { changeMonth: true, changeYear: true, showButtonPanel: false, dateFormat: 'mm/yy', onClose: function(dateText, inst) { $(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1)); } }); */ /******************/ $("#doj").datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'mm/yy', onClose: function(dateText, inst) { var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); $(this).val($.datepicker.formatDate('MM yy', new Date(year, month, 1))); } }); $("#doj").focus(function () { $(".ui-datepicker-calendar").hide(); $("#ui-datepicker-div").position({ my: "center top", at: "center bottom", of: $(this) }); }); /*****************/ $('#student').autocomplete({ source: function( request, response ) { $.ajax({ url : 'ajx.php', dataType: "json", data: { name_startsWith: request.term, type: 'studentname' }, success: function( data ) { response( $.map( data, function( item ) { return { label: item, value: item } })); } }); } /*, autoFocus: true, minLength: 0, select: function( event, ui ) { var abc = ui.item.label.split("-"); //alert(abc[0]); $("#student").val(abc[0]); return false; }, */ }); $('#find').click(function () { mydatatable(); }); $('#clear').click(function () { $('#searchform')[0].reset(); mydatatable(); }); function mydatatable() { $("#subjectresult").html('<table class="table table-striped table-bordered table-hover" id="tSortable22"><thead><tr><th>Name/Contact</th><th>Fees</th><th>Balance</th><th>Grade</th><th>DOJ</th><th>Action</th></tr></thead><tbody></tbody></table>'); $("#tSortable22").dataTable({ 'sPaginationType' : 'full_numbers', "bLengthChange": false, "bFilter": false, "bInfo": false, 'bProcessing' : true, 'bServerSide': true, 'sAjaxSource': "datatable.php?"+$('#searchform').serialize()+"&type=feesearch", 'aoColumnDefs': [{ 'bSortable': false, 'aTargets': [-1] /* 1st one, start by the right */ }] }); } //////////////////////////// $("#tSortable22").dataTable({ 'sPaginationType' : 'full_numbers', "bLengthChange": false, "bFilter": false, "bInfo": false, 'bProcessing' : true, 'bServerSide': true, 'sAjaxSource': "datatable.php?type=feesearch", 'aoColumnDefs': [{ 'bSortable': false, 'aTargets': [-1] /* 1st one, start by the right */ }] }); /////////////////////////// }); function GetFeeForm(sid) { $.ajax({ type: 'post', url: 'getfeeform.php', data: {student:sid,req:'1'}, success: function (data) { $('#formcontent').html(data); $("#myModal").modal({backdrop: "static"}); } }); } </script> <style> #doj .ui-datepicker-calendar { display:none; } </style> <div class="panel panel-default"> <div class="panel-heading"> Gerer Tarif </div> <div class="panel-body"> <div class="table-sorting table-responsive" id="subjectresult"> <table class="table table-striped table-bordered table-hover" id="tSortable22"> <thead> <tr> <th>Prenom & MAT</th> <th>Tarif</th> <th>Reset</th> <th>Class</th> <th>Date</th> <th>Action</th> </tr> </thead> <tbody> </tbody> </table> </div> </div> </div> <!--------> <!-- Modal --> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" style="color:red;">×</button> <h4 class="modal-title">Collect Tarif</h4> </div> <div class="modal-body" id="formcontent"> </div> </div> </div> </div> <!---------> </div> <!-- /. PAGE INNER --> </div> <!-- /. PAGE WRAPPER --> </div> <!-- /. WRAPPER --> <!-- BOOTSTRAP SCRIPTS --> <script src="js/bootstrap.js"></script> <!-- METISMENU SCRIPTS --> <script src="js/jquery.metisMenu.js"></script> <!-- CUSTOM SCRIPTS --> <script src="js/custom1.js"></script> </body> </html>