<?php include('site-header.php'); ?>
  <!-- end of LOGO CONTAINER -->
  <!-- - - - - - - - - - - - - -->
  <!-- start of SIDEBAR        -->
  <!-- - - - - - - - - - - - - -->
<?php include('left-nevigation.php'); ?>
  <!-- - - - - - - - - - - - - -->
  <!-- end of SIDEBAR          -->
  <!-- - - - - - - - - - - - - -->
<script src="ckeditor/ckeditor.js"></script>
 <main id="playground">
    <!-- - - - - - - - - - - - - -->
    <!-- start of TOP NAVIGATION -->
    <!-- - - - - - - - - - - - - -->
<?php include('site-top-header.php'); ?>
    <!-- - - - - - - - - - - - - -->
    <!-- end of TOP NAVIGATION   -->
    <!-- - - - - - - - - - - - - -->
    <!-- PAGE TITLE -->

<?php
$testi_id=$_REQUEST['testi_id'];

if(isset($_REQUEST['send']))
{
        $testi_name=$_REQUEST['testi_name'];
        $testi_desc=$_REQUEST['testi_desc'];
        $testi_loction=$_REQUEST['testi_loction'];
        $sql="insert into  tbl_testimonial set 
        testi_name='$testi_name',
        testi_loction='$testi_loction',
        testi_desc='$testi_desc'";

        if(mysqli_query($link,$sql))
          {
             $img = "<p style='color:green;'>Save successfully!!!!!</p>";
          }
      
}
if(isset($_REQUEST['Updt_id'])!="")
{
    if(isset($_REQUEST['Updt']))
    {
        $testi_name=$_REQUEST['testi_name'];
        $testi_desc=$_REQUEST['testi_desc'];
        $testi_loction=$_REQUEST['testi_loction'];

        $sqlUp="update tbl_testimonial set 
        testi_name='$testi_name',
        testi_loction='$testi_loction',
        testi_desc='$testi_desc'where testi_id='$_REQUEST[Updt_id]'";
       
        if(mysqli_query($link,$sqlUp))
          {
             $img = "<p style='color:green;'>Delete successfully!!!!!</p>";
          }
    }
}
?>
<?php
if(isset($_REQUEST['Updt_id'])!="")
{
    $sql="select * from tbl_testimonial where testi_id='$_REQUEST[Updt_id]'";
    $data=mysqli_query($link,$sql);
    $result=mysqli_fetch_array($data);
}
?>  
 <?php
$sql="select * from tbl_testimonial where testi_id='$_REQUEST[Updt_id]'";
$data=mysqli_query($link,$sql);
$result=mysqli_fetch_array($data);
?> 
    <section id="page-title" class="row">
      <div class="col-md-8">
        <h1>Services & Facilities</h1>
        <p class="lead">Add your Services & Facilities below</strong>.</p>
        <?=$img;?>
      </div>
      <div class="col-md-4">
        <ol class="breadcrumb pull-right no-margin-bottom">
        
          <li><a href="dashboard.php">Services & Facilities</a></li>
          <li class="active">Add Services & Facilities</li>
        </ol>
      </div>
    </section>
    <!-- / PAGE TITLE -->
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">
          <a href="testimonial-list.php" class="btn btn-primary">Back</a>
        </div>
      	  <form method="post" enctype="multipart/form-data">
            <div class="form-group">
              <label for="">Name</label>
              <input type="text" class="form-control" name="testi_name" value="<?php echo $result['testi_name'];?>" placeholder="Enter Your customer Name">
             <!--  <label>Profile</label>
              <input type="text" name="testi_loction" class="form-control" value="<?php echo $result['testi_loction'];?>" placeholder="Enter Your customer Profile"> -->
            </div> 
              <div class="col-md-12">
                  <h3>Description</h3>
                  <section class="panel tasks-widget">
                    <textarea id="ckeditor1" name="testi_desc"><?php echo $result['testi_desc']; ?></textarea>
                  </section>
             </div>
          </div>
      <br><br>
      <?php if(isset($_REQUEST['Updt_id'])){ ?>
      <div class="text-center"> <button class="btn btn-primary" name="Updt">Update</button></ </div>
      <?php }else
			  { ?>
      <div class="text-center"> <button class="btn btn-primary" name="send">Submit</button></ </div>
       <?php } ?>
      </form>
    </div>
  
    
    <!-- / container-fluid -->
    <script>
      CKEDITOR.replace(ckeditor1)  
    </script>
 <?php include('site-footer.php'); ?>