Add files via upload

This commit is contained in:
Fernando Méndez
2021-05-29 17:06:35 +02:00
committed by GitHub
parent e12c79d493
commit f5ede5cb15
3 changed files with 16 additions and 13 deletions

View File

@@ -3,16 +3,12 @@
* CompluCine - FDI-cines
*/
/* TO-DO: enviar el contenido del array de promociones */
window.onload = function () {
//Promociones:
var promos = document.getElementById("promotions").value;
console.log(promos);
// Promociones (Cambiar por el contenido del array "promotions")
const IMAGENES = [
'../img/promos/promo_vuelve.jpg',
'../img/promos/promo_palomitas.jpg',
'../img/promos/promo_miercoles.jpg'
];
const prefix = "../img/promos/";
const IMAGENES = JSON.parse(promos);
const TIEMPO_INTERVALO_MILESIMAS_SEG = 3500;
let posicionActual = 0;
let $botonRetroceder = document.querySelector('#retroceder');
@@ -52,7 +48,7 @@ window.onload = function () {
* Funcion que actualiza la imagen de imagen dependiendo de posicionActual
*/
function renderizarImagen () {
$imagen.style.backgroundImage = `url(${IMAGENES[posicionActual]})`;
$imagen.style.backgroundImage = `url(${prefix+IMAGENES[posicionActual]})`;
}
/**

View File

@@ -27,7 +27,7 @@
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
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();
return $promotions;