<?php if (!defined('IN_SITE')) {
    die('The Request Not Found');
}

if(isset($_GET['ref'])){
    $ref_id = validate_int($_GET['ref'], 1);
    if($ref_id !== false && $row = $CMSNT->get_row_safe("SELECT * FROM `users` WHERE `id` = ?", [$ref_id])){
        $_SESSION['ref'] = $row['id'];
        // CỘN LƯỢT CLICK
        $CMSNT->cong('users', 'ref_click', 1, " `id` = ? ", [$row['id']]);
        redirect(base_url());
    }
    redirect(base_url());
}
redirect(base_url());
 
?>
 