-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathunreturnedBooks.php
executable file
·215 lines (154 loc) · 5.03 KB
/
unreturnedBooks.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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<style>
.hed{
float:left;
width:860px;
margin-left:35px;
padding-bottom:20px;
margin-top:10px;}
</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>
<script>
function printDiv(divID) {
//Get the HTML of div
var divElements = document.getElementById(divID).innerHTML;
//Get the HTML of whole page
var oldPage = document.body.innerHTML;
//Reset the page's HTML with div's HTML only
document.body.innerHTML =
"<nav>" +
divElements + "</nav>";
//Print Page
window.print();
//Restore orignal HTML
document.body.innerHTML = oldPage;
window.location='index.php?unreturnedBooks';
}
</script>
<script>
$(document).ready(function(){
$("#closeempty").click(function(){
$("#divempty").fadeOut("slow");
window.location='index.php?unreturnedBooks';
});
});
</script>
<div id="divempty" style=" z-index:20; position:absolute; background:url(images/trans_bg.png); width:100%;height:100%;display:none;">
<div class="boxaction" style="margin-top:-20px;">
<div class="headbox">
<img src="icons/error.png" height="25" style="margin-top:8px; float:left; margin-left:10px;"/>
<div style=" margin-left:7px; margin-top:13px; color:#030; font-size:15px; font-family:Verdana, Geneva, sans-serif; font-weight:bold;float:left">Error</div>
</div>
<div class="btnbox" id="closeempty" style="cursor:pointer;">
<div style="font:14px; font-family:Verdana, Geneva, sans-serif; color:#FFF; font-weight:bold; text-align:center; margin-top:5px;">OK</div>
</div>
</div>
</div>
<style>
.trsss{
background-color:#FFCC99;}
.trsss:hover{background-color:#F90;
</style>
<div class="hed" id="printablediv">
<?php
if(isset($_POST['print'])){
if(!$_POST['checkbox']){ ?>
<script>
$(document).ready(function(){
$("#divempty").fadeIn(1000);
});
</script>
<?php }else{}
?>
<?php
}
else{
?>
<?php
include('config.php');
?>
<form action="" method="post">
<table border="0" style="margin-top:20px; margin-left:0;">
<tr>
<tr>
<td style="font-size:18px;font-family:Verdana, Geneva, sans-serif; border-bottom:#666 solid 1px; ">List of Unreturned 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>
<table width="100%" bordercolor="#999999" class="web" border="0" cellspacing="1" style="border:#666 solid 1px; margin-bottom:20px; margin-left:0px;font-size:12px;font-family:Verdana, Geneva, sans-serif; margin-top:20px;">
<thead>
<tr bgcolor="#F90" height="30" style="color:black; font-weight:bold; text-align:left;">
<td>No.</td>
<td class="web" width="100" align="center">Card No.</td>
<td class="web" width="400" align="center">Book Title</td>
<td class="web" width="240" align="center">Borrower's Name</td>
<td class="web" width="240" align="center">Date of Lend</td>
<?php
include('config.php');
$q="select * from book_loans where date_in = '0000-00-00'";
$rs=mysql_query($q);
$count=0;
$ihap=0;
$num=mysql_num_rows($rs);
while($row=mysql_fetch_array($rs)){
$count++;
?>
</tr>
<tr class="trsss" align="center" height="25">
<td><?php echo $count; ?></td>
<td bgcolor="" width="100">
<?php
echo $row['card_no']; ?>
</td>
<td width="400"><?php
$qs= mysql_query("SELECT * from book where book_id={$row['book_id']}");
while($title=mysql_fetch_array($qs)){
echo $title['title']; }?></td>
<td width="180">
<?php
$qs=mysql_query("select * from borrower where card_no=$row[card_no]");
while($title=mysql_fetch_array($qs)){
echo $title['fname']." ".$title['lname']; }?>
</td>
<td><?php echo date_format(date_create($row['date_out']), 'F d, Y'); ?></td>
</tr>
<?php
} ?>
</thead>
</table>
<?php } ?>
</div>
<!--footer-->
<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>
<td>Count of Unreturn Books</td>
<td><input type="text" value="<?php echo $num; ?>" style="padding:2px; width:60px;" readonly="readonly"></td>
</tr>
</table>
</div>
<div class="rightfoot"></div>
</div>
</div>
</body>
</html>