<?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'); ?>
    <!-- - - - - - - - - - - - - -->
    <!-- end of TOP NAVIGATION   -->
    <!-- - - - - - - - - - - - - -->
    <!-- PAGE TITLE -->

<?php 
   if($_REQUEST['s_id']!="")
   {
   $s_id=$_REQUEST['s_id'];
   $sql_del ="DELETE FROM `tbl_withdrawn` WHERE id='$s_id'";
  
   if(mysqli_query($link,$sql_del))
      {
        $msg = "<p style='color:green;'>Delect Successfully...</p>";
      }
      else
      {
         $msg = "<p style='color:red;'>Not Delect...</p>";
      }
   }
   ?>


    <section id="page-title" class="row">
      <div class="col-md-8">
        <h1>Dashboard</h1>
        <p class="lead">Update your Withdrawn Organisation</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 Withdrawn Organisation</li>
        </ol>
      </div>
    </section>
    <!-- / PAGE TITLE -->
    <?php
    $sqli ="SELECT * FROM `tbl_withdrawn`";
    $data=mysqli_query($link,$sqli);
    $sn=0;
    ?>
    <div class="col-md-12">
      <div class="col-md-4"></div>
      <div class="col-md-4">
        <a href="add-withdrawn.php" class="btn btn-primary">Add Withdrawn </a>
      </div>
      <div class="col-md-4"></div>
      <div class="col-md-12">
        <table class="table table-hover table-responsive" width="100%">
            <thead style="background-color: orange; color: white">
              <tr>
                  <th scope="row">S. No</th>
                  <td> Name</td>
                  <td>Address</td>
                  <td>Reason </td>
                  <td>Date And Time</td>
                  <td>Action</td>
              </tr>
              </thead>
               <tbody>
                <?php
                while($result=mysqli_fetch_array($data))
                {
                  $date = date_create($result['date']);
                date_format($date,"d F , Y");
                  $sn++;
                  ?>
                  <tr>
                    <th> <?=$sn;?></th>
                  <th><?=$result['name']?></th>
                  <th><?=$result['address']?></th>
                  <th><?=$result['reason']?></th>
                  <th><?=date_format($date,"d F  Y h:i:s A");?></th>
                  <th>
                          <a class="btn btn-success"  href="add-withdrawn.php?edit=<?=$result['id']?>">Edit</a>&nbsp;
                          <input type="hidden" name="id" value="<?=$result['id']?>">
                        
                     <form method="post">
                        <input type="hidden" name="s_id" value="<?php echo $result['id'] ?>">
                        <button class="btn btn-danger" name="del">Delete</button> 
                    </form>
                  </th>
                </tr>
                  <?php
                }
                ?>
              </tbody>
            </table>
          </div>
        </div>

    <!-- / container-fluid -->
 <script>

      CKEDITOR.replace(ckeditor1)  

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