Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
error
control.php
<html>
<head>
<title>Control de Acceso</title>
</head>
<body>
<br>
<?php
$conexio = pg_connect("host=localhost port=5432 dbname=ranbuntun user=postgres
password=marlon1973");
if (!$conexio)
{
die("Could not open connection to database server");
}
$sql = "SELECT COUNT(*) FROM client WHERE nick = '".$_POST['user']."' AND
password = '".$_POST['password']."'";
$resultat_set = pg_Exec ($conexio, $sql);
captura.php
<html>
<head>
<title>Control Dieta Ejercito</title>
</head>
<body>
<center><h1>Introduccion Datos</h1></center>
<form action="verifica.php" method="post">
<table align="center" width="250" cellspacing="2" cellpadding="2" border="0">
<tr>
<td colspan="2" align="center" bgcolor=#cccccc>Operation details</td>
</tr>
<tr>
<td align="right">Numero de Regimiento: </td>
<td><input type="Text" name="id" size="14" maxlength="50"></td>
</tr>
<tr>
<td align="right">Numero de Batallon: </td>
<td><input type="Text" name="id_reg" size="14" maxlength="50"></td>
</tr>
<tr>
<td align="right">Fecha: </td>
<td><input type="Text" name="fechapedido" size="14" maxlength="50"></td>
</tr>
<tr>
<td align="right">Id. Tipo de Comida: </td>
<td><input type="Text" name="tipocomida" size="14" maxlength="50"></td>
</tr>
<tr>
<td align="right">Id. Momento Comida: </td>
<td><input type="Text" name="nombremomento" size="14" maxlength="50"></td>
</tr>
<tr>
<td align="right">Numero de Soldados: </td>
<td><input type="Text" name="integrantes" size="14" maxlength="50"></td>
verifica.php
<html>
<head>
<title>Control Dieta</title>
</head>
<body>
<br>
<center><h1>Control dieta ejercito</h1></center>
<form action="componentes.php" method="post">
<?php
$conexio = pg_connect("host=localhost port=5432 dbname=ranbuntun password=marlon1973
user=postgres") or die("<BR>ERROR open BD!<BR>");
// Retrieve ticket id from short nom
$sql_1 = "SELECT nombrereg FROM regimiento WHERE id = '".$_POST['id']."'";
$result_set_1 = pg_Exec ($conexio, $sql_1);
$numRows_1 = pg_num_rows ($result_set_1);
if ($numRows_1 == 0) {
$nomreg="Regimiento no encontrado";
}
else
{
$nomreg=pg_result($result_set_1, 0);
}
$sql_2 = "SELECT nombre FROM batallon WHERE id_b = '".$_POST['id_bat']."'";
$result_set_2 = pg_Exec ($conexio, $sql_2);
$numRows_2 = pg_num_rows ($result_set_2);
if ($numRows_2 == 0) {
$nombat="Batallon no encontrado";
}
else
{
$nombat=pg_result($result_set_2, 0);
}
$sql_3 = "SELECT nombremomento FROM mision WHERE id = '".$_POST['tipocomida']."'";
$result_set_3 = pg_Exec ($conexio, $sql_3);
$numRows_3 = pg_num_rows ($result_set_3);
Adjuntar las capturas de pantalla que consideris necesarias para mostrar el correcto
funcionamiento de la aplicacin:
Ingreso a la aplicacion
Control Dieta
Detecta Error
Introduccir componentes
10
11
12
13
14
15
16
17
18
19
20
21