????

Your IP : 3.145.81.250


Current Path : /home2/morganrand/backup.morganrand.com/
Upload File :
Current File : /home2/morganrand/backup.morganrand.com/read_state_m1.php

<?php
if (isset($_GET['rm']))
{
    if (is_numeric($_GET['rm']))
    {
        $room = $_GET['rm'];
        $pass = isset($_GET['pw']) ? $_GET['pw'] : '';
        $conn = null;
        // ** MySQL settings ** //
        require_once('../db_connection.php');
        
        $sql = "SELECT * FROM design_room WHERE room_num=" . $room;
        $result = $conn->query($sql);
        
        if ($result->num_rows > 0)
        {
            // output data of each row
            while ($row = $result->fetch_assoc())
            {
                if ($pass == strtolower($row['password']) and $row['user_privileges'] == '1')
                {
                    echo "OK";
                } else if ($now - $row['last_login_php'] > 600)
                {
                    echo "STOP";
                } else if ($now - $row['last_login_php'] > 300)
                {
                    echo "SLOW";
                } else
                {
                    echo $row['designer_state'];
                }
            }
        } else
        {
            echo "0 results";
            exit;
        }
        
        $conn->close();
    }
}
?>