<div class="t"><?php echo $titulo; ?></div>
<table  border="0" cellspacing="0" cellpadding="0" class="hovertable" width="100%">
	  <tr style='font-size:12px;'>
    
    <th width='5%' ></th>
    <th width='50'>PERIODO</th>
 	  <th width='50'>FECHA</th>       
    <th width='50'>GRADO</th>
	  <th width='50'>CURSO</th> 
    <th width='50'>ASIGN.</th>         
	  <th width='50' >CODIGO</th>
    <th>NOMBRES</th>
    <th width='50'>FALTA</th>    
	  <th>DESCRIPCI&Oacute;N</th>
    <th width='50'>NOTA</th>
    <th width='50'>SUCESO</th>
	  </tr>

     <?php $cantidad=0; ?>
	   <?php foreach ($tsArray as $data): ?>

         <?php $cantidad++; ?>
	       <tr style='font-size:12px;' onmouseover="this.style.backgroundColor='#89F2AC';" onmouseout="this.style.backgroundColor='#BBE9EE';">
               <td align="center"> <img id="elemento1"  class="confirmar" src="imagenes/foto1.jpg" onClick="Eliminar(<?php echo $data['orden'];?>,<?php echo $inicio; ?>,<?php echo $total_tpsofalta; ?>)" height="20" width="20" alt="Eliminar" title="Eliminar">  </td>

               <td align="center"><?php echo $data['periodo'];?></td> 
               <td align="center"><?php echo $data['fecha'];?></td> 
               <td align="center"><?php echo $data['grado'];?></td> 
               <td align="center"><?php echo $data['curso'];?></td> 
               <td align="center"><?php echo $data['asignatura'];?></td>                                                                     
               <td align="center"><?php echo $data['codigo'];?></td>               
               <td><?php echo ($data['nombres']);?></td>           
               <td align="center"><?php echo $data['falta'];?></td> 
               <td><?php echo ($data['descripcion']);?></td>
               <td align="center"><?php echo $data['descuento'];?></td> 
               <td align="center"><?php echo $data['estilo'];?></td>               
	      </tr>
	   <?php endforeach; ?>

            <?php

            if ($cantidad>=1 && $cantidad<15){

                  for ($i=1; $i<=15-$cantidad; $i++) {  ?>

                     <tr onmouseover="this.style.backgroundColor='#89F2AC';" onmouseout="this.style.backgroundColor='#BBE9EE';">
                     <td align="center"> <img id="elemento1"  class="confirmar" src="imagenes/foto1b.jpg" height="20" width="20" >  </td>
                     <td align="center"> <img id="elemento2"  class="confirmar" src="imagenes/foto1b.jpg" height="20" width="20" >  </td>
                     <td></td> <td></td> <td></td> <td></td> <td></td> <td></td> <td></td>   <td></td> <td></td> <td></td> <td></td>
                     </tr>

                 <?php }

                    if($total_tpsofalta>15){ ?>

                        <tr>
                        <td align="center" colspan="2"></td>
                        <td align="center"><INPUT TYPE="button" class="button small green" id="btn_buscar" value="Consultar"></td>
                        <td>    
                        </td><td></td><td></td>  <td></td>   <td></td> <td></td> <td></td> <td></td>
                        <td align="center">
                        <INPUT TYPE="button" name="restar" onclick="disminuir(<?php echo $inicio; ?>);" value=" <<  Anterior  ">
                        </td>
                        
                        </tr>
                     <?php } else { ?>

                        <tr>
                        <td align="center" colspan="2"></td>
                        <td align="center" ><INPUT TYPE="button"  class="button small green" id="btn_buscar" value="Consultar"></td>
                        <td></td>  <td></td> <td></td> <td></td>  <td></td>  <td></td> <td></td> <td></td> <td></td> <td></td>
                        </tr>

                     <?php }

                  } else {

                        if ($inicio==0 && $total_tpsofalta>15){ ?>

                          <tr>
                          <td align="center" colspan="2"></td>
                          <td align="center"><INPUT TYPE="button" class="button small green" id="btn_buscar" value="Consultar"></td>
                        <td>    
                        </td><td></td><td></td> <td></td>   <td></td> <td></td> <td></td> <td></td>
                          <td align="center">
                          <INPUT TYPE="button" name="sumar" class="button small green" onclick="aumentar(<?php echo $inicio; ?>);" value=" Siguiente >> ">
                          </td>

                          </tr>

                        <?php }else if (($inicio==$total_tpsofalta-15)&& ($total_tpsofalta>15)){ ?>

                          <tr>
                          <td align="center" colspan="2"></td>
                          <td align="center"><INPUT TYPE="button" class="button small green" id="btn_buscar" value="Consultar"></td>
                        <td>    
                        </td><td></td><td></td>
                          <td align="center">
                          <INPUT TYPE="button" name="restar" onclick="disminuir(<?php echo $inicio; ?>);" value=" <<  Anterior  ">
                          </td>
                          </tr>

                         <?php }else if ($total_tpsofalta==15){ ?>

                            <tr>
                            <td align="center" colspan="2"></td>
                            <td align="center"><INPUT TYPE="button" class="button small green" id="btn_buscar" value="Consultar"></td>
                            <td></td> <td></td> <td></td> <td></td>
                            </tr>

                        <?php }else{  ?>

                          <tr>
                          <td align="center" colspan="2"></td>
                          <td align="center"><INPUT TYPE="button" class="button small green" id="btn_buscar" value="Consultar"></td>
                          <td></td><td></td><td></td>  <td></td>   <td></td> <td></td> 
                          <td align="center" colspan="2">
                          <INPUT TYPE="button" name="restar" class="button small green" onclick="disminuir(<?php echo $inicio; ?>);" value=" <<  Anterior  ">
                          </td>
                          
                           <td><INPUT TYPE="button" name="sumar"  class="button small green" onclick="aumentar(<?php echo $inicio; ?>);" value=" Siguiente >> ">
                          </td>
                          </tr>

                         <?php }

             } ?>

            </table>

<div id="insertar">

</div>
