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

if(isset($control)){
  if($idempresa){
  	$o_PlanillaConceptoPerDP = new CrPlanillaConceptoPerDP();
	$o_PlanillaConceptoPerDP->setIdEmpresa($idempresa);
	$o_PlanillaConceptoPerDP->setPeriodo($periodo);
	$bResult = $o_PlanillaConceptoPerDP->openCP();

    
    
    if($bResult){
      ?>
      <script language="JavaScript">
      parent.objMainTab.reqBody('<?=buildUrl('planilla/list')?>','002&delete=1&cod=<?=$id?>');
       parent.objMainTab.windowsCloseAll();
      </script>
      <?
      
    }else{
        ?>
	      <script language="JavaScript">
	      //parent.objMainTab.reqBody('<?=buildUrl('planilla/list')?>','002&delete=1&cod=<?=$id?>');
	      </script>
	      <?
    }
  } 
}

$o_CrPlanillaPeriodoFN = new CrPlanillaPeriodoFN();
$o_CrPlanillaPeriodoFN->setIdEmpresa($idempresa);
$o_CrPlanillaPeriodoFN->setPeriodo($periodo);
$o_CrPlanillaPeriodoBN = $o_CrPlanillaPeriodoFN->select();
$ob_PlaEmpresa = $o_CrPlanillaPeriodoBN[0];
if(is_object($ob_PlaEmpresa)){
?>
<form name='form' method="POST" onsubmit='disableButton()'>
	<input type="hidden" name="control" value="1" >
	<input type="hidden" name="id" value="<?=$id?>">
	
	
	<table class="grid" width="100%" border="0" cellpadding="2" cellspacing="0">
		<?php if($bResult){?>
		<tr height="">
			<td colspan="2" align="center" class="req"><?php echo $bResult?></td>
		</tr>
		<?php }else{?>
		<tr height="">
			<td colspan="2" align="center" class="req">¿Esta seguro de abrir la planilla?</td>
		</tr>
		<?php }?>
	    <tr height="">
	      <td width="25%" align="right" class="req">Empresa</td>
	      <td width="75%" align="left"><?=$ob_PlaEmpresa->getDescripcionEmpresa()?></td>
	    </tr>
	     <tr height="">
	      <td width="25%" align="right" class="req">Periodo</td>
	      <td width="75%" align="left"><?=$ob_PlaEmpresa->getPeriodo()?></td>
	    </tr>
	    
	    <tr>
		<td align="center" colspan="5">
		  <input type="hidden" name="typeSubmit" id="typeSubmit">
		  <!--<input class="button" type="submit" value="Grabar y Nuevo" onclick="$('typeSubmit').value='add';"/>-->
		  <?php if(!$bResult){?>
		  <input class="button" id='btn' type="submit" value="Aceptar" onclick="$('typeSubmit').value='list';">
		  <?php }?>
		  <input class="button" type="button" value="Cancelar" onclick="parent.objMainTab.windowsCloseAll();"/>
		</td>
		</tr>
	</table>
	
	    </td>
	  </tr>
	</table>
</form>
<?php
}
?>