-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathborrowedbooks.php
More file actions
164 lines (124 loc) · 4.68 KB
/
borrowedbooks.php
File metadata and controls
164 lines (124 loc) · 4.68 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
155
156
157
158
159
160
161
162
163
164
<?php
require 'includes/snippet.php';
require 'includes/db-inc.php';
include "includes/header.php";
?>
<div class="container">
<?php include "includes/nav.php"; ?>
<!-- navbar ends -->
<!-- info alert -->
<div class="alert alert-warning col-lg-7 col-md-12 col-sm-12 col-xs-12 col-lg-offset-2 col-md-offset-0 col-sm-offset-1 col-xs-offset-0" style="margin-top:70px">
<span class="glyphicon glyphicon-book"></span>
<strong>Borrow Books</strong>
</div>
</div>
<div class="container">
<div class="panel panel-default">
<!-- Default panel contents -->
<div class="panel-heading">
<div class="row">
<!-- <a href="lendbook.php"><button class="btn btn-success col-lg-3 col-md-4 col-sm-11 col-xs-11 button" style="margin-left: 15px;margin-bottom: 5px"><span class="glyphicon glyphicon-plus-sign"></span> Lend Book</button></a>-->
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 pull-right">
<!-- <form method="post" action="borrowedbooks.php" enctype="multipart/form-data">
<div class="input-group pull-right">
<span class="input-group-addon">
<button class="btn btn-success" name="search">Search</button>
</span>
<input type="text" class="form-control" name="text">
</div>
</form> -->
</div><!-- /.col-lg-6 -->
</div>
</div>
<table class="table table-bordered">
<thead>
<tr>
<th>ID</th>
<th>Book Name</th>
<th>Member Name</th>
<th>Matric Number</th>
</tr>
</thead>
<?php
$sql = "SELECT * FROM borrow";
$query = mysqli_query($conn, $sql);
$counter =1;
while($row = mysqli_fetch_array($query)){
?>
<tbody>
<tr>
<td><?php echo $counter++; ?></td>
<td><?php echo $row['bookName'];?></td>
<td><?php echo $row['memberName']; ?></td>
<td><?php echo $row['matricNo']; ?></td>
</tr>
</tbody>
<?php }
?>
</table>
<!-- // echo "<td>
// <a href='lendbook.php'>
// <button class='btn btn-success' name='submit'>Borrow Now</button>
// </a>
-->
<!-- <td><button class="btn btn-info" data-toggle="modal" data-target="#popUpWindow">BORROW NOW</button></td>-->
<!-- <td><a href="lendbook.php" <button class="btn btn-success ">Borrow Now</button></a></td> -->
</div>
</div>
<div class="mod modal fade" id="popUpWindow">
<div class="modal-dialog">
<div class="modal-content">
<!-- header begins here -->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title"> Warning</h3>
</div>
<!-- body begins here -->
<div class="modal-body">
<p>Are you sure you want to delete this book?</p>
</div>
<!-- button -->
<div class="modal-footer ">
<button class="col-lg-4 col-sm-4 col-xs-6 col-md-4 btn btn-warning pull-right" style="margin-left: 10px" class="close" data-dismiss="modal">
No
</button>
<button class="col-lg-4 col-sm-4 col-xs-6 col-md-4 btn btn-success pull-right" class="close" data-dismiss="modal" data-toggle="modal" data-target="#info">
Yes
</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="info">
<div class="modal-dialog">
<div class="modal-content">
<!-- header begins here -->
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3 class="modal-title"> Warning</h3>
</div>
<!-- body begins here -->
<div class="modal-body">
<p>Book deleted <span class="glyphicon glyphicon-ok"></span></p>
</div>
</div>
</div>
</div>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/bootstrap.js"></script>
<script type="text/javascript">
//$(".show-in").on("click", function(e){
e.preventDefault();
var book_id = $(this).find(".book-id"); //Get the id of the book;
book_id = book_id.val();
var book_name = $(this).find(".book-name"); //Get the name of the book;
book_name = book_name.val();
var purpose = $(this).find(".purpose"); //Get the purpose of the passing the value;
purpose = purpose.val();
if(purpose == "show"){
alert(book_name);
}
//})
</script>
</body>
</html>