<?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();

$comprobacion = base64_decode($_REQUEST['id']);

$query_enc = "select comentario_comprobacion from recibedoce where upper(concat(comprobacion_prefijo,'-',comprobacion_no))=upper('$comprobacion') limit 1";


$result_enc = mysqli_query($conexion->CONEXION,$query_enc);

if(mysqli_num_rows($result_enc) > 0){
    $temp = mysqli_fetch_array($result_enc,MYSQLI_ASSOC);
}
	
	
?>
<!--<link rel="stylesheet" type="text/css" href="libs/jqueryEasy_1.2.5/themes/default.css"/>-->
<script language="javascript" src="libs/Vanadium/vanadium.js"></script>
<script language="javascript" src="libs/autocompletar/lib/jquery.ui.1.8.16.js"></script>
<link rel="stylesheet" type="text/css" href="libs/autocompletar/css/jquery.ui.css"/>
  <!--<link rel="stylesheet" type="text/css" href="libs/autocompletar/css/default.css"/>-->

<script>
$j_6(document).ready(function() {
	$j_6('#loading').hide();
    $j_6().ajaxStart(function() {
        $j_6('#loading').show();
        $j_6('#result').hide();
    }).ajaxStop(function() {
        $j_6('#result').fadeIn('slow');
		$j_6('#loading').hide();
    });
	
	$j_6('#form, #fat, #formComentario').submit(function() {
        $j_6.ajax({
            type: 'POST',
            url: $j_6(this).attr('action'),
            data: $j_6(this).serialize(),
            /*beforeSend: function(){
                if(!validaUser())
                    return false;
            },*/
            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);
 }
}

function pulsar(e) {
  tecla = (document.all) ? e.keyCode : e.which;
  return (tecla != 13);
}
</script>

<table>
		<tr>
		<td valign="top" class="txt_logindat" width="800" height="20"><div id="result"></div></td>
		</tr>
</table>
        
        <form target="_self" action="guardaComentario.php" method="post" name="formComentario" id="formComentario" onkeypress = "return pulsar(event)">
			<INPUT TYPE="hidden" NAME="comprobacion" id="comprobacion" value="<?=$_REQUEST['id']?>">
			
			<table class="td_general" bgcolor="#FFFFFF">
                                        <tr>
                                            <td colspan="2" align="center" height="50px"><center><strong>Comprobacion: <?=$comprobacion?></strong></center></td>
                                        </tr>
                                        <tr>
                                            <td valign="top" class="txt_logindat" align="center" width="200px">Comentario:</td>
                                            <td valign="top" class="txt_logindat">
                                                <textarea cols="50" rows="5" name="comentario_comprobacion" id="comentario_comprobacion" class="Logers" ><?=$temp['comentario_comprobacion']?></textarea>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td valign="top" class="txt_logindat" align="left" colspan="2">
                                                <input type="submit" class="estilo_btn" value="GUARDAR"/>
                                            </td>
                                        </tr>
			</table>
        </form>