Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/01/2012, 07:25
Avatar de JeMaGa
JeMaGa
 
Fecha de Ingreso: julio-2011
Ubicación: Bogota
Mensajes: 430
Antigüedad: 12 años, 9 meses
Puntos: 4
tomar el name de un textbox

Hola tengo una pequeña inquietud que no he podido solucionar, resulta que tengo que imprimir un formulario html en un pdf, bueno yo utilizo fpdf, pero tengo un problema al momento de generar el pdf no me toma los valores de todos los campos, es decir, tengo un formulario que tiene una lista en esta lista aparece la opcion de nuevo y una serie de codigos ya existentes, cuando yo selecciono nuevo no hay problema me crea el formulario bien, y me toma todos los datos, el problema biene cuando yo selecciono un codigo ya existente, este codigo me trae una consulta de la base de datos y me lo muestra en el formulario, y hay campos del formulario que sale de la consulta mysql, como hago para tomar el nombre de estos campos y mostrarlos en mi pdf

Código PHP:
Ver original
  1. <form name="MB11-176_iverchem" method="post" action="pdf.php" enctype="multipart/form-data">
  2.  
  3. <!-- Se crea un input de tipo oculto y se le pasa como valor el codigo del documento. -->
  4. <input type="hidden" name="No_Analisis" value="<?php echo $_POST['No_Analisis'] ?>">
  5.  
  6. <?PHP
  7.  
  8. require('Conexion.php');
  9.  
  10. $analis=$_POST['No_Analisis'];
  11.  
  12. $sql="select DISTINCT * FROM `certificado` where `No.Analisis` = '$analis'";
  13.  
  14. $result = mysql_query($sql,$Conexion) or die (mysql_error());
  15.  
  16. $row=mysql_num_rows($result);
  17.  
  18. if($row == 0){
  19.        
  20.     include('NuevoMB11-176.php');
  21.        
  22. }else {
  23.                            
  24. while ($filas=mysql_fetch_array($result)){
  25.    
  26.  
  27. ?>
  28.  
  29. <center>
  30.   <table width="60%" border="1">
  31.  
  32.   <tr>
  33.     <td width="14%"><strong>PRODUCTO:</strong></td>
  34.     <td colspan="3"><center>
  35.       <div id="busqueda">
  36.       <input type="text" name="producto" id="producto" size="99" value="<?php echo $filas['Producto'];?>">
  37.       </div>
  38.     </center></td>
  39.   </tr>
  40.  
  41.   <tr>
  42.     <td height="26"><strong>No.LOTE</strong></td>
  43.     <td width="20%">
  44.       <input type="text" name="lote" id="lote" value="<?php echo $filas['No.Lote'];?>"></td>
  45.     <td width="24%"><strong>FORMA FARMACEUTICA:</strong></td>
  46.     <td width="42%">
  47.       <input type="text" name="formula" id="formula" size="48" value="<?php echo $filas['FormaFarmaceutica'];?>"></td>
  48.   </tr>
  49.  
  50.   <tr>
  51.     <td><strong>CLIENTE:</strong></td>
  52.     <td colspan="3">
  53.       <input type="text" name="Cliente" id="Cliente" size="99" value="<?php echo $filas['Cliente']; ?>"></td>
  54.   </tr>
  55.  
  56.   <tr>
  57.     <td><strong>FECHA DE RECEPCI&Oacute;N:</strong></td>
  58.     <td><label for="Recep"></label>
  59.       <input id="fc_1326233462" type="text" READONLY name="fechaRecepMDE" title="YYYY-MM-DD" onClick="displayCalendar(this);" value="<?php echo $filas['FechaRecepcion'];?>"></td>
  60.     <td><strong>T&Eacute;CNICA:</strong></td>
  61.     <td>USP 32</td>
  62.   </tr>
  63.  
  64.   <tr>
  65.     <td><strong>FECHA DE SIEMBRA:</strong></td>
  66.     <td><label for="siem"></label>
  67.       <input id="fc_1326233488" type="text" READONLY name="fechaSiembraMDE" title="YYYY-MM-DD" onClick="displayCalendar(this);" value="<?php echo $filas['FechaSiembra'];?>"></td>
  68.     <td><strong>METODO:</strong></td>
  69.     <td><label for="me"></label>
  70.       <input type="text" name="me" id="me" size="48" value="<?php echo $filas['Metodo'];?>"></td>
  71.   </tr>
  72.  
  73.   <tr>
  74.     <td><strong>FECHA LECTURA</strong></td>
  75.     <td><label for="lect"></label>
  76.       <input id="fc_1326232694" type="text" READONLY name="fechaLecturaMDE" title="YYYY-MM-DD" onClick="displayCalendar(this);" value="<?php echo $filas['FechaLectura'];?>"></td>
  77.     <td><strong>PRESENTACI&Oacute;N:</strong></td>
  78.     <td>
  79.       <input type="text" name="Presen" id="Presen" size="48" value="<?php echo $filas['Presentacion'];?>"></td>
  80.   </tr>
  81. </table></center>
  82.  
  83. <p>
  84.  
  85. </p>
  86. <center><table width="84%" border="1">
  87.   <tr>
  88.     <td bgcolor="#999999"><b><center>MEDIOS USADOS</center></b></td>
  89.     <td bgcolor="#999999"><b><center>No.LOTE</center></b></td>
  90.     <td bgcolor="#999999"><b><center>RESULTADO</center></b></td>
  91.   </tr>
  92.  
  93.   [B]<?php
  94.  
  95. $Codigo=$_GET['codigo'];
  96.  
  97. echo $Codigo;
  98.  
  99. $analis=$_POST['No_Analisis'];
  100.  
  101. $sql2="select DISTINCT * FROM `medios` where `No.Analisis` = '$analis'";
  102.  
  103. $result2 = mysql_query($sql2,$Conexion) or die (mysql_error());
  104.  
  105. $row2=mysql_num_rows($result2);
  106.  
  107. while ($filas2=mysql_fetch_array($result2)){
  108.  
  109. ?>
  110.  
  111. <tr>
  112.  
  113.     <td><input name="medioss" type="text"  value="<?php echo $filas2['Medios_Usados']; ?>"      size="44" ></td>
  114.  
  115.     <td><input name="mdios" type="text"  value="<?php echo $filas2['No.Lote'];?>" size="30">    </td>
  116.  
  117.     <td><input name="medios2"  type="text" value="<?php echo $filas2['Resultado'];?>" size=    "30"></td>
  118.  
  119. </tr>
  120.  
  121. <?php[/B] // esta consulta devuelve mas  campos, pero esos campos no me los toma
  122.  
  123. }
  124.  
  125. ?>
  126.  
  127. </table></center>
  128.  
  129.  
  130. <center><table width="60%" border="1">
  131.   <tr>
  132.     <td colspan="3" bgcolor="#999999"><center><b>SUITABYLITY TEST</b></center></td>
  133.   </tr>
  134.  
  135.   <tr>
  136.     <td bgcolor="#999999"><center><b>MEDIOS USADOS</b></center></td>
  137.     <td bgcolor="#999999"><center><b>CONTROLACTIVIDAD</b></center></td>
  138.     <td bgcolor="#999999"><center><b>CONTROL ESTIRILIDAD</b></center></td>
  139.   </tr>
  140.  
  141.   <?php
  142.  
  143. $analis=$_POST['No_Analisis'];
  144.  
  145. $sql3="select DISTINCT * FROM `test` where `No.Analisis` = '$analis'";
  146.  
  147. $result3 = mysql_query($sql3,$Conexion) or die (mysql_error());
  148.  
  149. $row3=mysql_num_rows($result3);
  150.  
  151. while ($filas3=mysql_fetch_array($result3)){
  152.  
  153.   ?>
  154.  
  155.   <tr>
  156.     <td><label for="medios1"></label>
  157.       <input type="text" name="medios1" id="medios1" size="27" value="<?php echo $filas3['Medios_Usados'];?>"></td>
  158.     <td><input type="text" name="controlactividad" id="controlactividad" size="38" value="<?php echo $filas3['Control_actividad'];?>"></td>
  159.     <td><input type="text" name="controlesterilidad" id="controlesterilidad" size="38" value="<?php echo $filas3['Control_Estirilidad'];?>"></td>
  160.   </tr>
  161.   <?php
  162.  
  163. }
  164.  
  165. ?>
  166.  
  167.   <tr>
  168.     <td bgcolor="#999999" ><B>CONCEPTO:</B></td>
  169.     <td colspan="3" bgcolor="#999999"><input name="concepto" id="concepto" type="text" size="84" bgcolor="#999999" ></td>
  170.     </tr>
  171. </table></center>
  172.  
  173.  
  174. <p><strong>OBSERVACIONES:</strong> </p><textarea name="observaciones" cols="50" rows="5"></textarea>
  175. <p>&nbsp;</p>
  176. <p>&nbsp;</p>
  177.  
  178. <center>
  179. <table width="60%" >
  180.   <tr>
  181.     <td width="53%"><input name="Micro" type="text" size="30" value=""></td>
  182.   </tr>
  183.     <tr>
  184.     <td>Coordinadora Microbiologia</td>
  185.   </tr>
  186. </table>
  187. </center>
  188.  
  189. <center>
  190.   <p>
  191.     <a href="MenuCertificados.php">..:::Regresar:::.. </a>  
  192.     │
  193.     <input name="Crear" type="submit" value="Generar">
  194.   </p>
  195. </center>
  196.  
  197. <?php
  198.  
  199.     }
  200.            
  201. }
  202.  
  203. ?>
  204. </form>


Agradesco toda la ayuda