<?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 -->
    <!-- - - - - - - - - - - - - -->
   <?php include('site-top-header.php'); ?>

    <?php
    extract($_POST);
    
    if(isset($updat))
    {
      if($_FILES['img_file']['name']!="")
      {
        $image_name=$_FILES['img_file']['name']; 
        $about_image= time()."_".$image_name;
        $sqlUp = "UPDATE `tbl_about_us` SET 
                          `about_desc`='$about_desc',
                          `grc_screen`='$grc_screen',
                          `benifit`='$benifit',
                          `technique`='$technique',
                          `title4`='$title4',
                          `title5`='$title5',
                          `title6`='$title6',
                          `title7`='$title7',
                          `ta1`='$ta1',
                          `ta2`='$ta2',
                          `ta3`='$ta3',
                          `ta4`='$ta4',
                          `ta5`='$ta5',
                          `ta6`='$ta6',
                          `about_image`='$about_image',
                          `title1`='$title1'
                          WHERE  id=1";
            if(mysqli_query($link,$sqlUp))
                 {
                    move_uploaded_file($_FILES['img_file']['tmp_name'], "../about-image/$about_image"); 
                   $img = "<p style='color:green;'>Image Upload successfully!!!!!</p>";
                 }   
       }
       else
        {
           $sqlUp = "UPDATE `tbl_about_us` SET 
                            `about_desc`='$about_desc',
                            `grc_screen`='$grc_screen',
                            `benifit`='$benifit',
                            `technique`='$technique',
                            `title4`='$title4',
                          `title5`='$title5',
                          `title6`='$title6',
                          `title7`='$title7',
                            `ta1`='$ta1',
                            `ta2`='$ta2',
                            `ta3`='$ta3',
                            `ta4`='$ta4',
                            `ta5`='$ta5',
                            `ta6`='$ta6',
                            `title1`='$title1'
                              WHERE  id=1";
              if(mysqli_query($link,$sqlUp))
                   {
                     $img = "<p style='color:green;'>Upload successfully!!!!!</p>";
                   }         
        }
      
    }
    ?>
    <div class="container-fluid textsss">
    <section id="page-title" class="row">
      <div class="col-md-8">
        <h1>About Us</h1>
        <p class="lead">Update your About Us below</strong>.</p>
        <?=$img;?>
      </div>
      <div class="col-md-4">
      </div>
    </section>
    <!-- / PAGE TITLE -->
    <?php
    $que = "select * from tbl_about_us";
    $run=mysqli_query($link,$que);
    $result= mysqli_fetch_assoc($run);
    ?>
    <div class="container-fluid">
       <div class="row">
        <form method='post' enctype="multipart/form-data">
          <h6>Little's Kingdom Toys World</h6>
          <div class="col-sm-8">
              <textarea  id="ckeditor1" name="about_desc">
                      <?=$result['about_desc'];?>
              </textarea>
          </div>
           <div class="col-sm-4">
            <div class="form-group" style="text-align: center;">
                <img src="../about-image/<?=$result['about_image']?>" style="height: 300px; width: 100%; border-radius: 100%;">
                  <p style="font-weight: bold;">Image Size(570 x 490)Pixel</p>
                  <input type="file" name="img_file">
                </div> 
          </div> 
          <div class="col-md-12" style="margin-top: 40px;">
              <p style="color: #000; background: orange; text-align: center; font-size: 20px; font-weight: bold;">
                Why Choose Us?
              </p>
              <div class="col-sm-4">
                <h5>High Quality Products</h5>
                  <textarea name="title4" class="form-control" style="width: 100%; height: 120px;">
                    <?=$result['title4']?>
                  </textarea>
              </div>
              <div class="col-sm-4">
                <h5>Client Satisfaction</h5>
                  <textarea name="title5" class="form-control" style="width: 100%; height: 120px;">
                    <?=$result['title5']?>
                  </textarea>
              </div>
              <div class="col-sm-4">
                <h5>Budget-Friendly Prices</h5>
                  <textarea name="title6" class="form-control" style="width: 100%; height: 120px;">
                    <?=$result['title6']?>
                  </textarea>
              </div>
              <!-- 
              <div class="col-sm-3">
                  <label>Satisfied Client</label>
                  <input type="text" class="form-control" name="title7" value="<?=$result['title7']?>">
              </div> -->

          </div>
       <!--    <div class="col-md-12" style="margin-top: 40px;">
              <p style="color: #000; background: orange; text-align: center; font-size: 20px; font-weight: bold;">
                Why Choose Us?
              </p>
            <div class="col-sm-4">
              <label>Quality Products</label>
              <textarea name="ta1" class="form-control" style="width: 100%; height: 80px;">
                <?=$result['ta1']?>
              </textarea>
              <label>On Time Delivery :</label>
              <textarea name="ta2" class="form-control" style="width: 100%; height: 80px;">
                <?=$result['ta2']?>
              </textarea>
              <label>Qualified Team : </label>
              <textarea name="ta3" class="form-control" style="width: 100%; height: 80px;">
                <?=$result['ta3']?>
              </textarea>
             
            </div>
           
          <div class="col-sm-4">
            <label>Modern Technology : </label>
              <textarea name="ta4" class="form-control" style="width: 100%; height: 80px;">
                <?=$result['ta4']?>
              </textarea>
              <label>Manufacturer Unit : </label>
              <textarea name="ta5" class="form-control" style="width: 100%; height: 80px;">
                <?=$result['ta5']?>
              </textarea>
              <label>Best Support :</label>
              <textarea name="ta6" class="form-control" style="width: 100%; height: 80px;">
                <?=$result['ta6']?>
              </textarea>
          </div>

           <div class="col-md-12">
          <div class="col-md-6">
              <label>Provide Best Solution </label>
                    <textarea  id="ckeditor2" name="benifit">
                      <?=$result['benifit'];?>
                    </textarea>
            </div>
            <div class="col-md-6">
              <label>Manufacturer & Exporter</label>
                    <textarea  id="ckeditor3" name="technique">
                      <?=$result['technique'];?>
                    </textarea>
            </div>
          </div>
         < 
           
          <div class="col-sm-12">
                <label>About Carpet People:</label>
                    <textarea  id="ckeditor4" name="grc_screen">
                      <?=$result['grc_screen'];?>
                    </textarea>
          </div>
          </div> -->
        <div class="col-md-12">
          <br><br><br>
                <div class="text-center">
                  <div class="form-group">
                  <input class="btn btn-primary" name="updat" type="submit" value="SUBMIT">
                  </div>
                </div>
         </div>
        
        </form>
      </div>
    </div><!--/container-->
  </div>
       <script>
      CKEDITOR.replace(ckeditor1)
      CKEDITOR.replace(ckeditor2)
      CKEDITOR.replace(ckeditor3) 
      CKEDITOR.replace(ckeditor4)
      CKEDITOR.replace(ckeditor5)
      CKEDITOR.replace(ckeditor6)
      CKEDITOR.replace(ckeditor7)
      CKEDITOR.replace(ckeditor8)
      CKEDITOR.replace(ckeditor9)
      CKEDITOR.replace(ckeditor10)
	  </script>
      <!-- / row -->
    <!-- / container-fluid -->
 <?php include('site-footer.php'); ?>
     <script type="text/javascript">
          $('document').ready(function()
          {
              $('textarea').each(function(){
                      $(this).val($(this).val().trim());
                  }
              );
          });
    </script>

 <style type="text/css">
    h6
   {
    padding-top: 5px;
    font-weight: bold;
    font-size: 20px;
    text-align: center;
    background: #555555;
    color: orange;
    height: 35px;
    border-radius: 3px;
   }

     h5
   {
    padding-top: 5px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    background: #555555;
    color: orange;
    height: 28px;
    border-radius: 5px;
   }
 </style>