<?php session_start();
include("./../config/config.php");  
include("./backend/validated_admin.php");  
$page = $_REQUEST["page"];
$sql = "SELECT * FROM page_master WHERE page_name='$page'";
   
    $myquery=$conn->query($sql);
  $mydara= $myquery->fetchAll()  ;
  
  $rows_found = $myquery->rowCount();
  foreach ($mydara as $key ) {
     $short_title= $key['short_title'];
     $description= $key['description'];
     $keyword= $key['keyword'];
     $data= $key['data'];
  }
?>
<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>Edit Delete Master - iCouponWorld | Coupons | Discounts| Promo Codes<</title>
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <link id="favicon" rel="icon" type="image/x-icon" href="../images/web-images/home/favicon.png">
      <meta name="robots" content="index, follow" />
      <meta name="author" content="Design Collection">
      <meta name="description" content="With Edit Delete Master you can edit and delete pages. Such as about page, privacy policy, terms and conditions pages">
      <link rel="canonical" href="edit-delete-master.php"/>
      <meta name="keywords" content="Edit, Delete,Edit Delete Master">
      <!-- Viewport configuration, scaling options -->
      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
      <!-- Bootstrap CSS -->
      <link href="../css/icouponworld.css" rel="stylesheet">
      <!-- CSS Stylesheet -->
      <link href="../css/dashboard.css" rel="stylesheet">
      <!-- Font Awesome icon -->
      <link href="../fontawesome/css/fontawesome.css" rel="stylesheet" />
      <!-- Roboto font  -->
      <link rel="preconnect" href="https://fonts.googleapis.com">
      <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
      <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;1,100;1,300;1,400;1,500;1,700&display=swap" rel="stylesheet">
      <!-- sweetalert.min js  -->
       <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>
      <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
      <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
      <![endif]-->
   </head>
   <body>
      <!--unique id begin -->
      <div id="s_mm">
         <!--scroll-top Begin-->
         <div id="scroll-top">
            <!--sidebarwrapper Begin-->
            <div id="sidebarwrapper">
               <!--Sidebarmenu Begin-->
               <?php include("./includefiles/sidebar.php"); ?>
               <!--Sidebarmenu End-->
               <!--content-wrapper Begin-->
               <div id="content-wrapper" class="d-flex flex-column dashboard-navbar">
                  <div id="maincontent">
                     <!-- Navbar Topbar Begin-->
                     <?php include("./includefiles/header.php"); ?>
                     <!-- Navbar Topbar End-->
                     <!-- Container Begin-->
                     <div class="container-fluid px-4">
                        <div class="d-sm-flex align-items-center justify-content-between mb-4">
                           <h3>
                              Update Webpages
                           </h3>
                        </div>
                          <?php include("./includefiles/coupon_count.php"); ?>
                        <div class="row">
                           <div class="col-md-12">
                              <div class="mb-4">
                                 <!--Alert Message Begin-->
                                 <div class="alert alert-primary fs-14 mt-2" role="alert">
                                    <strong>Important message:</strong>  You can edit and delete your master page very easily. 
                                 </div>
                                 <!--Alert Message End-->
                              </div>
                           </div>

                          <?
if($_SESSION["edit_status"]!=''){

?>
<script> swal("Created!", "Your page is updated!", "success");  </script>

<?
unset($_SESSION["edit_status"]);
}
?>
                          <form  method="post" action="./backend/edit-delete-master.php">

                              <div class="row">
                                 <!--Google Analytics Code Past Here Begin-->
                                 <div class="col-md-12">
                                    <div class="card border-0  shadow mb-4">
                                       <div class="card-header bg-white border-bottom py-3">
                                          <h6 class="m-0 fw-bold">Edit Master Web Page</h6>
                                       </div>
                                       <div class="card-body">
                                          <div class="row">
                                             <div class="col-md-12">
                                                <div class="mb-3">
                                                   <label for="metatitle" class="form-label">Meta Title <span class="text-danger">*</span><small >(should not be more than 70 character)</small></label>
                                                   <input type="text" value="<?=$short_title?>" class="form-control" name="<?=SESS_MASTER?>title" maxlength="60" id="metatitle">
                                                </div>
                                             </div>
                                             <div class="col-md-12">
                                                <div class="mb-3">
                                                   <label for="metadescription" class="form-label">Meta Description <span class="text-danger">*</span><small >(should not be more than 160 character)</small></label>
                                                   <input type="text" name="<?=SESS_MASTER?>description"  value="<?=$description?>" class="form-control" maxlength="160" id="metatitle">
                                                </div>
                                             </div>
                                             <div class="col-md-12">
                                                <div class="mb-4">
                                                   <label for="metakeyword" class="form-label">Meta Keyword <span class="text-danger">*</span><small >(should not be more than 8 to 10 word)</small></label>
                                                   <input name="<?=SESS_MASTER?>keyword" type="text" value="<?=$keyword?>" class="form-control" maxlength="160" id="metakeyword">
                                                </div>
                                             </div>
                                             <div class="col-md-12">
                                                <div class="mb-3">
                                                   <textarea name="editor1" required ><?=$data?></textarea>
                                                </div>
                                             </div>
                                          </div>
                                       </div>
                                    </div>
                                 </div>
                                 <!---Google Analytics Code Past Here End-->
                                 <div class="col-lg-12 col-sm-12 mx-auto">
                                    <input name="<?=SESS_MASTER?>page" value="<?=$page?>" type="hidden" >
                                    <button type="submit" class="btn btn-primary mt-2 mb-5">Update</button>
                                 </div>
                              </div>
                           </form>
                        </div>
                     </div>
                     <!-- Container End-->
                  </div>
                  <!--Copyright Begin-->
                  <div class="p-4 border bg-white">
                     <div class="container">
                        <div class="row align-items-center">
                           <div class="col-lg-12 col-sm-12">
                              <p class="small text-center p-0 m-0">© 2022. All Rights Reserved. Proudly Designed By icoupon world Team. </p>
                           </div>
                        </div>
                     </div>
                  </div>
                  <!--Copyright End-->
               </div>
               <!--content-wrapper End-->
            </div>
            <!--sidebarwrapper End-->
            <!--Scroll to top Begin-->
            <a class="scroll-to-top rounded" href="#scroll-top">
            <i class="fas fa-angle-up"></i>
            </a>
            <!--Scroll to top End-->
            <!-- Jquery Script Begin-->
            <script src="../js/jquery-3.4.1.min.js"></script>
             <!-- Jquery Script End-->
            <!-- bootstrap.bundle.min Script Begin-->
            <script src="../js/bootstrap.bundle.min.js"></script>
             <!-- bootstrap.bundle.min Script End-->
              <!-- dashboard-icouponworld.js Script Begin-->
            <script src="../js/dashboard-icouponworld.js"></script>
             <!-- dashboard-icouponworld.js Script End-->
              <!-- ckeditor Script Begin-->
            <script src="https://cdn.ckeditor.com/4.14.1/standard/ckeditor.js"></script>
            <!-- ckeditor Script End-->
            <!-- editor1 Script Begin-->
            <script>
               CKEDITOR.replace( 'editor1' );
            </script>
             <!-- editor1 Script End-->
              <!-- gtag Script Begin-->
            <script>
               window.dataLayer = window.dataLayer || [];
               function gtag(){dataLayer.push(arguments);}
               gtag('js', new Date());
               
               gtag('config', 'UA-151767913-1');
            </script>
             <!-- gtag Script End-->
         </div>
         <!--scroll-top End-->
      </div>
      <!--unique id End -->
   </body>
</html>
