<?php

/**
 * @author Pratik Dev <webmaster.pratik@gmail.com>
 */
require_once __DIR__ . '/../header.php';
$user  = $db->where('id', Input('id'))->getOne('users');

if(file_exists($RootPath.'/upload_file/userthumb/150x150/'.$user['user_name'].'.jpg')){


    $userProf= '../../../upload_file/userthumb/150x150/'.$user['user_name'].'.jpg';
}
else 

$userProf = '../assets/img/undraw_profile.svg';

?>


<div class="container-fluid">
    <div class="card shadow mb-4">
        <div class="card-header py-3">

            <div class="d-flex justify-content-between">
                <h6 class="m-0 font-weight-bold text-primary"><?php echo $user['name']; ?> Info</h6>
            </div>
        </div>
        <div class="card-body">

            <div class="row justify-content-center">
                <div class="col-12">
                    <div class="mt-2">
                        <img title="<?php echo $user['user_name'];?>" src="<?php echo $userProf;?>" alt="<?php echo $user['user_name'];?>" class="mx-auto d-block rounded" width="150" height="150">
                    </div>
                    <h2 class="text-center p-2 mb-2 text-truncate fs-6 fw-normal border-bottom">
                        <?php echo $user['name'];?></h2>
                    <div class="p-2">
                    <p>User Id: <?php echo $user['id'];?></p>
                      <p>Username: <?php echo $user['user_name'];?></p>
                       <p>Name: <?php echo $user['name'];?></p>
                       <p>Email: <?php echo $user['email'];?></p>
                       <p>LoginVia: <?php echo $user['user_type'];?></p>
                       <p>Registered On: <?php echo date('M d, Y',strtotime($user['created_at']));?></p>
                    </div>
                    <div class="d-flex m-2 justify-content-between">
                        <a href="../files/index.php?userid=<?php echo $user['id'];?>" class="btn btn-primary btn">View All Uploaded</a>

                    </div>
                </div>
            </div>

        </div>

    </div>
</div>
<?php

require_once __DIR__ . '/../footer.php';

?>