<?php use_helper('UrlFunctions'); ?>
<?php

if(isset($delete)){
  if($id){
    $o_ClienteBean = new ClienteBean();
    $o_ClienteBean->setIdCliente($id);
    
    $o_ClienteBean->setUsuarioEliminado(myUser::getUser()->getUserId());
    $o_ClienteSystemClass = new ClienteSystemClass($o_ClienteBean);
    $bResult = $o_ClienteSystemClass->eliminarCliente();
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('cli/list')?>','001&delete=1&cod=<?=$o_ClienteBean->getIdCliente()?>');
      parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
       $url = buildUrl('cli/delete', "block=".$block."&error=1");
    }
  } 
}
