-
Notifications
You must be signed in to change notification settings - Fork 0
/
individual_report_search.php
115 lines (89 loc) · 3.89 KB
/
individual_report_search.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
<?php include ('header.php'); ?>
<?php
$roll_number = $_GET['roll_number'];
$user_query = mysqli_query($con,"SELECT * FROM user WHERE roll_number = '$roll_number' ");
$user_row = mysqli_fetch_array($user_query);
?>
<div class="page-title">
<div class="title_left">
<h3>
<small>Home /</small> Individual Book Report
</h3>
</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="x_title">
<?php
$sql = mysqli_query($con,"SELECT * FROM user WHERE roll_number = '$roll_number' ");
$row = mysqli_fetch_array($sql);
?>
<h2>
Borrower Name : <span style="color:maroon;"><?php echo $row['firstname']." ".$row['middlename']." ".$row['lastname']." (".$row['branch'].")";?></span>
</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<!-- content starts here -->
<?php
$borrow_query = mysqli_query($con,"SELECT * FROM borrow_book
LEFT JOIN book ON borrow_book.book_id = book.book_id
WHERE user_id = '".$user_row['user_id']."' && borrowed_status = 'borrowed' ORDER BY borrow_book_id DESC") or die(mysqli_error($con));
$borrow_count = mysqli_num_rows($borrow_query);
echo "<span style='color:red;font-size:16px;font-weight:bold;font-family:Times New Roman, Times, serif;'>Total Number of Books Borrowed is = ".$borrow_count."</span";
?>
<br>
<div class="table-responsive">
<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered">
<thead>
<tr>
<th>Barcode</th>
<th>Title</th>
<th>Publisher</th>
<th>Copyright Year</th>
<th>Date Borrowed</th>
<?php
$borrow_query = mysqli_query($con,"SELECT * FROM borrow_book
LEFT JOIN book ON borrow_book.book_id = book.book_id
WHERE user_id = '".$user_row['user_id']."' && borrowed_status = 'borrowed' ORDER BY borrow_book_id DESC") or die(mysqli_error($con));
$borrow_count = mysqli_num_rows($borrow_query);
while($borrow_row = mysqli_fetch_array($borrow_query)){
$due_date= $borrow_row['due_date'];
$timezone = "Asia/Manila";
if(function_exists('date_default_timezone_set')) date_default_timezone_set($timezone);
$cur_date = date("Y-m-d H:i:s");
$date_returned = date("Y-m-d H:i:s");
?>
</tr>
</thead>
<tbody>
<tr>
<td><?php echo $borrow_row['book_barcode']; ?></td>
<td style="text-transform: capitalize"><?php echo $borrow_row['book_title']; ?></td>
<td style="text-transform: capitalize"><?php echo $borrow_row['book_pub']; ?></td>
<td><?php echo $borrow_row['copyright_year']; ?></td>
<td><?php echo date("M d, Y h:m:s a",strtotime($borrow_row['date_borrowed'])); ?></td>
</tr>
<?php
}
if ($borrow_count <= 0){
echo '
<table style="float:right;">
<tr>
<td style="padding:10px;" class="alert alert-danger">No books borrowed</td>
</tr>
</table>
';
}
?>
</tbody>
</table>
</div>
</div>
<!-- content ends here -->
</div>
</div>
</div>
<?php include ('footer.php'); ?>