Example #1
0
    backup_tables();
}
$url = filter_var($_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL);
if ($url == '/') {
    $url = array(0 => '/');
} else {
    $url = explode('/', $url);
    $url[0] = '/';
}
//$res = $db->get('url',array('url_part','=','ufa'));
//$res = $db->query("SELECT * FROM url WHERE url_part = Ufa");
//pr($res->first()->title);
//pr(count($url));
foreach ($url as $tr) {
    //pr( parse_part($tr));
    $re = parse_part($tr);
    pr($re);
}
function parse_part($part = null)
{
    $res = $GLOBALS['db']->get('url', array('url_part', '=', $part));
    if (!empty($res->first()->id)) {
        return $res->first()->id;
    }
    return false;
}
//$app = new App;
//pr($app->url);
//render();
/*
if(Cookie::exists(Config::get('remember/cookie_name')) && !Session::exists(Config::get('session/session_name'))){
Example #2
0
function parse_reqs($reqs)
{
    $parts = explode(';', $reqs);
    //echo 'Parsing: '.$reqs."\n";
    foreach ($parts as &$xxx) {
        $xxx = trim($xxx);
    }
    unset($xxx);
    // Let's start breaking down the reqs into logical units.
    // XXX ###(, ###, ###, ...)
    //    Example: PHARM 129, 131, 220
    //    Means: You must take all three courses.
    // XXX ### or ###
    //    Example: AFM 101 or 128
    //    Means: You must take one or the other.
    $operators = array();
    foreach ($parts as $part) {
        $sub_operators = parse_part($part);
        $operators = array_merge($operators, $sub_operators);
    }
    return $operators;
}