<?php

require_once ("../../config/Cado.php");

require_once ("cTarjeta.php");

$oTarjeta = new cTarjeta();



$dts=$oTarjeta->filtrar();

$num_rows= mysql_num_rows($dts);



?>





<section class="content" id="table" style="min-height:0px;padding-bottom:0px;margin-bottom:-30px;">

  <div class="row">

    <div class="col-xs-12">

      <div class="box">

        <div class="box-body">

          <table id="tabla_tarjeta" class="table table-bordered table-striped">

           <thead>

                <tr>

                <th>NOMBRE</th>

                <th>CAJA</th>

                <th>ID</th>

                <th>&nbsp;</th>

                </tr>

            </thead> 

            <tbody>

            <?php

             if($num_rows>=1){

            while($dt = mysql_fetch_array($dts)){

            ?>

                <tr>

                <td><?php echo $dt['tb_tarjeta_nom']?></td>

                <td><?php echo $dt['tb_caja_nom']?></td>

                <td><?php echo $dt['tb_tarjeta_id']?></td>

                <td align="center" >

                

				<span title="Editar" class="btn btn-primary glyphicon glyphicon-pencil" onClick="tarjeta_form('editar','<?php echo $dt['tb_tarjeta_id']?>')" ></span>

				<span title="Eliminar" class="btn btn-primary glyphicon glyphicon-trash" onClick="eliminar_tarjeta('<?php echo $dt['tb_tarjeta_id']?>')" ></span>

				

				</td>

                </tr>

            <?php

                }

                mysql_free_result($dts);}

            ?>

            </tbody>

        </table>

      </div>

    </div>

  </div>

</div>

</section>



<script type="text/javascript">

  $(function() {  

    $("#tabla_tarjeta").DataTable( {

      "columnDefs": [

      { "orderable": false, "targets": [1] }

      ],

      "searching": false,

      "order":[[0,"asc"]]

    });

  }); 

</script>