$dept->{$k} = $v; } $dept->save(); $ID = $dept->lastInsertId(); $department = $app->db->department()->where('deptID = ?', $ID); $q = $department->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; } return $array; }); echo json_encode($q); }); $app->post('/subj/', function () use($app) { etsis_cache_flush_namespace('subj'); $subj = $app->db->subject(); foreach ($_POST as $k => $v) { $subj->{$k} = $v; } $subj->save(); $ID = $subj->lastInsertId(); $subject = $app->db->subject()->where('subjectID = ?', $ID); $q = $subject->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; } return $array; }); echo json_encode($q);
* redirect user to the lock screen until he/she enters * his/her password to gain access. */ if (isset($_COOKIE['SCREENLOCK'])) { redirect(get_base_url() . 'lock' . '/'); } }); $app->match('GET|POST', '/grade-scale/(\\d+)/', function ($id) use($app, $css, $js, $flashNow) { if ($app->req->isPost()) { $gs = $app->db->grade_scale(); foreach ($_POST as $k => $v) { $gs->{$k} = $v; } $gs->where('ID = ?', $id); if ($gs->update()) { etsis_cache_flush_namespace('grsc'); $app->flash('success_message', $flashNow->notice(200)); etsis_logger_activity_log_write('Update Record', 'Grade Scale', _filter_input_string(INPUT_POST, 'grade'), get_persondata('uname')); } else { $app->flash('error_message', $flashNow->notice(409)); } redirect($app->req->server['HTTP_REFERER']); } $gs = $app->db->grade_scale()->where('ID = ?', $id); $q = etsis_cache_get($id, 'grsc'); if (empty($q)) { $q = $gs->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; }
foreach ($data as $d) { $array[] = $d; } return $array; }); $items = []; foreach ($q as $r) { $option = ['id' => $r['courseSecID'], 'value' => $r['courseSection']]; $items[] = $option; } $data = json_encode($items); $response = isset($_GET['callback']) ? $_GET['callback'] . "(" . $data . ")" : $data; echo $response; }); $app->post('/loc/', function () use($app) { etsis_cache_flush_namespace('loc'); $loc = $app->db->location(); foreach ($_POST as $k => $v) { $loc->{$k} = $v; } $loc->save(); $ID = $loc->lastInsertId(); $location = $app->db->location()->where('locationID = ?', $ID); $q = $location->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; } return $array; }); echo json_encode($q);
$spec->{$k} = $v; } $spec->save(); $ID = $spec->lastInsertId(); $specialization = $app->db->specialization()->where('specID = ?', $ID); $q = $specialization->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; } return $array; }); echo json_encode($q); }); $app->post('/cip/', function () use($app) { etsis_cache_flush_namespace('cip'); $c = $app->db->cip(); foreach ($_POST as $k => $v) { $c->{$k} = $v; } $c->save(); $ID = $c->lastInsertId(); $cip = $app->db->cip()->where('cipID = ?', $ID); $q = $cip->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; } return $array; }); echo json_encode($q);
* * @since 6.1.00 * @return mixed */ $app->hook->do_action('myet_student_course_registration'); // Flash messages for success or error if ($ID > 0) { $st = $app->db->stu_acad_cred()->select('courseSection')->where('stuID = ?', get_persondata('personID'))->_and_()->where('LastUpdate = ?', $now); $qry = $st->find(function ($data) { $array = []; foreach ($data as $d) { $array[] = $d; } return $array; }); if (count($qry[0]['courseSection']) > 0) { if (get_option('registrar_email_address') != '') { $email->course_registration(get_persondata('personID'), $_POST['termCode'], get_base_url()); } } etsis_cache_flush_namespace('student_account'); $app->flash('success_message', $flashNow->notice(200)); } else { $app->flash('error_message', $flashNow->notice(409)); } redirect($app->req->server['HTTP_REFERER']); }); }); $app->setError(function () use($app) { $app->view->display('error/404', ['title' => '404 Error']); });