<?
/*
Autor: Lic. Carlos Alberto Vaca Coronado
Version: 3.2.0
*/
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;}

$where="";

$keys = explode("|",$_POST['keys']);
$valkeys = explode("|",$_POST['valKeys']);

for($i = 0; $i < count($keys); $i++){
	if($where == "")
		$where=" where ".$keys[$i]."='".$valkeys[$i]."'";
	else
		$where.=" and ".$keys[$i]."='".$valkeys[$i]."'";
}
if($where != "")
	$sql="delete from ".$_POST['tabla'].$where;
?>
<script>
$j_6(document).ready(function() {
	$j_6('#loadingForm').hide();
    $j_6().ajaxStart(function() {
        $j_6('#loadingForm').show();
        $j_6('#resultForm').hide();
    }).ajaxStop(function() {
        $j_6('#loadingForm').hide();
        $j_6('#resultForm').fadeIn('slow');
    });
	
	$j_6('#form, #fat, #formDatos').submit(function() {
        $j_6.ajax({
            type: 'POST',
            url: $j_6(this).attr('action'),
            data: $j_6(this).serialize(),
            success: function(data) {
					$j_6('#resultForm').html(data);
					$j_6('#closeModal').click();
            }
        })
        return false;
    });
	
	$j_6('#cancelar').click(function() {
       $j_6('#closeModal').click();
    });
});
</script>
<table width="100%">
	<tr>
		<td width="95%" align="right"><div id="resultForm"></div></td>
		<td><div id="loadingForm"><img src="Imagenes/loading.gif" width="28" height="25"></div></td>
	</tr>
</table>
<center>
<?=str_replace("\"","",str_replace("\\","",$_POST['captionForm']))?>
<form action="grids/delete.php" id="formDatos" name="formDatos">
<input type="hidden" value="<?=$sql?>" id="query" name="query">
<INPUT TYPE="hidden" NAME="reloadGridAfterSave" id="reloadGridAfterSave" value="<?=$_POST['reloadGridAfterSave']?>">
<INPUT TYPE="hidden" NAME="valLiga" id="valLiga" value="<?=@$_GET['valLiga']?>">
<input type="submit" value="ACEPTAR" class="estilo_btn" id="aceptar">
<input type="button" value="CANCELAR" class="estilo_btn" id="cancelar">
</form>
</center>