$pay = TrainingTracker::pay_translation($current_user_level); TrainingTracker::mail($pay, $level, $people); } } } $responce->redirect('/webapp/training-tracker/'); }); //promote/demote ajax page respond('POST', '/fate', function ($request, $response, $app) { $permission = $request->data['permission']; $wpid = $request->data['wpid']; if ($permission == 'supervisor' || $permission == 'shift_leader' || $permission == 'sta' || $permission == 'trainee') { if (TrainingTracker::valid_wpid($wpid)) { $pidm = PSUPerson::get($wpid)->pidm; $type = TrainingTracker::checklist_type($permission); TrainingTracker::set_user_level($wpid, $permission); if (!TrainingTracker::checklist_exists($pidm, $type, 1)) { TrainingTracker::checklist_close($pidm); TrainingTracker::checklist_insert($pidm, $type); } else { TrainingTracker::checklist_close($pidm); TrainingTracker::checklist_open($pidm, $type); } } } }); //admin page respond('GET', '/fate', function ($request, $response, $app) { if (!$app->is_admin) { die('You do not have access to this page.'); }