Add files via upload

This commit is contained in:
Fernando Méndez 2021-06-03 13:40:11 +02:00 committed by GitHub
parent 6326ff3e1e
commit 5c460bf06f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 47 deletions

View File

@ -18,7 +18,7 @@
$forms = self::manage();
return $reply = '<div class="code info">
<h1>Bienvenido, '.$name.', a tu Panel de Usuario.</h1>
<h1>Bienvenido '.$name.', a tu Panel de Usuario.</h1>
<hr />
<a href="./?option=change_profile_pic"><img src='.$userPic.' alt="user_profile_picture"/></a>
<h3>'.strftime("%A %e de %B de %Y | %H:%M").'</h3>

View File

@ -10,6 +10,7 @@ include_once($prefix.'assets/php/includes/hall_dao.php');
include_once($prefix.'assets/php/includes/hall.php');
include_once($prefix.'assets/php/includes/purchase_dao.php');
include_once($prefix.'assets/php/includes/purchase.php');
include_once($prefix.'assets/php/includes/promotion_dao.php');
include_once($prefix.'assets/php/includes/user.php');
class FormPurchase extends Form {
@ -22,6 +23,7 @@ class FormPurchase extends Form {
private $seat; // Seat of the film to be purchased.
private $row; // Row of the seat.
private $col; // Column of the seat.
private $code; // Promotional code.
private $years; // Actual year.
private $months; // Months of the year.
private $_TODAY; // Actual date.
@ -57,6 +59,14 @@ class FormPurchase extends Form {
}
}
$promoDAO = new Promotion_DAO("complucine");
$this->code = intval(0);
if(isset($_POST["code"]) && $_POST["code"] !== ""){
if($promoDAO->GetPromotion($_POST["code"])->data_seek(0)){
$this->code = intval(3);
}
}
$TODAY = getdate();
$year = "$TODAY[year]";
@ -95,11 +105,15 @@ class FormPurchase extends Form {
<p>Vuelva atrás para selecionar otra sesión.</p>
</div>";
} else {
if(!empty($this->seat)){
$seats = "";
foreach($this->seat as $value){
$seats .= $value.", ";
}
$promo = "";
if($this->code > 0) $promo = "<pre>(Se ha aplicado un descuento por código promocional).</pre>";
$html = "<div class='row'>
<fieldset id='datos_entrada'>
<legend>Resumen de la Compra</legend>
@ -110,7 +124,8 @@ class FormPurchase extends Form {
<p>Asiento(s):".$seats."</p>
<p>Fecha: ".date_format(date_create($this->session->getDate()), 'd-m-Y')."</p>
<p>Hora: ".$this->session->getStartTime()."</p>
<p>Precio Total: ".$this->session->getSeatPrice()*count($this->seat)." (Precio por asiento: ".$this->session->getSeatPrice()." )</p>
<p>Precio Total: ".intval($this->session->getSeatPrice()*count($this->seat)-$this->code)." (Precio por asiento: ".$this->session->getSeatPrice()." )</p>
<p>".$promo."</p>
</fieldset>
<fieldset id='pagar_entrada'><pre>".$htmlErroresGlobales."</pre>
<legend>Datos Bancarios</legend>
@ -141,6 +156,12 @@ class FormPurchase extends Form {
<input type='reset' id='reset' value='Borrar' />
</div>
</div>";
} else {
$html = "<div class='code info'>
<h2>No se ha seleccionado asiento(s).</h2>
<p>Vuelva atrás para selecionar una butaca.</p>
</div>";
}
}
return $html;
}

View File

@ -83,6 +83,7 @@ class FormSelectSeat extends Form {
//Pay button:
$pay = '<input type="hidden" name="sessions" id="sessions" value="'.$_POST["sessions"].'" />
<input type="hidden" name="code" id="code" value="'.$_POST["code"].'" />
<input type="submit" id="submit" value="Pagar" />';
return '