Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2.            
  3.            
  4.            
  5.             function muestra() {
  6.                 if ($("#maximo").val() - $("#minimo").val() < $("#cantidad").val()-1) {
  7.                     $("#resultado").html('La cantidad de numeros a extraer supera la cantidad a sortear');
  8.                 }
  9.                 else {
  10.                     $.getJSON(
  11.                         "muestra.php?minimo="+$("#minimo").val()+"&maximo="+$("#maximo").val()+"&cantidad="+$("#cantidad").val()
  12.                     ).done(function(d) {
  13.                         var resultado = d.resultado;
  14.                         var numero = [];
  15.                         var nombre = [];
  16.                        
  17.                         var div = '<table id="table_result">';
  18.                         var datos_sube = '<table id="table_datos_sube"  style="display: none; ">';
  19.                        
  20.                         for (var i=0; i<resultado.length; i++) {
  21.                             div = div + "<tr><td class='td1'>"+(i+1)+"</td><td>&nbsp;&nbsp;<img src='images/pico.png' height='15'>&nbsp;&nbsp;&nbsp;</td><td class='td2'><p>" +resultado[i]['id']+  "</p></td></tr>";
  22.  
  23.                             numero[i] = resultado[i]['numero'];
  24.                             nombre[i] = resultado[i]['nombre'];
  25.                            
  26.                             datos_sube = datos_sube + "<tr><td class='td2'><a onClick=\"abrir('"+numero[i]+"','"+nombre[i]+"')\">"+numero[i]+ "</a></td></tr>";
  27.                            
  28.                         }
  29.                         datos_sube = datos_sube + '</table>';
  30.                         div = div + '</table>';
  31.                        
  32.                         $("#resultado").html(div);
  33.                         $("#datos_sube").html(datos_sube);
  34.                         $("#verGanadores").css("display","");
  35.                        
  36.                     });
  37.                 }
  38.             }
  39.             function abrir(numero, nombre) {
  40.                
  41.                 $.colorbox({iframe: true, innerWidth:689, innerHeight:434, href:"verTarjeta.php?numero="+numero+"&nombre="+nombre}).show();
  42.             }
  43.  
  44.         </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement