You are on page 1of 48

UNIVERSIDAD PEDAGOGICA NACIONAL

FRANCISCO MORAZAN
(U.P.N.F.M)
Programa de Formación Permanente
(P.F.P.)

PROYECTO:

SISTEMA “HOTEL EMPERADOR”

Espacio Pedagógico:

PROGRAMACION DE BASE DE DATOS

Alumnos:

JUAN FUNEZ

Cuenta:

1513 1969 00046

Ingeniero:

MARIO ROLANDO FUNEZ MARIN

La Ceiba, Atlántida, Veintinueve de noviembre de 2018.


Introducción

La automatización de la información hoy en día es un tema de gran importancia para


cualquier empresa competitiva. Optimizar los recursos y tecnología es fundamental para
obtener un buen desarrollo económico, principalmente cuando se quiere alcanzar un
mejor posicionamiento en el mercado.
Los turistas son cada vez más complejos y específicos en sus gustos y preocupaciones.
Están mejor informados y saben bien lo quieren. Se necesita entonces ser flexible en el
diseño de los productos turísticos e incorporar la opinión de los turistas en el diseño de
ofertas. Un aspecto muy importante en los paquetes turísticos es la reserva de hotel. La
reserva de habitaciones es un proceso que actualmente se lleva a cabo persona a
persona, generalmente un pasajero contacta telefónicamente a un hotel o envía un
correo electrónico haciendo las consultas correspondientes, consultando por su
disponibilidad para cierta fecha y número de personas, donde este medio de
comunicación tiene algunos inconvenientes: Muchos hoteles se diferencean de su
competencia por su imagen y no por sus valores, lo que no se puede destacar por
teléfono.
El contacto telefónico es informal y no genera compromisos.

El contacto vía correo electrónico genera demoras en respuestas.


Hoy en día son muchas las personas que utilizan Internet para encontrar información de
dónde y cuándo viajar. Con un sistema de reserva, vía Internet, los hoteles podrán
ofrecer la comodidad de un servicio en el cual los pasajeros no tendrán que salir de su
casa u oficina, ni llenar formularios en papel, ni tampoco gastar en llamadas o envío de
fax. Todo el proceso de reserva se puede realizar frente a la misma pantalla en un corto
periodo de tiempo.
El presente proyecto muestra el desarrollo de un sistema de manera genérica, el cual
tiene como propósito ayudar en el proceso de control de reservas en dicho hotel.
2.- MODELADO BASE DE DATOS HOTEL EMPERADOR.

FechaReservacion

Precio
Estadía

RESERVACIONES

Idhabitaciones
Idreservaciones

Idhuésped

Apellido 2

Apellido 1 Identidad

Edad
Nombre 2

Huésped

Nombre 1 Sexo

Idhuésped
Lugar de origen

Teléfono
Tipohabitacion

Numhabitacion Habitaciones Estadohabitacion

Idhabitaciones
3. DICCIONARIO DE DATOS HOTEL EMPERADOR

2.1- HOTEL EMPERADOR


Atributo Tipo de Dato Tamaño Observación
idhabitaciones int 11 ““
numHabitacion int 11 ““
tipoHabitacion varchar 45 ““
estadoHabitacin Varchar 45 ““

2.2- RESERVACION
Atributo Tipo de Dato Tamaño Observación
idreservacion int 11 ““
estadia int 11 ““
fechaReservacion date 11 ““
precio int 11 ““
Habitaciones_idhabitaciones int 11 ““
Huésped_idhuespede int 11 ““

2.3- huésped
Atributo Tipo de Dato Tamaño Observación
idhuesped int 11 ““
nombre1 varchar 45 ““
nombre2 varchar 45 ““
apellido1 varchar 45 ““
apellido varchar 45 ““
# identidad bigint 13 ““
# edad int 11 ““
lugarOrigen varchar 45 ““
teléfono int 8 ““
4. Español estructurado proyecto Hotel Emperador.

4.1 EN ARBOL
Huésped:
Masculino
SEXO: Masculino o Femenino M

SEXO

F
Femenino
HABITACIONES:

Tipo de habitaciones: Sencilla, dobles, triples

Sencillas
M
Tipo de
habitacion Dobles

Triples

