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

if(isset($delete)){
  if($id){
    $o_MercadoBean = new MercadoBean();
    $o_MercadoBean->setIdMercado($id);
    
    $o_MercadoBean->setUsuarioEliminado(myUser::getUser()->getUserId());
    $o_MercadoSystemClass = new MercadoSystemClass($o_MercadoBean);
    $bResult = $o_MercadoSystemClass->eliminarMercado();
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('mer/list')?>','001&delete=1&cod=<?=$o_MercadoBean->getIdMercado()?>');
      parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
       $url = buildUrl('mer/delete', "block=".$block."&error=1");
    }
  } 
}
