Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. <select name="key">
  2. <?php
  3.  
  4. include_once 'DB.inc.php';
  5. $qry="SELECT * FROM resourses ";
  6. $result=mysqli_query($con,$qry);
  7.  
  8. if($result){
  9. while ($info=mysqli_fetch_array($result)) {
  10. print " <option value=" .$info['id']. ">".$info['type']. " </option>";
  11. }
  12. }
  13. ?>
  14. </select>
  15. <?php
  16.  
  17. //fetch_user.php
  18.  
  19. include('database_connection.php');
  20.  
  21. session_start();
  22.  
  23. $query = "
  24. SELECT * FROM add_employees,resourses
  25. WHERE k=2
  26. ";
  27.  
  28. $statement = $connect->prepare($query);
  29.  
  30. $statement->execute();
  31.  
  32. $result = $statement->fetchAll();
  33.  
  34. $output = '
  35. <table class="table table-bordered table-striped">
  36. <tr>
  37. <th width="70%">Username</td>
  38. <th width="30%">Status</td>
  39. <th width="30%">Action</td>
  40. <th width="30%">Type</td>
  41. <th width="30%">Quantity</td>
  42. </tr>
  43. ';
  44.  
  45. foreach($result as $row)
  46. {
  47. $status = '';
  48. $current_timestamp = strtotime(date("Y-m-d H:i:s") . '- 10 second');
  49. $current_timestamp = date('Y-m-d H:i:s', $current_timestamp);
  50. $user_last_activity = fetch_user_last_activity($row['a_id'], $connect);
  51. if($user_last_activity > $current_timestamp)
  52. {
  53. $status = '<span class="label label-success">Online</span>';
  54. }
  55. else
  56. {
  57. $status = '<span class="label label-danger">Offline</span>';
  58. }
  59. $output .= '
  60. <tr>
  61. <td>'.$row['username'].' '.count_unseen_message($row['a_id'], $_SESSION['a_id'], $connect).' '.fetch_is_type_status($row['a_id'], $connect).'</td>
  62. <td>'.$status.'</td>
  63. <td><button type="button" class="btn btn-info btn-xs start_chat" data-touserid="'.$row['a_id'].'" data-tousername="'.$row['username'].'">Start Chat</button></td>
  64. </tr>
  65. ';
  66. }
  67.  
  68.  
  69. $output .= '<td><select><option value="'.$row['id'].'">'.$row['type'].'</option></td></select>
  70. </table>';
  71.  
  72. echo $output;
  73.  
  74. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement