예제 #1
0
파일: index.php 프로젝트: ATCS-BCA/bca-apps
// If the user is being mimicked by an admin, use that id as the updt id.
// Otherwise, use the id of the current user.
$updateById;
if (!isset($_SESSION['prev_usr_id'])) {
    $updateById = $user->usr_id;
} else {
    $updateById = $_SESSION['prev_usr_id'];
}
switch ($action) {
    case "update_times":
        $free_mods = $_POST["id_field"];
        $next_page = $_POST["next_page"];
        $decode = json_decode($free_mods, true);
        reset_times($usr_id);
        for ($i = 0; $i < $decode["length"]; $i++) {
            update_times($usr_id, $decode[$i], $updateById);
        }
        if ($next_page == 'admin') {
            $_SESSION['user'] = User::getUserByUsrId($_SESSION['prev_usr_id']);
            $_SESSION['prev_usr_id'] = NULL;
            header("Location: ../../admin/availability/index.php");
        } else {
            if ($user->usr_type_cde == 'TCH') {
                header("Location: ../index.php");
            } else {
                header("Location: ../../Student/index.php");
            }
        }
        break;
    case "back":
        $next_page = $_POST["next_page"];
예제 #2
0
 function run_start($clear_log = 0)
 {
     if ($this->error) {
         return FALSE;
     }
     if ($_POST['clear_log'] || $clear_log == 1) {
         unset($this->pick_cache_data);
         $this->i = 1;
         show_pick_info(milu_lang('clear_log'), '', $this->msg_args);
         update_times($this->pid);
         DB::query('DELETE FROM ' . DB::table('strayer_url') . " WHERE pid = '" . $this->pid . "'");
     }
     if ($this->i > 1) {
         $this->get_now_url_arr($this->now_level);
         if (!$this->now_url_arr) {
             $this->pick_cache_data = NULL;
             cache_del('pick' . $this->pid);
         }
     } else {
         $this->get_start_url();
         //获得入口地址
         $this->now_level = $this->max_level;
     }
     if ($this->p_arr['rules_type'] == 1 && !$this->rid) {
         show_pick_info(milu_lang('pick_no_select_rules'), 'exit', $this->msg_args);
         return FALSE;
     }
     if (!$this->now_url_arr && $this->i == 1) {
         show_pick_info(milu_lang('pick_no_link'), 'exit', $this->msg_args);
         return FALSE;
     }
     if ($this->i == 1) {
         show_pick_info(milu_lang('pick_get_linked') . milu_lang('el'), '', $this->msg_args);
     }
     if (!$this->max_level) {
         show_pick_info(milu_lang('no_set_level'), 'exit', $this->msg_args);
         return FALSE;
     }
     $this->robot($this->now_level);
     $this->finsh();
 }