<?php 

include('includes/head.php'); 
$id = $_GET['id'];

$sqlMpg = "SELECT * FROM pagos_matriculas PMT INNER JOIN matricula MT ON PMT.matricula_INT = MT.Matricula_id INNER JOIN curso CS ON MT.Curso_id = CS.Curso_id INNER JOIN persona PS ON MT.Persona_id = PS.Persona_id WHERE PMT.idPago = '$id'";
$queryMpg = mysqli_query($con, $sqlMpg);
$fetchMpg = mysqli_fetch_assoc($queryMpg);

$iva = $fetchMpg['monto_abonado'] / 11;
$totalLetras = convertir($fetchMpg['monto_abonado']);
?>
<style>
  body{
      font-size: 20px; 
      line-height: 20px; 
      color: #000;
  }

  .mt--10{
    margin-top: -10px;
  }

  .mt--40{
    margin-top: -40px;
  }

  .mt-5{
    margin-top: 5px;
  }

  .mt-35{
    margin-top: 35px;
  }

  .mt-45{
    margin-top: 45px;
  }

  .mt-80{
    margin-top:80px; 
  }

  .mt-100{
    margin-top:100px; 
  }

  .mt-120{
    margin-top:120px; 
  }

  .mt-150{
    margin-top: 150px;
  }

  .mt-170{
    margin-top: 170px;
  }

  .mt-180{
    margin-top: 180px;
  }

  .mt-190{
    margin-top: 190px;
  }

  .mt-200{
    margin-top: 200px;
  }

  .ml-80{
    margin-left:80px;
  }

  .ml-100{
    margin-left:100px;
  }

  .ml-110{
    margin-left:110px;
  }

  .ml-120{
    margin-left:120px;
  }

  .ml-140{
    margin-left:140px;
  }

  .ml-150{
    margin-left:150px;
  }

  .ml-165{
    margin-left:165px;
  }

  .ml-170{
    margin-left:170px;
  }

  .ml-180{
    margin-left:180px;
  }

  .ml-190{
    margin-left:190px;
  }

  .ml-215{
    margin-left:215px;
  }

  .ml-200{
    margin-left:200px;
  }

  .ml-220{
    margin-left:220px;
  }

  .ml-225{
    margin-left:225px;
  }

  .ml-230{
    margin-left:230px;
  }

  .ml-240{
    margin-left:240px;
  }

  .ml-250{
    margin-left:250px;
  }
  
  .w-320{
    width: 320px;
  }

  #copia_factura{
    margin-top: -50px;
  }
  .transparente{
    color: rgba(255, 255, 255, 0);
  }
</style>

<body>
  <section class="datos_cliente">
    <div class="container">
        <div class="row"> 
          <p class="mt-170 ml-215"><?php echo strftime('%d de %B del %Y', strtotime($fetchMpg['fecha_matricula'])); ?></p>
          <p class="mt-180 ml-200"></p>
          <p class="mt-170 ml-150">x</p>
        </div>
          <p class="ml-225"><?php echo buscaDatos($fetchMpg['pago_nombre'])?></p>
          <p class="ml-250"><?php echo buscaDatos($fetchMpg['pago_ruc_ci'])?></p>
          <p class="ml-200 mt--10"><?php echo buscaDatos($fetchMpg['pago_direccion'])?></p>
    </div>
  </section>

  <section class="datos_detalles mt-15">
    <div class="container">
      <div class="row">
          <p class="mt-50 ml-90"><?php echo $fetchMpg['idPago']; ?></p>
          <p class="mt-50 ml-50">1</p>
          <p class="mt-50 ml-60 w-320">Matricula <?php echo $fetchMpg['Descripcion'].' - '.$fetchMpg['AhoLectivo'].' - '.$fetchMpg['Nombre'].' '.$fetchMpg['Apellido']; ?></p>
          <p class="mt-50 "><?php echo number_format($fetchMpg['monto_abonado'], 0, ',', "."); ?></p>
          <p class="mt-50 ml-20"><?php echo number_format($fetchMpg['monto_abonado'], 0, ',', "."); ?></p>
      </div>
          <p class="mt-40 ml-100 transparente">espacio</p>
        <div class="row">
            <p class="ml-220"></p>
            <p class="ml-220"></p>
            <p class="mt-35 ml-220"> <?php echo number_format($fetchMpg['monto_abonado'], 0, ',', "."); ?></p>
          </div>
      <div class="row">
        <p class="ml-30"></p>
        <p class="ml-40"></p>
        <p class="mt-10 ml-150"> <?php echo $totalLetras;?> ---</p>
      </div>
      <div class="row">
          <p class="mt-20 ml-240">-------</p>
          <p class="mt-50 ml-240"></p>
          <p class="mt-20 ml-60">-------</p>
          <p class="mt-50 ml-70"></p>
          <p class="mt-50 ml-30"></p>
          <p class="mt-20 ml-100">-------</p>
      </div>
    </div>
  </section>


  <section class="datos_cliente mt-40"  id="copia_factura">
    <div class="container">
        <div class="row"> 
          <p class="mt-180 ml-215"><?php echo strftime('%d de %B del %Y', strtotime($fetchMpg['fecha_matricula'])); ?></p>
          <p class="mt-180 ml-200"></p>
          <p class="mt-170 ml-150">x</p>
        </div>
          <p class="ml-225 mt--1"><?php echo buscaDatos($fetchMpg['pago_nombre'])?></p>
          <p class="ml-250"><?php echo buscaDatos($fetchMpg['pago_ruc_ci'])?></p>
          <p class="ml-200 mt--10"><?php echo buscaDatos($fetchMpg['pago_direccion'])?></p>
    </div>
  </section>

  <section class="datos_detalles mt-15">
    <div class="container">
      <div class="row">
          <p class="mt-50 ml-90"><?php echo $fetchMpg['idPago']; ?></p>
          <p class="mt-50 ml-50">1</p>
          <p class="mt-50 ml-60 w-320">Matricula <?php echo $fetchMpg['Descripcion'].' - '.$fetchMpg['AhoLectivo'].' - '.$fetchMpg['Nombre'].' '.$fetchMpg['Apellido']; ?></p>
          <p class="mt-50 "><?php echo number_format($fetchMpg['monto_abonado'], 0, ',', "."); ?></p>
          <p class="mt-50 ml-20"><?php echo number_format($fetchMpg['monto_abonado'], 0, ',', "."); ?></p>
      </div>
          <p class="mt-40 ml-100 transparente">espacio</p>
        <div class="row">
            <p class="ml-220"></p>
            <p class="ml-220"></p>
            <p class="mt-35 ml-220"> <?php echo number_format($fetchMpg['monto_abonado'], 0, ',', "."); ?></p>
          </div>
      <div class="row">
        <p class="ml-30"></p>
        <p class="ml-40"></p>
        <p class="mt-5 ml-150"> <?php echo $totalLetras;?> ---</p>
      </div>
      <div class="row">
          <p class="mt-20 ml-240">-------</p>
          <p class="mt-50 ml-240"></p>
          <p class="mt-20 ml-60">-------</p>
          <p class="mt-50 ml-70"></p>
          <p class="mt-50 ml-30"></p>
          <p class="mt-20 ml-100">-------</p>
      </div>
    </div>
  </section>

</body>