Add files via upload
This commit is contained in:
parent
e12c79d493
commit
f5ede5cb15
@ -3,16 +3,12 @@
|
|||||||
* CompluCine - FDI-cines
|
* CompluCine - FDI-cines
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* TO-DO: enviar el contenido del array de promociones */
|
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
|
//Promociones:
|
||||||
var promos = document.getElementById("promotions").value;
|
var promos = document.getElementById("promotions").value;
|
||||||
console.log(promos);
|
const prefix = "../img/promos/";
|
||||||
// Promociones (Cambiar por el contenido del array "promotions")
|
const IMAGENES = JSON.parse(promos);
|
||||||
const IMAGENES = [
|
|
||||||
'../img/promos/promo_vuelve.jpg',
|
|
||||||
'../img/promos/promo_palomitas.jpg',
|
|
||||||
'../img/promos/promo_miercoles.jpg'
|
|
||||||
];
|
|
||||||
const TIEMPO_INTERVALO_MILESIMAS_SEG = 3500;
|
const TIEMPO_INTERVALO_MILESIMAS_SEG = 3500;
|
||||||
let posicionActual = 0;
|
let posicionActual = 0;
|
||||||
let $botonRetroceder = document.querySelector('#retroceder');
|
let $botonRetroceder = document.querySelector('#retroceder');
|
||||||
@ -52,7 +48,7 @@ window.onload = function () {
|
|||||||
* Funcion que actualiza la imagen de imagen dependiendo de posicionActual
|
* Funcion que actualiza la imagen de imagen dependiendo de posicionActual
|
||||||
*/
|
*/
|
||||||
function renderizarImagen () {
|
function renderizarImagen () {
|
||||||
$imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;
|
$imagen.style.backgroundImage = `url(${prefix+IMAGENES[posicionActual]})`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||||
|
|
||||||
while($fila=$resul->fetch_assoc()){
|
while($fila=$resul->fetch_assoc()){
|
||||||
$promotions[] = $this->loadPromotion($fila["id"], $fila["tittle"], $fila["description"], $fila["code"], $fila["active"], null);
|
$promotions[] = $this->loadPromotion($fila["id"], $fila["tittle"], $fila["description"], $fila["code"], $fila["active"], $fila["img"],);
|
||||||
}
|
}
|
||||||
$resul->free();
|
$resul->free();
|
||||||
return $promotions;
|
return $promotions;
|
||||||
|
13
index.php
13
index.php
@ -2,7 +2,14 @@
|
|||||||
//General Config File:
|
//General Config File:
|
||||||
require_once(__DIR__.'/assets/php/config.php');
|
require_once(__DIR__.'/assets/php/config.php');
|
||||||
|
|
||||||
$promotions = "HOLA MUNDO";
|
//Promotions:
|
||||||
|
include_once(__DIR__.'/assets/php/includes/promotion_dao.php');
|
||||||
|
|
||||||
|
$promotionsDAO = new Promotion_DAO("complucine");
|
||||||
|
$promotions = $promotionsDAO->allPromotionData();
|
||||||
|
foreach($promotions as $key=>$value){
|
||||||
|
$promotions_img[$key] = $value->getImg();
|
||||||
|
}
|
||||||
|
|
||||||
//Page-specific content:
|
//Page-specific content:
|
||||||
$section = '<!-- Undercard -->
|
$section = '<!-- Undercard -->
|
||||||
@ -27,8 +34,8 @@
|
|||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<input type="hidden" id="promotions" value="'.$promotions.'" />
|
';
|
||||||
';
|
$section.="<input type='hidden' id='promotions' value='".json_encode($promotions_img)."' />";
|
||||||
|
|
||||||
//General page content:
|
//General page content:
|
||||||
require RAIZ_APP.'/HTMLtemplate.php';
|
require RAIZ_APP.'/HTMLtemplate.php';
|
||||||
|
Loading…
Reference in New Issue
Block a user