Add files via upload
This commit is contained in:
@ -556,6 +556,12 @@ textarea {
|
||||
border:#000000;
|
||||
background-color: #791515;
|
||||
}
|
||||
.file{
|
||||
margin-top: 10px;
|
||||
}
|
||||
.file input{
|
||||
height: 110%;
|
||||
}
|
||||
|
||||
|
||||
/* Footer */
|
||||
|
@ -14,10 +14,10 @@
|
||||
//Methods:
|
||||
|
||||
//Create a new Session.
|
||||
public function createFilm($id, $tittle, $duration, $language,$description){
|
||||
public function createFilm($id, $tittle, $duration, $language, $description){
|
||||
$sql = sprintf( "INSERT INTO `film`( `id`, `tittle`, `duration`, `language`,`description`)
|
||||
VALUES ( '%d', '%s', '%d', '%s','%s')",
|
||||
$id, $tittle, $duration, $language,$description);
|
||||
$id, $tittle, $duration, $language, $description);
|
||||
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
return $resul;
|
||||
|
@ -9,7 +9,6 @@
|
||||
private $_duration; //Film duration.
|
||||
private $_language; //Film language.
|
||||
private $_description; //Film description.
|
||||
|
||||
|
||||
//Constructor:
|
||||
function __construct($id, $tittle, $duration, $language, $description){
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
include_once($prefix.'assets/php/common/hall_dao.php');
|
||||
include_once('../assets/php/common/hall_dao.php');
|
||||
|
||||
class Hall{
|
||||
|
||||
@ -25,18 +25,6 @@
|
||||
return "";
|
||||
}
|
||||
|
||||
public static function create_hall($hall){
|
||||
$bd = new HallDAO('complucine');
|
||||
if($bd ){
|
||||
if(!$bd->searchHall($hall['cinema'], $hall['number'])){
|
||||
$bd->createHall($hall['number'], $hall['cinema'], $hall['cols'], $hall['rows']);
|
||||
return "Se ha creado la sala con exito";
|
||||
} else {
|
||||
return "Esta sala ya existe";
|
||||
}
|
||||
} else { return "Error al conectarse a la base de datos"; }
|
||||
}
|
||||
|
||||
//Getters && Setters:
|
||||
public function setNumber($number){ $this->_number = $number; }
|
||||
public function getNumber(){ return $this->_number; }
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
require_once($prefix.'assets/php/dao.php');
|
||||
require_once('../assets/php/dao.php');
|
||||
include_once('hall.php');
|
||||
|
||||
class HallDAO extends DAO {
|
||||
@ -17,12 +17,10 @@
|
||||
$sql = sprintf( "INSERT INTO `hall`( `number`, `idcinema`, `numrows`, `numcolumns`)
|
||||
VALUES ( '%d', '%d', '%i', '%i')",
|
||||
$number, $idcinema, $numRows, $numCol );
|
||||
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error BD createhall');
|
||||
|
||||
|
||||
return $sql;
|
||||
}
|
||||
|
||||
|
||||
//Returns a query to get the halls data.
|
||||
public function getAllHalls($cinema){
|
||||
$sql = sprintf( "SELECT * FROM hall WHERE
|
||||
@ -41,24 +39,7 @@
|
||||
|
||||
return $hall;
|
||||
}
|
||||
|
||||
//Returns the count of the hall searched
|
||||
public function searchHall($number, $cinema){
|
||||
|
||||
$sql = sprintf( "SELECT COUNT(*) FROM hall WHERE
|
||||
idcinema = '%s' AND number = '%s'",
|
||||
$cinema, $number);
|
||||
$resul = mysqli_query($this->mysqli, $sql) or die ('Error into query database');
|
||||
|
||||
$hall = mysqli_fetch_array($resul);
|
||||
|
||||
mysqli_free_result($resul);
|
||||
|
||||
return $hall[0];
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//Create a new Hall Data Transfer Object.
|
||||
public function loadHall($number, $idcinema, $numrows, $numcolumns){
|
||||
return new Hall($number, $idcinema, $numrows, $numcolumns);
|
||||
|
@ -7,6 +7,11 @@
|
||||
define('BD_USER', 'sw');
|
||||
define('BD_PASS', '_admin_');
|
||||
|
||||
/**
|
||||
* Temprarl files directory.
|
||||
*/
|
||||
define('TMP_DIR', __DIR__.'/img/');
|
||||
|
||||
/**
|
||||
* Utf-8 support settings, location (language and country) and time zone.
|
||||
*/
|
||||
@ -23,7 +28,7 @@
|
||||
$prefix = $template->get_prefix();
|
||||
|
||||
//Depuración (BORRAR):
|
||||
//ini_set('display_errors', 1);
|
||||
//ini_set('display_startup_errors', 1);
|
||||
//error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
error_reporting(E_ALL);
|
||||
?>
|
@ -1,6 +1,9 @@
|
||||
<?php
|
||||
class Template {
|
||||
|
||||
//Constants:
|
||||
private const _NUMPAGES = 10;
|
||||
|
||||
//Attributes:
|
||||
public $page; //Page Name.
|
||||
public $prefix; //Page prefix.
|
||||
@ -183,14 +186,14 @@
|
||||
|
||||
case "manager": array_push($menus, "<li>Ver como...
|
||||
<ul>
|
||||
<a href='./?state=view_user'><li>Usuario</li></a>
|
||||
<a href='./?state=view_ruser'><li>Usuario registrado</li></a>
|
||||
<a href='./?state=us_u'><li>Usuario</li></a>
|
||||
<a href='./?state=us_r'><li>Usuario registrado</li></a>
|
||||
</ul>
|
||||
</li>");
|
||||
array_push($menus, "<li>Modificar
|
||||
<ul>
|
||||
<a href='./?state=manage_halls'><li>Salas</li></a>
|
||||
<a href='./?state=manage_sessions'><li>Sesiones</li></a>
|
||||
<a href='./?state=rooms'><li>Salas</li></a>
|
||||
<a href='./?state=sessions'><li>Sesiones</li></a>
|
||||
</ul>
|
||||
</li>");
|
||||
break;
|
||||
@ -318,8 +321,7 @@
|
||||
</section>
|
||||
";
|
||||
}
|
||||
echo "</div>
|
||||
</div>\n";
|
||||
echo "</div>\n";
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -359,6 +361,7 @@
|
||||
</div>\n";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function print_cinemas(){
|
||||
|
Reference in New Issue
Block a user