<?
session_name('portal_absa');
session_start();
if(!isset($_SESSION['usuario_p_prov_absa']) || trim($_SESSION['usuario_p_prov_absa']) == "" || trim(strtoupper($_SESSION["URL_PORTAL"]."admin.php")) != trim(strtoupper($_SERVER['HTTP_REFERER']))){
	?><script>window.location.href="<?=$_SESSION["URL_PORTAL"]."index.php"?>"</script><?
	exit;
}
require "../../conexion/conectar.php";
require("../../libs/funciones.php");

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

if(!isset($_REQUEST["id"])){
	?><script>$j_6.messager.alert("Error","Faltan parametros.","error");</script><?exit;
}

$qdelete="delete from correos_proveedores where id=".$_REQUEST["id"];
if(!mysqli_query($conexion->CONEXION,$qdelete)){
	?><script>$j_6.messager.alert("Error","Ocurrio un error al eliminar el correo. Intente nuevamente.","error");</script><?exit;
}
?><script>$j_6.messager.alert("Informaci&oacute;n","Se ha eliminado correctamente el correo","info");recargaCorreosProveedor();</script><?exit;
?>