Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/09/2012, 12:49
hfmp29
 
Fecha de Ingreso: mayo-2009
Ubicación: Loja - Ecuador
Mensajes: 2
Antigüedad: 15 años, 10 meses
Puntos: 0
Respuesta: Jalar datos de mysql a php

Ayuda tengo este código que en mi compu está funcionando perfectamente

pero al llevarlo a otra maquina y ejecutarlo me presenta estas dos líneas de código o errores

Notice: C:\xampp\htdocs\ministerio\consulta.php line 62 - Undefined index: miCombo

Notificación: C:\xampp\htdocs\ministerio\consulta.php línea 122- Undefined index: imprimir

Código PHP:
Ver original
  1. <html >
  2.     <head>
  3.     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4.     <title>Pago a Contratados</title>
  5.     </head>
  6.  
  7.     <body>
  8.  
  9.   <table width="927" border="0">
  10.     <tr>
  11.       <th width="813" height="99" scope="row"><p><strong>REPUBLICA DEL ECUADOR</strong></p>
  12.         <p><strong>DIRECCIÓN PROVINCIAL DE EDUCACIÓN HISPANA DE ZAMORA</strong></p>
  13.         <p><strong>PAGO DE HABERES</strong></p></th>
  14.     </tr>
  15.   </table>
  16.   <p>&nbsp;</p>
  17.  
  18.     <p><strong>
  19.     <!-- #BeginDate format:Am1 -->Septiembre 5, 2012<!-- #EndDate --></strong></p>
  20.     <p><strong></strong></p>
  21. <FORM method=post action="consulta.php" >
  22.   <tr>
  23.     <td colspan="2"><p>
  24.       <label>Contratado:
  25.         <!--Label-->
  26.         </select>
  27.       </label>
  28.       <?php
  29.  
  30.     include('Conectarse/conectar.php');
  31.     $link = Conectarse( );
  32.     $query2=mysql_query("Select * from tabla1");
  33.  
  34.    
  35.  
  36.     if ($row = mysql_fetch_array($query2)){
  37.     echo '<select name= "miCombo">';
  38.     echo'<option value="--Seleccione">---Seleccione una persona---';
  39.     do {
  40.     echo '<option value= "'.$row["id"].'">'.$row["apellidosnombres"].'</option>';
  41.     } while ($row = mysql_fetch_array($query2));
  42.     echo '</select>';
  43.        
  44.        
  45.     }
  46.  
  47.     ?>
  48.       <input type="submit" name="ver" value="Ver Detalles" />
  49.     </p>
  50.       <table width="674" border="0">
  51.         <tr>
  52.           <th width="500" scope="col"><p>NOMINA DE CONTRATO </p></th>
  53.           <th width="10" scope="col">&nbsp;</th>
  54.           <th width="150" scope="col"><p>INSTITUCIONAL</p></th>
  55.         </tr>
  56.     </table></td>
  57. </tr>
  58.  
  59.     <table width="937" height="261">
  60.     <?php
  61.     $id ='$_POST[miCombo]';
  62.     $query3=mysql_query("Select * from tabla1 where id='$_POST[miCombo]'");
  63.     while ($fila=mysql_fetch_array($query3))
  64.     {
  65.     ?>
  66.     <tr bgcolor="#999999">
  67.     <td width="269" height="73" align="right"><strong>Nombres :</strong></td>
  68.     <td width="261"><input type="text" size="42" value="<?php echo $fila['apellidosnombres']?>" maxlength="42" name="nombre" readonly="yes" /></td>
  69.     <td width="244" align="right"><strong>Cédula :</strong></td>
  70.     <td width="143"><input type="text" size="15" value="<?php echo $fila['cedula']?>" maxlength="15" name="cp5" readonly="yes" /></td>
  71.     </tr>
  72.     <tr align="left" valign="middle" bgcolor="#FFFFFF">
  73.     <td align="right"><p><strong><em>Rubro Ingresos</em></strong></p></td>
  74.     <td align="center"><strong><em>Monto</em></strong></td>
  75.     <td align="center"><strong><em>Rubro Descuentos</em></strong></td>
  76.     <td align="center"><strong><em>Monto</em></strong></td>
  77.     </tr>
  78.     <tr bgcolor="#CCCCCC">
  79.     <td align="right"><p><strong>REMUNERACIONES UNIFICADAS</strong></p>
  80.       <p><strong> 2012 :</strong></p></td>
  81.     <td><input type="text" size="10" value="<?php echo $fila['sueldo']?>" maxlength="10" name="apellido2" readonly="yes" /></td>
  82.     <td align="right"><strong>APORTE PERSONAL IESS :</strong></td>
  83.     <td><input type="text" size="10" value="<?php echo $fila['aportepersonaliess']?>" maxlength="10" name="cp4" readonly="yes" /></td>
  84.     </tr>
  85.     <tr bgcolor="#CCCCCC">
  86.     <td align="right"><strong>FONDO DE RESERVA 2012 :</strong></td>
  87.     <td><input type="text" size="10" value="<?php echo $fila['fondoreserva']?>" maxlength="10" name="cp2" readonly="yes" /></td>
  88.     <td align="right"><strong>COOP. MEGO :</strong></td>
  89.     <td><input type="text" size="10" value="<?php echo $fila['coopmego']?>" maxlength="10" name="cp3" readonly="yes" /></td>
  90.     </tr>
  91.     <tr bgcolor="#CCCCCC">
  92.       <td height="34" align="right"><strong>TOTAL :</strong></td>
  93.       <td><input type="text" size="10" value="<?php echo $fila['total']?>"maxlength="10" name="cp" readonly="yes" /></td>
  94.       <td align="right"><strong>PRESTAMO QUIROGRAFARIO :</strong></td>
  95.       <td><input type="text" size="10" value="<?php echo $fila['prestamoquirografario']?>" maxlength="25" name="cp" readonly="yes" /></td>
  96.       </tr>
  97.     <tr bgcolor="#CCCCCC">
  98.       <td height="34" align="right">
  99.        
  100.           <p><strong> A COBRAR :</strong></p>
  101.        
  102.       </td>
  103.       <td><input type="text" size="10" value="<?php echo $fila['acobrar']?>" maxlength="10" name="cp" readonly="yes" /></td>
  104.     <td height="34" align="right"><strong>TOTAL :</strong></td>
  105.     <td><input type="text" size="10" value="<?php echo $fila['total2']?>" maxlength="10" name="cp" readonly="yes" /></td>
  106.    
  107.    
  108.      
  109.  
  110.     </tr>
  111.         <td width="269" align="right"><input type="hidden" size="10" value="<?php echo $fila['id']?>" maxlength="10" id="id" name="id" readonly="yes" /></td>
  112.     </table>
  113.  
  114.     <?
  115.     }
  116.    
  117.    
  118.      echo "<input type='submit' id='i' name='imprimir' value='Imprimir' />";
  119.      
  120.     ?>
  121.     <?
  122.      if ($_POST["imprimir"])
  123.     {
  124.         $id= $_POST['id'];
  125.         echo "<body onload=\"ventanaRecomendaciones('/ministerio/pdfs/i_usuarios2.php?id=".$id."')\"></body>";
  126.     }
  127.     ?>
  128. <script>
  129. function ventanaRecomendaciones (URL)
  130. {
  131.  
  132.   window.open(URL,"ventana1","width=523, height=527, scrollbars=no, menubar=no, location=no, resizable=no, toolbar=no, directories=no, top=100,left=100")
  133. }
  134. </script>      
  135.   </td>
  136.     </tr>
  137.  
  138.   </form>
  139.     <p>&nbsp;</p>
  140.     </body>
  141.    
  142.     </html>

Última edición por hfmp29; 06/09/2012 a las 13:02