<?php
session_start();
foreach($_GET  as $key => $value){${$key}=trim($value);$_PARAMS[$key]=${$key};}  
foreach($_POST as $key => $value){${$key}=trim($value);$_PARAMS[$key]=${$key};}

include_once('lib_main.php');
if(!empty($empr)){$link_data=msql_connect('','','',$empr); $cfg_empr=$empr;}
$user_codigo=$_SESSION['user_codigo'];
$user0=data_maes('user',$user_codigo);
$empr0=data_maes('empr',$empr);

$docu1=data_docu($docu1,$idnum1);

$sql_updt='update enti0 set enti_email="'.$email1.'" where enti_codigo like "'.substr($docu1['enti'],0,10).'%" and length(trim(enti_email))<6';
$res_updt=msql_result($sql_updt,$link_data);

$sql_updt='update enti0 set enti_emailce="'.$email1.'" where enti_codigo like "'.substr($docu1['enti'],0,10).'%" and length(trim(enti_emailce))<6';
$res_updt=msql_result($sql_updt,$link_data);


// $xmail=mail_docu($docu1,$idnum1,$email1);
$xmail=mail_docu($docu1['docu'],$docu1['idnum1'],$email1);


return;

     
?>