<?php session_start();?>
<?php include('../_cfg/config.php');?>
<?php include('php_gene1.php'); ?>
<?php include('php_session.php');?>
<?php
echo '<br>';
echo 'TEST 8';
echo '<br>';

if(mb_stristr('fran.unil',$cfg_empr))
{

//    $sql_cont='select * from cont1 order by idnum1';
//    $res_cont=msql_query($sql_cont,$link_vcrx);

//    while($asoc=msql_fetch_assoc($res_cont))
   if(1==2)
   {
        $xidnum=$asoc['idnum1'];
//         echo '<br>****'.$xidnum;
//         if($xidnum!=$lidnum)
        {
             $sql_cont2='select * from cont2 where idnum2="'.$xidnum.'"';
             $res_cont2=msql_query($sql_cont2,$link_vcrx);
             $idtot=msql_num_rows($res_cont2);
             
                  $sql_updt='update cont2 set iddet=0 where idnum2="'.$xidnum.'"';
                  $res_updt=msql_query($sql_updt,$link_vcrx);
             
             for($idx=1; $idx<=$idtot; $idx++)
             {
                  echo '<br>'.$xid;
                  $sql_updt='update cont2 set iddet="'.$idx.'" where idnum2="'.$xidnum.'" and iddet=0 order by ctas limit 1';
                  $res_updt=msql_query($sql_updt,$link_vcrx);
                  echo '<br>'.$sql_updt;
                  echo msql_error($res_updt);
             }
        }
   }
     
   $sql_enti='select distinct enti from vtas12 where enti_descri="" or enti_descri is null';
   $res_enti=msql_query($sql_enti,$link_vcrx);
     
   while($asoc=msql_fetch_assoc($res_enti)){echo $asoc['enti'];get_ruc0($asoc['enti']);}
   
   $sql_enti='select distinct enti from comp12 where enti_descri="" or enti_descri is null';
   $res_enti=msql_query($sql_enti,$link_vcrx);
     
   while($asoc=msql_fetch_assoc($res_enti)){echo $asoc['enti'];get_ruc0($asoc['enti']);}
   
}

// file_get_contents();

?>