<?php

require_once("../pidbco/pidbjoin.php");
if(!isset($_SESSION)){
    session_start();
}

if(isset($_POST['btn_check_usr_data']))
{
    $user = strip_tags(trim($_POST['user']));
    $stmt = $con->prepare("SELECT photo,username,emp_name FROM employee_registration WHERE username = ?");
    $stmt->bind_param("s",$user);
    $stmt->execute();
    $stmt->store_result();
    $stmt->bind_result($photo,$username,$emp_name);
    $row = $stmt->num_rows;
    if($row > 0)
    {
        $stmt->fetch();
        ?>
        <img src="images/users/<?php echo $photo; ?>" width="140" height="140" class="img-circle" />

        <?php
        if(!empty($emp_name))
        {
        ?>
        <script>
            $('#user_name').html('<label id="usr"><?php echo 'Welcome '.$emp_name; ?></label>');
        </script>
    <?php
        }
    }

    $stmt->close();
    exit();
}


?>