98 lines
2.5 KiB
PHP
98 lines
2.5 KiB
PHP
<?php
|
|
|
|
|
|
|
|
require_once 'include/utils/utils.php';
|
|
|
|
require_once 'includes/Loader.php';
|
|
|
|
vimport ('includes.runtime.EntryPoint');
|
|
|
|
require_once 'SUtiles.php';
|
|
|
|
@session_start();
|
|
|
|
|
|
|
|
global $adb;
|
|
|
|
$current_user = Users_Record_Model::getCurrentUserModel();
|
|
|
|
$userId = $current_user->get('id');
|
|
|
|
$roleid = $current_user->get('roleid');
|
|
|
|
|
|
|
|
//get year
|
|
|
|
$today = date("Y-m-d", strtotime('today'));
|
|
|
|
|
|
|
|
function getDetailSplashScreen($today , $roleid ){
|
|
|
|
global $adb;
|
|
|
|
|
|
|
|
$query = "SELECT * FROM splash_screen where date_debut <= '".$today."' and date_fin >= '".$today."' and `visible_pour` like '%::{$roleid}::%'
|
|
|
|
order by ordre ASC";
|
|
|
|
$sql_get_result = $adb->query($query);
|
|
|
|
$Details = array();
|
|
|
|
|
|
|
|
while ($recordinfo = $adb->fetch_array($sql_get_result)) {
|
|
|
|
$Details[] = $recordinfo;
|
|
|
|
}
|
|
|
|
//echo $query;
|
|
|
|
return $Details;
|
|
|
|
}
|
|
|
|
|
|
|
|
$Detail = getDetailSplashScreen($today , $roleid);
|
|
|
|
//print("<pre>".print_r($Detail,true)."</pre>");
|
|
|
|
if( sizeof($Detail) > 0 ){
|
|
|
|
echo'
|
|
|
|
<div id="interactive" class="opened">
|
|
|
|
<span style="top:10px;right:20px;font-size: 150%;position:absolute;" id="close" onclick="this.parentNode.remove(); return false;">X</span>
|
|
|
|
<img id="packimg" style="left:20%;top:60px;width:65%;position:absolute;" src="'.$Detail[0]['lien_image'].'"/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<style type="text/css">
|
|
|
|
#interactive.closed {
|
|
|
|
max-height: 0;
|
|
|
|
z-index: -1;
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
#interactive.opened {
|
|
|
|
max-height: 130%;
|
|
|
|
z-index: 2000;
|
|
|
|
visibility: visible;
|
|
|
|
}
|
|
|
|
#interactive {
|
|
|
|
top:40px;
|
|
|
|
width: 100%;
|
|
|
|
height: 130%;
|
|
|
|
position: absolute;
|
|
|
|
background: rgb(250, 250, 250)
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<script>';
|
|
|
|
$total_time = 10000;
|
|
|
|
$time = 10000;
|
|
|
|
|
|
|
|
if( sizeof($Detail) > 1 ){
|
|
|
|
for($p=1;$p < sizeof($Detail);$p++){
|
|
|
|
echo'setTimeout(function() {
|
|
|
|
|
|
|
|
var interactive = document.querySelector("#packimg");
|
|
|
|
interactive.src = "'.$Detail[$p]['lien_image'].'";
|
|
|
|
|
|
|
|
},"'.$time.'");';
|
|
|
|
$time = $time + 10000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
echo' setTimeout(function() {
|
|
|
|
|
|
|
|
var interactive = document.querySelector("#interactive");
|
|
|
|
if (interactive.classList.contains("opened")) {
|
|
|
|
interactive.classList.remove("opened");
|
|
|
|
interactive.classList.add("closed");
|
|
|
|
}
|
|
|
|
|
|
|
|
},"'.($total_time*sizeof($Detail)).'");
|
|
|
|
|
|
|
|
|
|
|
|
</script>';
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|