<?php include('site-header.php'); ?>
  <!-- end of LOGO CONTAINER -->
  <!-- - - - - - - - - - - - - -->
  <!-- start of SIDEBAR        -->
  <!-- - - - - - - - - - - - - -->
<?php include('left-nevigation.php'); ?>
  <!-- - - - - - - - - - - - - -->
  <!-- end of SIDEBAR          -->
  <!-- - - - - - - - - - - - - -->
  <main id="playground">
  <script src="ckeditor/ckeditor.js"></script>
    <!-- - - - - - - - - - - - - -->
    <!-- start of TOP NAVIGATION -->
    <!-- - - - - - - - - - - - - -->
    <nav class="navbar navbar-top navbar-static-top">
      <div class="container-fluid">
        <!-- sidebar collapse and toggle buttons get grouped for better mobile display -->
        <div class="navbar-header nav">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-top"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="navbar-top">
          <ul class="nav navbar-nav navbar-right">
            <li class="dropdown user-profile"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
              <div class="user-img-container"> <img src="demofiles/demoimage.gif" alt=""> </div>
              Sign Out <span class="chat-status success"></span> </a> </li>
          </ul>
        </div>
      </div>
      <!-- end of container-fluid -->
    </nav>
    <!-- - - - - - - - - - - - - -->
    <!-- end of TOP NAVIGATION   -->
    <!-- - - - - - - - - - - - - -->
    <!-- PAGE TITLE -->
    
        <?php
    extract($_POST);
    $tmp = $_FILES['att']['tmp_name'];
    $name = $_FILES['att']['name'];
    $image_names= time()."_".$name;
   
    if(isset($_POST['Update']))
    {
      if($_FILES['att']['name']!="")
      {
        $sqlUp_t = "UPDATE `tbl_home_about` SET 
                     `desc2`='$desc2',
                     `title1`='$title1',
                     `title2`='$title2',
                     `title4`='$title4'
                     `home_image`='$image_names' 
                     WHERE id=1";
        if(mysqli_query($link,$sqlUp_t))
        {
          move_uploaded_file($tmp,"../about-image/$image_names");
          $img = "<p style='color:green;'>Image Upload successfully!!!!!</p>";
        }
      }
      else
      {
        $sqlUp_t = "UPDATE `tbl_home_about` SET 
                     `desc2`='$desc2',
                     `title1`='$title1',
                     `title2`='$title2',
                     `title4`='$title4'
                     WHERE id=1";
        if(mysqli_query($link,$sqlUp_t))
        {
           $img = "<p style='color:green;'>update successfully!!!!!</p>";
        }
      }
    }
    ?>



    <!-- / PAGE TITLE -->
    <?php 
    $sqlUp="select * from tbl_home_about where id=1";
    $dataup = mysqli_query($link,$sqlUp);
    $updtRslt = mysqli_fetch_array($dataup);
    ?>
    <section id="page-title" class="row">
      <div class="col-md-8">
        <h1>About Us</h1>
        <p class="lead">Update your Home About below</strong>.</p>
      </div>
      <div class="col-md-4">
      </div>
    </section>
    <div class="container-fluid">
      <div class="row"><?=@$img;?></div>
      <form method="post" enctype="multipart/form-data">
        <div class="row">

         <!--  <div class="col-md-6">
            <section class="panel tasks-widget">
              <img src="../about-image/<?=$updtRslt['home_image'];?>" width="100%" height="250px">
                <label>Image Size about us(444 X 250) Pixel:</label>
              <input type="file" name="att">
            </section>

            

          </div> -->
          <div class="col-md-12">
            <section class="panel tasks-widget">
                <textarea id="ckeditor1" name="desc2"><?php echo $updtRslt['desc2']; ?></textarea>
            </section>
           
          </div>

        
        <div class="col-md-12"><br><br>
          <div class="text-center"> 
            <button name="Update" class="btn btn-primary">Submit</button> 
          </div>
        </div>
        </div>
      </form>
     <script type="text/javascript">
      CKEDITOR.replace(ckeditor1)
      CKEDITOR.replace(ckeditor2)  
    </script>
    <!-- / container-fluid -->
 <?php include('site-footer.php'); ?>