Beispiel #1
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * action create/update emcall
  */
 public function action_index()
 {
     $data['person_id'] = Input::get('person_id');
     $emcall = new \Model_Emcall();
     if (!isset($data['person_id']) || !\Model_Person::find($data['person_id'])) {
         Session::set_flash('error', '緊急連絡先は存在しません');
         return Response::redirect('/job/persons');
     }
     Session::set('emcall_url', Uri::current() . '?person_id=' . $data['person_id']);
     if (Input::method() == 'POST') {
         $emcall_id = Input::post('sssale_id', null);
         if ($emcall_id and !($emcall = \Model_Emcall::find_by_pk($emcall_id))) {
             Session::set_flash('error', '緊急連絡先は存在しません');
             return Response::redirect(Session::get('emcall_url'));
         }
         $fields = $emcall->set_data($emcall, Input::post());
         $message = \Constants::$message_create_error;
         if ($emcall->save_data($fields)) {
             Session::set_flash('success', \Constants::$message_create_success);
             return Response::redirect(Session::get('emcall_url'));
         }
         if (!isset($emcall_id)) {
             $data['action'] = 'add';
         }
         Session::set_flash('error-' . Input::post('panel_index'), $message);
     }
     $data['emcalls'] = $emcall->get_data(['person_id' => $data['person_id']]);
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('emcall/index', $data);
 }
Beispiel #2
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * action create/edit user
  * @return mixed
  */
 public function action_index()
 {
     $data = array();
     $user_id = Input::get('user_id');
     if (isset($user_id)) {
         $data['user'] = \Model_Muser::find_by_pk($user_id);
         if (!isset($data['user'])) {
             Session::set_flash('error', 'ユーザが存在しません');
             return Response::redirect('/master/users');
         }
     }
     if (Input::method() == 'POST') {
         $url = Session::get('users_url') ? Session::get('users_url') : Uri::base() . 'master/users';
         $user_id = Input::post('user_id', null);
         if ($user_id && !\Model_Muser::find_by_pk($user_id)) {
             Session::set_flash('success', 'ユーザーは存在しません');
             return Response::redirect($url);
         }
         $user = new \Model_Muser();
         $fields = $user->set_data(Input::post());
         $check = $user->validate_unique_login_id($fields['login_id'], isset($fields['user_id']) ? $fields['user_id'] : null);
         if ($check && $user->save_data($fields)) {
             Session::set_flash('success', \Constants::$message_create_success);
             return Response::redirect($url);
         }
         $message = \Constants::$message_create_error;
         if (!$check) {
             $message = '入力したIDは既存に存在してます。';
         }
         Session::set_flash('error', $message);
     }
     $data['department'] = \Constants::get_create_department();
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('user', $data);
 }
Beispiel #3
0
 public function after($response)
 {
     View::set_global('__header__', View::forge('partials/header', $this->template->get()));
     View::set_global('__footer__', View::forge('partials/footer', $this->template->get()));
     //        View::set_global('__alertbox__', View::forge('partials/alertbox', array('_alert'=>\Messages::get())) );
     return parent::after($response);
 }
Beispiel #4
0
 public static function _init()
 {
     static::$crypter = new Crypt_AES();
     static::$hasher = new Crypt_Hash('sha256');
     // load the config
     \Config::load('crypt', true);
     static::$config = \Config::get('crypt', array());
     // generate random crypto keys if we don't have them or they are incorrect length
     $update = false;
     foreach (array('crypto_key', 'crypto_iv', 'crypto_hmac') as $key) {
         if (empty(static::$config[$key]) or strlen(static::$config[$key]) % 4 != 0) {
             $crypto = '';
             for ($i = 0; $i < 8; $i++) {
                 $crypto .= static::safe_b64encode(pack('n', mt_rand(0, 0xffff)));
             }
             static::$config[$key] = $crypto;
             $update = true;
         }
     }
     // update the config if needed
     if ($update === true) {
         // load the file config
         \Config::load('file', true);
         try {
             \Config::save('crypt', static::$config);
             chmod(APPPATH . 'config' . DS . 'crypt.php', \Config::get('file.chmod.files', 0666));
         } catch (\FileAccessException $e) {
             // failed to write the config file, inform the user
             echo \View::forge('errors/crypt_keys', array('keys' => static::$config));
             die;
         }
     }
     static::$crypter->enableContinuousBuffer();
     static::$hasher->setKey(static::safe_b64decode(static::$config['crypto_hmac']));
 }
