<?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'];

    $fn = $_FILES['att']['name'];

    $fnn = rand()."$fn";

    if(isset($_POST['update']))

    {

      echo $himage = $_POST['himage'];

      $sel = "update tbl_stativ_pages set add_certificate='$fnn' where id=3";

      if(mysqli_query($link,$sel))

      {

        move_uploaded_file($tmp,"../about-image/$fnn");

        unlink("../about-image/$himage");

        $msg = "<p style='color:green;'>Upload Successfully!!!</p>";

      }

    }

    // Update logo Certification

    if(isset($_POST['logo_upd']))

    {

      $himage = $_POST['hlogo'];

      $sel = "update tbl_stativ_pages set logo_certificate='$fnn' where id=3";

      if(mysqli_query($link,$sel))

      {

        move_uploaded_file($tmp,"../header-image/$fnn");

        unlink("../header-image/$himage");

        $msg = "<p style='color:green;'>Upload Logo Successfully!!!</p>";

      }

    }

    ?>



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

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

        <h1>Dashboard</h1>

        <p class="lead">Update your Certificate below</strong>.</p>

      </div>

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

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

         

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

          <li class="active">Update Certificate</li>

        </ol>

      </div>

    </section>

    <!-- / PAGE TITLE -->

    <?php

    $sel = mysqli_query($link,"select * from tbl_stativ_pages where id=3");

    $arr = mysqli_fetch_assoc($sel);

    ?>

    <div class="container-fluid">

      <div><?=@$msg;?></div>

      <div class="row">

        <form method="post" enctype="multipart/form-data">

          <div class="col-md-3"></div>

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

          <section class="panel tasks-widget">

            <p>Update Here Logo certificate...</p>

            <img src="../header-image/<?=$arr['logo_certificate'];?>" style="width:100%;">

            <input type="hidden" name="hlogo" value="<?=$arr['logo_certificate']?>">

            <label>Image Size (200 x 80) Pixel</label>

            <input type="file" name="att" class="btn btn-primary ">

          </section>

          <div class="text-center">

          <input type="submit" name="logo_upd" value="Update" class="btn bnt-primary">

          </div>

        </div>

        </form>

      </div>

      <form method="post" enctype="multipart/form-data">

      <div class="row">

        <div class="col-md-3"></div>

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

          <section class="panel tasks-widget">

            <p>Update Here certificate...</p>

            <img src="../about-image/<?=$arr['add_certificate'];?>" style="width:100%;">

            <input type="hidden" name="himage" value="<?=$arr['add_certificate']?>">

            <label>Image Size (543 x 768) Pixel</label>

            <input type="file" name="att" class="btn btn-primary ">

          </section>

        </div>

        <div class="col-md-3"></div>

      </div>

      <div class="text-center"> <button name="update" class="btn btn-primary">Submit</button></div>

       </form>

       <script>

      CKEDITOR.replace(ckeditor1)  

	  </script>

      <!-- / row -->

    </div>

    <!-- / container-fluid -->

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