-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoverdue.php
executable file
·168 lines (111 loc) · 3.83 KB
/
overdue.php
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
$timezone = "America/Chicago";
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
?>
<style>
.trss{
background-color:#FFCC99;}
.trss:hover{background-color:#F90;
}
</style>
<SCRIPT language="javascript">
$(function () {
// add multiple select / deselect functionality
$("#selectall").click(function () {
$('.name').attr('checked', this.checked);
});
// if all checkbox are selected, then check the select all checkbox
// and viceversa
$(".name").click(function () {
if ($(".name").length == $(".name:checked").length) {
$("#selectall").attr("checked", "checked");
} else {
$("#selectall").removeAttr("checked");
}
});
});
</SCRIPT>
<?php
if(isset($_POST['overreport'])){
include('overreport.php');
}else{
?>
<table border="0" style="margin-top:20px; margin-left:38px;">
<tr>
<td rowspan="3"> </td>
<tr>
<td style="font-size:18px;font-family:Verdana, Geneva, sans-serif; border-bottom:#666 solid 1px; ">List of Overdue Books</td>
</tr>
<tr>
<td style="font-size:12px;font-family:Verdana, Geneva, sans-serif;"><?php echo date_format(date_create(date("Y/m/d")), 'F d, Y');?></td>
</tr>
</tr>
</table>
<form action="" method="post">
<table cellpadding="5px" width="92%" align="center" bordercolor="#999999" class="web" border="0" cellspacing="1" style="border:#666 solid 1px;
margin-bottom:20px; margin-left:38px; margin-right:45px; font-size:12px;font-family:Verdana, Geneva, sans-serif; margin-top:20px;">
<thead>
<tr bgcolor="#F90" height="30" style="color:#000; font-weight:bold; text-align:left;" >
<td>No.</td>
<td class="web" width="100" align="center">Card No</td>
<td class="web" width="300" align="center">Book Title</td>
<td class="web" width="200" align="center">Borrower's Name</td>
<td class="web" width="120" align="center">Due Date</td>
<td class="web" width="150" align="center">Count of days
</td>
<td class="web" width="120" align="center">Fine Amount</td>
</tr>
<?php
$FINE_AMT = 0.25;
$duedate=mysql_query("SELECT *, DATEDIFF(NOW(), due_date) AS due_days, (DATEDIFF(NOW(), due_date)* $FINE_AMT) AS fine FROM `book_loans` WHERE date_in = '0000-00-00' AND due_date < NOW()");
$count=0;
$c=1;
while($row=mysql_fetch_array($duedate)){
$count++;
$borrower=mysql_query("select * from borrower where card_no='".$row['card_no']."'");
$stud=mysql_fetch_array($borrower);
$bo=mysql_query("select * from book where book_id='".$row['book_id']."'");
$book=mysql_fetch_array($bo);
$fineamt = $row['fine'];
?>
<tr class="trss" align="center" >
<td><?php echo $count;?></td>
<td><?php echo $row['card_no']; ?></td>
<td><?php echo $book['title']; ?></td>
<td><?php echo $stud['fname']." ".$stud['lname']; ?></td>
<td><?php echo date_format(date_create($row['due_date']), 'F d, Y'); ?></td>
<td>
<input type="hidden" name="countdays" value="<?php echo $row['due_days']; ?>">
<?php echo $row['due_days']; ?></td>
<td><?php echo ("$")." ".$fineamt; ?></td>
</tr>
<?php
} ?>
</table>
<?php }?>
<div class="footer">
<div class="leftfoot"></div>
<div class="bodyfoot">
<table border="0" style="margin-top:20px; font-family:Verdana, Geneva, sans-serif; font-size:10px;">
<tr>
<?php
if(isset($_POST['overreport'])){ ?>
<?php }else{?>
<td>Count of Over Due Books</td>
<td><input type="text" value="<?php echo $j; ?>" style="padding:2px; width:60px;" readonly="readonly"></td>
<?php } ?>
<td>
<?php
if(isset($_POST['overreport'])){ ?>
<?php }else{?>
</form>
<?php } ?>
</td>
</tr>
</table>
</div>
<div class="rightfoot"></div>
</div>
</div>
</body>
</html>