Beispiel #5
0
 public function action_signin()
 {
     if (Model_Base_User::is_admin()) {
         Response::redirect('/admin');
     }
     $this->template->content = View::forge($this->layout . '/auth/signin');
 }
Beispiel #6
0
 public static function send($option = null)
 {
     try {
         $email = Email::forge();
         $email->from(Config::get('email.defaults.from.email'), Config::get('email.defaults.from.name'));
         $to = $option->to;
         if (is_string($to)) {
             $email->to($to);
         } elseif (is_array($to)) {
             $email->to(Config::get('email.defaults.from.email'), Config::get('email.defaults.from.name'));
             $email->bcc($to);
         }
         $email->subject(html_entity_decode($option->subject, ENT_QUOTES));
         if (!empty($option->attach)) {
             $email->attach(DOCROOT . $option->attach);
         }
         $email->html_body(View::forge('email/' . $option->view, $option->content));
         $email->send();
     } catch (\EmailSendingFailedException $e) {
         Log::write('ERROR', $e->getMessage(), 'Send_email');
         return false;
     } catch (\EmailValidationFailedException $e) {
         Log::write('ERROR', $e->getMessage(), 'Validation_email');
         return false;
     } catch (Exception $e) {
         Log::write('ERROR', $e->getMessage(), 'Exception');
         return false;
     }
     return true;
 }
Beispiel #7
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * list media
  */
 public function action_index()
 {
     $m_group = new \Model_Mgroups();
     $m_partner = new \Model_Mpartner();
     $tmp = array('' => 'その他');
     $data['groups'] = $tmp + (new \Model_Mgroups())->get_type(2);
     $data['partners'] = $this->_partners;
     $filters = Input::get();
     $query_string = empty($filters) ? '' : '?' . http_build_query($filters);
     Session::set('medias_url', Uri::base() . 'master/medias' . $query_string);
     if (isset($filters['m_group_id']) && $filters['m_group_id']) {
         $data['partners'] += array_column($m_partner->get_partner_group($filters['m_group_id'], $this->_partner_type), 'branch_name', 'partner_code');
     }
     $m_media = new \Model_Mmedia();
     $m_post = new \Model_Mpost();
     $data['count_media'] = $m_media->count_data($filters);
     $pagination = \Uospagination::forge('pagination', array('pagination_url' => Uri::base() . 'master/medias' . $query_string, 'total_items' => $data['count_media'], 'per_page' => \Constants::$default_limit_pagination, 'num_links' => \Constants::$default_num_links, 'uri_segment' => 'page', 'show_last' => true));
     $filters['offset'] = $pagination->offset;
     $filters['limit'] = $pagination->per_page;
     $medias = $m_media->get_data($filters);
     foreach ($medias as $media) {
         $media->count_post = $m_post->count_by_media_id($media->m_media_id);
     }
     $data['pagination'] = $pagination;
     $data['medias'] = $medias;
     $data['type'] = \Constants::$media_type;
     $data['classification'] = \Constants::get_search_media_classification();
     $data['filters'] = $filters;
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('medias', $data);
 }
Beispiel #8
0
 /**
  * initialisation and auto configuration
  */
 public static function _init()
 {
     $crypter = new Crypt_AES();
     $hasher = new Crypt_Hash('sha256');
     // load the config
     \Config::load('crypt', true);
     static::$defaults = \Config::get('crypt', array());
     // generate random crypto keys if we don't have them or they are incorrect length
     $update = false;
     foreach (array('crypto_key', 'crypto_iv', 'crypto_hmac') as $key) {
         if (empty(static::$defaults[$key]) or strlen(static::$defaults[$key]) % 4 != 0) {
             $crypto = '';
             for ($i = 0; $i < 8; $i++) {
                 $crypto .= static::safe_b64encode(pack('n', mt_rand(0, 0xffff)));
             }
             static::$defaults[$key] = $crypto;
             $update = true;
         }
     }
     // update the config if needed
     if ($update === true) {
         try {
             \Config::save('crypt', static::$defaults);
         } catch (\FileAccessException $e) {
             // failed to write the config file, inform the user
             echo \View::forge('errors/crypt_keys', array('keys' => static::$defaults));
             die;
         }
     }
 }
