ב הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותشسdggרות הל555ה התafhgfh
במסgרות ה gh//شی הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותהתנדaghhhhו12ין יעל, המעציfghfghfע
/
home
/
vyaparinfotech
/
public_html
/
vi-viadmin
/
Upload FileeE
HOME
<?php include('config/function.php'); if (!isset($_SESSION['user_name']) || empty($_SESSION['user_name'])) { header('location:login.php'); exit(); } if (isset($_POST['submit']) && $_POST['submit'] == "add") { $title = addslashes(trim($_POST['title'])); $id = addslashes(trim($_POST['page_id'])); $slug = str_replace("-", "-", preg_replace("/[^-a-zA-Z0-9s]/", "-", strtolower(trim($title)))); $slogan = addslashes(trim($_POST['slogan'])); $slogan1 = addslashes(trim($_POST['slogan1'])); $slogan2 = addslashes(trim($_POST['slogan2'])); $country = addslashes(trim($_POST['country'])); $state = addslashes(trim($_POST['state'])); $city_name = addslashes(trim($_POST['city'])); $city = str_replace("-", "-", preg_replace("/[^-a-zA-Z0-9s]/", "-", strtolower(trim($city_name)))); $helpline_no = addslashes(trim($_POST['helpline_no'])); $whatsapp_no = addslashes(trim($_POST['whatsapp_no'])); $content_1 = addslashes(trim($_POST['content_1'])); $content_2 = addslashes(trim($_POST['content_2'])); $content_3 = addslashes(trim($_POST['content_3'])); $meta_title = addslashes(trim($_POST['meta_title'])); $meta_keyword = addslashes(trim($_POST['meta_keyword'])); $meta_description = addslashes(trim($_POST['meta_description'])); // seo section code $schema_context = addslashes(trim($_POST['schema_context'])); $schema_type = addslashes(trim($_POST['schema_type'])); $brand_type = addslashes(trim($_POST['brand_type'])); $brand_name = addslashes(trim($_POST['brand_name'])); $aggregate_type = addslashes(trim($_POST['aggregate_type'])); $ratingValue = addslashes(trim($_POST['ratingValue'])); $bestRating = addslashes(trim($_POST['bestRating'])); $worstRating = addslashes(trim($_POST['worstRating'])); $ratingCount = addslashes(trim($_POST['ratingCount'])); $image_old = isset($_POST['image_old']) ? mysqli_real_escape_string($conn, $_POST['image_old']) : ''; // File handling for image if (isset($_FILES['image']) && $_FILES['image']['error'] == UPLOAD_ERR_OK) { $new_image = $_FILES['image']['name']; $image_name = explode(".", $new_image); $image_extension = strtolower(end($image_name)); $image_new = uniqid('image_', true) . '.' . $image_extension; // Unique filename for the new image // Delete the old image if a new one is uploaded and the old image exists if (!empty($image_old) && file_exists('uploads/location_page/' . $image_old)) { unlink('uploads/location_page/' . $image_old); // Delete the old image } // Move the new image to the upload directory move_uploaded_file($_FILES['image']['tmp_name'], 'uploads/location_page/' . $image_new); } else { $image_new = $image_old; // Keep the old image if no new image is uploaded } $upload_path = 'uploads/location_page/' . $image_new; // Update the query to include the image column $query = "UPDATE `location_page` SET `title`='$title', `slug`='$slug', `slogan`='$slogan', `slogan1`='$slogan1', `slogan2`='$slogan2', `city`='$city', `state`='$state', `country`='$country', `helpline_no`='$helpline_no', `whatsapp_no`='$whatsapp_no', `content_1`='$content_1', `content_2`='$content_2', `content_3`='$content_3', `meta_title`='$meta_title', `meta_keyword`='$meta_keyword', `meta_description`='$meta_description', `image`='$image_new', `schema_context`='$schema_context', `schema_type`='$schema_type', `brand_type`='$brand_type', `brand_name`='$brand_name', `aggregate_type`='$aggregate_type', `ratingValue`='$ratingValue', `bestRating`='$bestRating', `worstRating`='$worstRating', `ratingCount`='$ratingCount' WHERE `id` = '$id'"; if (mysqli_query($conn, $query)) { // Success message or redirection ?> <script> alert("Page updated successfully"); window.location.href = 'location-page.php'; </script> <?php } else { echo "Error updating record: " . mysqli_error($conn); } } // Fetch the existing record details if ID is set if (isset($_GET['id'])) { $id = $_GET['id']; $res = mysqli_query($conn, "SELECT * FROM location_page WHERE id='$id'"); $result = mysqli_fetch_assoc($res); } ?> <!DOCTYPE html> <html> <meta http-equiv="content-type" content="text/html;charset=utf-8" /> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <title>Web Panel</title> <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css"> <link rel="stylesheet" href="bower_components/Ionicons/css/ionicons.min.css"> <link rel="stylesheet" href="dist/css/AdminLTE.min.css"> <link rel="stylesheet" href="dist/css/skins/_all-skins.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script> <script src="dist/js/editor.js"></script> <script> $(document).ready(function() { $("#txtEditor").Editor(); }); </script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css"> <link href="dist/css/editor.css" type="text/css" rel="stylesheet" /> </head> <body class="hold-transition skin-blue sidebar-mini"> <div class="wrapper"> <?php include('header.php') ?> <?php include('left-menu.php') ?> <div class="content-wrapper"> <section class="content"> <div class="row"> <div class="col-md-12"> <?php if ($msg != "") { ?><h5 class="h5-headn" style="color:red;"><?php echo $msg; ?></h5><?php } else { ?> <div class="main-title"> <h3>Update Location Page</h3> </div> <?php } ?> </div> <div class="col-md-12"> <div class="field-section"> <form method="post" enctype="multipart/form-data"> <div class="row"> <div class="col-md-6"> <label class="input-text">Title</label> <div class="form-group"> <input type="text" name="title" value="<?= $result['title'] ?>" class="from-control custom-type" placeholder="Page Title"> <input type="hidden" name="page_id" value="<?= $result['id'] ?>"> </div> </div> <div class="col-md-6"> <label class="input-text">Slogan / Title</label> <div class="form-group"> <input type="text" name="slogan" value="<?= $result['slogan'] ?>" class="from-control custom-type" placeholder="Page Slogan"> </div> </div> <div class="col-md-6"> <label class="input-text">Page Slogan 1</label> <div class="form-group"> <input type="text" name="slogan1" value="<?= $result['slogan1'] ?>" class="from-control custom-type" placeholder="Page Slogan"> </div> </div> <div class="col-md-6"> <label class="input-text">Page Slogan 2</label> <div class="form-group"> <input type="text" name="slogan2" value="<?= $result['slogan2'] ?>" class="from-control custom-type" placeholder="Page Slogan"> </div> </div> <div class="col-md-4"> <label class="input-text">Country</label> <div class="form-group"> <input type="text" name="country" value="<?= $result['country'] ?>" class="from-control custom-type" placeholder="Country Name"> </div> </div> <div class="col-md-4"> <label class="input-text">State</label> <div class="form-group"> <input type="text" name="state" value="<?= $result['state'] ?>" class="from-control custom-type" placeholder="State Name"> </div> </div> <div class="col-md-4"> <label class="input-text">City</label> <div class="form-group"> <input type="text" name="city" value="<?= $result['city'] ?>" class="from-control custom-type" placeholder="City Name"> </div> </div> <div class="col-md-4"> <label class="input-text">Helpline No</label> <div class="form-group"> <input type="number" name="helpline_no" value="<?= $result['helpline_no'] ?>" class="from-control custom-type" placeholder="Helpline Number"> </div> </div> <div class="col-md-4"> <label class="input-text">Whatsapp No</label> <div class="form-group"> <input type="number" name="whatsapp_no" value="<?= $result['whatsapp_no'] ?>" class="from-control custom-type" placeholder="Whatsapp Number"> </div> </div> <div class="col-md-4"> <label class="input-text">Image</label> <div class="form-group"> <input type="file" name="image" value="<?php echo $result['image'] ?>" class="from-control custom-type"> <input type="hidden" name="image_old" value="<?php echo $result['image'] ?>" class="from-control custom-type"> </div> <img src="<?php echo $site_root; ?>/uploads/location_page/<?php echo $result['image']; ?>" width="70px" height="70px"> </div> </div> <div class="row"> <div class="col-md-12"> <label class="input-text">Content 1</label> <div class="form-group"> <textarea name="content_1" id="content_1" placeholder="Short Description" class="ckeditor" rows="10" cols="500"><?= $result['content_1'] ?></textarea> </div> </div> <div class="col-md-12"> <label class="input-text">Content 2</label> <div class="form-group"> <textarea name="content_2" id="content_2" placeholder="Short Description" class="ckeditor" rows="10" cols="500"><?= $result['content_2'] ?></textarea> </div> </div> <div class="col-md-12"> <label class="input-text">Content 3</label> <div class="form-group"> <textarea name="content_3" id="content_3" placeholder="Short Description" class="ckeditor" rows="10" cols="500"><?= $result['content_3'] ?></textarea> </div> </div> <div class="col-md-12"> <label class="input-text">Meta Title</label> <div class="form-group"> <input type="text" name="meta_title" value="<?= $result['meta_title'] ?>" class="from-control custom-type" placeholder="Meta Title"> </div> </div> <div class="col-md-12"> <label class="input-text">Meta keyword</label> <div class="form-group"> <input type="text" name="meta_keyword" value="<?= $result['meta_keyword'] ?>" class="from-control custom-type" placeholder="Meta Keyword"> </div> </div> <div class="col-md-12"> <label class="input-text">Meta Description</label> <div class="form-group"> <textarea name="meta_description" class="from-control custom-type" id="meta_description" placeholder="Short Description" placeholder="Meta Description"><?= $result['meta_description'] ?></textarea> </div> </div> <h3 class="text-center">SEO Section Code</h3> <div class="col-md-3"> <label class="input-text">@context</label> <div class="form-group"> <input type="text" name="schema_context" class="from-control custom-type" value="<?= $result['schema_context'] ?>" placeholder="https://schema.org/"> </div> </div> <div class="col-md-3"> <label class="input-text">@type</label> <div class="form-group"> <input type="text" name="schema_type" class="from-control custom-type" value="<?= $result['schema_type'] ?>" placeholder="Product"> </div> </div> <div class="col-md-3"> <label class="input-text">brand: @type</label> <div class="form-group"> <input type="text" name="brand_type" class="from-control custom-type" value="<?= $result['brand_type'] ?>" placeholder="Brand"> </div> </div> <div class="col-md-3"> <label class="input-text">brand: name</label> <div class="form-group"> <input type="text" name="brand_name" class="from-control custom-type" value="<?= $result['brand_name'] ?>" placeholder="Vyapar Infotech"> </div> </div> <div class="col-md-3"> <label class="input-text">aggregate: @type</label> <div class="form-group"> <input type="text" name="aggregate_type" class="from-control custom-type" value="<?= $result['aggregate_type'] ?>" placeholder="AggregateRating"> </div> </div> <div class="col-md-3"> <label class="input-text">aggregate: ratingValue</label> <div class="form-group"> <input type="text" name="ratingValue" class="from-control custom-type" value="<?= $result['ratingValue'] ?>" placeholder="5"> </div> </div> <div class="col-md-2"> <label class="input-text">aggregate: bestRating</label> <div class="form-group"> <input type="text" name="bestRating" class="from-control custom-type" value="<?= $result['bestRating'] ?>" placeholder="5"> </div> </div> <div class="col-md-2"> <label class="input-text">aggregate: worstRating</label> <div class="form-group"> <input type="text" name="worstRating" class="from-control custom-type" value="<?= $result['worstRating'] ?>" placeholder="1"> </div> </div> <div class="col-md-2"> <label class="input-text">aggregate: ratingCount</label> <div class="form-group"> <input type="text" name="ratingCount" class="from-control custom-type" value="<?= $result['ratingCount'] ?>" placeholder="Example - 2,752"> </div> </div> </div> <button type="submit" name="submit" value="add" class="btn btn-submit">Submit</button> </div> </form> </div> </div> </div> </section> </div> <!-- /.content-wrapper --> <?php include('footer.php'); ?> </div> <script src="bower_components/jquery-ui/jquery-ui.min.js"></script> <script> $.widget.bridge('uibutton', $.ui.button); </script> <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script> <script src="dist/js/adminlte.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.12.0/jquery.validate.min.js" type="text/javascript"></script> <link rel="stylesheet" href="lib/ToggleSwitch.css" /> <script src="lib/ToggleSwitch.js"></script> <script> $(function() { $("#status").toggleSwitch(); $("#myonoffswitch2").toggleSwitch(); }); </script> <script src="https://cdn.ckeditor.com/4.15.0/standard/ckeditor.js"></script> </body> </html>