<?php
/*
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;
}

require_once "conexion/conectar.php";

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

	$id=$_POST["id"];
	$buscar="";
	$elemento="";
	$upload="";
if(trim($_POST["id"]) != "")
{
	$query="Select id, buscar, upload, elementoAttr from configxml where id='".$_POST["id"]."' LIMIT 1";

	$rquery=mysqli_query($conexion->CONEXION,$query);
	
	if(mysqli_num_rows($rquery) == 1)
	{
		$temp=mysqli_fetch_assoc($rquery);
		$id=$temp["id"];
		$buscar=$temp["buscar"];
		$elemento=$temp["elementoAttr"];
		$upload=$temp["upload"];

	}
}
?>
<script language="javascript" src="libs/Vanadium/vanadium.js"></script>
<script>
$j_6(document).ready(function() {
    $j_6().ajaxStart(function() {
        $j_6('#loading').show();
        $j_6('#result').hide();
    }).ajaxStop(function() {
        $j_6('#result').fadeIn('slow');
		$j_6('#loading').hide();
    });
	
		/*$j_3('#formXML').ajaxForm(function(data) {
						$j_3('#result').html(data);
						$j_3('#loading').hide();
		});*/
		
		$j_6('#form, #fat, #formXML').submit(function() {
        $j_6.ajax({
            type: 'POST',
            url: $j_6(this).attr('action'),
            data: $j_6(this).serialize(),
            success: function(data) {
					$j_6('#result').html(data);
					$j_6('#loading').hide();
            }
        })
        
        return false;
    });
	
});
function maximo(campo,limite){
if(campo.value.length>=limite){
campo.value=campo.value.substring(0,limite);
 }
}
</script>
<table>
		<tr>
		<td valign="top" class="txt_logindat" width="800" height="35"><div id="result"></div></td>
		</tr>
</table>
<table bgcolor="#FFFFFF">
		<tr>
			<td valign="top" class="txt_logindat" align="center"><center><h2>CONFIGURACI&Oacute;N DE RECEPCI&Oacute;N</h2></center></td>
		</tr>
</table>
        <form action="AltaConfigRecepcion.php" name="formXML" id="formXML">
		<INPUT TYPE="hidden" NAME="reloadGridAfterSave" id="reloadGridAfterSave" value="<?=$_POST['reloadGridAfterSave']?>">
		<input type="hidden" value="<?=$id?>" name="id" id="id" />
        <table class="td_general" bgcolor="#FFFFFF">
		<tr>
		<td valign="top" class="txt_logindat" width="150">
		<strong>Buscar: * :</strong>
		</td>
		<td valign="top" class="txt_logindat" align="left">
		<input type="text" size="60" name="buscar" id="buscar" class=":required Logers" value="<?=$buscar?>" />
        </td>
        </tr>
		<tr>
        <td valign="top" class="txt_logindat">
        <strong>Almacen *:</strong>
		</td>
		<td valign="top" class="txt_logindat">
		<input type="text" size="60" name="upload" id="upload" class=":required Logers" value="<?=$upload?>"/>
		</td>
		</tr>
		<tr>
        <td valign="top" class="txt_logindat">
        <strong>Elemento y/o Attr * :</strong>
		</td>
		<td valign="top" class="txt_logindat">
		<textarea name="elemento" id="elemento" class=":required Logers" cols="42" rows="4"><?=$elemento?></textarea>
		</td>
		</tr>
        <tr>
        <td colspan="2">
			<input type="submit" class="estilo_btn" value="GUARDAR"/>
        </td>
        </tr>
		</table>
        </form>