Beispiel #9
0
 /**
  * 東京メトロのトップページ
  * @return \Fuel\Core\Response
  */
 public function action_metro()
 {
     $url = 'https://api.tokyometroapp.jp/api/v2/datapoints?rdf:type=odpt:Train&acl:consumerKey=f7c4cef2952419c085133c0ea49ace44d7602eb57aa2b535c88763bf335faee5';
     $json = file_get_contents($url);
     $arr = json_decode($json, true);
     $dat['trains'] = $arr;
     return \Fuel\Core\Response::forge(View::forge('metro/index', $dat));
 }
Beispiel #10
0
 public function action_view($id = null)
 {
     is_null($id) and Response::redirect('post');
     if (!($data['post'] = Model_Post::find($id))) {
         Session::set_flash('error', 'お求めの記事はありません [# ' . $id . ' ]');
         Response::redirect('post');
     }
     $this->template->title = "ブログ";
     $this->template->content = View::forge('post/view', $data);
 }
Beispiel #11
0
 public function action_edit($id = null)
 {
     if (empty($id) || !Model_Base_Product::valid_field('id', $id)) {
         Response::redirect('/admin/product');
     }
     $this->data['category'] = Model_Base_Category::get_all();
     $this->data['product'] = Model_Base_Product::get_one($id);
     $this->data['product']['category'] = Model_Base_ProductCategory::get_by('category_id', 'product_id', $id);
     $this->data['product']['sub_photo'] = Model_Base_Product::get_sub_photo($id);
     $this->template->content = View::forge($this->layout . '/product/edit', $this->data);
 }
Beispiel #12
0
 public function get_index()
 {
     $manager = new StoryManager();
     $resData['SideStory'] = $manager->get_side_list();
     $resData['Highlight'] = $manager->get_highlight_list();
     $resData['Slider'] = $manager->get_slider_list();
     $resData['Events'] = array();
     $resData['LecturerNews'] = array();
     $resData['ListStory'] = $manager->get_list(0);
     $this->template->__yield__ = View::forge('home', $this->formatData($resData));
 }
Beispiel #13
0
 public function init()
 {
     View::set_global('base_url', Config::get('base_url'));
     View::set_global('controller', Request::active()->controller);
     View::set_global('action', Request::active()->action);
     View::set_global('category', Model_Base_Category::get_all(array('where' => array(array('status', '=', 1)))));
     View::set_global('head', View::forge($this->layout . '/global/head'));
     View::set_global('header', View::forge($this->layout . '/global/header'));
     View::set_global('footer', View::forge($this->layout . '/global/footer'));
     View::set_global('script', View::forge($this->layout . '/global/script'));
 }
Beispiel #14
0
 public function action_connectdb()
 {
     $connectDB = View::forge('admin/connectdb');
     $viewData = null;
     $query = DB::select()->from('users');
     $viewData = $query->execute();
     //$connectDB->set("userData" , $viewData["result"]);
     //return Response::forge ( $connectDB );
     var_dump($viewData);
     die;
 }
Beispiel #15
0
 public function action_index($code = null)
 {
     if (empty($code) || !Model_Base_Category::valid_by(array(array('code' => $code), array('status' => 1)))) {
         Response::redirect('/');
     }
     $category_id = Model_Base_Category::get_id_by_code($code);
     $total_page = ceil(Model_Base_Product::count_by_category($category_id) / _DEFAULT_LIMIT_);
     View::set_global('total_page', $total_page);
     $this->data['products'] = Model_Base_Product::get_by_category($category_id);
     $this->template->title = 'Category Page';
     $this->template->content = View::forge($this->layout . '/category/list', $this->data);
 }
