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

if(isset($delete)){
  if($id){
    $o_HipotecaBean = new HipotecaBean();
    $o_HipotecaBean->setIdHipoteca($id);
    
    $o_HipotecaBean->setUsuarioEliminado(myUser::getUser()->getUserId());
    $o_HipotecaSystemClass = new HipotecaSystemClass($o_HipotecaBean);
    $bResult = $o_HipotecaSystemClass->eliminarHipoteca();
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('hip/list')?>','006&delete=1&cod=<?=$o_HipotecaBean->getIdHipoteca()?>');
      parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
       $url = buildUrl('hip/delete', "block=".$block."&error=1");
    }
  } 
}