Habitaciones: sencilla, dobles, triple


Habitacion1

V F
Hab 1

V F
Habitacion 2 Hab 2

V F
Habitacion2
Hab 3

V
Hab 3 F

V F
Hab4

V F
Hab5

V
Habitacion 3

Habitacion3

V
Hab 6 F

V F
Hab7

V F
Hab8

Habitacion 4

Habitacion4

V
Hab 9 F

V F
Hab10

V F
Hab11

V
Habitacion 5

Habitacion5

V
Hab 12 F

V F
Hab13

V F
Hab14

V
Habitacion 6

Habitacion6

V
Hab 12 F

V F
Hab13

V F
Hab14

V
Habitacion 7

Habitacion7

V
Hab 15 F

V F
Hab16

V F
Hab17

Habitacion 8

Habitacion8

V
Hab 18 F

V F
Hab19

V F
Hab20

V
5. PANTALLAS DE ENTRADA

Hotel Emperador Ingreso de datos.


Habitaciones:
Formulario de ingreso

Formulario de Modificar
6. PANTALLA DE SALIDA

Tipo de Consultas

Huéspedes por habitacion


Habitaciones ocupadas

Lista de Huéspedes por habitacion Ocupada


Lista de huéspedes.

Venta total por habitaciones ocupadas.


Número de habitaciones ocupadas por fecha.

7. MANUAL TÉCNICO
7.1 FORMULARIO MENU
CÓDIGO PARA INGRESAR AL FORMULARIO DE HOTEL EMPERADOR DESDE MENU:

<!DOCTYPE html>
<html lang="es" >
<!---->
<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<!---->
<body >
<form>
<h1><b><font size="15"><center>Hotel Emperador</center></font></b></h1>
<div class="contentform">

<!-- BOTONES DE MENU PRINCIPAL -->


<input type="button" onclick="document.location.href='ingreso.php';"
value="INGRESAR" target="_blank" class="bouton-e">
<input type="button" onclick="location.href='mostrar.html';"
value="CONSULTAS" target="_blank" class="bouton-e">
<input type="button" onclick="document.location.href='modificar.php';"
value="MODIFICAR" target="_blank" class="bouton-e">

</div>
</form>
</body>
<!---->
</html>

CÓDIGO PARA GUARDAR:

<?php
$elnombre1=$_POST["nombre1"];
$elnombre2=$_POST["nombre2"];
$elapellido1=$_POST["apellido1"];
$elapellido2=$_POST["apellido2"];
$elsexo=$_POST["sexo"];
$laidentidad=$_POST["identidad"];
$eltelefono=$_POST["telefono"];
$eledad=$_POST["edad"];
$elorigenCliente=$_POST["origenCliente"];
//----------------------------------------
$elnumhabitacion=$_POST["habitacion"];
//----------------------------------------
$elestadia=$_POST["estadia"];
//----------------------------------------
$elfechares=$_POST["fechaRes"];
$elvalor=$_POST["valor"];
//----------------------------------------

include "conexion.php";

//----------------------------------------------------------------------------------------
---------

