Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.57 KB | None | 0 0
  1. <div class="col-lg-9" style="overflow:auto;">
  2.     <form class="navbar-form navbar-right" method="post" role="search">
  3.         <div class="form-group">
  4.             <input type="text" class="form-control" name="value" placeholder="Search by ID/surname">
  5.         </div>
  6.         <button type="submit" name="search" class="searchAccount btn btn-default">Search</button>
  7.     </form>
  8.     <?php
  9.         if(isset($_POST['search'])){
  10.             if($_POST['value'] == null){
  11.                 header("Location: ?page=home&sub=loginlog");
  12.             } else {
  13.                 $value = $_POST['value'];
  14.                 header("Location: ?page=home&sub=loginlog&search=$value");
  15.             }
  16.         }
  17.     ?>
  18.     <table class="table table-bordered">
  19.         <tr>
  20.             <th>Loginlog ID</th>
  21.             <th>Username</th>
  22.             <th>Date/Time</th>
  23.             <th>Type</th>
  24.         </tr>
  25.         <?php
  26.             $generateLink = "content/sub/loginlogreport.php";
  27.             if(isset($_GET['search'])){
  28.                 $value = $_GET['search'];
  29.                 $sql = "SELECT * FROM loginlog WHERE loginlog_id = '$value' OR username = '$value'";
  30.                 $result3 = mysqli_query($connection, $sql);
  31.                 $generateLink = "content/sub/loginlogreport.php?search=$value";
  32.             }
  33.             while($row = mysqli_fetch_array($result3)){
  34.                 ?>
  35.                 <tr>
  36.                     <td><?php echo $row['loginlog_id']; ?></td>
  37.                     <td><?php echo $row['username']; ?></td>
  38.                     <td><?php echo $row['datetime']; ?></td>
  39.                     <td><?php echo $row['type']; ?></td>
  40.                 </tr>
  41.                 <?php
  42.             }
  43.         ?>
  44.     </table>
  45. </div>
  46. <div class="col-lg-12" style="margin-top: 5%;">
  47.     <button type="button" class="btn btn-info pull-right" onclick="window.open('<?php echo $generateLink; ?>', '_blank');">Generate Report in PDF File...</button>
  48. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement