Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select name="key">
- <?php
- include_once 'DB.inc.php';
- $qry="SELECT * FROM resourses ";
- $result=mysqli_query($con,$qry);
- if($result){
- while ($info=mysqli_fetch_array($result)) {
- print " <option value=" .$info['id']. ">".$info['type']. " </option>";
- }
- }
- ?>
- </select>
- <?php
- //fetch_user.php
- include('database_connection.php');
- session_start();
- $query = "
- SELECT * FROM add_employees,resourses
- WHERE k=2
- ";
- $statement = $connect->prepare($query);
- $statement->execute();
- $result = $statement->fetchAll();
- $output = '
- <table class="table table-bordered table-striped">
- <tr>
- <th width="70%">Username</td>
- <th width="30%">Status</td>
- <th width="30%">Action</td>
- <th width="30%">Type</td>
- <th width="30%">Quantity</td>
- </tr>
- ';
- foreach($result as $row)
- {
- $status = '';
- $current_timestamp = strtotime(date("Y-m-d H:i:s") . '- 10 second');
- $current_timestamp = date('Y-m-d H:i:s', $current_timestamp);
- $user_last_activity = fetch_user_last_activity($row['a_id'], $connect);
- if($user_last_activity > $current_timestamp)
- {
- $status = '<span class="label label-success">Online</span>';
- }
- else
- {
- $status = '<span class="label label-danger">Offline</span>';
- }
- $output .= '
- <tr>
- <td>'.$row['username'].' '.count_unseen_message($row['a_id'], $_SESSION['a_id'], $connect).' '.fetch_is_type_status($row['a_id'], $connect).'</td>
- <td>'.$status.'</td>
- <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>
- <td><option value="'.$row['id'].'">'.$row['type'].'</option></td>
- </tr>
- ';
- }
- $output .= '</table>';
- echo $output;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement