Skip to content

Commit 3ad5545

Browse files
committed
AddBooks edited
1 parent 240f913 commit 3ad5545

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

addBooks.php

+7-22
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,12 @@
9696
<td colspan="0" align="left"><input type="text" name="booktitle" style="width:250px; padding:4px;" value="<?php echo $edit['title']; ?>"></td>
9797
</tr>
9898
<tr>
99-
<td >No. of authors </td><td>:</td>
100-
<td align="left"><input type="text" style="width:250px;padding:4px;" name="authortype" value="<?php echo $edit['type']; ?>"></td>
101-
102-
<?php
103-
104-
?>
10599

106100

107101
<td >Book Author(s)</td><td>:</td>
108-
<td align="left"><input type="text" style="width:250px;padding:4px;" name="author" value="<?php echo $edit['author_name']; ?>"></td>
102+
<td align="left" width="200px"><input type="text" style="width:250px;padding:4px;" name="author" value="<?php echo $edit['author_name']; ?>"></td>
103+
<td align="left">[if multiple, seperate with ","(comma)]</td>
104+
109105
</tr>
110106
<tr>
111107
<td>
@@ -151,7 +147,6 @@
151147
</td>
152148
<?php
153149

154-
$branch_id="1";
155150

156151
switch ($branch_name) {
157152
case "Oak Lawn":
@@ -173,7 +168,6 @@
173168
}
174169
?>
175170
<td ></td><td></td>
176-
<td align="left">[if multiple, seperate with ","(comma)]</td>
177171

178172
</tr>
179173

@@ -251,11 +245,11 @@
251245
$insert1="Insert into book(book_id,title)
252246
values('$_POST[book_id]','$_POST[booktitle]')";
253247

254-
$insert2="Insert into book_copies(book_id, branch_id, no_of_copies)
255-
values('$_POST[book_id]',".$branch_id.",'$_POST[copies]')";
256248

257-
$insert3="Insert into book_authors(book_id, author_name, type)
249+
$insert2="Insert into book_authors(book_id, author_name, type)
258250
values('$_POST[book_id]','$_POST[author]','".$auth_type."')";
251+
$insert3="Insert into book_copies(book_id, branch_id, no_of_copies)
252+
values('$_POST[book_id]',".$branch_id.",'$_POST[copies]')";
259253

260254

261255

@@ -264,8 +258,7 @@
264258
$rs3=mysql_query($insert3) or die(mysql_error());
265259

266260
if($rs1 && $rs2 && $rs3){ ?>
267-
268-
<script>
261+
<script>
269262
$(document).ready(function(){
270263
$("#success").fadeIn(1000);
271264
});
@@ -308,14 +301,6 @@
308301
</tr>
309302
</table>
310303
</div>
311-
<div style="width:300px; float:left; margin-left:20px; margin-top:10px;">
312-
<table border="0">
313-
<tr>
314-
<td> </td>
315-
</tr>
316-
</table>
317-
</div>
318-
319304
</form>
320305

321306

0 commit comments

Comments
 (0)