Пример #1
0
  */
 $app->before('GET|POST', '/addnl/(\\d+)/', function () {
     if (!hasPermission('access_course_screen')) {
         redirect(get_base_url() . 'dashboard' . '/');
     }
 });
 $app->match('GET|POST', '/addnl/(\\d+)/', function ($id) use($app, $css, $js, $json_url, $flashNow) {
     $course = get_course($id);
     if ($app->req->isPost()) {
         $crse = $app->db->course();
         foreach ($_POST as $k => $v) {
             $crse->{$k} = $v;
         }
         $crse->where('courseID = ?', (int) $id);
         if ($crse->update()) {
             etsis_cache_delete($id, 'crse');
             /**
              * Is triggered after course additional info is updated.
              * 
              * @since 6.1.05
              * @param object $crse Course object.
              */
             $app->hook->do_action('post_update_crse_addnl_info', $crse);
             $app->flash('success_message', $flashNow->notice(200));
             etsis_logger_activity_log_write('Update Record', 'Course', $course->courseCode, get_persondata('uname'));
         } else {
             $app->flash('error_message', $flashNow->notice(409));
         }
         redirect($app->req->server['HTTP_REFERER']);
     }
     /**
Пример #2
0
 /**
  * Delete an option from the table
  */
 public function delete_option($name)
 {
     $key = $this->_app->db->options_meta()->where('meta_key = ?', $name);
     $results = $key->find(function ($data) {
         $array = [];
         foreach ($data as $d) {
             $array[] = $d;
         }
         return $array;
     });
     if (is_null($results) || !$results) {
         return false;
     }
     $this->do_action('delete_option', $name);
     $this->_app->db->options_meta()->where('meta_key', $name)->delete();
     etsis_cache_delete($name, 'option');
     return true;
 }
Пример #3
0
     $prog->majorCode = $_POST['majorCode'];
     $prog->minorCode = $_POST['minorCode'];
     $prog->specCode = $_POST['specCode'];
     $prog->acadLevelCode = $_POST['acadLevelCode'];
     $prog->cipCode = $_POST['cipCode'];
     $prog->locationCode = $_POST['locationCode'];
     $prog->where('acadProgID = ?', $_POST['acadProgID']);
     /**
      * Fires during the update of an academic program.
      *
      * @since 6.1.10
      * @param array $prog Academic program object.
      */
     $app->hook->do_action('update_acad_program_db_table', $prog);
     if ($prog->update()) {
         etsis_cache_delete($id, 'prog');
         $app->flash('success_message', $flashNow->notice(200));
         etsis_logger_activity_log_write('Update', 'Acad Program', $program->acadProgCode, get_persondata('uname'));
     } else {
         $app->flash('error_message', $flashNow->notice(409));
         etsis_logger_activity_log_write('Update Error', 'Acad Program', $program->acadProgCode, get_persondata('uname'));
     }
     redirect($app->req->server['HTTP_REFERER']);
 }
 /**
  * If the database table doesn't exist, then it
  * is false and a 404 should be sent.
  */
 if ($program == false) {
     $app->view->display('error/404', ['title' => '404 Error']);
 } elseif (empty($program) == true) {
Пример #4
0
 $p_decode = json_decode($json_p, true);
 $staff = $app->db->staff()->where('staffID = ?', $id)->findOne();
 if ($app->req->isPost()) {
     $addr = $app->db->address();
     foreach ($_POST as $k => $v) {
         $addr->{$k} = $v;
     }
     $addr->where('addressID = ?', $id);
     if ($addr->update()) {
         $app->flash('success_message', $flashNow->notice(200));
         etsis_logger_activity_log_write('Update Record', 'Address', get_name($a_decode[0]['personID']), get_persondata('uname'));
     } else {
         $app->flash('error_message', $flashNow->notice(409));
     }
     etsis_cache_delete($a_decode[0]['personID'], 'stu');
     etsis_cache_delete($a_decode[0]['personID'], 'person');
     redirect($app->req->server['HTTP_REFERER']);
 }
 /**
  * If the database table doesn't exist, then it
  * is false and a 404 should be sent.
  */
 if ($a_decode == false) {
     $app->view->display('error/404', ['title' => '404 Error']);
 } elseif (empty($a_decode) == true) {
     $app->view->display('error/404', ['title' => '404 Error']);
 } elseif (count($a_decode[0]['addressID']) <= 0) {
     $app->view->display('error/404', ['title' => '404 Error']);
 } else {
     $app->view->display('person/addr', ['title' => get_name($a_decode[0]['personID']), 'cssArray' => $css, 'jsArray' => $js, 'addr' => $a_decode, 'nae' => $p_decode, 'staff' => $staff]);
 }
Пример #5
0
     $dotw = '';
     /** Combine the days of the week to be entered into the database */
     $days = $_POST['dotw'];
     for ($i = 0; $i < sizeof($days); $i++) {
         $dotw .= $days[$i];
     }
     $soff = $app->db->course_sec();
     $soff->buildingCode = $_POST['buildingCode'];
     $soff->roomCode = $_POST['roomCode'];
     $soff->dotw = $dotw;
     $soff->startTime = $_POST['startTime'];
     $soff->endTime = $_POST['endTime'];
     $soff->webReg = $_POST['webReg'];
     $soff->where('courseSecID = ?', $id);
     if ($soff->update()) {
         etsis_cache_delete($id, 'sect');
         $app->flash('success_message', $flashNow->notice(200));
         etsis_logger_activity_log_write('Update Record', 'Course Section Offering', $sect->courseSection, get_persondata('uname'));
     } else {
         $app->flash('error_message', $flashNow->notice(409));
     }
     redirect(get_base_url() . 'sect/soff' . '/' . (int) $id . '/');
 }
 /**
  * If the database table doesn't exist, then it
  * is false and a 404 should be sent.
  */
 if ($sect == false) {
     $app->view->display('error/404', ['title' => '404 Error']);
 } elseif (empty($sect) == true) {
     $app->view->display('error/404', ['title' => '404 Error']);
Пример #6
0
         if (count($sql[0]['id']) <= 0) {
             $al = $app->db->stu_acad_level();
             $al->stuID = $id;
             $al->acadProgCode = _trim($_POST['acadProgCode']);
             $al->acadLevelCode = $decode[0]['acadLevelCode'];
             $al->addDate = $app->db->NOW();
             $al->save();
         }
         $app->flash('success_message', $flashNow->notice(200));
         etsis_logger_activity_log_write('New Record', 'Student Academic Program', get_name($id), get_persondata('uname'));
         redirect(get_base_url() . 'stu' . '/' . $id . '/' . bm());
     } else {
         $app->flash('error_message', $flashNow->notice(409));
         $app->req->server['HTTP_REFERER'];
     }
     etsis_cache_delete($id, 'stu');
 }
 $stu = $app->db->student()->where('stuID = ?', $id);
 $q = $stu->find(function ($data) {
     $array = [];
     foreach ($data as $d) {
         $array[] = $d;
     }
     return $array;
 });
 /**
  * If the database table doesn't exist, then it
  * is false and a 404 should be sent.
  */
 if ($q === false) {
     $app->view->display('error/404', ['title' => '404 Error']);