Beispiel #16
0
 public function announcement_view_details($data)
 {
     $id = $data['post'];
     $this->side_data['Data'] = array();
     $post_data = NewsPost::get($id);
     $retData['Data']['MainSection'] = 'Thông báo';
     $retData['Data']['SubSection'][0] = 'Thông Báo & Sự Kiện';
     $retData['Data']['SubSection'][1] = 'Thông Báo';
     $retData['Data']['Next'] = array();
     $retData['Data']['Popular'] = array();
     $retData['Data']['Event'] = array();
     $retData['Data']['Post'] = $post_data;
     $this->template->__yield__ = View::forge('section/details', $retData);
 }
Beispiel #17
0
 public function action_detail($code = null)
 {
     $this->data['product'] = Model_Base_Product::get_by_code($code, array('where' => array(array('status', '=', 1))));
     if (empty($this->data['product']['id'])) {
         Response::redirect('/');
     }
     $this->data['product']['sub_photo'] = Model_Base_Product::get_sub_photo($this->data['product']['id']);
     $category_ids = Model_Base_ProductCategory::get_by('category_id', 'product_id', $this->data['product']['id']);
     if (!empty($category_ids)) {
         $this->data['products'] = Model_Base_Product::get_by_category_ids($category_ids, 0, 5);
     }
     View::set_global('product', $this->data['product']);
     $this->template->title = 'Product List';
     $this->template->content = View::forge($this->layout . '/product/detail', $this->data);
 }
Beispiel #18
0
 public function post_recruitment()
 {
     $data = Input::json();
     if ($data == null) {
         $this->template->__yield__ = View::forge('pages/recruitment', array());
     } else {
         if ($data['action'] == 'save') {
             $response['Code'] = Recruitment::update_content($data);
             if ($response['Code'] == 1) {
                 $response['Msg'] = 'Update success';
             } else {
                 $response['Msg'] = 'Update fail';
             }
             return json_encode($response);
         }
     }
 }
 public static function routes()
 {
     $route = '_status';
     Router::add($route, new Route($route, function ($request) {
         // ignore this transaction
         Transaction::ignore();
         // load a config
         $conf = Config::load('newrelic-ping');
         // ping the urls
         $pinger = new Pinger($conf['urls'], $conf['base_host']);
         $res = $pinger->ping();
         // add path to lookup view
         Finder::instance()->add_path(realpath(rtrim(__DIR__, '/') . '/../'));
         // build a response and return it
         return new Response(View::forge('_newrelic-status', ['result' => $res]), $res->getResultStatusCode());
     }));
 }
Beispiel #20
0
 public function get_index()
 {
     $reqObj = Input::get();
     $id = $reqObj['id'];
     $managerObj = new StoryManager();
     $storyObj = $managerObj->getStoryBaseID($id);
     $a = $managerObj->getSectionInfoBaseID($storyObj->Type);
     $storyObj->updateView();
     //		$retData['Data']['MainSection'] = 'Thông báo';
     //		$retData['Data']['SubSection'][0] = 'Thông Báo & Sự Kiện';
     //		$retData['Data']['SubSection'][1] = 'Thông Báo';
     $retData['Data'] = $a;
     $retData['Data']['Next'] = array();
     $retData['Data']['Popular'] = array();
     $retData['Data']['Event'] = array();
     $retData['Data']['Post'] = $storyObj->getFull();
     $this->template->__yield__ = View::forge('section/details', $retData);
 }
Beispiel #21
0
 public function init()
 {
     View::set_global('controller', $this->controller);
     View::set_global('action', $this->action);
     if (Model_Base_User::is_login()) {
         View::set_global('head', View::forge($this->layout . '/global/head'));
         View::set_global('header', View::forge($this->layout . '/global/header'));
         View::set_global('sidebar', View::forge($this->layout . '/global/sidebar'));
         View::set_global('script', View::forge($this->layout . '/global/script'));
         list(, $auth_id) = Auth::get_user_id();
         $this->user_id = $auth_id;
         $this->user_info = Model_Base_User::get_user_info($auth_id);
         $this->user_fb = Model_Base_User::get_user_fb($auth_id);
         View::set_global('user', $this->user_info);
         View::set_global('user_fb', $this->user_fb);
         View::set_global('base_url', Config::get('base_url'));
     }
 }
