<?php 
declare(strict_types=0);

foreach($_GET as $campo => $valor){${$campo}=trim($valor);} 
foreach($_POST as $campo => $valor){${$campo}=trim($valor);} 

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


// $error=0;
if(empty($user_codigo)){$error=1;}
if(empty($docu)){$docu;};
if(empty($docu)){$docu='CAR1';};
// echo '/*/*/*'.$user_codigo;
// echo '/*/*/*'.$error;
// if(empty($error))
{
     $sql_carr ='select * from carr1 ';
     $sql_carr.='where docu="'.$docu.'" ';
     $sql_carr.='and iuser="'.$user_codigo.'" ';
     $res_carr=msql_query($sql_carr,$link_data);
     
//      echo '*/*/'.$sql_carr;
     if(msql_num_rows($res_carr)!=0)
     {
          $idcarr=msql_result($res_carr,0,'idnum1');
          $sql_updt='delete from carr2 where idnum2='.$idcarr;
          $res_updt=msql_query($sql_updt,$link_data);
     }
}
?>

