コード例 #1
0
ファイル: staff.php プロジェクト: AholibamaSI/plymouth-webapp
    $app->tpl->assign('checked', $checklist_checked);
    $app->tpl->assign('comments', $comments);
    $app->tpl->assign('current_user', $current_user);
    $app->tpl->assign('current_user_level', $current_user_level);
    $app->tpl->assign('active_user_level', $active_user_level);
    $app->tpl->assign('mentee', $mentee);
    $app->tpl->assign('checklist_items', $checklist_items);
    $app->tpl->assign('checklist_item_sub_cat', $checklist_item_sub_cat);
    $app->tpl->assign('checklist_item_cat', $checklist_item_cat);
    $app->tpl->assign('current_level', $current_level);
    $app->tpl->assign('stats', $stats);
    $app->tpl->display('statistics.tpl');
});
respond('POST', '/merit/remove', function ($request, $responce, $app) {
    $id = $request->data['id'];
    TrainingTracker::merit_remove($id);
});
respond('POST', '/merit', function ($request, $responce, $app) {
    $type = $request->data['type'];
    $comments = $request->data['comments'];
    $wpid = $request->data['wpid'];
    if (TrainingTracker::valid_wpid($wpid)) {
        $comments = htmlentities($comments);
        $comments = stripslashes($comments);
        $comments = trim($comments);
        if ($type == 'star' || $type == 'dog-house') {
            $checklist_id = TrainingTracker::get_checklist_id($wpid);
            // If they don't have a checklist, most likely a mentor
            if (!$checklist_id) {
                $user_type = TrainingTracker::level_translation(TrainingTracker::get_user_level($wpid));
                TrainingTracker::checklist_insert($wpid, $user_type);