<?php
class checkPaid extends database
{
    public function userStatus($id)
    {
        $sql = ' SELECT MAX(cl_expiry_date) AS max_expiry FROM tb_payments WHERE cl_user_id=?  ';
        return $this->CallQueryRow($sql, [$id]);
    }
}

$paidObj = new checkPaid();
$userPayment = $paidObj->userStatus($user['cl_user_id']);

if(!$userPayment || ($userPayment['max_expiry'] < date('Y-m-d')))
{
    ?>

<div class="col-12 alert alert-danger">
    Your account is not active. Please  contact administrator
</div>
<a href="<?php echo DOMAIN ?>/auth/logout.php">Logout</a>

<?php
exit;
}