Beispiel #22
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * action list ss
  */
 public function action_index()
 {
     $filters = Input::get();
     $query_string = empty($filters) ? '' : '?' . http_build_query($filters);
     Session::set('sslist_url', Uri::base() . 'master/sslist' . $query_string);
     $m_ss = new \Model_Mss();
     $data = array();
     $data['count_ss'] = $m_ss->count_data($filters);
     $pagination = \Uospagination::forge('pagination', array('pagination_url' => Uri::base() . 'master/sslist' . $query_string, 'total_items' => $data['count_ss'], 'per_page' => \Constants::$default_limit_pagination, 'num_links' => \Constants::$default_num_links, 'uri_segment' => 'page', 'show_last' => true));
     $filters['offset'] = $pagination->offset;
     $filters['limit'] = $pagination->per_page;
     $data['ss'] = $m_ss->get_data($filters);
     $data['addr1'] = \Constants::get_search_address();
     $data['filters'] = $filters;
     $data['pagination'] = $pagination;
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('sslist', $data);
 }
Beispiel #23
0
 /**
  * @author: Bui Cong Dang (dangbcd6591@seta-asia.com.vn)
  * @params: List partner
  **/
 public function action_index()
 {
     $data = array();
     $partner = new \Model_Mpartner();
     //Get value from form search
     if ($filter = Input::get()) {
         Session::set('url_filter_partner', http_build_query($filter));
         //Set url filter
     }
     $pagination = \Uospagination::forge('pagination', array('pagination_url' => Uri::base() . 'master/partners?' . http_build_query($filter), 'total_items' => $partner->count_data($filter), 'per_page' => \Constants::$default_limit_pagination, 'num_links' => \Constants::$default_num_links, 'uri_segment' => 'page', 'show_last' => true));
     $filter['offset'] = $pagination->offset;
     $filter['limit'] = $pagination->per_page;
     $data['pagination'] = $pagination;
     $data['filter'] = $filter;
     $data['partners'] = $partner->get_filter_partner($filter);
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('partners/index', $data);
 }
Beispiel #24
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * action create/update ss
  */
 public function action_index()
 {
     $ss_id = Input::get('ss_id');
     $filter_group = $this->filter_group;
     $data_filter['field'] = $filter_group;
     if (isset($ss_id)) {
         $ss = \Model_Mss::find_by_pk($ss_id);
         if (!isset($ss)) {
             Session::set_flash('error', 'SSは存在しません');
             return Response::redirect('/master/sslist');
         }
         $data['ss'] = $ss;
         $data['json'] = $ss->edit_data != '' ? json_decode($ss->edit_data) : $ss;
         $data_filter['datafilter'] = \Presenter_Group_Filter::edit($filter_group['step'], $filter_group['type'], $data['json']->partner_code);
         $partner = \Model_Mpartner::find_by_pk($ss->partner_code);
         $group = \Model_Mgroups::find_by_pk($partner->m_group_id);
         $data['branch_name'] = $partner->branch_name;
         $data['group_name'] = $group->name;
         $data['is_view'] = $this->_compare_data_json($ss, $ss->edit_data);
     }
     $submit = Input::post('submit');
     if (isset($submit)) {
         $url = Session::get('sslist_url') ? Session::get('sslist_url') : Uri::base() . 'master/sslist';
         $ss = new \Model_Mss();
         $ss->set_data(Input::post());
         if (isset($ss->fields['ss_id']) && !\Model_Mss::find_by_pk($ss->fields['ss_id'])) {
             Session::set_flash('error', 'SSは存在しません');
             return Response::redirect($url);
         }
         if (!\Model_Mpartner::find_by_pk(Input::post('partner_code'))) {
             Session::set_flash('error', '取引先(受注先)は存在しません');
         } else {
             if ($ss->save_data()) {
                 Session::set_flash('success', \Constants::$message_create_success);
                 return Response::redirect($url);
             }
             Session::set_flash('error', \Constants::$message_create_error);
         }
     }
     $data['address1'] = \Constants::get_create_address();
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('ss', $data);
     $this->template->content->filtergroup = \Presenter::forge('group/filter')->set('custom', $data_filter);
 }
