-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.php
More file actions
280 lines (234 loc) · 13.1 KB
/
options.php
File metadata and controls
280 lines (234 loc) · 13.1 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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
<?php
session_start();
include "connection.php";
$res19=mysqli_query($link,"select username from student_register where username='$_SESSION[username]'");
$count19=mysqli_num_rows($res19);
if(!isset($_SESSION["username"]) || ($count19==0)){
?>
<script type="text/javascript">
window.location="student_login.php";
</script>
<?php
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Student Beneficiary System | SBS </title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/nprogress.css" rel="stylesheet">
<link href="css/custom.min.css" rel="stylesheet">
</head>
<body class="nav-md">
<div class="container body">
<div class="main_container">
<div class="col-md-3 left_col">
<div class="left_col scroll-view">
<div class="navbar nav_title" style="border: 0;">
<a href="#" class="site_title"><i class="fa fa-book"></i> <span>SBS</span></a>
</div>
<div class="clearfix"></div>
<!-- menu profile quick info -->
<div class="profile clearfix">
<div class="profile_info">
<span>Welcome,</span>
<h2><?php echo $_SESSION["username"];?></h2>
</div>
<div class="clearfix"></div>
</div>
<!-- /menu profile quick info -->
<br/>
<!-- sidebar menu -->
<div id="sidebar-menu" class="main_menu_side hidden-print main_menu">
<div class="menu_section">
<h3>General</h3>
<ul class="nav side-menu">
<li><a href="shome.php"><i class="fa fa-home"></i> Home <span class="fa fa-chevron"></span></a>
</li>
<li><a href="sabout_us.php"><i class="fa fa-info-circle"></i> About Us <span class="fa fa-chevron"></span></a>
</li>
<li><a href="scontact.php"><i class="fa fa-mobile-phone"></i> Contact <span class="fa fa-chevron"></span></a>
</li>
<li><a href="sold_book_status.php"><i class="fa fa-check"></i> Sold book status <span class="fa fa-chevron"></span></a>
</li>
<li><a href="sold_books.php"><i class="fa fa-list-alt"></i> Sold books <span class="fa fa-chevron"></span></a>
</li>
<li><a href="bought_books.php"><i class="fa fa-gavel"></i> Bought books <span class="fa fa-chevron"></span></a>
</li>
<li><a href="wishlist_books.php"><i class="fa fa-heart"></i> Wishlist <span class="fa fa-chevron"></span></a>
</li>
<li><a href="add_books.php"><i class="fa fa-money"></i> Sell book <span class="fa fa-chevron"></span></a>
</li>
<li><a href="pretranreport.php"><i class="fa fa-history"></i> Previous Transaction reports <span class="fa fa-chevron"></span></a>
</li>
<li><a href="notifications.php"><i class="fa fa-bell"></i> Notifications <span class="fa fa-chevron"></span></a>
</li>
<li><a href="changepassword.php"><i class="fa fa-key"></i> Change Password <span class="fa fa-chevron"></span></a>
</li>
</ul>
</div>
</div>
</div>
</div>
<!-- top navigation -->
<div class="top_nav">
<div class="nav_menu">
<nav>
<div class="nav toggle">
<a id="menu_toggle"><i class="fa fa-bars"></i></a>
</div>
<ul class="nav navbar-nav navbar-right">
<li class="">
<a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown"
aria-expanded="false">
<?php $res2=mysqli_query($link,"select fname,lname from student where username='$_SESSION[username]'"); $row2=mysqli_fetch_array($res2); echo $row2["fname"]." ".$row2["lname"];?>
<span class=" fa fa-angle-down"></span>
</a>
<ul class="dropdown-menu dropdown-usermenu pull-right">
<li><a href="logout.php"><i class="fa fa-sign-out pull-right"></i> Log Out</a></li>
</ul>
</li>
</ul>
</nav>
</div>
</div>
<!-- /top navigation -->
<!-- page content area main -->
<div class="right_col" role="main">
<div class="">
<div class="clearfix"></div>
<div class="row" style="min-height:500px">
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>Search Books</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<form name="form1" action="" method="post">
<table class="table table-bordered">
<tr>
<td>
<select name="book" class="form-control selectpicker">
<?php
$res5=mysqli_query($link,"select distinct bookname from books where ((sold='No') and (bookid not in (select bookid from transaction where usn=(select usn from student where username='$_SESSION[username]'))))");
while($row5=mysqli_fetch_array($res5))
{
echo "<option>";
echo $row5["bookname"];
echo "</option>";
}
?>
</select>
</td>
<td><input type="submit" name="submit1" value="Search" class="form-control btn btn-default"></td>
</tr>
</table>
</form>
<?php
if(isset($_POST["submit1"]))
{
$res3=mysqli_query($link,"select * from books where (bookname like('%$_POST[book]%') and (sold='No' and bookid not in (select bookid from transaction where usn in (select usn from student where username='$_SESSION[username]') )))");
echo "<table class='table table-bordered'>";
echo "<tr>";
echo "<th>";
echo "<b>"."Book name"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Course id"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Book isbn"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Publication name"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Author name"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Edition"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Actual price"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Selling price"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Owned by"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Contact"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Email"."</b>";
echo "</th>";
echo "<th>";
echo "<b>"."Buy?"."</b>";
echo "</th>";
echo "</tr>";
while($row3=mysqli_fetch_array($res3))
{
echo "<tr>";
echo "<td>";
echo "<b>".$row3["bookname"]."</b>";
echo "</td>";
echo "<td>";
echo "<b>".$row3["courseid"]."</b>";
echo "</td>";
echo "<td>";
echo "<b>".$row3["bookisbn"]."</b>";
echo "</td>";
echo "<td>";
echo "<b>".$row3["publicationname"]."</b>";
echo "</td>";
echo "<td>";
echo "<b>".$row3["authorname"]."</b>";
echo "</td>";
echo "<td>";
echo "<b>".$row3["edition"]."</b>";
echo "</td>";
echo "<td>";
echo "<b>".$row3["actualprice"]."</b>";
echo "</td>";
echo "<td>";
echo "<b>".$row3["sellingprice"]."</b>";
echo "</td>";
$res15=mysqli_query($link,"select * from student where usn in (select usn from transaction where bookid='$row3[bookid]')");
$row15=mysqli_fetch_array($res15);
echo "<td>";
echo "<b>".$row15["fname"]." ".$row15["lname"]."</b>";
echo "</td>";
$res16=mysqli_query($link,"select * from student_register where username='$row15[username]'");
$row16=mysqli_fetch_array($res16);
echo "<td>";
echo "<b>".$row16["phoneno"]."</b>";
echo "</td>";
echo "<td>";
?>
<a href="mailto: <?php echo $email?>"style="color:black"><?php echo $row16['email'] ?></a><?php
echo "</td>";
echo "<td>"; ?> <a href="buy.php?id=<?php echo $row3['bookid']; ?>">Buy</a> <?php echo "</td>";
echo "</tr>";
}
}
echo "</tr>";
echo "</table>";
?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /page content -->
<?php
include "footer.php";
?>