Ver Mensaje Individual
  #2 (permalink)  
Antiguo 27/10/2015, 05:39
ddaavviidd
 
Fecha de Ingreso: octubre-2015
Mensajes: 2
Antigüedad: 8 años, 6 meses
Puntos: 0
Respuesta: popup en boton php

He corregido algun error del codigo.... me falta que salga un popup por cada boton puesto con el select, ahora solo tengo uno puesto de ejemplo pero quiero que me salga en los puestos con el "$sql = 'select * from Empleados WHERE EmpleadoID IN(1, 4, 7, 8, 10, 11, 12, 13, 15, 18, 19, 20) order by Alias';
foreach ($conn->query($sql) as $row): "

Código HTML:
Ver original
  1. <!DOCTYPE html>
  2.     <meta name="viewport" content="width=device-width">
  3.     <meta name="mobile-web-app-capable" content="yes">
  4.     <link rel="icon" sizes="192x192" href="/icon.png">
  5.     <head>
  6.         <meta charset="utf-8">
  7.         <meta name="viewport" content="width=device-width, initial-scale=1">
  8.         <title>Z</title>
  9.         <link rel="stylesheet" href="jquery.mobile/jquery.mobile-1.4.5.css">
  10.         <script src="jquery.mobile/jquery.js"></script>
  11.         <script src="jquery.mobile/jquery.mobile-1.4.5.js"></script>
  12.          <link href="../assets/jquery.signaturepad.css" rel="stylesheet">
  13.          <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
  14.       <!--  <link rel="stylesheet" href="css/signature-pad.css">-->
  15.         <link rel="stylesheet" type="text/css" href="fondo.css" media="screen" />
  16.  
  17.  
  18.         <script>
  19.  
  20.    
  21.             <!--Los botones tienen un código-->
  22.          <!-- data-dni="<?php /*?><?=$row['DNINIF']?><?php */?>" onclick="dniEmpleado = $(this).data('dni')"; -->
  23.             <!--  que guarda el DNI del empleado-->
  24.             // Y al hacer click lo guarda en esta variable
  25.             <!--var dniEmpleado = '';-->
  26.             // El botón del popup llamará a este método para comprobar si el DNI introducido es el correcto
  27.            
  28.            
  29.             function comprobarDNI() {
  30.                 var dniIntroducido = $('#pw').val();
  31.                
  32.                 if(dniIntroducido == dniEmpleado) {
  33.                     // El DNI es correcto. La ejecución del botón continúa
  34.                     return true;  
  35.                 } else {
  36.                     // El DNI es incorrecto. No se ejecutará el botón
  37.                     return false;
  38.                 }
  39.             }
  40.                        
  41. </script>  
  42.     </head>
  43.      <body onbeforeunload="return myFunction8()">
  44.         <div data-role="page"  data-theme="a" >
  45.             <div data-role="header" style="text-transform: uppercase;" data-theme="b">
  46.                 <h1>INICIO</h1><!--<div data-theme="a" id="reloj" class="reloj">00 : 00 : 00</div>--><a href="#"><img  src="imagenes/icono.png" height="73" width="73" ></a>
  47.             </div>
  48.          
  49.             <br><br><br><br><br>
  50.             <div data-role="main">
  51.          
  52.                 <div class="ui-content">
  53.                
  54.                     <?php
  55.                    require 'db.php';
  56.   $sql = 'select * from Empleados WHERE EmpleadoID IN(1, 4, 7, 8, 10, 11, 12, 13, 15, 18, 19, 20) order by Alias';
  57.                     foreach ($conn->query($sql) as $row):                    
  58.                      ?>
  59.  
  60.  <a href="tecnicos.php?tecnicoId=<?= $row['EmpleadoID'] ?>" data-dni="<?=$row['DNINIF']?>" onclick="dniEmpleado = $(this).data('dni');" data-role="button" data-inline="true" data-mini="false" data-theme="a" ><img src ="imagenes/icono-usuarios.png" height="110" width="117" ><br><?= $row['Alias'] ?><a/>
  61.  
  62. <?php endforeach ?>
  63.  
  64.  <!-- POPUP EJEMPLO a insertar en cada boton del row-->
  65.                  <a href="#popupLogin" data-rel="popup" data-transition="slidedown" data-position-to="window" class="ui-btn ui-corner-all ui-shadow ui-btn-inline ui-icon-check ui-btn-icon-left ui-btn-a" data-transition="pop">BOTON EJEMPLO</a>
  66. <div data-role="popup" id="popupLogin" data-theme="a" class="ui-corner-all">
  67.  
  68.     <form action="tecnicos.php?tecnicoId=<?= $row['EmpleadoID'] ?>" method="GET">
  69.         <div style="padding:10px 20px;">
  70.             <h3 align="center">INTRODUCE LA CLAVE</h3>  
  71.            <!--<label for="un" class="ui-hidden-accessible">Username:</label>
  72.            <input name="user" id="un" value=""  data-theme="a" type="text">-->
  73.            <label for="pw" class="ui-hidden-accessible">Password:</label>
  74.             <input name="pass" id="pw" value="" data-theme="a" type="text">
  75.             <button type="submit" data-inline="true" class="ui-btn ui-corner-all ui-shadow ui-btn-b ui-btn-icon-left ui-icon-check" onclick="comprobarDNI()">ACEPTAR</button>
  76.         </div>
  77.     </form>
  78.     </div>
  79.     <!--FIN POPUP EJEMPLO-->
  80.         </div>
  81.                </div>
  82.  
  83.                  </div>
  84.    
  85. </body>
  86. </html>

Gracias.