<?php 
error_reporting(E_ALL);
ini_set('display_errors', 1);
    include "header.php";
   include "databaseConnect.php";  
   $cczCount ='';  
   $totalCount='';
   $ccaCount='';

   $id = '';
   if(isset($_GET['Id']) && !empty($_GET['Id'])){
    $id = $_GET['Id'];
   }else{
    exit;
   }

   $query = "SELECT * FROM tbltimetovisit where id= $id"; 
   $result = mysqli_query($conn, $query);
?>
<style>
    .switch {
        position: relative;
        display: inline-block;
        width: 50px;
        height: 23px;
    }
    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }
    .slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #ccc;
        transition: .4s;
    }
    .slider:before {
        position: absolute;
        content: "";
        height: 15px;
        width: 15px;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: .4s;
    }
    input:checked + .slider {
        background-color: #0d6efd;
    }
    input:focus + .slider {
        box-shadow: 0 0 1px #0d6efd;
    }
    input:checked + .slider:before {
        transform: translateX(26px);
    }
    .slider.round {
        border-radius: 34px;
    }
    .slider.round:before {
        border-radius: 50%;
    }
</style>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <div class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1 class="m-0"><i class="nav-icon fas fa-tachometer-alt"></i> Dashboard</h1>
                </div><!-- /.col -->
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item">Home</li>
                        <li class="breadcrumb-item">Edit Time To Visit Content</li>
                    </ol>
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.container-fluid -->
    </div>
    <!-- /.content-header -->

    <!-- Main content -->
    <section class="content" style = "min-height:454px;">
        <div class="container-fluid">
            <?php if(mysqli_num_rows($result) > 0){
                    $res = mysqli_fetch_assoc($result);
                ?>
                <form method="post" action ="manage-hotels-process.php" id="addForm" enctype="multipart/form-data">
                    <input type = "hidden" name="type" value="editFormsidebar-2" />
                    <input type = "hidden" name="id" value="<?=$id?>" />
                    <label>Page Slug</label>
                    <select class="form-control" name="addBySlug">
                        <option value=""> Slug</option>
                        <?php 
                            $sql = "select distinct slug from tblhoteldetails where slug != ''";
                            $query = mysqli_query($conn, $sql);
                            if(mysqli_num_rows($query)>0){
                        ?>
                                <?php while($slugs = mysqli_fetch_assoc($query)){?>
                                    <option value="<?=$slugs['slug']?>" <?=$res['slug']== $slugs['slug'] ? 'selected' : ''?>><?=$slugs['slug']?></option>
                        <?php }}?>
                    </select>
                    <div class="row mb-3">
                        <div class="col-sm-12">
                            <label>Best Time To Visit Content</label>
                            <textarea class="form-control" rows="8" name="hoteledittimetovisit" placeholder="Enter edit time to visit..."><?=$res['timetovisitcontent']?></textarea>
                            <small class="text-danger error" id="erroredittimetovisit"></small>
                        </div>
                    </div>
                    <div class="row text-right mb-3" style="justify-content:right;">
                        <button type="submit" class="btn btn-primary btn-lg" id="addHotelData">Submit</button>
                    </div>
                </form>
            <?php }?>
        </div><!-- /.container-fluid -->
    </section>
    <!-- /.content -->
</div>
<?php include "footer.php"?>
