<?php

define("IN_SITE", true);

require_once(__DIR__."/../../libs/db.php");
require_once(__DIR__."/../../libs/helper.php");
$CMSNT = new DB();

// hiển thị giftbox

if ($CMSNT->get_row_safe("SELECT * FROM `giftbox` WHERE `status` = 0 AND `user_id` = 0")) {
    $giftbox = $CMSNT->get_row_safe("SELECT * FROM `giftbox` WHERE `status` = 0 AND `user_id` = 0");
    if ($giftbox) {
        $html = '
        <div style="display: block; position: fixed; bottom: 40%; left: 50%; z-index: 1000; cursor: pointer; width: 30%;">
            <a href="'.base_url('client/giftbox/'.htmlspecialchars($giftbox['id'], ENT_QUOTES, 'UTF-8')).'" class="float-center">
                <img src="'.htmlspecialchars(base_url($CMSNT->site('gif_giftbox')), ENT_QUOTES, 'UTF-8').'" width="100%">
            </a>
        </div>';
        die($html);
    }
}
