-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsellbook.php
198 lines (188 loc) · 7.55 KB
/
sellbook.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
<?php
require_once('functions/function.php');
get_header();
?>
<!-- slider-start -->
<div class="slider-area">
<div class="page-title">
<div class="single-slider slider-height slider-height-breadcrumb d-flex align-items-center" style="background-image: url(img/bg/sell.jpg);">
<div class="container">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="slider-content slider-content-breadcrumb text-center">
<h1 class="white-color f-700">Sell Books</h1>
<nav class="text-center" aria-label="breadcrumb">
<ol class="breadcrumb justify-content-center">
<li class="breadcrumb-item"><a href="index.php">Buy Book</a></li>
<li class="breadcrumb-item active" aria-current="page">Sell Books</li>
</ol>
</nav>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- slider-end -->
<!--gap div start-->
<div class="my-5">
</div>
<!--gap div end-->
<!--Sell page side tutorial start-->
<div class="tutorial-area">
<div class="container">
<div class="row">
<div class="col-md-1">
</div>
<div class="col-md-12">
<div class="card text-center">
<div class="card-header">
Unused Book Selling Process
</div>
<div class="card-body">
<h5 class="card-title">Unused Book Selling Process</h5>
<p class="card-text">
This is a short video, which helps beginners to sell their unused books via our online system. It will helps a seller to sell their unused books with a good price. Sell easily set books ads and publish the ads in the system. On the other hand, Buyer can view and buy the books.
</p>
<p class="card-text">
Sell needs to fill up some requirements as like:
</p>
<p class="card-text">
1. Fill the below form with valid data
</p>
<p class="card-text">
2. Give Clear Information
</p>
<a href="#sellbookform" class="btn btn-primary">Sell Your Books</a>
</div>
<div class="card-footer text-muted">
2 days ago
</div>
</div><!--Sell page side tutorial end-->
</div>
<div class="col-md-1">
</div>
</div>
</div>
</div>
<!--gap div start-->
<div class="my-5">
</div>
<!--gap div end-->
<!-- video start -->
<div class="container">
<div class="video-area">
<div class="container">
<div class="row">
<div class="col-xl-12">
<div class="video-wrapper text-center">
<div class="video-content">
<a class="popup-video" href="https://www.youtube.com/watch?v=sCbbMZ-q4-I&list=RDMMsCbbMZ-q4-I&start_radio=1"><img src="img/video/play_icon.png" alt=""></a>
<span>Watch Our Latest Video</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- video end -->
<!--sell book form start-->
<div class="sellbook-area pt-65 gray-bg">
<div class="container">
<div class="row ml-5">
<!--Sell page form start-->
<div class="col-md-8 col-lg-8 col-xl-8 col-sm-8 bg-white my-4 ml-5 py-5" id="sellbookform">
<div class="">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="breadcrumb-item" aria-current="page"><a href="#"><span class="text-center">Fill the form for selling books</span></a></li>
</ol>
</nav>
</div>
<form class="form-horizontal" action="" method="post" enctype="multipart/form-data">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="col-md-9 heading_title">
</div>
<div class="clearfix"></div>
</div>
<div class="panel-body">
<?php
if(!empty($_POST)){
$secbook_title=$_POST['book_title'];
$secbook_author=$_POST['book_author'];
$secbook_edition=$_POST['book_edition'];
$secbook_price=$_POST['book_price'];
$seller_num=$_POST['seller_num'];
$image=$_FILES['pic'];
$imageName='user_'.time().'_'.rand(10000000,1000000000).'.'.pathinfo($image['name'],PATHINFO_EXTENSION);
if(!empty($secbook_title)){
$insert="INSERT INTO adm_selloldbook(secbook_title,secbook_author,secbook_edition,secbook_price,seller_num,secbook_img)
VALUES('$secbook_title','$secbook_author','$secbook_edition','$secbook_price','$seller_num','$imageName')";
if(mysqli_query($con,$insert)){
move_uploaded_file($image['tmp_name'],'admin/uploads/'.$imageName);
echo "Second-Hand book Successfully Published";
}else{
echo "Failed publish";
}
}else{
echo "Please, enter book title";
}
}
?>
<div class="form-group">
<label for="" class="col-sm-3 control-label">Book Title</label>
<div class="col-md-8">
<input type="text" class="form-control" name="book_title">
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-3 control-label">Book Author</label>
<div class="col-md-8">
<input type="text" class="form-control" name="book_author">
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-3 control-label">Book Edition</label>
<div class="col-md-8">
<input type="text" class="form-control" name="book_edition">
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-3 control-label">Book Price</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="book_price">
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-3 control-label">Seller Phone Number</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="seller_num">
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-3 control-label">Book Cover image(270*326)</label>
<div class="col-sm-8">
<input type="file" name="pic">
</div>
</div>
</div>
<div class="panel-footer col-xl-6 text-center mt-5 ml-5">
<button class="btn btn-sm btn-primary">Publish</button>
</div>
</div>
</form>
</div>
<!--Sell page form end-->
</div>
</div>
</div>
<!---->
<!---->
</div>
<!--sell book form start-->
<?php
get_footer();
?>