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

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

$dom = new DOMDocument();
     $dom->encoding = 'utf-8';
     $dom->xmlVersion = '1.0';
     $dom->formatOutput = true;

$error_save='';

$response=$dom->appendChild($dom->createElement("response"));
$msgswal=$response->appendChild($dom->createElement("msgswal")); 
     $msgswal->setAttribute("id","msgswal");

// tabla / campo /registro /valor
// $link_data=msql_connect('','','',$empr);

$tabla0=$tabla.'0';
$tabla1=$tabla.'1';
$tabla2=$tabla.'2';



$error_save='';
     
if(!empty($error_save))
{
     $msgswal->appendChild($dom->createElement("icon","error")); 
     $msgswal->appendChild($dom->createElement("title","Error")); 
     $msgswal->appendChild($dom->createElement("text",$error_save)); 
}

if(empty($error_save))
{

     $sql_maes='';
     $sql_maes.='update '.$tabla0.' set '.$colu.'='.$valorc.' ';
     $sql_maes.='where '.$tabla.'_codigo like "'.$fila.'" ';
     $sql_maes.='limit 1 ';     
     $res_maes=msql_query($sql_maes,$link_data);
     
     $consolelog=$response->appendChild($dom->createElement("consolelog"));
     // $div=$consolelog->appendChild($dom->createElement("sql",$sql_query)); 
     // $div=$consolelog->appendChild($dom->createElement("empr",$empr)); 
     // $div=$consolelog->appendChild($dom->createElement("idnum1",$idnum1)); 
     // $div=$consolelog->appendChild($dom->createElement("numero",$numero)); 
     
     $response->appendChild($dom->createElement("docu",$docu));
     $response->appendChild($dom->createElement("idnum1",$idnum1));
     $response->appendChild($dom->createElement("numero",$numero));
     

}


echo $dom->saveXML();
     
     
     
?>

