include_once('conexion.php');
$sql = "SELECT * FROM cuenta c WHERE c.fecha_baja IS NULL ORDER BY fecha;";
$res = $con->query($sql);
$ide = "";
echo "<div id='pad-wrapper' class='datatables-page'>";
echo " <div class='row'>";
echo " <div class='col-md-8-2'>";
echo " <table id='tablCuentas' style='text-align:center' class='stripe row-border order-column' cellspacing='0' width='60%'>";
echo " <thead>";
echo " <tr>";
echo " <th tabindex='0' rowspan='2' colspan='1'></th>";
echo " <th tabindex='0' rowspan='2' colspan='1'></th>";
echo " <th style = 'display:none;' tabindex='0' rowspan='2' colspan='1'>ID</th>";
echo " <th class='center' tabindex='0' rowspan='2' colspan='1'>Fecha</th>";
echo " <th class='center' tabindex='0' rowspan='2' colspan='1'>Detalle</th>";
echo " <th class='center' tabindex='0' rowspan='2' colspan='1'>Monto</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Caja</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>BCI P7</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Chile P7</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Santander P7 1</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Santander P7 2</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Proveedores</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Clientes</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Varios Acreedores</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Varios Deudores</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Cuenta RGU</th>";
echo " <th class='center' tabindex='0' rowspan='1' colspan='2'>Cuenta EGD</th>";
echo " </tr>";
echo " <tr>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Egreso</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Ingreso</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Deposito</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Cargo</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Deposito</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Cargo</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Deposito</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Cargo</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Deposito</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Cargo</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Compra</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Pago</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Gastos</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Ingresos</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Deuda</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Pago</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Deuda</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Pago</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Retiros</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Aportes</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Retiros</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Aportes</th>";
echo " <th tabindex='0' rowspan='1' colspan='1'>Validado</th>";
echo " </tr>";
echo " </thead>";
echo " <tbody>";
while ($edit_cuentas = $res->fetch_array()) {
echo " <tr>";
echo " <td class='center'><a onclick='actualizarCuenta(".$ide=$edit_cuentas[0].");' data-toggle='modal' style='cursor:pointer;'><img src='img/edit.png' width='20' height='20'></i></a></td>";
echo " <td class='center'><a onclick='Menelimcta(".$ide=$edit_cuentas[0].");' data-toggle='modal' data-target='#myModal-DeleteCta' style='cursor:pointer;'><img src='img/delete.png' width='20' height='20'></a></td>";
echo " <td style = 'display:none;'>".$edit_cuentas[0]."</td>";
echo " <td class='center'>".$edit_cuentas[3]."</td>";
echo " <td class='center'>".$edit_cuentas[4]."</td>";
echo " <td class='center'>".$edit_cuentas[5]."</td>";
echo " <td class='center'>".$edit_cuentas[6]."</td>";
echo " <td class='center'>".$edit_cuentas[7]."</td>";
echo " <td class='center'>".$edit_cuentas[8]."</td>";
echo " <td class='center'>".$edit_cuentas[9]."</td>";
echo " <td class='center'>".$edit_cuentas[10]."</td>";
echo " <td class='center'>".$edit_cuentas[11]."</td>";
echo " <td class='center'>".$edit_cuentas[12]."</td>";
echo " <td class='center'>".$edit_cuentas[13]."</td>";
echo " <td class='center'>".$edit_cuentas[14]."</td>";
echo " <td class='center'>".$edit_cuentas[15]."</td>";
echo " <td class='center'>".$edit_cuentas[16]."</td>";
echo " <td class='center'>".$edit_cuentas[17]."</td>";
echo " <td class='center'>".$edit_cuentas[18]."</td>";
echo " <td class='center'>".$edit_cuentas[19]."</td>";
echo " <td class='center'>".$edit_cuentas[20]."</td>";
echo " <td class='center'>".$edit_cuentas[21]."</td>";
echo " <td class='center'>".$edit_cuentas[22]."</td>";
echo " <td class='center'>".$edit_cuentas[23]."</td>";
echo " <td class='center'>".$edit_cuentas[24]."</td>";
echo " <td class='center'>".$edit_cuentas[25]."</td>";
echo " <td class='center'>".$edit_cuentas[26]."</td>";
echo " <td class='center'>".$edit_cuentas[27]."</td>";
echo " <td class='center'>".$edit_cuentas[28]."</td>";
echo " </tr>";
$cta = $edit_cuentas[2];
}
echo " </tbody>";
echo " </table>";
echo " <br />";
echo " <p style='margin-top: 25px;'>";
echo " <button type='submit' name= 'envio' onclick='mostrarFormularioCuenta()' class='btn-flat1' data-toggle='modal' data-target='#myModal-NewCta'>Nuevo Registro en Cuenta</button>";
echo " <button type='submit' name= 'generar' onclick='CrearPlanillaDetalle()' class='btn-flat1' data-toggle='modal' data-target='#myModal-Gen'>Generar Excel</button>";
echo " </p>";
echo " </div>";
echo " </div>";
echo " </div>";
<script type="text/javascript">
$(document).ready(function() {
var table = $('#tablCuentas').DataTable( {
dom: 'Cfrtip',
scrollY: '300px',
scrollX: true,
scrollCollapse: true,
sPaginationType: 'full_numbers',
oLanguage:{
sProcessing: 'Cargando...',
sLengthMenu: 'Mostrar _MENU_ registros',
sZeroRecords: 'No se encontraron resultados',
sEmptyTable: 'Ningún dato disponible en esta tabla',
sInfo: 'Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros',
sInfoEmpty: 'Mostrando registros del 0 al 0 de un total de 0 registros',
sInfoFiltered: '(filtrado de un total de _MAX_ registros)',
sInfoPostFix: '',
sSearch: 'Buscar:',
sUrl: '',
sInfoThousands: '',
sLoadingRecords: 'Cargando...',
oPaginate: {
sFirst: 'Primero',
sLast: 'Último',
sNext: 'Siguiente',
sPrevious: 'Anterior'
},
oAria: {
sSortAscending: ': Activar para ordenar la columna de manera ascendente',
sSortDescending: ': Activar para ordenar la columna de manera descendente'
}
},
aaSorting: [[ 0, 'desc' ]],//ordenar
iDisplayLength: 20,
aLengthMenu: [[1, 2, 5, 10, 20, 50, -1], [1, 2, 5, 10, 20, 50, 'All']]
} );
new $.fn.dataTable.FixedColumns( table, {
leftColumns: 6
} );
} );
</script>