Пример #1
0
function func_show_movies($option, $option2, $db)
{
    switch ($option) {
        case '':
            show($db, 1);
            break;
        case 'desc':
            show($db, -1);
            break;
        case 'genre':
            show_genre($db, $option2);
            break;
        case 'year':
            show_year($db, $option2);
            break;
        case 'rate':
            show_rate($db, $option2);
            break;
        default:
            echo "Error: Wrong option (valid : desc, genre, year, rate)";
            break;
    }
}
Пример #2
0
Web: http://www.pauloandrade1.com
************************************************/
session_start();
set_time_limit(0);
// Ajustamos la zona horaria
date_default_timezone_set('America/Mexico_City');
require_once '../config.php';
require_once 'Db.php';
$db = new Db();
$type = empty($_POST['type']) ? '' : $_POST['type'];
switch ($type) {
    case 'show_month':
        show_month($db);
        break;
    case 'show_year':
        show_year($db);
        break;
    case 'stats_resumen':
        stats_resumen($db);
        break;
    case 'stats_visitas':
        stats_visitas($db);
        break;
    case 'stats_historial':
        stats_historial($db);
        break;
}
// Cargamos las estadisticas para un mes en concreto
function show_month($db)
{
    $show_month = $_POST['show_month'];