Example #1
0
function checkAccept($user_id, $task_id)
{
    $chkApt = Database::getThat("latest", "`user_id`=" . $user_id . " and `task_id`=" . $task_id);
    if ($chkApt["score"] == 100) {
        return true;
    } else {
        return false;
    }
}
Example #2
0
include "addon/config.php";
include "config.php";
include "addon/library.php";
$result_task = Database::getAllThat("task", "`see` = 1");
$count["all"] = 0;
$count["pass"] = 0;
$count["not_pass"] = 0;
$count["not_submit"] = 0;
$count["new"] = 0;
while ($task = mysql_fetch_array($result_task)) {
    $count["all"]++;
    $task_pass = Database::getThat("pass", "`task_id` = " . $task["task_id"] . " and `user_id` = " . $_SESSION[$config['name_short']]['user_id']);
    if (isset($task_pass["pass_id"])) {
        $count["pass"]++;
    } else {
        $task_not_pass = Database::getThat("result", "`task_id` = " . $task["task_id"] . " and `user_id` = " . $_SESSION[$config['name_short']]['user_id']);
        if (isset($task_not_pass["result_id"])) {
            $count["not_pass"]++;
        } else {
            $count["not_submit"]++;
        }
    }
    if (date("m-d-y", $task["see_date"]) == date("m-d-y", time())) {
        $count["new"]++;
    }
}
?>
<script type="text/javascript">
function select_type(input)
{
	location.hash = "#main/task";