Repository navigation
Expand file tree
/
Copy pathedit.php
More file actions
170 lines (142 loc) · 5.79 KB
/
Copy pathedit.php
File metadata and controls
170 lines (142 loc) · 5.79 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
<?php
//if (session_status() !== PHP_SESSION_ACTIVE) {session_start();}
if(session_id() == '' || !isset($_SESSION)){session_start();}
if(!isset($_SESSION["username"])) {
header("location:index.php");
}
include 'config.php';
?>
<!doctype html>
<html class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Register || Online book Sharing Platform "Porao"</title>
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
</head>
<body>
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name">
<h1><a href="index.php">Online book Sharing Platform "Porao"</a></h1>
</li>
<li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li>
</ul>
<section class="top-bar-section">
<!-- Right Nav Section -->
<ul class="right">
<li><a href="about.php">About</a></li>
<li><a href="books.php">Books</a></li>
echo '<li><a href="requests.php">Your Requests</a></li>';
<?php
if(isset($_SESSION['username'])){
echo '<li class="active"><a href="ShareBookAdd.php">Share Book</a></li>';
echo '<li><a href="DonateBookAdd.php">Donate Book</a></li>';
echo '<li class="active"><a href="view.php">View Books</a></li>';
echo '<li><a href="logout.php">Log Out</a></li>';
}
else{
echo '<li><a href="login.php">Log In</a></li>';
echo '<li><a href="register.php">Register</a></li>';
}
?>
</ul>
</section>
</nav>
<form method="POST" action="update_books.php" style="margin-top:30px;">
<?php
$edit_id = (int)$_GET['edit'];
$edit_result = $mysqli->query("SELECT * FROM books WHERE id = '{$edit_id}'");
$edit_field = mysqli_fetch_assoc($edit_result);
?>
<div class="row">
<div class="small-8">
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">ISBN</label>
</div>
<div class="small-8 columns">
<input type="number" id="right-label" name="id" value=<?php echo $edit_field['id']?> readonly>
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Book Title</label>
</div>
<div class="small-8 columns">
<textarea type="text" id="right-label" name="book_title"><?php echo $edit_field['title']?></textarea>
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Author</label>
</div>
<div class="small-8 columns">
<input type="text" id="right-label" name="author" value=<?php echo $edit_field['author']?>>
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Edition</label>
</div>
<div class="small-8 columns">
<input type="number" id="right-label" name="edition" value=<?php echo $edit_field['edition']?>>
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Category</label>
</div>
<div class="small-8 columns">
<input type="text" id="right-label" name="category" value=<?php echo $edit_field['category']?>>
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Price</label>
</div>
<div class="small-8 columns">
<input type="number" id="right-label" name="price" value=<?php echo $edit_field['price']?>>
</div>
</div>
<div class="row">
<div class="small-4 columns">
<label for="right-label" class="right inline">Available Units</label>
</div>
<div class="small-8 columns">
<input type="number" id="right-label" name="qty" value=<?php echo $edit_field['qty']?>>
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="photo">Product Photo:</label>
<input class="form-control" type="file" name="photo" id="photo" accept=<?php echo $edit_field['image']?>>
</div>
<div class="row">
<div class="form-group col-md-6">
<label for="description">Description</label>
<textarea class="form-control" name="description" id="description" rows="6" ><?php echo $edit_field['description']?></textarea>
</div>
</div>
<div class="small-8 columns">
<input type="submit" id="right-label" value="Update" style="background: #0078A0; border: none; color: #fff; font-family: 'Helvetica Neue', sans-serif; font-size: 1em; padding: 10px;">
</div>
</div>
</div>
</div>
</form>
<div class="row" style="margin-top:10px;">
<div class="small-12">
<footer>
<p style="text-align:center; font-size:0.8em;">© Online book Sharing Platform "Porao". All Rights Reserved.</p>
</footer>
</div>
</div>
<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>