<?php
session_start();

   include_once("../scripts/connect.php");
include_once("../scripts/connect.php");
               include("../scripts/session.php");
//Validar Session

    $sesion=new Sesion("","","");/*Se crea un objeto nuevo con el privilegio necesario para la pag. actual*/

    if(!$sesion->isValida("4")){ /*Sesion invalida*/
    header("Location: ../login.php?err=NoSesion");
    }/*no hay sesion*/

    else{
       $dato=explode("|",$_SESSION['usuario']);
       $sesion->setDatos($dato[0],$dato[1],$dato[2]);
    }
    //fin validar session

  $conexion=conecta_default();
	$dist=$_GET['ref'];
	
	$qa = "SELECT referencia, rfc, nombre, appat, apmat, estatus_idestatus, idprom FROM inversionista WHERE id_inver = '".$dist."'";
   $ca = mysqli_query($conexion, $qa) or die ('Error (Registro No Encontrado): ' . mysqli_error($conexion));

   if(mysqli_affected_rows($conexion))
   {
       	
   	$ra = mysqli_fetch_object($ca);
	$id = $ra->referencia;
    $rfc = $ra->rfc;
	$nombre = $ra->nombre;
	$apat = $ra->appat;
	$amat = $ra->apmat;
    $estatus = $ra->estatus_idestatus;
    $idp = $ra->idprom;
 }
	
	
	 $qPP = "update promo_esp set reg='1', time=now() where id_inverp=$dist";
    $rPP = mysqli_query($conexion, $qPP) or die ('ErrPP update consec: '. mysqli_error($conexion));
	
 echo"<center><table>,<tr><td align='center' width=400>
 <font size='+2'>Real Rich Business<br>11 Aniversario<br>Registro<br>
</font><br><img src='https://barcode.tec-it.com/barcode.ashx?data=$id&code=Code128&multiplebarcodes=false&translate-esc=false&unit=Fit&dpi=96&imagetype=Gif&rotation=0&color=%23000000&bgcolor=%23ffffff&qunit=Mm&quiet=0' /><br><br> Recib&iacute; <br><font size='+2'>Playera</font><br><br>__________________________________ <br>$nombre <br>$apat $amat</td>
<td align='center' width=400>
 <font size='+2'>Real Rich Business<br>11 Aniversario<br>Registro<br>
</font><br><img src='https://barcode.tec-it.com/barcode.ashx?data=$id&code=Code128&multiplebarcodes=false&translate-esc=false&unit=Fit&dpi=96&imagetype=Gif&rotation=0&color=%23000000&bgcolor=%23ffffff&qunit=Mm&quiet=0' /><br><br> Recib&iacute; <br><font size='+2'>kit de bienvenida</font><br><br>__________________________________ <br>$nombre <br>$apat $amat</td>
</tr></table>";
  
  
              
?>