<html>

<head>
  <meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <title>Formato</title>
</head>

<body>
  <style type='text/css'>
    body {
      font-family: Arial, Helvetica, sans-serif;
      font-weight: 400;
      font-style: normal;
      font-size: 12PX;
      margin: 0 0 0 0;
    }



    #table-example-1 caption {
      padding-bottom: 0.5em;
    }

    #table-example-1 td {
      white-space: nowrap;
    }

    #table-example-1 th {
      font-weight: normal;
    }

    #table-example-1 td {
      border-style: none solid;
      vertical-align: top;
    }

    #table-example-1 th {
      padding: 0.2em;
      vertical-align: middle;
      text-align: left;
      font-size: 12px;

    }

    #table-example-1 tbody td:first-child::after {
      content: leader('. ');
    }

    th {
      height: 30px;
      font-weight: bold;
    }

    #tarifas {
      color: red;
      font-size: 16px;
      font-weight: bolder;
      height: 300px;


    }
  </style>


  <?php setlocale(LC_TIME, 'spanish');
  include('../ajax/is_logged.php');
  require_once("../config/db.php");
  require_once("../config/conexion.php");

  $nume = $_GET['nume'];
  $usr = $_SESSION['user_name'];

  $fecha_actual = date("d-m-Y ");
  $sql = "SELECT user_email, n_cuenta,cc_asociado,nombre_1,nombre_2,apellido_1,apellido_2,fecha_nacimiento,direccion_resi,ciudad_resi,direccion_corre,
  ciudad_corre,tel_fijo,celular,correo, MAX(id_generados) as gen 
  FROM asociados,generados,users 
  WHERE cc_asociado = '$nume' 
  AND generados.id_asociado = '$nume'
  AND user_name = '$usr'";
  $query = mysqli_query($con, $sql);
  $row = mysqli_fetch_array($query);

  $id = $row['n_cuenta'];
  $cc = $row['cc_asociado'];
  $n1 = $row['nombre_1'];
  $n2 = $row['nombre_2'];
  $ap1 = $row['apellido_1'];
  $ap2 = $row['apellido_2'];
  $fn = $row['fecha_nacimiento'];
  $dir_resi = $row['direccion_resi'];
  $ci_resi = $row['ciudad_resi'];
  $dir_cor = $row['direccion_corre'];
  $ci_cor = $row['ciudad_corre'];
  $tel = $row['tel_fijo'];
  $cell = $row['celular'];
  $correo = $row['correo'];
  $gen = $row['gen'];
  $agen = $row['user_email'];

  if ($gen == 0) {
    $conse = 1;
  } else {
    $conse = $gen;
  }


  ?>
  <div>
    <table id='table-example-1'>
      <tbody>
        <tr>
          <th colspan='8' style=' border-bottom: groove; color:#0d9b76; font-weight: bold;'>ACTUALIZACI&Oacute;N DE DATOS - COOPSERP</th>
          <th colspan='1' style=' border-bottom: groove;'>Fecha: <?php echo $fecha_actual  ?></th>
          <th colspan='1' style=' border-bottom: groove;'>cta: <?php echo $id  ?></th>
          <th colspan='2' style=' border-bottom: groove;'>N° <?php echo str_pad($conse, 6, "0", STR_PAD_LEFT); ?></th>
        </tr>
        <tr>
          <th>Nombres Completos:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $n1 . " " . $n2 ?></th>
          <th rowspan='3' colspan='3' style="text-align:center !important;">Verifique y marque con una X si sus datos son correctos</th>
          <th rowspan='3' colspan='5' style="text-align:center !important;">
            AGENCIA: <?php echo $agen ?>
            <br>
            Escriba legible y verifique que sus datos sean correctos.
            <br>
            Y participa por un Televisor de 80 pulgadas
            <br>
            <img src="../img/tv.png" style=' width:100px; height:50px'>
          </th>
        </tr>
        <tr>
          <th>Apellidos Completos:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $ap1 . " " . $ap2 ?></th>
        </tr>
        <tr>
          <th>C&eacute;dula de ciudadan&iacute;a:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $cc ?></th>
        </tr>
        <tr>
          <th>Fecha de nacimiento:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $fn ?></th>
          <th colspan='3' style="text-align:center !important;">si<input type="checkbox" id="cbox1" value="first_checkbox" /> no <input type="checkbox" id="cbox1" value="first_checkbox" /> </th>
          <th colspan='8'> _________________________________________</th>
        </tr>
        <tr>
          <th>Dierccion de Residencia:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $dir_resi ?></th>
          <th colspan='3' style="text-align:center !important;">si<input type="checkbox" id="cbox1" value="first_checkbox" /> no <input type="checkbox" id="cbox1" value="first_checkbox" /> </th>
          <th colspan='8'> _________________________________________</th>
        </tr>
        <tr>
          <th>Ciudad de Residencia:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $ci_resi ?></th>
          <th colspan='3' style="text-align:center !important;">si<input type="checkbox" id="cbox1" value="first_checkbox" /> no <input type="checkbox" id="cbox1" value="first_checkbox" /> </th>
          <th colspan='8'> _________________________________________</th>
        </tr>
        <tr>
          <th>Direccion de Correspondencia:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $dir_cor ?></th>
          <th colspan='3' style="text-align:center !important;">si<input type="checkbox" id="cbox1" value="first_checkbox" /> no <input type="checkbox" id="cbox1" value="first_checkbox" /> </th>
          <th colspan='8'> _________________________________________</th>
        </tr>
        <tr>
          <th>Ciudad de Correspondencia:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $ci_cor ?> </th>
          <th colspan='3' style="text-align:center !important;">si<input type="checkbox" id="cbox1" value="first_checkbox" /> no <input type="checkbox" id="cbox1" value="first_checkbox" /> </th>
          <th colspan='8'> _________________________________________</th>
        </tr>
        <tr>
          <th>Telefono Fijo - celular:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $tel . " - " . $cell ?></th>
          <th colspan='3' style="text-align:center !important;">si<input type="checkbox" id="cbox1" value="first_checkbox" /> no <input type="checkbox" id="cbox1" value="first_checkbox" /> </th>
          <th colspan='8'> _________________________________________</th>
        </tr>
        <tr>
          <th>Email:</th>
          <th colspan='4' style="border-bottom: groove;"><?php echo $correo ?></th>
          <th colspan='3' style="text-align:center !important;">si<input type="checkbox" id="cbox1" value="first_checkbox" /> no <input type="checkbox" id="cbox1" value="first_checkbox" /> </th>
          <th colspan='8'> _________________________________________</th>
        </tr>
        </tbody>
      <tfoot>
        <tr>
          <th colspan='6'>
            <br>
            <n>RECOMIENDANOS UN AMIGO</n>
            <br>
            <br>
            CELULAR1 :_________________________
            <br>
          </th>
          <th colspan='6' style="text-align:center !important;">
            <br>
            <br>
            <br>
            CELULAR2 :_______________________________
            <br>
          </th>
        </tr>
        <tr>
          <th colspan='12' style="text-align:center !important;">
            <br>
            <br>
            _____________________________________
            <br>
            Firma
          </th>
        </tr>
      </tfoot>
    </table>
  </div>
</body>

</html>