Advertisement
michaelyuen

Untitled

Dec 5th, 2017
407
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.25 KB | None | 0 0
  1. <?php /* include 'session.php'; */ include 'mysql-con.php'; ?>
  2. <!DOCTYPE html><html lang="en"><head>
  3. <meta charset="utf-8">
  4. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Home | Galaxy Technology</title>
  7. <link href="css/tree.css" rel="stylesheet">
  8. <?php /* include 'header.php'; */ ?>
  9. <meta name="author" content="Muhammad Arsalan Siddiqui">
  10. <meta http-equiv="pragma" content="NO-CACHE"/>
  11. <meta http-equiv="expires"  content="0"/>
  12. <meta name="keywords" content=""/>
  13. <meta name="description" content=""/>
  14. <link href="" rel="canonical"/>
  15. <link rel="icon" href="">
  16. <link href="css/bootstrap.min.css" rel="stylesheet">
  17. <link href="css/font-awesome.min.css" rel="stylesheet">
  18. <!--<link rel="stylesheet" href="css/simplePagination.css" type="text/css"/>-->
  19. <link rel="stylesheet" href="css/style.css" type="text/css"/>
  20. <!--<link rel="stylesheet" type="text/css" href="css/jquery.dataTables.css">-->
  21. <link rel="stylesheet" href="js/jquery-ui-1.11.4.css">
  22.  
  23. <!--<link rel="stylesheet" type="text/css" href="css/bootstrap-datepicker.css">-->
  24. <link href="css/ie10-viewport-bug-workaround.css" rel="stylesheet">
  25. <!--[if lt IE 9]>
  26. <script src="html5shiv.min.js"></script>
  27. <script src="respond.min.js"></script>
  28. <![endif]-->
  29. </head>
  30. <body>
  31. <div class="orange-line"></div>
  32. <nav class="navbar navbar-inverse navbar-default navbar-static-top">
  33. <div class="container">
  34. <div class="navbar-header">
  35. <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
  36. <span class="sr-only">Toggle navigation</span>
  37. <span class="icon-bar"></span>
  38. <span class="icon-bar"></span>
  39. <span class="icon-bar"></span>
  40. </button>
  41. <a class="navbar-brand" href="index.php"><div class="nav-logo"></div></a>
  42. </div>
  43. <div id="navbar" class="navbar-collapse collapse">
  44. <ul class="nav navbar-nav navbar-right">
  45. <li><a href="index.php"><strong><i class="fa fa-home" aria-hidden="true"></i> Home</strong></a></li>
  46. <li><a href="dashboard.php"><strong><i class="fa fa-star" aria-hidden="true"></i> Dashboard</strong></a></li>
  47. <li class="dropdown">
  48. <a href="#" class="dropdown-toggle" data-toggle="dropdown">
  49. <strong><i class="fa fa-user-circle-o" aria-hidden="true"></i> Profile</strong></a>
  50. <ul class="dropdown-menu">
  51. <li>
  52. <div class="navbar-login">
  53. <div class="row">
  54. <div class="col-lg-4">
  55. <p class="text-center">
  56. <i class="fa fa-user-circle icon-size" aria-hidden="true"></i>
  57. </p>
  58. </div>
  59. <div class="col-lg-8">
  60. <p class="text-center"><strong>Administrator</strong></p>
  61. <p class="text-center small">syslog@galaxy.net.pk</p>
  62. <p class="text-center"><a href="profile.php" class="btn btn-default btn-block btn-sm">View Profile</a></p>
  63. </div>
  64. </div>
  65. </div>
  66. </li>
  67. <li class="divider"></li>
  68. <li>
  69. <div class="navbar-login navbar-login-session">
  70. <div class="row">
  71. <div class="col-lg-12">
  72. <p>
  73. <a href="logout.php?destroy" class="btn btn-danger btn-block"><strong><i class="fa fa-user-circle-o" aria-hidden="true"></i> Log Out</strong></a>
  74. </p>
  75. </div>
  76. </div>
  77. </div>
  78. </li>
  79. </ul>
  80. </li>
  81. </ul>
  82. </div>
  83. </div>
  84. </nav>
  85.  
  86. <!---->
  87. <div class="container">
  88. <div class="tree">
  89. <ul>
  90. <li>
  91. <span><i class="fa fa-home"></i> Home</span></a>
  92. <ul>
  93. <li><a href="live-log.php"><span><i class="fa fa-bar-chart"></i> Live Log</span></a></li>
  94. <li><a href="one-day-record.php"><span><i class="fa fa-calendar"></i> Single Day Record</span></a></li>
  95. <li><a href="index.php"><span><i class="fa fa-cubes"></i> All Records</span></a></li>
  96. <li><a href="date-2-date-search.php"><span><i class="fa fa-calendar"></i> Date to Date Search</span></a></li>
  97. </ul>
  98. </li>
  99. </ul>
  100. </div>
  101. </div>
  102.  
  103. <!---->
  104.  
  105. <div class="container">
  106. <form method="get" class="form-inline">
  107. <div class="form-group">
  108. <label>Date </label>
  109. <input type="date" class="form-control" name="date01" required />
  110. </div>
  111.  
  112. <div class="form-group">
  113. <label>Records Per Page</label>
  114. <select class="form-control span2 search-query" name="recordpp">
  115. <option>50</option>
  116. <option>100</option>
  117. <option>250</option>
  118. <option>500</option>
  119. <option>750</option>
  120. <option>1000</option>
  121. </select>
  122. </div>
  123.  
  124.  
  125.  
  126.  
  127. <button type="submit" name="oneday" class="btn btn-default">Submit</button>
  128. </form>
  129. </div>
  130.  
  131. <br>
  132.  
  133. <div class="container">
  134. <table class="table table-bordered">
  135. <thead>
  136. <tr>
  137. <th>SEQ</th>
  138. <th>MSG</th>
  139. <th>DATE TIME</th>
  140. <th>HOST</th>
  141. <th>PROGRAM</th>
  142. </tr>
  143. </thead>
  144. <tbody>
  145.  
  146. <?php
  147. if(isset($_GET['oneday'])){
  148. $date01 = mysqli_real_escape_string($dbcon,$_GET['date01']);
  149. $recordpp = $_GET['recordpp'];
  150. //$sql = "SELECT seq, msg, datetime, host, program FROM logs WHERE datetime BETWEEN DATE('$date01') AND '$date01 "." 23:59:59' LIMIT $recordpp ";
  151. //$rs_result = mysqli_query($dbcon, $sql);
  152. $query=mysqli_query($dbcon,"select count(seq) from logs");
  153. $row = mysqli_fetch_row($query);
  154. $rows = $row[0];
  155. //$page_rows = 10;
  156. $page_rows = $recordpp;
  157. $last = ceil($rows/$page_rows);
  158. if($last < 1){
  159. $last = 1;
  160. }
  161. $pagenum = 1;
  162. if(isset($_GET['pn'])){
  163. $pagenum = preg_replace('#[^0-9]#', '', $_GET['pn']);
  164. }
  165. if ($pagenum < 1){
  166. $pagenum = 1;
  167. }
  168. else if ($pagenum > $last) {
  169. $pagenum = $last;
  170. }
  171. $limit = 'LIMIT ' .($pagenum - 1) * $page_rows .',' .$page_rows;
  172. //$nquery=mysqli_query($dbcon,"SELECT seq, msg, datetime, host, program FROM logs $limit");
  173. $nquery=mysqli_query($dbcon,"SELECT seq, msg, datetime, host, program FROM logs WHERE datetime BETWEEN DATE('$date01') AND '$date01 "." 23:59:59' $limit");
  174.  
  175.  
  176. /* put your function here */
  177. function page($page_num) {
  178.     $query = $_GET;
  179.     $query['pn'] = $page_num;
  180.     $query_result = http_build_query($query);
  181.     return "<a href='{$_SERVER['PHP_SELF']}?{$query_result}'>{$page_num}</a>";
  182. }
  183.  
  184. $paginationCtrls = '';
  185.  
  186. if($last > 1){
  187.     for($i = 1; $i <= $last; $i++){
  188.         $paginationCtrls .= page($i) .' &nbsp; ';
  189.     }
  190. }
  191.  
  192. //include 'curPageURL.func.php';
  193. ?>
  194. <?php
  195. while($crow = mysqli_fetch_array($nquery)){
  196. ?>
  197. <tr>
  198. <td><?php echo $crow["seq"]; ?></td>
  199. <td><?php echo $crow["msg"]; ?></td>
  200. <td><?php echo $crow["datetime"]; ?></td>
  201. <td><?php echo $crow["host"]; ?></td>
  202. <td><?php echo $crow["program"]; ?></td>
  203. </tr>
  204. <?php
  205. }
  206. };
  207. ?>
  208.  
  209.  
  210.  
  211. </tbody>  
  212. </table>
  213.  
  214. <div id="pagination_controls" class="center-block"><?php echo $paginationCtrls; ?></div>
  215.  
  216. <!-- -->
  217. </div>
  218. <?php /* include 'footer.php'; */ ?>
  219.  
  220. <div class="container"><hr><footer><p>&copy; 2017 Galaxy Technology ~ <strong>Designed</strong> &amp; <strong>Developed</strong> by <strong><a href="#">Muhammad Arsalan Siddiqui</a></strong></a></p></footer></div>
  221. <script src="js/jquery.min.js"></script>
  222. <script>window.jQuery || document.write('<script src="js/jquery.min.js')</script>
  223. <script src="js/bootstrap.min.js"></script>
  224. <!--<script src="js/jquery-ui-v1.10.3.js"></script>-->
  225. <!--<script type="text/javascript" src="js/jquery.simplePagination.js"></script>-->
  226. <!--<script type="text/javascript" charset="utf8" src="js/jquery.dataTables.js"></script>-->
  227. <!--<script type="text/javascript" src="js/datatables.js"></script>-->
  228. <!--<script type="text/javascript" src="js/bootstrap-datepicker.js"></script>-->
  229. <script type="text/javascript" src="js/script.js">
  230. </script><script src="js/ie10-viewport-bug-workaround.js"></script></body></html>
  231. <?php mysqli_close($dbcon); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement