Ejemplo n.º 1
0
    // Bail with an error message, not pretty, but works:
    echo "ERROR: Cannot access Phergie Log File, " . "please check the configuration & access privileges";
    exit;
}
/********** DETECTION **********/
// Determine the mode of the application and call the appropriate handler function
$mode = empty($_GET['m']) ? '' : $_GET['m'];
switch ($mode) {
    case 'channel':
        show_days($db);
        break;
    case 'day':
        show_log($db);
        break;
    default:
        show_channels($db);
}
// Exit not really needed here,
// but reminds us that everything below is support functions:
exit;
/********** MODES **********/
/**
 * show_channels
 *
 * Provide a list of all channel's that we are logging information for:
 *
 * @param PDO $db A PDO object referring to the database
 *
 * @return void
 * @author Eli White <*****@*****.**>
 **/
Ejemplo n.º 2
0
    // Failure, can't access Phergie Log.
    exit("ERROR: Cannot access log, please check the configuration & access privileges");
}
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
/********** DETECTION **********/
// Determine the mode of the application and call the appropriate handler function
$mode = empty($_GET['m']) ? '' : $_GET['m'];
switch ($mode) {
    case 'channel':
        show_days($db, $table);
        break;
    case 'day':
        show_log($db, $table);
        break;
    default:
        show_channels($db, $table);
}
// Exit not really needed here,
// but reminds us that everything below is support functions:
exit;
/********** MODES **********/
/**
 * show_channels
 *
 * Provide a list of all channel's that we are logging information for:
 *
 * @param PDO $db A PDO object referring to the database
 * @param string $table The name of the logging table 
 * @return void
 * @author Eli White <*****@*****.**>
 **/