/info_alcancias_registradas.php
PHP | 119 lines | 57 code | 51 blank | 11 comment | 7 complexity | 30e16984321c407579b2bede3447195a MD5 | raw file
- <?php
- //VERIFICACION DE CONEXCION
- session_start();
- if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
- header ("Location: index.php");
- }
- ?>
- <!DOCTYPE html>
- <?php
- require "base.php";?>
- <html class="no-js" lang="">
- <head>
- <meta charset="utf-8">
-
- </head>
- <body>
- <center>
- <?php
- /*if ($_SESSION['rol'] != 'Oficina' ) {
- header ("Location: 404.html");
- }
- */
- // SE CREA LA CONEXCION A LA BASE DE DATOS DREAMHOST
- $conexion = new mysqli("mysql.campanaarquidiocesana.com","mgcdb","proyectosaga","campana_saga");
- if($conexion -> connect_error){
-
- die("Error en la conexion!");
-
- }
- else {
-
- ?>
- <form method="post" action="">
- <?php
- echo("<u><h2>Consulta de alcancias por parroquias</h2></u><br/>");
-
- }
- // OBTENEMOS EL VALOR QUE SE PASA DEL SELECT1 DEL FORMULARIO ALCANCIAS REGISTRADAS
- $alcancia = $_POST['select1'];
-
- // SE SELECCIONA DEPENDIENDO DE LA VICARIA Y PARROQUIA ESCOGIDA LA INFORMACION DE LA FAMILIA Y LA ALCANCIA
- $result3 = $conexion->query("SELECT `familia`.codigo_alcancia,`familia`.apellido,`familia`.direccion, `alcancia`.codigo_alcancia, `alcancia`.codigo_vicaria, `alcancia`.codigo_parroquia, `alcancia`.fecha_entrega,`alcancia`.fecha_devolucion
- FROM `familia` INNER JOIN `alcancia` ON `familia`.codigo_alcancia = `alcancia`.codigo_alcancia WHERE `alcancia`.codigo_alcancia ='{$alcancia}'" );
-
-
-
-
- // SE IMPRIME EN UNA TABLA A TRAVÉS DE UN ARREGLO
- if ($result3->num_rows > 0 ) {
- echo "<strong>Alcancias registrada ".$alcancia."</strong><br/><br>";
- echo '<div id="div1"><table id="testTable" class="scroll" > <tr> <th>Codigo de Alcancia</th><th>Familia</th><th>Dirección</th><th>Fecha de Entrega</th><th>Fecha de Devolución</th></tr>';
- while($row2= $result3->fetch_assoc()) {
-
- echo "<tr><td>".$row2["codigo_alcancia"]."</td><td>".$row2["apellido"]."</td><td>".$row2["direccion"]."</td><td>".$row2["fecha_entrega"]."</td><td>".$row2["fecha_devolucion"]."</td></tr>";
- }
- echo '</table></div>';
-
- } else {
- echo "0 Resultados.";
- }
- $conexion->close();
- ?>
- <br>
- <br>
- <br>
- <!--BOTON DE ACCION -->
- <div class="imagenes">
- <a href="consultar.php"> <button class= "icon" name="submit" type="submit" style='width:70px; height:50px' ><img src="css/fondos/checkmark.png"></button> </a>
- <button class= "icon" name="reset" type="reset" style='width:70px; height:50px' ><img src="css/fondos/cross.png"></button>
- <br/> <a href="consultar.php"></a>
- </div>
- </form> <br>
- </body>
- <center>
- </html>
- <?php
- require "footer.html";
- ?>