Example #1
0
 case 'listar_resultados':
     // Ruta actual
     $_SESSION['Ruta_Lista'] = $obj_generico->RutaRegreso();
     // Ruta regreso
     $obj_xtpl->assign('ruta_regreso', $_SESSION['Ruta_Form']);
     /*        $fecha_desde= $obj_generico->CleanText($_GET['fechadesde']);
             $fecha_hasta= $obj_generico->CleanText($_GET['fechahasta']);
       */
     $taquilla = $obj_generico->CleanText($_GET['op_taquilla']);
     $sorteo = $obj_generico->CleanText($_GET['sorteo']);
     $obj_xtpl->assign('fechadesde', $_GET['fechadesde']);
     $obj_xtpl->assign('fechahasta', $_GET['fechahasta']);
     $obj_xtpl->assign('taquilla', $taquilla);
     //echo $taquilla;
     $obj_xtpl->assign('sorteo', $sorteo);
     $fecha_desde = $obj_date->changeFormatDateII($obj_generico->CleanText($_GET['fechadesde']));
     $fecha_hasta = $obj_date->changeFormatDateII($obj_generico->CleanText($_GET['fechahasta']));
     $i = 0;
     $total_ventas = 0;
     $cantidad_anulados = 0;
     $total_anulados = 0;
     if ($result = $obj_modelo->GetTickets($fecha_desde, $fecha_hasta, $taquilla, $sorteo)) {
         if ($obj_conexion->GetNumberRows($result) > 0) {
             while ($row = $obj_conexion->GetArrayInfo($result)) {
                 if ($row['status'] == '0') {
                     $cantidad_anulados++;
                     $total_anulados = $total_anulados + $row['total_ticket'];
                 } else {
                     if ($i % 2 > 0) {
                         $obj_xtpl->assign('estilo_fila', 'even');
                     } else {
$minute = substr($string, 14, 2);
$dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado");
//$fecha_hora=$day."-".$month."-".$year." ".$hour.":".$minute;
$fecha_hora = $day . "-" . $month . "-" . $year;
if ($hour > 11) {
    $formato = "PM";
} else {
    $formato = "AM";
}
$formato_militar = array("13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24");
$formato_civil = array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");
$hour = str_replace($formato_militar, $formato_civil, $hour);
$hora = $hour . ":" . $minute . " " . $formato;
$fecha_desde = $obj_generico->CleanText($_GET['fechadesde']);
$fecha_hasta = $obj_generico->CleanText($_GET['fechahasta']);
$fecha_desde = $obj_date->changeFormatDateII($fecha_desde);
$fecha_hasta = $obj_date->changeFormatDateII($fecha_hasta);
$resulta = $obj_modelo->GetBalancebyTaquillaAnulados($fecha_desde, $fecha_hasta, $id_taquilla);
$total_anulados = array();
$totales_anulados = 0;
$tickets_anulados = array();
$i = 0;
while ($ruw = $obj_conexion->GetArrayInfo($resulta)) {
    $fecha_anul = substr($ruw['fecha'], 0, 10);
    if (!isset($mismo_fecha)) {
        $mismo_fecha = $fecha_anul;
    }
    if ($mismo_fecha != $fecha_anul) {
        $mismo_fecha = $fecha_anul;
        $totales_anulados = $ruw['total_ticket'];
        $total_anulados[$ruw['fecha']] = $totales_anulados;
Example #3
0
 * @package cRVer_Resultados.php
 * @author Brenda Batista B. - <*****@*****.**>
 * @copyright Grupo de empresas Voila
 * @license BSD License
 * @version v 1.0 Mayo - 2013
 */
// Vista asignada
$obj_xtpl->assign_file('contenido', $obj_config->GetVar('ruta_vista') . 'Rver_resultados' . $obj_config->GetVar('ext_vista'));
// Modelo asignado
require $obj_config->GetVar('ruta_modelo') . 'RVer_resultados.php';
$obj_modelo = new RVer_Resultados($obj_conexion);
$obj_date = new Fecha();
require './fpdf/fpdf.php';
switch (ACCION) {
    case 'listar_resultados':
        $fecha = $obj_date->changeFormatDateII($_GET['txt_fecha']);
        $obj_xtpl->assign('fecha', $obj_date->changeFormatDateI($fecha, 0));
        // Ruta actual
        $_SESSION['Ruta_Lista'] = $obj_generico->RutaRegreso();
        // Ruta regreso
        $obj_xtpl->assign('ruta_regreso', $_SESSION['Ruta_Form']);
        $i = 0;
        if ($result = $obj_modelo->GetResultados($fecha)) {
            if ($obj_conexion->GetNumberRows($result) > 0) {
                while ($row = $obj_conexion->GetArrayInfo($result)) {
                    if ($i % 2 > 0) {
                        $obj_xtpl->assign('estilo_fila', 'even');
                    } else {
                        $obj_xtpl->assign('estilo_fila', 'odd');
                    }
                    $obj_xtpl->assign('nombre_sorteo', $row['nombre_sorteo']);
$id_detalle_ticket[] = "";
$id_tickets[] = "";
$totales[] = "";
switch (ACCION) {
    case 'mod':
        // Ruta actual
        $_SESSION['Ruta_Form'] = $obj_generico->RutaRegreso();
        // Ruta regreso
        $obj_xtpl->assign('ruta_regreso', $_SESSION['Ruta_Form']);
        // Accion a realizar
        $obj_xtpl->assign('tipo_accion', 'upd');
        $obj_xtpl->assign('tag_boton', 'Modificar');
        //Obteniendo Datos del Usuario
        if (is_numeric($_GET['id'])) {
            $fecha = $_GET['fecha'];
            $fecha_hora = $obj_date->changeFormatDateII($fecha);
            $id_sorteo = $_GET['id'];
            $bajado = $_GET['bajado'];
            $id_resultado = $obj_modelo->VerificarResultadoSorteo($id_sorteo, $fecha_hora);
            if ($obj_generico->IsEmpty($id_resultado)) {
                // no tiene id_resultado, es decir no lo han cargado aun
                $_SESSION['mensaje'] = $mensajes['no_idresultado'];
                header('location:' . $_SESSION['Ruta_Lista']);
            }
            // Asignaciones
            $row = $obj_modelo->GetDatosSorteo($_GET['id']);
            //print_r($row);
            // Array ( [0] => 1 [id_resultados] => 1 [1] => 4 [id_sorteo] => 4 [2] => 0 [zodiacal] => 0 [3] => 833 [numero] => 833 [4] => 2014-02-08 [fecha_hora] => 2014-02-08 [5] => 1 [bajado] => 1 )
            if ($row['zodiacal'] != 0) {
                // Listado de Zodiacal
                if ($result_z = $obj_modelo->GetZodiacales()) {
$hour = substr($string, 11, 2);
$minute = substr($string, 14, 2);
$dias = array("Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado");
//$fecha_hora=$day."-".$month."-".$year." ".$hour.":".$minute;
$fecha_hora = $day . "-" . $month . "-" . $year;
if ($hour > 11) {
    $formato = "PM";
} else {
    $formato = "AM";
}
$formato_militar = array("13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24");
$formato_civil = array("01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12");
$hour = str_replace($formato_militar, $formato_civil, $hour);
$hora = $hour . ":" . $minute . " " . $formato;
$fecha = $obj_generico->CleanText($_GET['txt_fecha']);
$fecha = $obj_date->changeFormatDateII($fecha);
$i = strtotime($fecha);
$numero_semana = jddayofweek(cal_to_jd(CAL_GREGORIAN, date("m", $i), date("d", $i), date("Y", $i)), 0);
$data = "";
$i = 0;
if ($result = $obj_modelo->GetResultados($fecha)) {
    if ($obj_conexion->GetNumberRows($result) > 0) {
        // ENCABEZADO DEL TICKET
        $data .= " <table width='100%' cellpadding='0' cellspacing='0' border='0' >";
        $data .= "<tr><td colspan='3' align='center'><font face='Tahoma' size='1' >";
        $data .= $dias[date('w')] . " " . $fecha_hora . "&nbsp;&nbsp;" . $hora;
        $data .= " </font>";
        $data .= "<font face='Tahoma' size='2' >";
        $data .= "<br>";
        $data .= "<br>";
        $data .= "SISTEMA LOTTOMAX";
Example #6
0
     break;
 case 'save':
     $nombre = $obj_generico->CleanText($_POST['txt_name']);
     $status = $obj_generico->CleanText($_POST['op_status']);
     $status_espe = $obj_generico->CleanText($_POST['op_status_espe']);
     $dia_sem = $_POST['dia_sem'];
     $id_dias_semana = '';
     foreach ($dia_sem as $dia) {
         $id_dias_semana .= $dia . ',';
     }
     $id_dias_semana = trim($id_dias_semana, ",");
     // Verifica que los datos requeridos no este vacios
     if (!$obj_generico->IsEmpty($nombre)) {
         if ($opt_fecha_si) {
             if (isset($_POST['fechadesde']) && isset($_POST['fechahasta'])) {
                 $fecha_desde = $obj_date->changeFormatDateII($_POST['fechadesde']);
                 $fecha_hasta = $obj_date->changeFormatDateII($_POST['fechahasta']);
                 if (strtotime($fecha_desde) >= strtotime(date('y-m-d')) || strtotime(date('y-m-d')) <= strtotime($fecha_hasta)) {
                     if ($status_espe) {
                         $status = 1;
                     } else {
                         $status = 0;
                     }
                 }
             } else {
                 //$status=1;
                 $fecha_desde = "0000-00-00";
                 $fecha_hasta = "0000-00-00";
             }
         } else {
             //$status=1;
Example #7
0
$obj_generico = new Generica();
// Clase Date
require '.' . $obj_config->GetVar('ruta_libreria') . 'Fecha.php';
$obj_date = new Fecha();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Cargar_resultados.php';
$obj_modelo = new Cargar_resultados($obj_conexion);
$sw = 0;
// PARA PREMIAR TICKETS LUEGO
$fecha_hora = $obj_date->changeFormatDateII($_POST['fecha']);
$result = $obj_modelo->GetResultadosRepetidos($fecha_hora);
$sorteosexistentes = array();
while ($row = $obj_conexion->GetArrayInfo($result)) {
    $sorteosexistentes[$row['id_sorteo']] = 1;
}
$sorteos = preg_split('/-/', $_POST['sorteosnocargados']);
$sql = "INSERT INTO `resultados` (`id_sorteo` , `zodiacal`, `numero`, `fecha_hora`) VALUES ";
$resultados = array();
$zodiacales = array();
$primer_id = $obj_modelo->getUltimoIdResultado();
$id_resultado = $primer_id;
$obj_modelo->reseteaID($id_resultado + 1);
foreach ($sorteos as $st) {
    $numero = $_POST['txt_numero-' . $st];
    if (isset($_POST['zodiacal-' . $st])) {