$consulta = $conexion -> query("INSERT INTO


proyectohotel.huesped(nombre1,nombre2,apellido1,apellido2,identidad,edad,sexo,lugarOrigen,
telefono)
Values('".$elnombre1."','".$elnombre2."','".$elapellido1."','".$elapellido2."','".$laident
idad."','".$eledad."','".$elsexo."','".$elorigenCliente."','".$eltelefono."');");
//----------------------------------------------------------------------------------------
---------
$maxid=$conexion -> query("SELECT MAX(idHuesped) as newIdHuespued from
proyectohotel.huesped");
$maxidb= $maxid -> fetch_assoc();

$consulta = $conexion -> query("INSERT INTO


proyectohotel.reservaciones(estadia,fechaReservacion,precio,idhabitaciones,idhuesped)
Values('".$elestadia."','".$elfechares."','".$elvalor."','".$elnumhabitacion."','".$maxidb
["newIdHuespued"]."');");
//CONSULTA QUE ACTUALIZA EL ESTADO DE LA HABITACION DE DISPONIBLE A OCUPADO.
// UPDATE tabla
// SET columna=lo_que_queremos
// WHERE condicion

$consulta = $conexion -> query("UPDATE habitaciones


SET estadoHabitacion='ocupada'
WHERE numHabitacion='$elnumhabitacion' ");
//----------------------------------------------------------------------------------------
---------

$conexion=null;

if ($conexion==null)
{
header("Location:menu.html");
}
?>
CÓDIGO PARA MODIFICAR DESDE EL FORMULARIO:

<!DOCTYPE html>
<html lang="es" >

<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<body>
<h1><b>Hotel Emperador</b></h1>
<form action="modificar1.php" method="post">
<h1><center> <b>Formulario de Modificacion</b></center></h1>

<div class="contentform">
<input type="button" onclick="location.href='menu.html'; " value="REGRESAR" target="_blank"
class="bouton-e">
<div class="leftcontact">
<!--
===============================================================================
=== -->
<!--
===============================================================================
=== -->
<!--
===============================================================================
=== -->
<!—

CODIGO PARA MOSTRAR SOLO LAS HABITACIONES DISPONIBLES EN UN OPTGROUP (grupo de


opciones).

<?php
include 'conexion.php';
//CONSULTA PARA SELECCIONAR SOLO LAS HABITACIONES DONDE SU ESTADO SEA
"DISPONIBLE"
$query = "SELECT * FROM proyectohotel.huesped ";

$result = $conexion->query($query);

?>
<!-- OPTGROUP DONDE SE INGRESAN LOS RESULTADOS DE LA CONSULTA--
>
<label for="huesped">Huesped</label>
<br>
<br>
<!-- ESTE ES EL ID QUE SE USA PARA EL METODO POST-->
<select id="huesped" name="huesped">
<?php
while ( $row = $result->fetch_array() )
{
?>

<div class="optgroup">
<!—
SOLAMENTE SE MODIFICARAN LOS DATOS QUE RESPONDEN A UN ESPACIO DE LA BASE DE
DATOS.
Por ejemplo: 'numHabitacion' es la columna de la tabla que estamos llamando desde la
base de datos.
-->
<option value=" <?php echo $row['idhuesped'] ?> " >
<?php echo "Nom: ".$row['nombre1']." ".$row['apellido2']; ?>
</option>
</div>

<?php
}
?>
</select>
<?php

?>
<br>
<br>
<!--
===============================================================================
=== -->

<!--
===============================================================================
=== -->

<!--
===============================================================================
=== -->

</div>

<div class="rightcontact">

<!--
===============================================================================
=== -->

<!--
===============================================================================
=== -->

<!--
===============================================================================
=== -->

<!—
CODIGO PARA MOSTRAR SOLO LAS HABITACIONES DISPONIBLES EN UN OPTGROUP (grupo de
opciones).
<?php

include 'conexion.php';

//CONSULTA PARA SELECCIONAR SOLO LAS HABITACIONES DONDE SU ESTADO SEA


"DISPONIBLE"

$query = "SELECT * FROM proyectohotel.habitaciones where


estadoHabitacion='disponible' ";

$result = $conexion->query($query);

?>

<!-- OPTGROUP DONDE SE INGRESAN LOS RESULTADOS DE LA CONSULTA--


>
<label for="habitacion">Habitacion</label>
<br>
<br>
<!-- ESTE ES EL ID QUE SE USA PARA EL METODO POST-->
<select id="habitacion" name="habitacion">
<?php
while ( $row = $result->fetch_array() )
{
?>
<div class="optgroup">
<!—
SOLAMENTE SE MODIFICARAN LOS DATOS QUE RESPONDEN A UN ESPACIO DE LA BASE DE
DATOS.
Por ejemplo: 'numHabitacion' es la columna de la tabla que estamos llamando desde la
base de datos.
<option value=" <?php echo $row['numHabitacion'] ?> " >
<?php echo "Num: ".$row['numHabitacion']." "."-Disponible"." -".$row['tipoHabitacion']; ?>
</option>
</div>
<?php
}
?>
</select>
<?php
?>
<br>
<br>
<!--
===============================================================================
=== -->

<!--
===============================================================================
=== -->

<!--
===============================================================================
=== -->

</div>

<button type="submit" target="_blank" class="bouton-e">Guardar</button>

</form>

</html>

CÓDIGO PARA MODIFICAR 1.PHP DESDE EL MENU:

<?php

include "conexion.php";

//----------------------------------------------------------------------------------------
---------

//----------------------------------------------------------------------------------------
---------

$conexion=null;

if ($conexion==null)
{
header("Location:menu.html");
}
?>

CÓDIGO PARA MOSTRAR DESDE MENU:

<!-- CODIGO DE MENU DE MUESTRA -->


<!DOCTYPE html>
<html lang="es" >
<!---->
<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<!---->
<body >
<form>
<h1><b><font size="15"><center>Hotel Emperador</center></font></b></h1>
<div class="contentform">

<!-- BOTONES DE MENU MUESTRA -->


<input type="button" onclick="location.href='menu.html'; " value="REGRESAR"
target="_blank" class="bouton-e">

<input type="button"
onclick="document.location.href='mostrarHuespedes.php';" value="Huéspedes por Habitación
Ocupada" target="_blank" class="bouton-e">

<input type="button" onclick="location.href='mostrarHuespedes1.html';"


value="Habitación Ocupada o No" target="_blank" class="bouton-e">

<input type="button"
onclick="document.location.href='mostrarHuespedes2.php';" value="Lista de Huespedes por
Habitación Ocupada" target="_blank" class="bouton-e">

<input type="button"
onclick="document.location.href='mostrarHuespedes3.php';" value="Lista de Huespedes"
target="_blank" class="bouton-e">

<input type="button"
onclick="document.location.href='mostrarHuespedes4.php';" value="Venta Total por
Habitaciones Ocupadas" target="_blank" class="bouton-e">

<input type="button"
onclick="location.href='mostrarHuespedes5.html';" value="Venta Total por Mes"
target="_blank" class="bouton-e">
<input type="button"
onclick="location.href='mostrarHuespedes6.html';" value="Número de habitaciones ocupadas
por fecha" target="_blank" class="bouton-e">

</div>
</form>
</body>
<!---->
</html>
CÓDIGO PARA MOSTRAR HUESPEDES.PHP DESDE MENU:

<!DOCTYPE html>
<html lang="es" >

<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<body>
<h1><b>Hotel Emperador</b></h1>
<form>
<h1><center> <b>Huespedes por Habitacion Ocupada</b></center></h1>

<input type="button" onclick="location.href='mostrar.html';" value="REGRESAR"


target="_blank" class="bouton-e">

<div class="contentform">
<br>
<br>
<center>

<div style="height:300px;width:500px;border:1px solid #ccc;font:16px/26px Georgia,


Garamond, Serif;overflow:auto;">
<?php
include "conexion.php";

//MOSTRAR HUESPEDES POR HABITACION OCUPADA

$consulta1=$conexion -> query("SELECT * FROM reservaciones


LEFT JOIN habitaciones ON habitaciones_idhabitaciones = idhabitaciones
LEFT JOIN huesped ON huesped_idhuesped = idhuesped
WHERE estadoHabitacion='ocupada'") or die ();
while($REGISTROS = $consulta1 -> fetch_assoc())
{
echo "No. Habitacion:".$REGISTROS['numHabitacion'];
echo "<br>";
echo "huesped:".$REGISTROS['nombre1']." ".$REGISTROS['apellido1'];
echo "<br>";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=";
echo "<br>";
echo "<br>";
}

?>
</div>

</center>

</div>

</form>

</html>

CÓDIGO PARA MOSTRAR HUESPEDES1.HTML DESDE MENU:

<!DOCTYPE html>
<html lang="es" >
<!---->
<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<!---->
<body >
<form action="mostrarHuespedes1.php" method="POST">
<h1><b><font size="15"><center>Hotel Emperador</center></font></b></h1>
<div class="contentform">

<!-- BOTONES DE MENU MUESTRA -->


<input type="button" onclick="location.href='mostrar.html'; " value="REGRESAR"
target="_blank" class="bouton-e">
<div class="form-group">
<p>No. Habitacion</p>
<input type="text" name="numhab" id="numhab" data-rule="required" />
</div>

<button type="submit" target="_blank" class="bouton-e">Siguiente</button>

</div>
</form>
</body>
<!---->
</html>
CÓDIGO PARA MOSTRAR HUESPEDES1, PHP DESDE MENU:

<!DOCTYPE html>
<html lang="es" >

<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<body>
<h1><b>Hotel Emperador</b></h1>
<form>
<h1><center> <b>Habitacion Ocupada</b></center></h1>

<input type="button" onclick="location.href='mostrar.html';" value="REGRESAR"


target="_blank" class="bouton-e">

<div class="contentform">
<br>
<br>
<center>
<div style="height:300px;width:500px;border:1px solid #ccc;font:16px/26px Georgia, Garamond,
Serif;overflow:auto;">
<?php
include "conexion.php";
$elnumhab=$_POST["numhab"];

$consulta1=$conexion -> query("SELECT * FROM habitaciones where


numHabitacion='$elnumhab' and estadoHabitacion='ocupada' ") or die ();
while($REGISTROS = $consulta1 -> fetch_assoc())
{
echo "No. Habitacion:".$REGISTROS['numHabitacion'];
echo "<br>";
echo "Estado Habitacion:".$REGISTROS['estadoHabitacion'];
echo "<br>";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=";
echo "<br>";
echo "<br>";
}
?>
</div>
</center>
</div>

</form>

</html>

CÓDIGO PARA MOSTRAR HUESPEDES2, PHP DESDE MENU:

<!DOCTYPE html>
<html lang="es" >

<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<body>
<h1><b>Hotel Emperador</b></h1>
<form>
<h1><center> <b>Huespedes</b></center></h1>

<input type="button" onclick="location.href='mostrar.html';" value="REGRESAR"


target="_blank" class="bouton-e">

<div class="contentform">
<br>
<br>
<center>

<div style="height:300px;width:500px;border:1px solid #ccc;font:16px/26px Georgia, Garamond,


Serif;overflow:auto;">
<?php
include "conexion.php";

//MOSTRAR HUESPEDES POR HABITACION OCUPADA

$consulta1=$conexion -> query("SELECT * FROM reservaciones


LEFT JOIN habitaciones ON habitaciones_idhabitaciones = idhabitaciones
LEFT JOIN huesped ON huesped_idhuesped = idhuesped
WHERE estadoHabitacion='ocupada'") or die ();
while($REGISTROS = $consulta1 -> fetch_assoc())
{
echo "No. Habitacion:".$REGISTROS['numHabitacion'];
echo "<br>";
echo "huesped:".$REGISTROS['nombre1']." ".$REGISTROS['apellido1'];
echo "<br>";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=";
echo "<br>";
echo "<br>";
}

?>
</div>
</center>
</div>
</form>
</html>

CÓDIGO PARA MOSTRAR HUESPEDES3. PHP DESDE MENU:

<!DOCTYPE html>
<html lang="es" >

<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<body>
<h1><b>Hotel Emperador</b></h1>
<form>
<h1><center> <b>Huespedes</b></center></h1>

<input type="button" onclick="location.href='mostrar.html';" value="REGRESAR"


target="_blank" class="bouton-e">

<div class="contentform">
<br>
<br>
<center>
<div style="height:300px;width:500px;border:1px solid #ccc;font:16px/26px Georgia, Garamond,
Serif;overflow:auto;">
<?php
include "conexion.php";

//MOSTRAR HUESPEDES POR HABITACION OCUPADA

$consulta1=$conexion -> query("SELECT * FROM huesped") or die ();


while($REGISTROS = $consulta1 -> fetch_assoc())
{
echo "Nombre: ".$REGISTROS['nombre1'];
echo "<br>";
echo "Apellido: ".$REGISTROS['apellido1'];
echo "<br>";
echo "Identidad: ".$REGISTROS['apellido1'];
echo "<br>";
echo "Edad: ".$REGISTROS['apellido1'];
echo "<br>";
echo "Sexo: ".$REGISTROS['apellido1'];
echo "<br>";
echo "Lugar Origen: ".$REGISTROS['lugarOrigen'];
echo "<br>";
echo "Telefono: ".$REGISTROS['telefono'];
echo "<br>";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=";
echo "<br>";
echo "<br>";
}

?>
</div>
</center>
</div>
</form>
</html>
CÓDIGO PARA MOSTRAR HUESPEDES4. PHP DESDE MENU:

<!DOCTYPE html>
<html lang="es" >

<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<body>
<h1><b>Hotel Emperador</b></h1>
<form>
<h1><center> <b>Venta Total por Habitaciones ocupadas</b></center></h1>

<input type="button" onclick="location.href='mostrar.html';" value="REGRESAR"


target="_blank" class="bouton-e">

<div class="contentform">
<br>
<br>
<center>

<div style="height:300px;width:500px;border:1px solid #ccc;font:16px/26px Georgia, Garamond,


Serif;overflow:auto;">
<?php
include "conexion.php";

$consulta1=$conexion -> query("SELECT SUM(precio) as preciototal from reservaciones


LEFT JOIN habitaciones ON habitaciones_idhabitaciones=idhabitaciones
WHERE estadoHabitacion='ocupada'") or die ();
while($REGISTROS = $consulta1 -> fetch_assoc())
{
echo "Venta Total: ".$REGISTROS['preciototal'];
echo "<br>";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=";
echo "<br>";
echo "<br>";
}

?>
</div>

</center>

</div>

</form>

</html>

CÓDIGO PARA MOSTRAR HUESPEDES5. html DESDE MENU:

<!DOCTYPE html>
<html lang="es" >
<!---->
<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<!---->
<body >
<form action="mostrarHuespedes5.php" method="POST">
<h1><b><font size="15"><center>Hotel Emperador</center></font></b></h1>
<div class="contentform">

<!-- BOTONES DE MENU MUESTRA -->


<input type="button" onclick="location.href='mostrar.html'; " value="REGRESAR"
target="_blank" class="bouton-e">

<div class="optgroup">
<p>Mes</p>
<select id="mes" name="mes">
<optgroup label="mes">
<option value="1">Enero</option>
<option value="2">Febrero</option>
<option value="3">Marzo</option>
<option value="4">Abril</option>
<option value="5">Mayo</option>
<option value="6">Junio</option>
<option value="7">Julio</option>
<option value="8">Agosto</option>
<option value="9">Septiembre</option>
<option value="10">Octubre</option>
<option value="11">Noviembre</option>
<option value="11">Diciembre</option>
</optgroup>
</select>
</div>

<button type="submit" target="_blank" class="bouton-e">Siguiente</button>

</div>
</form>
</body>
<!---->
</html>
CÓDIGO PARA MOSTRAR HUESPEDES5. PHP DESDE MENU:

<!DOCTYPE html>
<html lang="es" >
<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<body>
<h1><b>Hotel Emperador</b></h1>
<form>
<h1><center> <b>Suma de Venta por Ocupadas</b></center></h1>

<input type="button" onclick="location.href='mostrar.html';" value="REGRESAR"


target="_blank" class="bouton-e">

<div class="contentform">
<br>
<br>
<center>

<div style="height:300px;width:500px;border:1px solid #ccc;font:16px/26px Georgia, Garamond,


Serif;overflow:auto;">
<?php
include "conexion.php";
$elmes=$_POST["mes"];
//MOSTRAR HUESPEDES POR HABITACION OCUPADA

$consulta1=$conexion -> query("SELECT SUM(precio) as sumaDinero FROM reservaciones


WHERE MONTH(fechaReservacion)='$elmes'") or die ();
while($REGISTROS = $consulta1 -> fetch_assoc())
{
echo "Venta Total: ".$REGISTROS['sumaDinero'];
echo "<br>";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=";
echo "<br>";
echo "<br>";
}
?>
</div>
</center>
</div>
</form>
</html>

CÓDIGO PARA MOSTRAR HUESPEDES6. HTML DESDE MENU:

<!DOCTYPE html>
<html lang="es" >
<!---->
<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<!---->
<body >
<form action="mostrarHuespedes6.php" method="POST">
<h1><b><font size="15"><center>Hotel Emperador</center></font></b></h1>
<div class="contentform">
<!—

BOTONES DE MENU MUESTRA -->

<input type="button" onclick="location.href='mostrar.html'; " value="REGRESAR"


target="_blank" class="bouton-e">

<div class="form-group">
<p>Fecha</p>
<input type="date" name="fecha" id="fecha" data-rule="required" />
</div>

<button type="submit" target="_blank" class="bouton-e">Siguiente</button>

</div>
</form>
</body>
<!---->
</html>

CÓDIGO PARA MOSTRAR HUESPEDES6. PHP DESDE MENU:

<!DOCTYPE html>
<html lang="es" >

<head>
<meta charset="UTF-8">
<title>Hotel Emperador</title>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<body>
<h1><b>Hotel Emperador</b></h1>
<form>
<h1><center> <b>Número de habitaciones ocupadas por fecha</b></center></h1>

<input type="button" onclick="location.href='mostrar.html';" value="REGRESAR"


target="_blank" class="bouton-e">
<div class="contentform">
<br>
<br>
<center>

<div style="height:300px;width:500px;border:1px solid #ccc;font:16px/26px Georgia, Garamond,


Serif;overflow:auto;">
<?php
include "conexion.php";
$elfecha=$_POST['fecha'];
//MOSTRAR HUESPEDES POR HABITACION OCUPADA

$consulta1=$conexion -> query("SELECT COUNT(numHabitacion) as habitacionesOcupadas from


habitaciones

LEFT JOIN reservaciones ON habitaciones_idhabitaciones=idhabitaciones


WHERE estadoHabitacion='ocupada' and fechaReservacion='$elfecha'") or die ();
while($REGISTROS = $consulta1 -> fetch_assoc())
{ echo "Total: ".$REGISTROS['habitacionesOcupadas'];
echo "<br>";
echo "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=";
echo "<br>";
echo "<br>";
}
?>
</div>
</center>
</div>
</form>
</html>

CODIGO PARA PRUEBA.PHP DESDE MENU:

<?php
include 'conexion.php';

$query = "SELECT * FROM proyectohotel.habitaciones where estadoHabitacion='disponible' ";


$result = $conexion->query($query);

?>
<select>
<?php
while ( $row = $result->fetch_array() )
{
?>

<option value=" <?php echo $row['numHabitacion'] ?> " >


<?php echo $row['numHabitacion']; ?>
</option>

<?php
}
?>
</select>
<?php

?>
8.- Manual de usuario
Viñeta de menú, sirve para ir al menú de formulario de ingreso
en el cual se hacen las reservaciones en el sistema,

En este formulario se ingresa el nombre y los apellidos, el sexo,


la identidad, la edad, el teléfono , el origen del huésped, se
elige la habitacion, se coloca la estadia, la fecha de reservación
y el valor a pagar.

Este formulario no lleva al formulario de la


consulta, donde se puede consultarlo siguiente:
Modificar, no lleva al formulario de
huéspedes por habitacion ocupada, habitaciones
modificación, en la cual podemos
ocupadas, lista de huéspedes por habitacion
modificar los nombres del huésped, y
ocupada, lista de huéspedes, venta total por
las habitaciones si están ocupadas o
habitacion ocupada, venta total por mes
disponibles
Formulario de ingreso Regresar, sirve para
regresar al menú
principal
Primer nombre

Tipo de habitacion, Estadia,


Sexo, si es hombre
Segundo sencilla doble o triple cuantos
Primer apellido o mujer
nombre días se va a
quedar

Segundo apellido
Fecha de reservación, la fecha en
que se hace la reservación

Valor, cuanto debe


pagar por habitacion
ingreso huéspedes por
habitacion ocupada,
hace la consulta de los Regresar, sirve para
huéspedes en regresar al menu
habitacion ocupada principal
Consulta por habitacion
ocupada

Muestra la lista de Elabora una lista de Muestra la venta total por


las habitaciones
los huéspedes mes
ocupadas
Muestra el número de habitacion y el
nombre del huésped
Muestra si la habitacion está ocupada

Nos die si la habitacion esta ocupada


Muestra los huéspedes por habitacion

Muestra los datos del huésped en cada


habitacion
Muestra la venta total de habitaciones ocupadas

Esta pantalla nos envía a la


pantalla de la suma de las ventas
por habitacion ocupada
Esta pantalla nos muestra la opción de la fecha,
para ir al formulario de habitaciones ocupadas
por fecha.
Muestra la fecha para conocer el número
de habitaciones ocupadas por fecha

You might also like