| Server IP : 103.48.194.25 / Your IP : 216.73.216.74 Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64 User : sieuthimay ( 1016) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hocthongminh.net-bk/public_html/site/components/home/views/ |
Upload File : |
<?php
function check_ads_value($json)
{
$rs = json_decode($json);
$obj = new stdClass();
$obj->lb_image = isset($rs->lb_image)? $rs->lb_image : '';
$obj->lb_subject = isset($rs->lb_subject)? $rs->lb_subject : '';
$obj->lb_content = isset($rs->lb_content)? $rs->lb_content : '';
$obj->bl_active = isset($rs->bl_active)? $rs->bl_active : 0;
return $obj;
}
$filename = ROOT_SITE.'cache/popup_ads.php';
$json = read_file($filename);
$ads = check_ads_value($json);
?>
<?php if($ads->bl_active){?>
<style type="text/css">
.popup {
display: none;
/* Hidden by default */
position: fixed;
/* Stay in place */
z-index: 999999999;
/* Sit on top */
left: 0;
top: 0;
width: 100%;
/* Full width */
height: 100%;
/* Full height */
overflow: auto;
/* Enable scroll if needed */
background-color: black;
/* Fallback color */
background-color: rgba(0, 0, 0, 0.8);
/* Black w/ opacity */ }
.popup .popup-content {
background: #FFF;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
margin: auto;
max-width: 750px;
width: 90%;
top: 50px;
position: relative;
}
.popup .popup-content .popup-wrapper {
background: rgba(255, 255, 255, 0.8);
padding: 30px 15px;
}
.popup .popup-content .popup-title {
color: #cd1818;
margin-bottom: 15px;
}
.popup .popup-content .popup-desc {
color: #333333;
margin-bottom: 15px;
text-align: justify;
}
.popup .popup-content .popup-list {
margin-bottom: 15px;
}
.popup .popup-content .popup-list ul {
margin: 0;
}
.popup .popup-content .popup-list ul li {
position: relative;
margin-bottom: 5px;
padding-left: 15px;
color: #333333;
}
.popup .popup-content .popup-list ul li:last-child {
margin: 0 !important;
}
.popup .popup-content .popup-list ul li:after {
content: '\f111';
font-family: FontAwesome;
position: absolute;
top: calc(50% - 3px);
left: 0;
font-size: 6px;
color: #cd1818;
line-height: normal !important;
}
.popup .popup-content .form-desc {
color: #333333;
margin-bottom: 15px;
}
.popup .popup-content form {
position: relative;
width: 100%;
}
.popup .popup-content form .input-group {
width: 100%;
}
.popup .popup-content form input {
width: 100%;
height: 40px;
line-height: 40px;
padding: 0px 45px 0px 15px;
color: #333333;
background: #fff;
border: 1px solid #cd1818;
border-radius: 100px !important;
outline: 0 !important;
margin-bottom: 15px;
}
.popup .popup-content form button {
position: absolute;
top: 3px;
right: 3px;
height: 34px;
width: 34px;
border-radius: 50%;
display: inline-block;
background: #cd1818;
color: #fff;
}
.popup .popup-content form button:hover {
background: #9f1313;
}
.popup .popup-content .popup-social-network {
display: inline-block;
color: #fff;
background: #cd1818;
margin-right: 5px;
margin-bottom: 5px;
height: 30px;
width: 30px;
text-align: center;
line-height: 30px;
padding: 0;
border-radius: 50%;
}
.popup .close-popup {
position: absolute;
top: -15px;
right: -15px;
color: #fff;
font-size: 18px;
font-weight: bold;
display: block;
height: 30px;
width: 30px;
background-color: #cd1818;
text-align: center;
z-index: 9999;
border-radius: 50%;
line-height: 30px;
}
.popup .close-popup:focus, .popup .close-popup:hover {
color: #fff;
text-decoration: none;
cursor: pointer;
}
#popup-btn {
display: none;
/*width: 200px;
height: 50px;
background: #F00;*/
}
</style>
<button id="popup-btn"></button>
<div id="popup-subscribe" class="popup">
<!-- Modal content -->
<div id="popup-modal" class="popup-content animate down show"> <span class="close-popup"> <i class="fa fa-times" aria-hidden="true"></i> </span>
<div class="grid">
<div class="grid__item push--large--one-half large--six-twelfths medium--one-whole small--one-whole">
<div class="popup-wrapper">
<?php if($ads->lb_subject){?><div class="popup-title"> <?=$ads->lb_subject?> </div> <?php } ?>
<div class="popup-desc"> <?=$ads->lb_content?> </div>
</div>
</div>
</div>
</div>
</div>
<script>
// Example:
// Stores the string "my name" in the cookie "myCookie" which expires after 24 hours.
// writeCookie("myCookie", "my name", 24);
function writeCookie(name, value, hours)
{
var expire = "";
if(hours != null)
{
expire = new Date((new Date()).getTime() + hours * 3600000);
expire = "; expires=" + expire.toGMTString();
}
document.cookie = name + "=" + escape(value) + expire;
}
// Example:
// alert( readCookie("myCookie") );
function readCookie(name)
{
var cookieValue = "";
var search = name + "=";
if(document.cookie.length > 0)
{
offset = document.cookie.indexOf(search);
if (offset != -1)
{
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
cookieValue = unescape(document.cookie.substring(offset, end))
}
}
return cookieValue;
}
function trit(o)
{
console.log(o) ;
}
function hidePopupSub(modal){
$('#popup-modal').removeClass('show');
setTimeout(function(){
modal.style.display = "none";
}, 500)
}
var modal = document.getElementById('popup-subscribe');
var span = document.getElementsByClassName("close-popup")[0];
var btn = document.getElementById("popup-btn");
btn.onclick = function() {
modal.style.display = "block";
setTimeout(function(){
$('#popup-modal').addClass('show');
}, 500)
}
span.onclick = function() {
//hidePopupSub(modal);
$('#popup-subscribe').removeClass('show');
}
window.onclick = function(event){
if (event.target == modal) {
hidePopupSub(modal);
document.cookie = "adstime = " + new Date().getTime();
}
}
$(window).load(function(){
var now = new Date().getTime();
var last = readCookie("adstime");
var about = now - last;
if (about > 15000){
document.cookie = "adstime = "+ now;
$('#popup-subscribe').addClass('show');
}
});
</script>
<?php } ?>