-
Notifications
You must be signed in to change notification settings - Fork 0
/
issue.php
237 lines (148 loc) · 5.66 KB
/
issue.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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="w3.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome Home</title>
</head>
<body >
<div class="w3-sidebar w3-bar-block w3-card w3-animate-left" style="display:none" id="mySidebar">
<button onclick="w3_close()" class="w3-bar-item w3-button w3-large">Close ×</button>
<a class="w3-bar-item w3-button" href="index.php">HOME</a>
<a class="w3-bar-item w3-button" href="dashboard.php">DASHBOARD</a>
<a class="w3-bar-item w3-button" href="logout.php">LOGOUT</a>
</div>
<div class="w3-container w3-animate-right" id="main">
<?php include 'header.php';?>
<div class="w3-container" >
<?php
include 'db.php';
include("auth.php");
$no="";
if(isset($_POST['submit']) && $_POST['new']==1)
{
$cglcode=$_REQUEST['cglcode'];
$br=strtoupper($_REQUEST['br']);
$stdno=$_REQUEST['stdno'];
$sdpin = $cglcode."-".$br."-".$stdno;
date_default_timezone_set('Asia/Kolkata');
$trn_date=date("Y-m-d H:i:s");
$accno=$_REQUEST['no'];
$sel_query_verify="Select * from bookdb where no='$accno' ;";
$result_t = mysqli_query($con,$sel_query_verify);
while($row_t = mysqli_fetch_assoc($result_t)) {
echo '<br/><br/> <div id="id01" class="w3-modal w3-animate-zoom">
<div class="w3-modal-content w3-padding-16 w3-card">
<div class="w3-container">
<span onclick="document.getElementById("id01").style.display="none"" class="w3-button w3-display-topright">×</span><div class="w3-responsive w3-card"><table class="w3-table-all w3-hoverable">
<thead>
<tr class="w3-hover-grey w3-red">
<center><th>ACC NO</th></center>
<center><th>BOOK NAME</th></center>
<center><th>AUTHOR</th></center>
<center><th>BOOK CATEGORY</th></center>
<center><th>PUBLISHER</th></center>
<center><th>PUBLISHED YEAR</th></center>
<center><th>EDITION</th></center>
<center><th>NO.OF PAGES</th></center>
<center><th>PRICE</th></center>
<center><th>RACK</th></center>
</tr>
</thead>
';
echo '<tr>
<td align="center" style="font-weight:bold;"> '.$row_t["no"].'</td>
<td align="center" style="font-weight:bold;">'.$row_t["name"].' </td>
<td align="center" style="font-weight:bold;">'.$row_t["author"].' </td>
<td align="center" style="font-weight:bold;">'. $row_t["bookcategory"].'</td>
<td align="center" style="font-weight:bold;">'. $row_t["publisher"].'</td>
<td align="center" style="font-weight:bold;">'. $row_t["pyear"].'</td>
<td align="center" style="font-weight:bold;">'.$row_t["edition"].'</td>
<td align="center" style="font-weight:bold;">'. $row_t["pages"].'</td>
<td align="center" style="font-weight:bold;">'. $row_t["price"].'</td>
<td align="center" style="font-weight:bold;">'. $row_t["rack"].'</td>
</tr></table></div>';
}
$q="UPDATE bookdb SET status='0',pin='$sdpin',date='$trn_date' WHERE no='$accno';";
$q2="insert into booksts (no,pin) values('$accno','$sdpin') ";
$sts=mysqli_query($con,$q) or die(mysqli_error($con));
$sts2=mysqli_query($con,$q2) or die(mysqli_error($con));
$report_q="insert into issue_reports (no,pin,date) values('$accno','$sdpin','$trn_date');";
if($sts && $sts2)
{
mysqli_query($con,$report_q) or die(mysqli_error($con));
echo'<script>document.getElementById("id01").style.display="block"</script>';
$alt='<center><p class="w3-panel w3-green w3-round">THE ABOVE BOOK ISSUED TO '.$sdpin.'<p></center><br/>';
echo $alt;
echo '<center><a class="w3-button w3-red" href="dashboard.php"><b>DONE</b></a></center></div>
</div>
</div>';
}
else{
echo '<center><p style="
color:red;
font-size:2em;
">TRANSATION IS CANCLED<p></center><br/>';
}
}
?>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<div class="w3-container w3-card-4 w3-light-grey w3-text-blue w3-margin w3-padding-16">
<form action="" method="post" align="center">
<input type="hidden" name="new" value="1" /></input>
<div class="w3-table-all w3-responsive">
<table>
<tr><th><lable>PIN:</lable></th>
<th><input type="textbox" style="width:100px;" name="cglcode" required ></input></th><th><b>-</b></th>
<th><select name="br" style="width:100px;" >
<option value="CM">CM</option>
<option value="EC">EC</option>
<option value="EE">EE</option>
<option value="M">M</option>
</select></th><th><b>-</b></th>
<th><input type="textbox" style="width:100px;" name="stdno" required ></th>
</tr></table>
</div>
<br/>
<lable><b>ENTER BOOK ACC.NO</lable></b>
<input class="w3-input" list="brow" name="no" placeholder="ENTER BOOK NAME[or] ACC.NO">
<datalist id="brow">
<?php
$sel_query="Select * from bookdb where status='1' ;";
$result = mysqli_query($con,$sel_query);
while($row = mysqli_fetch_assoc($result)) { ?>
<option value="<?php echo $row["no"]; ?>"><?php echo $row["no"].'-' .$row["name"]; ?></option>
<?php }?>
</datalist>
<br/><br/>
<br/>
<br/>
<div class="submitbtn">
<input type="submit" name="submit" class="w3-button w3-blue" placeholder="enter your msg">
</div>
</form></div>
<br/>
<?php include 'footer.php';?>
<script>
function w3_open() {
document.getElementById("main").style.marginLeft = "25%";
document.getElementById("mySidebar").style.width = "25%";
document.getElementById("mySidebar").style.display = "block";
document.getElementById("openNav").style.display = 'none';
}
function w3_close() {
document.getElementById("main").style.marginLeft = "0%";
document.getElementById("mySidebar").style.display = "none";
document.getElementById("openNav").style.display = "inline-block";
}
</script>
</div>
</body>
</html>