-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.html
86 lines (67 loc) · 2.75 KB
/
search.html
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
<html>
<head>
</head>
<body align="center">
<h1>किताब ढूंढें </h1>
<form action='' method='post' >
<input type="text" name="searchBook" placeholder="Book Name" required > <br/>
<input type="radio" name="searchRadio" value="bookName" id="Bookname">किताब का नाम
<input type="radio" name="searchRadio" value="Author" >लेखक / लेखिका
<input type="radio" name="searchRadio" value="BookCategory">किताब श्रेणी
<input type="radio" name="searchRadio" value="BookNumber">किताब संख्या
<input type="submit" >
</form>
<!-- <p><a href="viewRequests.php">View Requests</a></p> -->
<div>
<?php
include('config.php');
if(isset($_POST['searchBook']) && !empty($_POST['searchBook'])){
$search_query = $_POST['searchBook'];
if($_POST['searchRadio'] == "bookName"){
$query = mysqli_query($dbConn,"select * from bookdata where UPPER(bName) LIKE UPPER('%$search_query%')") or die(mysqli_error($dbConn));
}
else if($_POST['searchRadio'] == "Author"){
$query = mysqli_query($dbConn,"select * from bookdata where UPPER(bAuthor) LIKE UPPER('%$search_query%')") or die(mysqli_error($dbConn));
}else if($_POST['searchRadio'] == "BookCategory"){
$query = mysqli_query($dbConn,"select * from bookdata where UPPER(bCategory) LIKE UPPER('%$search_query%')") or die(mysqli_error($dbConn));
}
else {
$query = mysqli_query($dbConn,"select * from bookdata where bNo = '$search_query'") or die(mysqli_error($dbConn));
}
echo "<table border='1' cellpadding='10'>";
echo "<tr>
<th><font color='#3984DB'>किताब क्रम संख्या </font></th>
<th><font color='#3984DB'>नाम </font></th>
<th><font color='#3984DB'>लेखक / लेखिका </font></th>
<th><font color='#3984DB'> श्रेणी </font></th>
<th><font color='#3984DB'>शेल्फ संख्या </font></th>
<th><font color='#3984DB'>मौजूदगी </font></th>
<th><font color='#3984DB'>निवेदन करें </font></th>
</tr>";
while($row = mysqli_fetch_array( $query ))
{
$qty = $row['rqty'];
echo "<tr>";
echo '<td>' . $row['bNo'] . '</td>';
echo '<td>' . $row['bName'] . '</td>';
echo '<td>' . $row['bAuthor'] . '</td>';
echo '<td>' . $row['bCategory'] . '</td>';
echo '<td>' . $row['bShelfNo'] . '</td>';
if($qty>0) {
echo '<td>' . $row['status'] . '</td>';
echo '<td><a href="addRequest.php?id=' . $row['bNo'] . '">निवेदन करें </a></td>';
} else{
echo '<td>' . $row['status'] . '</td>';
echo '<td>निवेदन नहीं कर सकते</td>';
}
echo "</tr>";
}
echo "</table>";
}
?>
</div>
<script>
document.getElementById("Bookname").click();
</script>
</body>
</html>