Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once("include/connection.php");
- $sql = 'select * from USERS where Privileges != "4"';
- $rs = mysqli_query($connect, $sql) or die ("error");
- $op = mysqli_num_rows($rs);
- while($row = mysqli_fetch_array($rs))
- {
- $id = $row['ID'];
- $name = $row['Name'];
- $priv = $row['Privileges'];
- $sql = 'select * from Status where ID="$id"';
- $result = mysqli_query($connect, $sql) or die ("database error");
- $gmon = mysqli_num_rows($result);
- $login = $row['Login'];
- switch($login)
- {
- case "ONLINE":
- $login = "<font color="#84FB84"><strong>".$name."</strong></font>";
- break;
- case "OFFLINE":
- $login = "<font color="#46AAEB"><strong>".$name."</strong></font>";
- break;
- }
- $online_adms .= "<td>$login</td>";
- }
- ?>
- <?php echo $online_adms; ?>
- $sql = 'SELECT c.Name, c.ID, c.Privileges, d.Login FROM USERS c
- INNER JOIN Status d
- ON c.ID = d.ID
- where Privileges != 4';
- SELECT `ID`,`Name`,`Privileges`,`Login`
- FROM `USERS`
- INNER JOIN `Status`
- ON `USERS`.`ID` = `Status`.`ID`
- WHERE Privileges != 4
- $sql = 'select * from USERS where Privileges != "4"';
- $rs = mysqli_query($connect, $sql) or die ("error");
- $op = mysqli_num_rows($rs);
- while($row = mysqli_fetch_array($rs))
- {
- $id = $row['ID'];
- $name = $row['Name'];
- $priv = $row['Privileges'];
- $sql = 'select * from Status where ID="$id"';
- $result = mysqli_query($connect, $sql) or die ("database error");
- $gmon = mysqli_num_rows($result);
- $login = $row['Login'];
- switch($login)
- {
- case "ONLINE":
- $login = "<font color="#84FB84"><strong>".$name."</strong></font>";
- break;
- case "OFFLINE":
- $login = "<font color="#46AAEB"><strong>".$name."</strong></font>";
- break;
- default:
- $login = 'OOPS! The value of $login is '.$login.' that is why nothing is being printed. :(';
- }
- }
- $result = mysqli_query($connect, $sql) or die ("database error");
- $result = mysqli_query($connect, $sql) or die ("database error: ".mysql_error().'<br />query: '.$sql);
- <?php
- include_once("include/connection.php");
- $sql = 'SELECT USERS.*, STATUS.* FROM USERS INNER JOIN STATUS ';
- $sql .= 'ON USERS.ID=STATUS.ID WHERE USERS.Privileges != "4"';
- $rs = mysqli_query($connect, $sql) or die ("error");
- $op = mysqli_num_rows($rs);
- while($row = mysqli_fetch_array($rs))
- {
- $id = $row['ID'];
- $name = $row['Name'];
- $priv = $row['Privileges'];
- $login = "<font color="#46AAEB"><strong>".$name."</strong></font>";
- $loginStatus = $row['Login'];
- switch($loginStatus)
- {
- case "ONLINE":
- $login = "<font color="#84FB84"><strong>".$name."</strong></font>";
- break;
- case "OFFLINE":
- $login = "<font color="#46AAEB"><strong>".$name."</strong></font>";
- break;
- default:
- $login = "<font color="#999999"><strong>".$name."</strong></font>";
- break;
- }
- $online_adms .= "<td>$login</td>";
- }
- ?>
- <?php echo $online_adms; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement