<?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>

<?php

$testi_id=$_REQUEST['testi_id'];

if(isset($_REQUEST['send'])){

$testi_name=$_REQUEST['testi_name'];

$testi_desc=$_REQUEST['testi_desc'];

$sql="insert into  tbl_testimonial set 

testi_name='$testi_name',

testi_desc='$testi_desc'";

$data=mysql_query($sql);

}

if(isset($_REQUEST['Updt_id'])!=""){

if(isset($_REQUEST['Updt'])){

$testi_name=$_REQUEST['testi_name'];

$testi_desc=$_REQUEST['testi_desc'];

$sqlUp="update tbl_testimonial set 

testi_name='$testi_name',

testi_desc='$testi_desc'where testi_id='$_REQUEST[Updt_id]'";

mysql_query($sqlUp);

}

}

?>

<?php

if(isset($_REQUEST['Updt_id'])!=""){

$sql="select * from tbl_testimonial where testi_id='$_REQUEST[Updt_id]'";

$data=mysql_query($sql);

$result=mysql_fetch_array($data);

}

?>  

  <main id="playground">

    <!-- - - - - - - - - - - - - -->

    <!-- start of TOP NAVIGATION -->

    <!-- - - - - - - - - - - - - -->

<?php include('site-top-header.php'); ?>

    <!-- - - - - - - - - - - - - -->

    <!-- end of TOP NAVIGATION   -->

    <!-- - - - - - - - - - - - - -->

    <!-- PAGE TITLE -->

<?php

$sql="select * from tbl_testimonial where testi_id='$_REQUEST[Updt_id]'";

$data=mysql_query($sql);

$result=mysql_fetch_array($data);

?> 

    <section id="page-title" class="row">

      <div class="col-md-8">

        <h1>Dashboard <?php echo $testi_id ?></h1>

        <p class="lead">Add your testimonial below</strong>.</p>

      </div>

      <div class="col-md-4">

        <ol class="breadcrumb pull-right no-margin-bottom">

        

          <li><a href="dashboard.php">Dashboard</a></li>

          <li class="active">Add testimonial</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>

      	<div class="col-md-6">

          <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">

            </div>

        </div>

      </div>

      <div class="row">

        <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>

        <script>

      CKEDITOR.replace(ckeditor1)  

	  </script>

      </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 -->

 <?php include('site-footer.php'); ?>