/** * @author NamNT * action index */ public function action_index() { $model = new \Model_Person(); $filter = array(); $data = array(); if (Input::get()) { $filter = Input::get(); $query_string = http_build_query($filter); \Session::set('url_filter_persons', $query_string); $person_url = $query_string ? '?' . $query_string : ''; } else { $person_url = ''; } if (Input::get('export', false)) { $filter['per_page'] = 100000; $download_his = new \Model_Downloadhis(); $download = array('param' => json_encode($filter), 'content' => json_encode(Input::server())); $download_his->set_data($download); if ($download_his->save_data()) { $this->export($model->get_filter_person($filter)); } } $config = ['pagination_url' => \Uri::base() . 'job/persons/index' . $person_url, 'total_items' => $model->count_data($filter), 'per_page' => \Constants::$default_limit_pagination, 'uri_segment' => 'page', 'num_links' => \Constants::$default_num_links, 'show_last' => true]; \Fuel\Core\Cookie::set('person_url', \Uri::main() . $person_url, 30 * 60); $pagination = \Uospagination::forge('mypagination', $config); $filter['offset'] = $pagination->offset; $filter['limit'] = $pagination->per_page; $data['listPerson'] = $model->get_filter_person($filter); $data['groups'] = (new \Model_Mgroups())->get_type(1); $this->template->title = 'UOS求人システム'; $this->template->content = \View::forge('persons/persons', $data); }
function getCallbackUrl() { $thisUrl = \Fuel\Core\Input::server('HTTPS') ? "https://" : "http://"; $thisUrl .= \Fuel\Core\Input::server('SERVER_NAME'); $thisUrl .= \Fuel\Core\Input::server('SERVER_PORT') == 80 || \Fuel\Core\Input::server('SERVER_PORT') == 443 ? "" : ":" . \Fuel\Core\Input::server('SERVER_PORT'); $thisUrl .= '/index/login'; $thisUrl .= '?action=callback'; return $thisUrl; }
public function __construct() { if (!\Fuel\Core\Input::is_ajax()) { $protocol = strtolower(substr(\Fuel\Core\Input::server('SERVER_PROTOCOL'), 0, 5)) == 'https' ? 'https://' : 'http://'; $uri_current = $protocol . \Fuel\Core\Input::server('HTTP_HOST') . \Fuel\Core\Input::server('REQUEST_URI'); if (!Input::get('export', false)) { \Fuel\Core\Session::set('uri_before_login', $uri_current); } } }
public function serve() { if ($this->last_mod === 0) { $this->last_mod = filemtime($this->resized); } $header_modified_since = strtotime(Input::server('HTTP_IF_MODIFIED_SINCE', 0)); ob_clean(); $status = 200; // Set the response headers for cache etc $headers = array('Cache-Control' => 'public', 'Last-Modified' => gmdate('D, d M Y H:i:s', $this->last_mod) . ' GMT', 'Content-Disposition' => 'inline; filename=' . $this->pathinfo['filename'] . '.' . $this->pathinfo['extension'], 'Content-Type' => $this->mime_type); // Return 304 not modified if the file hasn't changed if ($header_modified_since >= $this->last_mod) { $status = 304; } else { // Serve up the image $body = file_get_contents($this->resized); } return \Response::forge($body, $status, $headers); }