if (more_than_one_function($options)) {
    echo "Only one of the following options can be used: \n";
    foreach ($long_function_opts as $value) {
        echo "\t--" . $value . "\n";
    }
    die;
} else {
    if (no_function($options)) {
        echo "One of the following options must be used: \n";
        foreach ($long_function_opts as $value) {
            echo "\t--" . $value . "\n";
        }
        die;
    }
}
$task = get_function($options);
if (!function_has_data($task, $options, $requires)) {
    echo "Option --" . $task . " requires data option --" . $requires[$task] . "\n";
    die;
}
include 'SQLHelpers.php';
if ($task === "authorizeClient") {
    $db = new \mfoley\ClientDeviceSQL("students.db");
    echo $db->authorizeKey($options["hash"]);
} else {
    if ($task === "addUser") {
        $db = new \mfoley\StudentSQL("students.db");
        echo $db->addKey($options["userID"]);
    } else {
        if ($task === "generateQR") {
            $db = new \mfoley\StudentSQL("students.db");
Example #2
0
        $tpl->saved_poems = $get_saved_poems;
    }
    //--get saved poets--//
    if (!empty($get_saved_poets)) {
        foreach ($get_saved_poets as $k => $poet_id) {
            $get_saved_poets[$k] = get_author($database, $poet_id);
        }
        $tpl->saved_poets = $get_saved_poets;
    }
    //--get saved users--//
    if (!empty($get_saved_user)) {
        foreach ($get_saved_user as $k => $poet_id) {
            $data = get_user_info($database, $poet_id);
            $get_saved_user[$k] = $data[0];
        }
        $tpl->saved_users = $get_saved_user;
    }
    //--get saved poets--//
    if (!empty($get_user_added_function)) {
        foreach ($get_user_added_function as $k => $poet_id) {
            $get_saved_poets[$k] = get_author($database, $poet_id);
        }
        $tpl->saved_poets = $get_saved_poets;
    }
    $get_active_function = get_function($database, $user_id);
    $get_inactive_function = get_inactive_function($database, $user_id);
    $tpl->my_function = array_merge_recursive($get_active_function, $get_inactive_function);
} else {
    header("location: " . main_url);
}
echo $tpl->render("themes/site/" . theme_name . "/html/mystuff.php");