<link href="../../../js/tabla_sorteada/sortableTable.css" rel="stylesheet" type="text/css" />
{literal}
<script type="text/javascript" src="../../../js/tabla_sorteada/mootools-1.2.4-core-yc.js"></script>
<script type="text/javascript" src="../../../js/tabla_sorteada/sortableTable.js"></script>
<script type="text/javascript" src="../../../js/tooltip/BoxOver.js"></script>
{/literal}

<table width="100%" border="0">
  <tr>
    <td width="28%">    </td>
    <td align="center" width="50%">
      <h1><img src="../../../imagen/menu/chart_bar_add.png" border="0">&nbsp;PROGRAMA DECLARACION TELEMATICA </h1>
    </td>
    <td align="right" width="22%">&nbsp;</td>
  </tr>
</table>
<hr />

<center>

 	<div class="search" >
		  		<form id="tableFilter" onsubmit="myTable.filter(this.id); return false;">Filtrar: 
					<select id="column">
		  				<option value="1">Codigo</option>
						<option value="2">Periodo Pago</option>
						<option value="3">Planilla</option>
						<option value="4">Fecha de Inicio</option>
					</select>
					<input type="text" id="keyword" />
					<input type="submit" value="Buscar" />
					<input type="reset" value="Resetear" />
				</form>
  </div>
		 
	 <br />
<table id="myTable" class="tabla_sorteada" cellpadding="0"  width="100%">
	  <thead> 
        <tr valign="top">
          <th title="header=[] body=[Ordenar por Cod.]" axis="number"><h3>Cod.</h3></th>
          <th title="header=[] body=[Ordenar por Periodo]" axis="string"><h3>Periodo Pago</h3> </th>
          <th><h3>Planilla</h3></th>
          <th><h3>Clase de Planilla</h3></th>
		  <th><h3>Fecha Inicio</h3></th>
		  <th><h3>Fecha Final</h3> </th>
          <!-- <th><h3>REGISTRADO</h3></th>
		  <th><h3>MODIFICADO<h3></th>
		  <th><h3>USUARIO</h3></th> -->
		  <th colspan="2"><h3>Estado</h3></th>
        </tr>
      </thead>
		<tbody>
        {assign var="total" value="$pagina"}
        {assign var="total" value="`$total-1`"} 
        {assign var="a" value="`$numreg*$total`"}
        {assign var="b" value="`$b+1+$a`"}
        {foreach item=r from=$planilla}
        {if $fila == 0}
          {assign var="color" value="$color1"}
          {assign var="fila" value="1"}
        {else}
          {assign var="color" value="$color2"}
          {assign var="fila" value="0"}
        {/if}
        <tr>
          <td>{$r.id_planilla}</td>
          <td>{$r.periodo_pago}</td>
          <td>{$r.nombre}</td>
          <td>{$r.clase_planilla}</td>
          <td bgcolor="#FFCC66">{$r.fecha_inicio}</td>          
		  <td bgcolor="#CCFF99">{$r.fecha_final}</td>
          <!--<td align="center">{$r._registrado}</td>
          <td align="center">{$r._modificado}</td>
          <td>{$r.usuario}</td>-->
		  {if $r.estado == C}
          <td bgcolor="#99CC33" align="center">
		  PLANILLA CERRADA		  </td>
		  {else}
		  <td bgcolor="#99FFFF" align="center">
		  PLANILLA ABIERTA		  </td>
		  {/if}	  
          <td title="header=[PDT] body=[Generar Reporte]" align="center">
            <form name='formDetalle{$r.id_planilla}' method="POST" action="pdt_detalle.php">
              <input type='hidden' name='id_planilla' value='{$r.id_planilla}'>
              <a href='javascript:document.formDetalle{$r.id_planilla}.submit();' >
                <img src="../../../imagen/menu/cd_burn.png" border="0" title="Detalle De la planilla">              </a>
            </form>		  </td>
        {assign var="b" value="`$b+1`"}
        {/foreach}
		</tbody> 
      </table>

</table>   
{literal}
	<script type="text/javascript">
			var myTable = {};
			window.addEvent('domready', function(){
				myTable = new sortableTable('myTable', {overCls: 'over', onClick: function(){alert(this.id)}});
			});
		</script>
{/literal}
<table>	
  <tr align="center">        
    <td>{$pag.pagV}
      {if !empty($urlback)}
        <form name='formPagAnt' method='post' action="{$urlback}">
          <a href="javascript:document.formPagAnt.submit();"><b style="font-family: Verdana;font-size: 9px;">&laquo;Anterior</b>
            <input type='hidden' name='pag' value='{$paginita-1}'>
            <input type='hidden' name='posBoton' value='{$posBoton}' >
            <input type='hidden' name='regIni' value='{$paginita-1}' >
          </a>
        </form>
      {/if}
    </td>  
    {if !empty($paginas)}
    {foreach from=$paginas item=pag}
    <td> 
      {if $pag.npag == $pagina}
        {if $pagina neq '1'} | {/if} <b style="color:#FB992F;font-size: 12px;"> {$pag.npag}</b>
      {else}
        {if $pag.npag neq ''}
          <form name='formPag{$pag.npag}' method='post' action="{$pag.pagV}">
            <a href="javascript:document.formPag{$pag.npag}.submit();">|{$pag.npag}
              <input type='hidden' name='pag' value='{$pag.npag}'>
              <input type='hidden' name='posBoton' value='{$posBoton}' >
              <input type='hidden' name='regIni' value='{$pag.npag}' >
            </a>
        {/if}
          </form>
      {/if}
    </td>
    {/foreach}
    {/if}
    <td>
      {if $numpaginas gt $numbotones and !empty($urlnext) and $pagina lt $numpaginas}
        <form name='formPagSig' method='post' action="{$pag.pagV}">
          <a href="javascript:document.formPagSig.submit();"><b style="font-family: Verdana;font-size: 9px;">Siguiente&raquo;</b>
            <input type='hidden' name='pag' value='{$paginita+1}'>
            <input type='hidden' name='posBoton' value='{$posBoton}' >
            <input type='hidden' name='regIni' value='{$paginita+1}' >
          </a>
       </form>
     {/if}
    </td>
  </tr>
</table>
</center>