/alcancias_registradas.php
PHP | 228 lines | 125 code | 93 blank | 10 comment | 14 complexity | 92763eedcabc1f43d97bcd0d93be61a4 MD5 | raw file
- <?php
- session_start();
- if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')) {
- header ("Location: index.php");
- }
- ?>
- <!DOCTYPE html>
- <style>
- table, th, td {
- border: 1px solid black;
- }
- table.scroll {
- width: 100%;
- /* border-collapse: collapse; */
- border-spacing: 0;
- border: 2px solid transparent;
- }
- th{
- background: gray;
- /*position:fixed; */
- }
- table.scroll tbody,
- table.scroll thead {
- display: inherit;
- margin-left: -25%;
- }
- thead tr th {
- height: 30%;
- line-height: 30%;
- /*text-align: left;*/
- }
- table.scroll tbody {
- height: 100%;
- width: 100%;
- }
- tbody { border-top: 2px solid black; }
- tbody td, thead th {
-
- border-right: 1px solid black;
- }
- tbody td:last-child, thead th:last-child {
- border-right: none;
- }
- </style>
- <?php
- $rol = $_SESSION['rol'];
- if($rol=="Coordinador Parroquial"){
- require "base_parroco_coordinador.php";
-
- }
- elseif($rol=="Oficina"){
- require "base.php";
- }
- elseif($rol=="Sacerdote"){
- header('base_parroco_coordinador.php');
- }
- elseif($rol=="Coordinador Sectorial"){
- header('base_parroco_coordinador.php');
- }
-
- elseif($rol=="Coordinador Vicarial"){
- header('base_parroco_coordinador.php');
- }
- ?>
- <html class="no-js" lang="">
- <head>
- <meta charset="utf-8">
- <script language="javascript" type="text/javascript" src="js/jquery-1.6.2.js"></script>
- <script language="javascript" type="text/javascript" src="js/ajax.js"></script>
- <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>
- <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
- </head>
- <body>
- <center>
-
- <?php
- /*if ($_SESSION['rol'] != 'Oficina' ) {
- header ("Location: 404.html");
- }
- */
- $conexion = new mysqli("localhost","tesis","utp.2015","saga");
- //$conexion = new mysqli("mysql.campanaarquidiocesana.com","mgcdb","proyectosaga","campana_saga");
- if($conexion -> connect_error){
-
- die("Error en la conexion!");
-
- }
- else {
-
- ?>
- <div id="contenedor2">
- <div id="contenedor3">
- <form method="GET" action="" id="form1">
-
- <?php
- echo("<u><h2>Consulta de alcancias por parroquias</h2></u><br/>");
-
- }
- $vicaria = $_POST['slct1'];
- $parroquia = $_POST['slct2'];
-
-
-
- $indicador = 0;
-
- $result = $conexion->query("SELECT codigo_vicaria from alcancia WHERE codigo_vicaria = '{$vicaria}' LIMIT 1");
- $result2 = $conexion->query("SELECT codigo_parroquia from alcancia WHERE codigo_parroquia = '{$parroquia}' LIMIT 1");
- $result3 = $conexion->query("SELECT nombre from parroquia WHERE codigo_parroquia = '{$parroquia}' ");
- $result4 = $conexion->query("SELECT nombre from vicaria WHERE codigo_vicaria = '{$vicaria}' ");
- if ($result->num_rows == 1) {
- $indicador = 1;
-
- }
-
-
- if ($indicador == 1 && $result3->num_rows > 0 && $result4->num_rows > 0){
- $row2= $result3->fetch_assoc();
- $row3= $result4->fetch_assoc();
- echo "<strong>Alcancias registradas en la vicaria: ".$row3['nombre']."<n/> <n/>y parroquia: <n/> <n/>".$row2['nombre'].", <u> Elija una opciĆ³n para desplegar informaciĆ³n</u></strong><br/><br>";
- }
- $sql = "SELECT `codigo_alcancia` FROM `alcancia` WHERE codigo_vicaria ='{$vicaria}' AND codigo_parroquia = '{$parroquia}' ORDER BY `codigo_alcancia` ASC ";
- $result = $conexion->query($sql);
- if ($result->num_rows > 0 ) {
- echo "<select name='select1' id='select1' >";
- while($row = $result->fetch_assoc() ) {
-
- echo "<option value='".$row['codigo_alcancia']."'>".$row['codigo_alcancia']."</option>";
- }
- echo "</select>";
- echo "<br>";
-
- } else {
-
- echo "0 Resultados.";
- }
- ?>
- <br>
- <br>
- <br>
- <input type="button" style="width:37px; height:40px; background-image: url(css/fondos/checkmark.png);" id="ajaxButton" ></input>
- <div id="result"></div>
-
- </form>
- </div>
- </div>
- <br>
- </body>
- <center>
- </html>
- <?php
- require "footer.html";
- ?>