-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfees.php
More file actions
154 lines (143 loc) · 4.36 KB
/
fees.php
File metadata and controls
154 lines (143 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php include('db_connect.php');?>
<style>
input[type=checkbox]
{
/* Double-sized Checkboxes */
-ms-transform: scale(1.3); /* IE */
-moz-transform: scale(1.3); /* FF */
-webkit-transform: scale(1.3); /* Safari and Chrome */
-o-transform: scale(1.3); /* Opera */
transform: scale(1.3);
padding: 10px;
cursor:pointer;
}
</style>
<div class="container-fluid">
<div class="col-lg-12">
<div class="row mb-4 mt-4">
<div class="col-md-12">
</div>
</div>
<div class="row">
<!-- FORM Panel -->
<!-- Table Panel -->
<div class="col-md-12">
<div class="card">
<div class="card-header">
<b>List of Student fees </b>
<span class="float:right"><a class="btn btn-primary col-sm-6 col-md-2 float-right" href="javascript:void(0)" id="new_fees">
<i class="fa fa-plus"></i> New
</a></span>
</div>
<div class="card-body">
<table class="table table-condensed table-bordered table-hover">
<thead>
<tr>
<th class="text-center">S/N</th>
<th class="">ID No.</th>
<th class="">EF No.</th>
<th class="">Name</th>
<th class="">Course</th>
<th class="">Payable Fee</th>
<th class="">Paid</th>
<th class="">Balance</th>
<th class="text-center">Action</th>
</tr>
</thead>
<tbody>
<?php
$i = 1;
$fees = $conn->query("SELECT ef.*, s.name AS sname, s.id_no, c.course AS course_name
FROM student_ef_list ef
INNER JOIN student s ON s.id = ef.student_id
INNER JOIN courses c ON c.id = ef.course_id
ORDER BY s.name ASC
");
while($row=$fees->fetch_assoc()):
$paid = $conn->query("SELECT sum(amount) as paid FROM payments where ef_id=".$row['id']);
$paid = $paid->num_rows > 0 ? $paid->fetch_array()['paid']:'';
$balance = $row['total_fee'] - $paid;
?>
<tr>
<td class="text-center"><?php echo $i++ ?></td>
<td>
<p> <?php echo $row['id_no'] ?></p>
</td>
<td>
<p> <?php echo $row['ef_no'] ?></p>
</td>
<td>
<p> <?php echo ucwords($row['sname']) ?></p>
</td>
<td>
<p> <?php echo $row['course_name'] ?></p>
</td>
<td class="text-right">
<p><?php echo number_format($row['total_fee'],2) ?></p>
</td>
<td class="text-right">
<p><?php echo number_format($paid,2) ?></p>
<td class="text-right">
<p><?php echo number_format($balance,2) ?></p>
</td>
<td class="text-center">
<button class="btn btn-primary view_payment" type="button" data-id="<?php echo $row['id'] ?>"><i class="fa fa-eye"></i></button>
<button class="btn btn-info edit_fees" type="button" data-id="<?php echo $row['id'] ?>" ><i class="fa fa-edit"></i></button>
<button class="btn btn-danger delete_fees" type="button" data-id="<?php echo $row['id'] ?>"><i class="fa fa-trash-alt"></i></button>
</td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
</div>
</div>
</div>
<!-- Table Panel -->
</div>
</div>
</div>
<style>
td{
vertical-align: middle !important;
}
td p{
margin: unset
}
img{
max-width:100px;
max-height: :150px;
}
</style>
<script>
$(document).ready(function(){
$('table').dataTable()
})
$('.view_payment').click(function(){
uni_modal("Payment Details","view_payment.php?ef_id="+$(this).attr('data-id')+"&pid=0","mid-large")
})
$('#new_fees').click(function(){
uni_modal("Enroll Student ","manage_fee.php","mid-large")
})
$('.edit_fees').click(function(){
uni_modal("Manage Student's Enrollment Details","manage_fee.php?id="+$(this).attr('data-id'),"mid-large")
})
$('.delete_fees').click(function(){
_conf("Are you sure to delete this fees ?","delete_fees",[$(this).attr('data-id')])
})
function delete_fees($id){
start_load()
$.ajax({
url:'ajax.php?action=delete_fees',
method:'POST',
data:{id:$id},
success:function(resp){
if(resp==1){
alert_toast("Data successfully deleted",'success')
setTimeout(function(){
location.reload()
},1500)
}
}
})
}
</script>