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

if(isset($delete)){
  if($id){
    $o_AdelantoBean = new AdelantoBean();
    $o_AdelantoBean->setIdAdelanto($id);
    
    $o_AdelantoBean->setUsuarioEliminado(myUser::getUser()->getUserId());
    $o_AdelantoSystemClass = new AdelantoSystemClass($o_AdelantoBean);
    $bResult = $o_AdelantoSystemClass->eliminarAdelanto();
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('ads/list')?>','001&delete=1&cod=<?=$o_AdelantoBean->getIdAdelanto()?>');
      parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
       $url = buildUrl('ads/delete', "block=".$block."&error=1");
    }
  } 
}
