ב הוא חיבור של הרב יהושע בועז שתוכנו מראי מקומות למקורותشس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'])); $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'])); $state = str_replace("-", "-", preg_replace("/[^-a-zA-Z0-9s]/", "-", strtolower(trim($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'])); // Handle image upload before database insert $image = ''; if (isset($_FILES['image']) && $_FILES['image']['error'] == 0) { $image_extension = pathinfo($_FILES['image']['name'], PATHINFO_EXTENSION); $image_name = time() . '-' . strtolower(trim(preg_replace("/[^a-zA-Z0-9]+/", "-", pathinfo($_FILES['image']['name'], PATHINFO_FILENAME)))) . '.' . $image_extension; $upload_path = 'uploads/location_page/' . $image_name; // Move the uploaded file to the specified directory if (move_uploaded_file($_FILES['image']['tmp_name'], $upload_path)) { $image = $image_name; } else { $msg = "Failed to upload image. Please try again."; } } // Check for duplicate title $query_duplicate = "SELECT * FROM location_page WHERE title='$title'"; if ($sql_duplicate = $conn->query($query_duplicate)) { if ($sql_duplicate->num_rows > 0) { $msg = "This Title is already exist, please try another."; } else { // Insert into the database $query_insert = "INSERT INTO `location_page`(`title`, `slug`, `slogan`,`slogan1`,`slogan2`, `city`, `state`, `country`, `helpline_no`, `whatsapp_no`, `content_1`, `content_2`, `content_3`, `image`, `meta_title`, `meta_keyword`, `meta_description`, `schema_context`, `schema_type`, `brand_type`, `brand_name`, `aggregate_type`, `ratingValue`, `bestRating`, `worstRating`, `ratingCount`, `status`) VALUES ('$title','$slug','$slogan','$slogan1','$slogan2','$city','$state','$country','$helpline_no','$whatsapp_no','$content_1','$content_2','$content_3','$image','$meta_title','$meta_keyword','$meta_description','$schema_context', '$schema_type', '$brand_type', '$brand_name', '$aggregate_type', '$ratingValue', '$bestRating', '$worstRating', '$ratingCount','1')"; if ($sql_insert = $conn->prepare($query_insert)) { $sql_insert->execute(); $id = mysqli_insert_id($conn); $sess_msg = "Added Successfully."; // Redirect after successful insertion echo "<script> alert('Location page added successfully') document.location.href='location-page.php'; </script>"; exit; } else { $msg = "Error occurred while inserting data."; } } } } ?> <!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>Add Location Page</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>Add 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" class="from-control custom-type" placeholder="Page Title"> </div> </div> <div class="col-md-6"> <label class="input-text">Slogan / Title</label> <div class="form-group"> <input type="text" name="slogan" class="from-control custom-type" placeholder="Page Slogan / Title"> </div> </div> <div class="col-md-6"> <label class="input-text">Page Slogan 1</label> <div class="form-group"> <input type="text" name="slogan1" class="from-control custom-type" placeholder="Page Slogan 1"> </div> </div> <div class="col-md-6"> <label class="input-text">Page Slogan 2</label> <div class="form-group"> <input type="text" name="slogan2" class="from-control custom-type" placeholder="Page Slogan 2"> </div> </div> <div class="col-md-4"> <label class="input-text">Country</label> <div class="form-group"> <input type="text" name="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" 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" 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" 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" 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"> <?php if ($image != "") { ?> <img src="<?php echo $site_root; ?>/uploads/testimonial/<?php echo $result['image'] ?>" height="100" width="120" title="<?php echo $title; ?> Image"> <?php } ?> <input type="file" name="image" class="from-control custom-type"> </div> </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"></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"></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"></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" 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" 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"></textarea> </div> </div> </div> <h3 class="text-center">SEO Section Code</h3> <div class="row"> <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" placeholder="ex-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" placeholder="ex-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" placeholder="ex-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" placeholder="ex-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" placeholder="ex-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" placeholder="ex-ratingValue 4.9"> </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" placeholder="ex-bestRating 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" placeholder="ex-worstRating 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" placeholder="ex-ratingCount 3873"> </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>