<?
session_name('portal_absa');
session_start();
require("../../conexion/conectar.php");

$conexion = new CONDB();
$conexion->conectar();

$rfc = $_POST['rfc'];
$check = $_POST['check'];

if($check=="false"){
	mysqli_query($conexion->CONEXION,"delete from proveedores where rfc_receptor='".$_SESSION['RFC_RECEPTOR_PORTAL']."' and rfc='$rfc'");
}else{
	$rExiste = mysqli_query($conexion->CONEXION,"select * from proveedores where rfc_receptor='".$_SESSION['RFC_RECEPTOR_PORTAL']."' and rfc='$rfc' LIMIT 1");
	if(mysqli_num_rows($rExiste) != 1)
		mysqli_query($conexion->CONEXION,"insert into proveedores set rfc='$rfc', rfc_receptor='".$_SESSION['RFC_RECEPTOR_PORTAL']."'");	
}

?>