2 function CONTENIDO_pantallas() {
4 echo '<h1>Gestión de pantallas de ' . _NOMBRE_
. '</h1>';
5 if ( $session->isAdmin() && isset($_POST['registrar_mupi']) ) {
6 //Nos toca registrar un MUPI
9 echo '<hr /><h2>Pantallas '._NOMBRE_
." registradas para Ud.</h2>";
11 if ( $session->isAdmin() ) {
12 echo '<hr /><h2>Registrar Pantallas</h2>';
13 verPantallasregistro();
16 function verPantallas(){
18 $q = "SELECT codigo_cara_mupi 'Código Pantalla', codigo_mupi ' Código " . _NOMBRE_
."', codigo 'Código propietario', alquilado_desde 'Alquilado desde', codigo_evento 'Evento', foto 'Foto' FROM ".TBL_MUPI_FACES
.";";
19 $result = $database->query($q);
20 /* Error occurred, return given name by default */
21 $num_rows = mysql_numrows($result);
22 if(!$result ||
($num_rows < 0)){
23 echo "Error mostrando la información";
27 echo "¡No hay Pantallas "._NOMBRE_
." ingresadas!<BR />";
30 echo Query2Table($result);
32 function verPantallasregistro() {
35 <form action="./?'._ACC_
.'=gestionar+pantallas" method="POST">
37 <tr><td>Código Pantalla '._NOMBRE_
.':</td><td><input type="text" name="codigo" maxlength="100" style="width: 100%;" value="' . $form->value("codigo"). '"></td></tr>
38 <tr><td>Foto:</td><td><input type="text" name="foto" style="width: 100%;" maxlength="255" value="' . $form->value("foto"). '"></td></tr>
40 <input type="submit" value="Registrar">
41 <input type="hidden" name="registrar_mupi" value="1">
45 function Pantalla_REGISTRAR() {
46 global $database,$form;
47 $form->setValue("codigo", $_POST['codigo']);
48 $form->setValue("foto", $_POST['foto']);
49 echo "Registrado ". $_POST['codigo'];
50 $q = "INSERT INTO ".TBL_MUPI_FACES
." (codigo_cara_mupi, foto) VALUES ('".$_POST['codigo'] . "', '" . $_POST['foto'] ."');";
52 $result = $database->query($q);