function setEventosTarifas() { // print_r($_POST); $eventos = new eventosModel(); $cLibreria = new cLibreria(); $id_evento = $_POST['id_evento']; $tarifa = $_POST['tarifa']; $tarifa_tipo_afiliacion = $_POST['tarifa_tipo_afiliacion']; $tarifa_tipo_estatus = $_POST['tarifa_tipo_participante']; $fecha_vencimiento = $cLibreria->getFechaYMD($_POST['fecha_vencimiento']); // $resultFechas=$eventos->getFechasTarifa($_POST['id_evento'],$fecha_vencimiento) $resultFechas = $eventos->getFechasTarifa($id_evento, $fecha_vencimiento, $tarifa_tipo_afiliacion, $tarifa_tipo_estatus); if (count($resultFechas) == 0) { $result = $eventos->setEventosTarifas($id_evento, $tarifa_tipo_afiliacion, $tarifa_tipo_estatus, $tarifa, $fecha_vencimiento); if ($result) { $respuesta = array('estatus' => 200, 'msg' => "DATOS GUARDADOS CORRECTAMENTE."); } else { $respuesta = array('estatus' => 500, 'msg' => 'ERROR AL GUARDAR DATOS.'); } } else { $respuesta = array('estatus' => 500, 'msg' => 'ERROR AL GUARDAR DATOS <b>HAY FECHAS POSTERIORES</b>.'); } echo json_encode($respuesta); }
function getReporteAccesos() { $cLibreria = new cLibreria(); $fechaInicio = $cLibreria->getFechaYMD($_POST['txtFechaInicio']); $fechaFin = $cLibreria->getFechaYMD($_POST['txtFechaFin']); $usuariosModel = new usuariosModel(); $tipoReporte = $_POST['tipoReporte']; switch ($tipoReporte) { case 1: //accesos al sistema $datos = $usuariosModel->getRegistroAccesos($fechaInicio, $fechaFin); break; case 2: //nuevos registros al sistema $datos = $usuariosModel->getRegistrosNuevos($fechaInicio, $fechaFin); break; default: echo "<h1>Error en tipo de reporte :P</h1>"; break; } ?> <table class="table table-striped table-bordered table-hover table-responsive" id="tabla"> <!-- <caption> --> <!-- <h1>Reporte de accesos al tablero cieft(Participantes)</h1> --> <!-- </caption> --> <thead> <tr> <th>NOMBRE</th> <th>CORREO</th> <th>FECHA</th> </tr> </thead> <tbody> <?php foreach ($datos as $key => $rowReportes) { echo "<tr>\n\t\t\t\t\t\t<td>" . $rowReportes['nombre'] . "</td>\n\t\t\t\t\t\t<td>" . $rowReportes['correo'] . "</td>\n\t\t\t\t\t\t<td>" . $rowReportes['fecha'] . "</td>\n\t\t\t\t\t\t</tr>"; } ?> </tbody> </table> <?php }
<?php if ($_POST) { include_once "../controller/cFallidos.php"; include_once "../controller/cLibreria.php"; $cLibreria = new cLibreria(); $cFallidos = new cFallidos(); switch ($_POST['opcion']) { case 'get': $datos = $cFallidos->getFallido($_POST['tipo'], $cLibreria->getFechaYMD($_POST['fecha_inicio']), $cLibreria->getFechaYMD($_POST['fecha_fin'])); ?> <table class="table table-hover table-bordered table-striped" id="tabla" border="1" cellpadding="10" cellspacing="0"> <thead> <tr> <th>Fecha de generación</th> <th>Tipo</th> <th>Descripción</th> <th>Vendedor</th> <th>Sucursal</th> </tr> </thead> <tbody> <?php while ($row = $datos->fetch_array(MYSQLI_ASSOC)) { if ($row['tipo'] == 1) { $msg = "<label class='bold'>PEDIDO FALLIDO</label>"; } else { $msg = "<label class='bold'>ENVIO DE CORREO FALLIDO</label>"; } $vendedor = $row['paterno'] . " " . $row['materno'] . " " . $row['nombre']; echo "<tr>";