Your IP : 216.73.216.26


Current Path : /home2/wtmwscom/public_html/admin/
Upload File :
Current File : /home2/wtmwscom/public_html/admin/upload_image_gallery.php

<?php include 'header.php';
include_once('lib/ps_pagination.php');
?>
<h1>Upload Image Gallary</h1>
    <?php echo getMessage();?>
    <section id="comments">
        <form action="upload_image_gallery_model.php" name="form" id="form" method="post" enctype="multipart/form-data">
          
          <p>
            <label for="receipt">Select File <span></span></label>
            <input type="file" name="receipt" id="receipt" required="">
          </p>
          <p><br />
              
              <input style="position: relative; left: 160px;" name="submit" type="submit" id="submit" value="Submit">
          </p>
        </form>
      </section>


 <h1>Photo Gallery</h1>
    <?php echo getMessage();?>
    
    <section>
        <table style="width: 100%;">
          <thead>
            <tr>
              <th>S. No.</th>
              <th>Filename</th>
              <th>Create Date</th>
              <th>Delete Image</th>
            </tr>
          </thead>
          <?php
          $query="SELECT * FROM photo_gallery";
            $pager = new PS_Pagination($connection, $query, 20, 5);
            $pager->setDebug(true);
            $result = $pager->paginate();
            if($result){
          ?>
          <tbody>
            <?php
                if(!isset($_GET['page'])){ $i=1; }else{ $i=(($_GET['page']-1)*20)+1; }
                while ($row = mysqli_fetch_object($result)){
                              ?>
            <tr <?php if($i%2){echo "class='light'";}else{echo "class='dark'";}?>>
              <td><?php echo $i;?></td>
              <td><?php echo $row->filename;?></td>
              <td><?php echo date("d M, Y h:i A", strtotime($row->datetime));?></td>
              <td><a href="javascript:void;" onclick="if(confirm('Are you sure you want to delete this image')){window.location='delete_photo_gallery.php?id=<?=$row->id?>&filename=<?=$row->filename?>';}">Delete Image</a></td>
            </tr>
            <?php $i++;}?>
          </tbody>
          
          <?php }?>
        </table>
            <?php echo $pager->renderFullNav();?>
      </section>
<?php include 'footer.php';?>