-
Notifications
You must be signed in to change notification settings - Fork 0
/
add-listing-step-3.php
364 lines (339 loc) · 19.7 KB
/
add-listing-step-3.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<?php
include "header.php";
if (file_exists('config/user_authentication.php')) {
include('config/user_authentication.php');
}
if (file_exists('config/general_user_authentication.php')) {
include('config/general_user_authentication.php');
}
if (file_exists('config/listing_page_authentication.php')) {
include('config/listing_page_authentication.php');
}
//To check the listings count with current plan starts
$plan_type_listing_count = $user_plan_type['plan_type_listing_count'];
$listing_count_user = getCountUserListing($_SESSION['user_id']);
if ($listing_count_user >= $plan_type_listing_count) {
$_SESSION['status_msg'] = $BIZBOOK['LISTINGS_LIMIT_EXCEED_MESSAGE'];
header('Location: db-all-listing');
}
//To check the listings count with current plan ends
//Get & Process Listing Data
//if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if (isset($_POST['listing_submit'])) {
// Service Provided Details
$_SESSION['service_id'] = $_POST["service_id"];
// ************************ Service Image Upload starts **************************
$all_service_image = $_FILES['service_image'];
$all_service_image23 = $_FILES['service_image']['name'];
for ($k = 0; $k < count($all_service_image23); $k++) {
if (!empty($_FILES['service_image']['name'][$k])) {
$file = rand(1000, 100000) . $_FILES['service_image']['name'][$k];
$file_loc = $_FILES['service_image']['tmp_name'][$k];
$file_size = $_FILES['service_image']['size'][$k];
$file_type = $_FILES['service_image']['type'][$k];
$allowed = array("image/jpeg", "image/pjpeg", "image/png", "image/gif", "image/webp", "image/svg", "application/pdf", "application/msword", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.openxmlformats-officedocument.wordprocessingml.template");
if(in_array($file_type, $allowed)) {
$folder = "images/services/";
$new_size = $file_size / 1024;
$new_file_name = strtolower($file);
$event_image = str_replace(' ', '-', $new_file_name);
//move_uploaded_file($file_loc, $folder . $event_image);
$service_image1[] = compressImage($event_image, $file_loc, $folder, $new_size);
}else{
$service_image1[] = '';
}
}
if($service_image1 != NULL){
$service_image = implode(",", $service_image1);
}else{
$service_image = '';
}
}
// ************************ Service Image Upload ends **************************
$_SESSION['service_image'] = $service_image;
}
//} else {
//
// header('Location: add-listing-step-1');
//}
?>
<!-- START -->
<!--PRICING DETAILS-->
<section class="<?php if ($footer_row['admin_language'] == 2) {
echo "lg-arb";
} ?> login-reg">
<div class="container">
<div class="row">
<div class="add-list-ste">
<div class="add-list-ste-inn">
<ul>
<li>
<a href="add-listing-step-1">
<span><?php echo $BIZBOOK['STEP1']; ?></span>
<b><?php echo $BIZBOOK['BASIC_INFO']; ?></b>
</a>
</li>
<li>
<a href="add-listing-step-2">
<span><?php echo $BIZBOOK['STEP2']; ?></span>
<b><?php echo $BIZBOOK['SERVICES']; ?></b>
</a>
</li>
<li>
<a href="add-listing-step-3" class="act">
<span><?php echo $BIZBOOK['STEP3']; ?></span>
<b><?php echo $BIZBOOK['OFFERS']; ?></b>
</a>
</li>
<li>
<a href="#!">
<span><?php echo $BIZBOOK['STEP4']; ?></span>
<b><?php echo $BIZBOOK['MAP']; ?></b>
</a>
</li>
<li>
<a href="#!">
<span><?php echo $BIZBOOK['STEP5']; ?></span>
<b><?php echo $BIZBOOK['OTHER']; ?></b>
</a>
</li>
<li>
<a href="#!">
<span><?php echo $BIZBOOK['STEP6']; ?></span>
<b><?php echo $BIZBOOK['DONE']; ?></b>
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="login-main add-list">
<div class="log-bor"> </div>
<span class="steps"><?php echo $BIZBOOK['STEP3']; ?></span>
<div class="log">
<div class="login">
<h4><?php echo $BIZBOOK['SPECIAL_OFFERS']; ?></h4>
<div class="add-list-off">
<span class="add-list-add-btn lis-add-off" title="add new offer">+</span>
<span class="add-list-rem-btn lis-add-rem" title="remove offer">-</span>
<form action="add-listing-step-4.php" class="listing_form_3" id="listing_form_3"
name="listing_form_3" method="post" enctype="multipart/form-data">
<ul>
<?php
$listings_a_row_service_1_name = $_SESSION['service_1_name'];
$listings_a_row_service_1_price = $_SESSION['service_1_price'];
$listings_a_row_service_1_detail = $_SESSION['service_1_detail'];
$listings_a_row_service_1_view_more = $_SESSION['service_1_view_more'];
// $ser_1_name_Array = explode(',', $listings_a_row_service_1_name);
// $ser_1_price_Array = explode(',', $listings_a_row_service_1_price);
// $ser_1_detail_Array = explode(',', $listings_a_row_service_1_detail);
$listings_a_row_service_1_name_count = isset($listings_a_row_service_1_name) ? count($listings_a_row_service_1_name) : 0; //Get count of array
if ($listings_a_row_service_1_name_count != 0) {
$zipped = array_map(null, $listings_a_row_service_1_name, $listings_a_row_service_1_price, $listings_a_row_service_1_detail, $listings_a_row_service_1_view_more);
foreach ($zipped as $tuple) {
$tuple[0]; // offer name
$tuple[1]; // offer Price
$tuple[2]; // offer Detail
$tuple[3]; // offer View more
?>
<li>
<!--FILED START-->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="text" name="service_1_name[]"
value="<?php echo $tuple[0]; ?>" class="form-control"
placeholder="<?php echo $BIZBOOK['OFFER_NAME']; ?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input type="text" name="service_1_price[]"
onkeypress="return isNumber(event)"
value="<?php echo $tuple[1]; ?>" class="form-control"
placeholder="<?php echo $BIZBOOK['PRICE']; ?>">
</div>
</div>
</div>
<!--FILED END-->
<!--FILED START-->
<div class="row">
<div class="col-md-12">
<div class="form-group">
<textarea name="service_1_detail[]" class="form-control"
placeholder="<?php echo $BIZBOOK['DETAILS_ABOUT_OFFER']; ?>"><?php echo $tuple[2]; ?></textarea>
</div>
</div>
</div>
<!--FILED END-->
<!--FILED START-->
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="fil-img-uplo">
<span class="dumfil"><?php echo $BIZBOOK['CHOOSE_OFFER_IMAGE']; ?></span>
<input type="file" name="service_1_image[]" accept="image/*,.jpg,.jpeg,.png" class="form-control">
</div>
</div>
</div>
</div>
<!--FILED END-->
<!--FILED START-->
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input type="text" name="service_1_view_more[]"
value="<?php echo $tuple[3]; ?>" class="form-control"
placeholder="<?php echo $BIZBOOK['VIEW_MORE_LINK']; ?>">
</div>
</div>
</div>
<!--FILED END-->
</li>
<?php
}
} else {
?>
<li>
<!--FILED START-->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<input type="text" name="service_1_name[]" class="form-control"
placeholder="<?php echo $BIZBOOK['OFFER_NAME']; ?>">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<input type="text" name="service_1_price[]"
onkeypress="return isNumber(event)"
class="form-control"
placeholder="<?php echo $BIZBOOK['PRICE']; ?>">
</div>
</div>
</div>
<!--FILED END-->
<!--FILED START-->
<div class="row">
<div class="col-md-12">
<div class="form-group">
<textarea name="service_1_detail[]" class="form-control"
placeholder="<?php echo $BIZBOOK['DETAILS_ABOUT_OFFER']; ?>"></textarea>
</div>
</div>
</div>
<!--FILED END-->
<!--FILED START-->
<div class="row">
<div class="col-md-12">
<div class="form-group">
<div class="fil-img-uplo">
<span class="dumfil"><?php echo $BIZBOOK['CHOOSE_OFFER_IMAGE']; ?></span>
<input type="file" name="service_1_image[]" accept="image/*,.jpg,.jpeg,.png" class="form-control">
</div>
</div>
</div>
</div>
<!--FILED END-->
<!--FILED START-->
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input type="text" name="service_1_view_more[]"
class="form-control"
placeholder="<?php echo $BIZBOOK['VIEW_MORE_LINK']; ?>">
</div>
</div>
</div>
<!--FILED END-->
</li>
<?php
}
?>
</ul>
</div>
<ul>
<hr>
<li>
<!--- START -->
<div class="list-show-oth-modu">
<h4><?php echo $BIZBOOK['PRODUCTS']; ?></h4>
<select name="listing_products[]" multiple="multiple" class="chosen-select form-control" data-placeholder="Select Products">
<?php
foreach (getAllProductUser($_SESSION['user_id']) as $row) {
?>
<option
value="<?php echo $row['product_id']; ?>"><?php echo $row['product_name']; ?></option>
<?php
}
?>
</select>
</div>
<!--- END -->
</li>
<hr>
<li>
<!--- START -->
<div class="list-show-oth-modu">
<h4><?php echo $BIZBOOK['EVENTS']; ?></h4>
<select name="listing_events[]" multiple="multiple" class="chosen-select form-control" data-placeholder="Select Events">
<?php
foreach (getAllUserEvents($_SESSION['user_id']) as $row) {
?>
<option
value="<?php echo $row['event_id']; ?>"><?php echo $row['event_name']; ?></option>
<?php
}
?>
</select>
</div>
<!--- END -->
</li>
</ul>
<!--FILED START-->
<div class="row">
<div class="col-md-6">
<a href="add-listing-step-2">
<button type="button"
class="btn btn-primary"><?php echo $BIZBOOK['PREVIOUS']; ?></button>
</a>
</div>
<div class="col-md-6">
<button type="submit" name="listing_submit"
class="btn btn-primary"><?php echo $BIZBOOK['NEXT']; ?></button>
</div>
<div class="col-md-12">
<a href="add-listing-step-4" class="skip"><?php echo $BIZBOOK['SKIP_THIS']; ?>
>></a>
</div>
</div>
<!--FILED END-->
<!--PROGRESSBAR START-->
<div class="progress biz-prog">
<div class="progress-bar bg-success progress-bar-striped progress-bar-animated" style="width:60%">60%</div>
</div>
<!--PROGRESSBAR END-->
</form>
</div>
</div>
</div>
</div>
</div>
</section>
<!--END PRICING DETAILS-->
<?php
include "footer.php";
?>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="js/jquery.min.js"></script>
<script src="js/popper.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery-ui.js"></script>
<script src="<?php echo $slash; ?>js/select-opt.js"></script>
<script type="text/javascript">var webpage_full_link = '<?php echo $webpage_full_link;?>';</script>
<script type="text/javascript">var login_url = '<?php echo $LOGIN_URL;?>';</script>
<script src="js/custom.js"></script>
</body>
</html>