How to send the data of a form to different documents with buttons?

0

I have a form that shows printed data of a query, but I want to send that data to a php file to generate a report in pdf when the user presses the "Generate" button, I do not know if it is working correctly since when recovering those data in the php file with the POST method does not recover it and sends me an error that the variable is undefined. This is my code.

<h1>Verifica que los datos que ingresaste sean correctos, si así lo es, presiona para generar tu ficha.</h1>


 <form action="" method="post" name="Hola">


<div  class="col-4">
    <label>
      FOLIO 
    <input name="FOLIO" type="text"  disabled="false" value="<?php echo $folio ?>" />    
    </label>
  </div>

   <div  class="col-4">
    <label>
      NOMBRE
      <input name="NOMBRE" type="text"  disabled="false" value="<?php echo $nom ?>" />    
      </label>
  </div>


<div class="col-4">
    <label>
      APELLIDO PATERNO
      <input name="APELLIDOPA" type="text" disabled="false" value="<?php echo $apellipa ?>" />
    </label>
  </div>


  <div class="col-4">
    <label>
      APELLIDO MATERNO
      <input name="APELLIDOMA" type="text" disabled="false" value="<?php echo $apellima?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
      FECHA DE NACIMIENTO
      <input name="FECHA_NACIMIENTO" type="text" disabled="false" value="<?php echo $nac ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
      CURP
      <input name="CURP" type="text" disabled="false" value="<?php echo $curp ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
      ESTADO CIVIL 
      <input name="ECIVIL" type="text" disabled="false" value="<?php echo $ecivil ?>" />
  </div>


   <div class="col-4">
    <label>
      ESTADO DE NACIMIENTO 
      <input name="CLAVE_ESTADO_NAC" type="text" disabled="false" value="<?php echo $estadonac ?>" />
    </label>
  </div>


  <div class="col-4">
    <label>
      MUNICIPIO DE NACIMIENTO
      <input name="CLAVE_MUNICIPIO_NAC" type="text" disabled="false" value="<?php echo $muninac ?>" />
    </label>
  </div>


   <div class="col-4">
    <label>
      ESTADO DONDE VIVE ACTUALMENTE 
      <input name="CLAVE_ESTADO_VIVE" type="text" disabled="false" value="<?php echo $estadovive ?>" />
    </label>
  </div>


   <div class="col-4">
    <label>
      MUNICIPIO DONDE VIVE ACTUALMENTE 
      <input name="CLAVE_MUNICIPIO_VIVE" type="text" disabled="false" value="<?php echo $munivive ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
     LOCALIDAD
      <input name="CLAVE_LOCALIDAD_VIVE" type="text" disabled="false" value="<?php echo $localidad ?>" />  
    </label>
  </div>


  <div class="col-3">
    <label>
      COLONIA 
      <input  name="COLONIA_VIVE" type="text" disabled="false" value="<?php echo $colonia ?>" />
    </label>
  </div>


  <div class="col-3">
   <label>
      CALLE 
      <input name="CALLE_VIVE" type="text" disabled="false" value="<?php echo $calle ?>" />
    </label>
  </div>


  <div class="col-4">
    <label>
       CÓDIGO POSTAL 
       <input name="CP_VIVE" type="text" disabled="false" value="<?php echo $cp ?>" />
    </label>
  </div>


  <div class="col-4">
    <label>
      TELÉFONO DE CASA
      <input name="TEL_CASA" type="text" disabled="false" value="<?php echo $telcasa ?>" />
    </label>
  </div>


  <div class="col-4">
    <label>
     CELULAR
     <input name="CELULAR" type="text" disabled="false" value="<?php echo $celular ?>" />
    </label>
  </div>


  <div class="col-4">
    <label>
      CORREO ELECTRÓNICO
      <input name="CORREO" type="text" disabled="false" value="<?php echo $correo ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
      PRIMERA OPCIÓN
     <input name="PRIMERA_OPCION" type="text" disabled="false" value="<?php echo $primera ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
     SEGUNDA OPCIÓN
     <input name="SEGUNDA_OPCION" type="text" disabled="false" value="<?php echo $segunda ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
      TERCERA OPCIÓN 
     <input name="TERCERA_OPCION" type="text" disabled="false" value="<?php echo $tercera ?>" />
  </div>


  <div class="col-4">
    <label>
       TIPO SANGUÍNEO
   <input name="TIPO_SANGUINEO" type="text" disabled="false" value="<?php echo $sangre ?>" />
  </div>


  <div class="col-4">
    <label>
      NACIONALIDAD
   <input name="NACIONALIDAD" type="text" disabled="false" value="<?php echo $nacionalidad ?>" />       
    </label>
  </div>


  <div class="col-4">
    <label>
       NOMBRE DE SECUNDARIA DE PROCEDENCIA
       <input name="NOMBRE_DE_SECUNDARIA_DE_PROSEDENCIA" type="text" disabled="false" value="<?php echo $secu ?>" />
    </label>
  </div>


  <div class="col-4">
    <label>
      CCT DE LA SECUNDARIA DE PROCEDENCIA
      <input name="CCT_DE_SECUNDARIA" type="text" disabled="false" value="<?php echo $cct ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
      NOMBRE DEL PADRE O TUTOR
      <input  name="NOMBRE_DE_PADRE_O_TUTOR" type="text" disabled="false" value="<?php echo $nombre_tutor_padre ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
     OCUPACIÓN DEL PADRE O TUTOR
     <input type="text" name="OCUPACION_DEL_TUTOR" disabled="false" value="<?php echo $ocupacion_tutor_padre ?>" />
    </label>
  </div>


  <div class="col-3">
    <label>
       NÚMERO DE CONTACTO 1
       <input name="NUMERO_1" type="number" disabled="false" value="<?php echo $numero1 ?>" />
  </div>


   <div class="col-3">
    <label>
       NÚMERO DE CONTACTO 2
       <input name="NUMERO_2" type="number" disabled="false" value="<?php echo $numero2 ?>" />
  </div>


   <div class="col-3">

  </div>
   <div class="col-3">

  </div>



    <div class="col-3">

  </div>


   <div class="col-3">

  </div>



    <div class="col-3">

  </div>


  <div class="col-submit">
    <input type="submit" class="submitbtn" name="enviar1" value="Ficha" onclick=this.form.action="Prueba3/reporte.php"
        <section id="openmodal" class="modalDialog">
            </section>
  </div>
  <div class="col-submit">
    <input type="submit" class="submitbtn" name="enviar" value="No" onclick=this.form.action="eliminar.php"
    <section id="openmodal" class="modalDialog">
    </section>
  <script type="text/javascript">
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));

