Ejemplo de un cine
Cine Programado en CSS
Este es un ejemplo de programacion en JavaScript pero creado en CSS, en donde nos da el costo total de:
1.- El pago por boletos.
2.-El tipo de funcion.
3.-El tipo de sala.
Codigo:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="es-mx" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Numero de Boletos</title>
<style type="text/css">
.auto-style2 {
margin-left: 0px;
}
.auto-style3 {
text-align: center;
}
.auto-style4 {
text-align: right;
}
.p {
font-family: "Agency FB";
color: #FFFFFF;
font-size: large;
}
.auto-style5 {
border: 5px solid #000000;
}
.auto-style6 {
font-family: "Agency FB";
color: #FFFFFF;
font-size: large;
text-align: left;
}
.auto-style7 {
text-align: center;
margin-left: 323px;
margin-top: 33px;
margin-right: 0px;
}
</style>
<script language="javascript">
function cuenta(bo,sa,fu)
{
bo=parseInt(bo);
if (sa=="Normal" && fu=="Matine")
document.Taquilla.Total.value=bo*25;
else
if (sa=="Normal" && fu=="Vespertino")
document.Taquilla.Total.value=bo*40;
else
if (sa=="Normal" && fu=="Nocturno")
document.Taquilla.Total.value=bo*55;
else
if (sa=="3D" && fu=="Vespertino")
document.Taquilla.Total.value=bo*100;
else
if (sa=="VIP" && fu=="Vespertino")
document.Taquilla.Total.value=bo*120;
else
if (sa=="3D" && fu=="Nocturno")
document.Taquilla.Total.value=bo*120;
else
if (sa=="VIP" && fu=="Nocturno")
document.Taquilla.Total.value=bo*160;
else
if (sa=="VIP" && fu=="Matine")
alert ("Error no hay matine");
else
if (sa=="3D" && fu=="Matine")
alert ("Error no hay matine");
else
if (fu=="Error" ||bo=="---" || sa=="---")
calcular =alert ("Error no hay valor 0");
}
</script>
</head>
<body style="background-color:#333399">
<form action="" method="post" name="Taquilla" style="height: 480px" >
<div class="auto-style7" style="height: 381px; width: 769px">
<br />
<br />
<br />
<input name="Image1" type="image" src="imagenes/logos_cines.jpg" height="68" /><br />
<br />
<br />
<br />
<br />
<table align="center" style="width: 18%; height: 175px" class="auto-style5" >
<tr>
<td class="auto-style6" style="width: 80px; height: 20px"> Numero
de Boletos</td>
<td class="auto-style4" style="height: 20px; width: 74px"><select class="auto-style2" name="Boletos" style="width: 43px; height: 20px">
<option value="---">----</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td>
</tr>
<tr>
<td class="auto-style6" style="width: 80px; height: 22px">Tipo de
Sala</td>
<td class="auto-style4" style="height: 22px; width: 74px">
<select name="Sala" style="width: 96px">
<option value="---">----------------</option>
<option value="Normal">Normal</option>
<option value="VIP">V.I.P</option>
<option value="3D">3D</option>
</select></td>
</tr>
<tr>
<td class="auto-style6" style="width: 80px; height: 13px">Funcion</td>
<td class="auto-style4" style="height: 13px; width: 74px">
<select name="Funcion" style="width: 96px">
<option value="Error">-------------------</option>
<option value="Matine">Matine</option>
<option value="Vespertino">Vespertino</option>
<option value="Nocturno">Nocturno</option>
</select></td>
</tr>
<tr>
<td class="auto-style6" style="width: 80px; height: 6px">Total a
Pagar</td>
<td class="auto-style4" style="height: 6px; width: 74px">
<input name="Total" style="width: 91px" type="text" /></td>
</tr>
<tr>
<td class="auto-style3" style="height: 30px; width: 80px">
<input name="Calcular" type="button" value="Calcular" onclick="cuenta(document.Taquilla.Boletos.value,document.Taquilla.Sala.value,document.Taquilla.Funcion.value)"/></td>
<td class="auto-style3" style="height: 30px; width: 74px">
<input name="Limpiar" type="reset" value="Limpiar" /></td>
</tr>
</table>
</div>
</form>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="es-mx" http-equiv="Content-Language" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Numero de Boletos</title>
<style type="text/css">
.auto-style2 {
margin-left: 0px;
}
.auto-style3 {
text-align: center;
}
.auto-style4 {
text-align: right;
}
.p {
font-family: "Agency FB";
color: #FFFFFF;
font-size: large;
}
.auto-style5 {
border: 5px solid #000000;
}
.auto-style6 {
font-family: "Agency FB";
color: #FFFFFF;
font-size: large;
text-align: left;
}
.auto-style7 {
text-align: center;
margin-left: 323px;
margin-top: 33px;
margin-right: 0px;
}
</style>
<script language="javascript">
function cuenta(bo,sa,fu)
{
bo=parseInt(bo);
if (sa=="Normal" && fu=="Matine")
document.Taquilla.Total.value=bo*25;
else
if (sa=="Normal" && fu=="Vespertino")
document.Taquilla.Total.value=bo*40;
else
if (sa=="Normal" && fu=="Nocturno")
document.Taquilla.Total.value=bo*55;
else
if (sa=="3D" && fu=="Vespertino")
document.Taquilla.Total.value=bo*100;
else
if (sa=="VIP" && fu=="Vespertino")
document.Taquilla.Total.value=bo*120;
else
if (sa=="3D" && fu=="Nocturno")
document.Taquilla.Total.value=bo*120;
else
if (sa=="VIP" && fu=="Nocturno")
document.Taquilla.Total.value=bo*160;
else
if (sa=="VIP" && fu=="Matine")
alert ("Error no hay matine");
else
if (sa=="3D" && fu=="Matine")
alert ("Error no hay matine");
else
if (fu=="Error" ||bo=="---" || sa=="---")
calcular =alert ("Error no hay valor 0");
}
</script>
</head>
<body style="background-color:#333399">
<form action="" method="post" name="Taquilla" style="height: 480px" >
<div class="auto-style7" style="height: 381px; width: 769px">
<br />
<br />
<br />
<input name="Image1" type="image" src="imagenes/logos_cines.jpg" height="68" /><br />
<br />
<br />
<br />
<br />
<table align="center" style="width: 18%; height: 175px" class="auto-style5" >
<tr>
<td class="auto-style6" style="width: 80px; height: 20px"> Numero
de Boletos</td>
<td class="auto-style4" style="height: 20px; width: 74px"><select class="auto-style2" name="Boletos" style="width: 43px; height: 20px">
<option value="---">----</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td>
</tr>
<tr>
<td class="auto-style6" style="width: 80px; height: 22px">Tipo de
Sala</td>
<td class="auto-style4" style="height: 22px; width: 74px">
<select name="Sala" style="width: 96px">
<option value="---">----------------</option>
<option value="Normal">Normal</option>
<option value="VIP">V.I.P</option>
<option value="3D">3D</option>
</select></td>
</tr>
<tr>
<td class="auto-style6" style="width: 80px; height: 13px">Funcion</td>
<td class="auto-style4" style="height: 13px; width: 74px">
<select name="Funcion" style="width: 96px">
<option value="Error">-------------------</option>
<option value="Matine">Matine</option>
<option value="Vespertino">Vespertino</option>
<option value="Nocturno">Nocturno</option>
</select></td>
</tr>
<tr>
<td class="auto-style6" style="width: 80px; height: 6px">Total a
Pagar</td>
<td class="auto-style4" style="height: 6px; width: 74px">
<input name="Total" style="width: 91px" type="text" /></td>
</tr>
<tr>
<td class="auto-style3" style="height: 30px; width: 80px">
<input name="Calcular" type="button" value="Calcular" onclick="cuenta(document.Taquilla.Boletos.value,document.Taquilla.Sala.value,document.Taquilla.Funcion.value)"/></td>
<td class="auto-style3" style="height: 30px; width: 74px">
<input name="Limpiar" type="reset" value="Limpiar" /></td>
</tr>
</table>
</div>
</form>
</body>
</html>
</html>