Add files via upload

This commit is contained in:
Fernando Méndez 2021-05-24 17:02:40 +02:00 committed by GitHub
parent 7587548296
commit 895526114a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 105 additions and 14 deletions

View File

@ -361,6 +361,15 @@
.code.cinemas { .code.cinemas {
height: 200px; height: 200px;
} }
.code.promo img {
margin: 0.1em 0 0.8em 0;
width: 30%;
height: 10%;
display: block;
margin-left: auto;
margin-right: auto;
box-shadow: 0 4px 8px 0 #00020f, 0 6px 20px 0 #00020f;
}
.code.purchase { .code.purchase {
text-align: center; text-align: center;
} }

View File

@ -359,6 +359,15 @@ main img {
.code.cinemas { .code.cinemas {
height: 200px; height: 200px;
} }
.code.promo img {
margin: 0.1em 0 0.8em 0;
width: 30%;
height: 10%;
display: block;
margin-left: auto;
margin-right: auto;
box-shadow: 0 4px 8px 0 #00020f, 0 6px 20px 0 #00020f;
}
.code.purchase { .code.purchase {
text-align: center; text-align: center;
} }

View File

@ -3,11 +3,11 @@
class Promotion{ class Promotion{
//Attributes: //Attributes:
private $_id; //Cinema ID. private $_id; //Promotion ID.
private $_tittle; //Cinema name. private $_tittle; //Promotions name.
private $_description; //Cinema direction. private $_description; //Promotion description.
private $_code; //Cinema phone. private $_code; //Promotion code.
private $_active; private $_active; //Promotion is active?
//Constructor: //Constructor:
function __construct($id, $tittle, $description, $code, $active){ function __construct($id, $tittle, $description, $code, $active){

View File

@ -505,7 +505,7 @@
<h2>".$names[$i]."</h2> <h2>".$names[$i]."</h2>
<hr /> <hr />
<li>Dirección: ".$directions[$i]."</li> <li>Dirección: ".$directions[$i]."</li>
<li>Teléfono: ".$phones[$i]." minutos</li> <li>Teléfono: ".$phones[$i]."</li>
</div> </div>
</a> </a>
</div> </div>
@ -573,6 +573,76 @@
return $reply; return $reply;
} }
function print_promotions(){
$reply = "";
//List of the cinemas:
require_once(__DIR__.'/includes/promotion_dao.php');
$prefix= $this->get_prefix();
$promotion = new Promotion_DAO("complucine");
$promotions = $promotion->allPromotionData();
$ids = array();
$tittles = array();
$descriptions = array();
$codes = array();
$isActive = array();
if(is_array($promotions)){
foreach($promotions as $key => $value){
$ids[$key] = $value->getId();
$tittles[$key] = $value->getTittle();
$descriptions[$key] = $value->getDescription();
$codes[$key] = $value->getCode();
if($value->getActive()){
$isActives[$key] = "ACTIVA";
} else {
$isActives[$key] = "CADUCADA";
}
}
}
switch($this->page){
case "Promociones":
for($i = 0; $i < count($promotions); $i++){
if($i%2 === 0){
if($i != 0) $reply .= "</div>
";
$reply .= "<div class='column side'>
";
}
else{
if($i != 0) $reply .= "</div>
";
$reply .= "<div class='column middle'>
";
}
$reply .= "<section id='".$tittles[$i]."'>
<div class='zoom'>
<div class='code promo'>
<div class='image'><img src='".$prefix."img/promos/".str_replace(' ', '_', strtolower($tittles[$i])).".jpg' alt='".$tittles[$i]."' /></div>
<h2>".$tittles[$i]."</h2>
<hr />
<div class='blockquote'>
<p>".$descriptions[$i]."</p>
</div>
<li>Código: ".$codes[$i]."</li>
<li>Estado: ".$isActives[$i]."</li>
</div>
</div>
</section>
";
}
$reply .= "</div>\n";
break;
default:
break;
}
return $reply;
}
//Print session MSG: //Print session MSG:
function print_msg() { function print_msg() {
if(isset($_SESSION['message'])){ if(isset($_SESSION['message'])){

View File

@ -1,10 +1,11 @@
<?php <?php
/** /**
* USUARIOS DE PRUEBAS: * USUARIOS DE PRUEBAS:
* user | userpass * user | userpass --> Usuario de pruebas 1.
* fernando | ferpass * fernando | ferpass --> Usuario de pruebas 2.
* manager | managerpass * manager | managerpass --> Manager asociado al cine 1.
* admin | adminpass * manager | manager2pass --> Manager asociado al cine 2.
* admin | adminpass --> Administrador de la aplicación.
*/ */
//General Config File: //General Config File:

View File

@ -4,9 +4,11 @@
//Specific page content: //Specific page content:
$section = '<!-- Promotions --> $section = '<!-- Promotions -->
<div class="row">
<section id="promociones"> <section id="promociones">
'.$template->print_promotions().'
</section> </section>
</div>
'; ';
//General page content: //General page content:

View File

@ -105,7 +105,7 @@
$reply = '<h1>ESTAMOS TRABAJANDO EN ELLO</h1>'; $reply = '<h1>ESTAMOS TRABAJANDO EN ELLO</h1>';
$pay = false; $pay = false;
} else { } else {
$reply = '<h1>No ha encontrado película ni cine.</h1>'; $reply = '<h1>No se ha encontrado película ni cine.</h1>';
$pay = false; $pay = false;
} }