Beispiel #25
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * action create/edit media
  */
 public function action_index()
 {
     $m_media_id = Input::get('id', null);
     $filter_group = $this->filter_group;
     $datafilter['field'] = $filter_group;
     $media = new \Model_Mmedia();
     if (isset($m_media_id)) {
         $media = \Model_Mmedia::find_by_pk($m_media_id);
         if (!isset($media)) {
             Session::set_flash('error', '媒体は存在しません');
             return Response::redirect('/master/medias');
         }
         $datafilter['datafilter'] = \Presenter_Group_Filter::edit($filter_group['step'], $filter_group['type'], $media->partner_code);
         $data['media'] = $media;
         $data['posts'] = \Model_Mpost::find_by_m_media_id($m_media_id);
     }
     $data['media_name_existed'] = $media->get_list_media('media_name');
     $data['media_version_name_existed'] = $media->get_list_media('media_version_name');
     if (Input::method() == 'POST') {
         $url = Session::get('medias_url') ? Session::get('medias_url') : Uri::base() . 'master/medias';
         $m_media_id = Input::post('m_media_id', null);
         if ($m_media_id && !\Model_Mmedia::find_by_pk($m_media_id)) {
             Session::set_flash('error', '媒体は存在しません');
             return Response::redirect($url);
         }
         if (!\Model_Mpartner::find_by_pk(Input::post('partner_code'))) {
             Session::set_flash('error', '取引先(受注先)は存在しません');
         } else {
             $media = new \Model_Mmedia();
             $media_data = $media->set_data(Input::post());
             $umedia = new \Model_Umedia();
             $posts = Input::post('post') != null ? Input::post('post') : array();
             if ($umedia->save_media($media_data, $posts, Input::post('m_media_id'))) {
                 Session::set_flash('success', \Constants::$message_create_success);
                 return Response::redirect($url);
             }
             Session::set_flash('error', \Constants::$message_create_error);
         }
     }
     $data['classification'] = \Constants::get_create_media_classification();
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('media', $data);
     $this->template->content->filtergroup = \Presenter::forge('group/filter')->set('custom', $datafilter);
 }
Beispiel #26
0
 public function action_filter()
 {
     $user_id = \Fuel\Core\Input::param('user_id', 0);
     $client_id = Fuel\Core\Input::param('client_id', 0);
     $project_id = \Fuel\Core\Input::param('project_id', 0);
     $month = Fuel\Core\Input::param('month', '00');
     $year = Fuel\Core\Input::param('year', date('Y'));
     $status = 0;
     $data['open_tasks'] = THelper::get_tasks($user_id, $client_id, $project_id, $month, $year, $status, array(\Fuel\Core\Input::param('sort', 'priority') => \Fuel\Core\Input::param('order', 0)));
     $view = \Fuel\Core\View::forge('admin/tasks/index');
     $view->set_global('clients', Model_Customer::find('all', array('order_by' => array('name' => 'asc'))));
     $view->set_global('users', Model_User::find('all', array('order_by' => array('username' => 'asc'))));
     $view->set_global('years', range(2015, date('Y')));
     $view->set_global('months', THelper::get_months_array());
     $view->set_global('open_tasks', $data['open_tasks']);
     $view->set_global('admin', true);
     $this->template->title = 'Open Tasks';
     $this->template->content = $view;
 }