elems.forEach(function(html) {
  var switchery = new Switchery(html);
);
</script>

  </form>

  </div>

And this is my code in the php that generates the pdf:

<?php


include('plantilla.php');
   require('conexion.php');

   /*$idr= $_POST['CURP'];
   $strConsulta = "SELECT * FROM inscripciones where CURP = '$idr'";
   $alumno = mysql_query($strConsulta);
   $fila = mysql_fetch_array($alumno);*/
   $abr=$_POST['FOLIO'];
   $pdf=new PDF('P','mm','A4');

   $pdf->AddPage();

   $pdf->Ln(5);
   $pdf->SetX(50);
   $pdf->SetFont('Arial', 'BU', 12);
   $pdf->Cell(100, 10,'PASE DE INGRESO AL EXAMEN', 0,0,'C');

   // Título
   $pdf->SetX(170);
   $pdf->Cell(23,27,'Foto',1,0,'C');

   // Salto de línea
   $pdf->Ln(20);

   $pdf->SetFont('Arial','B',10);
   $pdf->SetX(10);
   $pdf->MultiCell(100,10,utf8_decode('NÚMERO DE FOLIO: '.$abr),0,'C',0);

   $pdf->Output();
?>

For some reason you are not sending the data or maybe I am not defining the variable well, but I can not find the solution, I would be very grateful if you could help me. : 'v

    
asked by Oscar Reyes 09.09.2018 в 21:11
source

0 answers