Add files via upload
This commit is contained in:
parent
e12c79d493
commit
f5ede5cb15
@ -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]})`;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
13
index.php
13
index.php
@ -2,7 +2,14 @@
|
||||
//General Config File:
|
||||
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:
|
||||
$section = '<!-- Undercard -->
|
||||
@ -27,8 +34,8 @@
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
<input type="hidden" id="promotions" value="'.$promotions.'" />
|
||||
';
|
||||
';
|
||||
$section.="<input type='hidden' id='promotions' value='".json_encode($promotions_img)."' />";
|
||||
|
||||
//General page content:
|
||||
require RAIZ_APP.'/HTMLtemplate.php';
|
||||
|
Loading…
Reference in New Issue
Block a user