Beispiel #27
0
 /**
  * @author Thuanth6589
  * action index
  */
 public function action_index()
 {
     $data['person_id'] = Input::get('person_id', '');
     $inteview_usami = new \Model_Interviewusami();
     if ($data['person_id'] == '' || !\Model_Person::find($data['person_id'])) {
         return Response::redirect(Uri::base() . 'job/persons');
     }
     $data['inteview_usami'] = \Model_Interviewusami::find_one_by('person_id', $data['person_id']);
     if (Input::method() == 'POST') {
         $fields = Input::post('data');
         $inteview_usami->set_data($fields);
         if ($inteview_usami->save_data()) {
             Session::set_flash('success', \Constants::$message_create_success);
             return Response::redirect(Uri::base() . 'job/interviewusami?person_id=' . $data['person_id']);
         }
         Session::set_flash('error', \Constants::$message_create_error);
     }
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('interviewusami/index', $data);
 }
Beispiel #28
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * list, create, update sssale
  */
 public function action_index()
 {
     $data = array();
     $sssale = new \Model_Sssale();
     $data['ss_id'] = Input::get('ss_id', null);
     $ss_name = Input::get('ss_name');
     $data['ss_name'] = Input::get('ss_name') ? urldecode($ss_name) : null;
     if (!isset($data['ss_id']) || !isset($data['ss_name']) || !\Model_Mss::find_by_pk($data['ss_id'])) {
         Session::set_flash('error', '売上形態は存在しません');
         return Response::redirect('/master/sslist');
     }
     Session::set('sssale_url', Uri::current() . '?ss_id=' . $data['ss_id'] . '&ss_name=' . $ss_name);
     if (Input::method() == 'POST') {
         $sssale_id = Input::post('sssale_id', null);
         if ($sssale_id and !\Model_Sssale::find_by_pk($sssale_id)) {
             Session::set_flash('error', '売上形態は存在しません');
             return Response::redirect(Session::get('sssale_url'));
         }
         $fields = $sssale->set_data(Input::post());
         $check = true;
         $message = \Constants::$message_create_error;
         if (!$sssale->check_data_null($fields)) {
             $check = false;
             $message = '入力内容がありません。';
         }
         if ($check == true && $sssale->save_data($fields)) {
             Session::set_flash('success', \Constants::$message_create_success);
             return Response::redirect(Session::get('sssale_url'));
         }
         if (!isset($sssale_id)) {
             $data['action'] = 'add';
         }
         Session::set_flash('error-' . Input::post('panel_index'), $message);
     }
     $data['sale_type'] = \Constants::$sale_type;
     $data['hours'] = \Constants::$hours;
     $data['minutes'] = \Constants::$minutes;
     $data['sssales'] = $sssale->get_data($data['ss_id']);
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('sssale', $data);
 }
Beispiel #29
0
 public function action_confirm()
 {
     $confirmView = View::forge('login/confirm');
     // Lay du lieu tu DB
     $userData = $this->connectDB();
     //var_dump($userData);
     // So sanh username va password voi du lieu trong DB
     if (!empty($_POST['username'] && !empty($_POST['password']))) {
         for ($i = 0; $i < 3; $i++) {
             if ($_POST['username'] === $userData[$i]['username']) {
                 $confirmView->set('username', $_POST['username']);
             }
             if ($_POST['password'] === $userData[$i]['password']) {
                 $confirmView->set('password', $_POST['password']);
             }
         }
     } else {
         echo "<br>ERROR++++++++++++++++++++++++++++++++++ERROR<br>";
     }
     return Response::forge($confirmView);
 }
Beispiel #30
0
 public function action_index()
 {
     $this->template->title = 'UOS求人システム';
     $data = array();
     $data['file_name'] = '';
     if (Input::method() == 'POST') {
         $arr_file = Input::file('csv');
         if (substr($arr_file['name'], -4) == '.csv') {
             $data['file_name'] = $arr_file['name'];
             $import = new \Import();
             $res = $import->update_csv($arr_file['tmp_name']);
             $data['no_update'] = $import->no_update;
             if ($res) {
                 $data['success'] = true;
             } else {
                 $data['error'] = $import->get_errors();
             }
         } else {
             $data['error'] = array('CSVのフォーマットが正しくありません');
         }
     }
     $this->template->content = \Fuel\Core\View::forge('jobup/index', $data);
 }