Exemplo n.º 1
0
 /**
  * @author dangbc <*****@*****.**>
  * filter plan
  */
 public function action_loaddata()
 {
     $year = Input::post('year');
     $plan = new \Model_Plan();
     $data_plan = $plan->data_plan($year);
     return json_encode($data_plan);
 }
Exemplo n.º 2
0
 /**
  * @author Bui Dang <*****@*****.**>
  * action login
  */
 public function action_index()
 {
     if (\Fuel\Core\Session::get('login_info')) {
         \Fuel\Core\Response::redirect(($uri = \Fuel\Core\Session::get('uri_before_login')) ? $uri : \Fuel\Core\Uri::base());
     }
     if (\Fuel\Core\Input::post()) {
         $login_id = \Fuel\Core\Input::post('login_id');
         $pass = \Fuel\Core\Input::post('password');
         if ($user = Model_Muser::find_one_by(array('login_id' => $login_id, 'pass' => hash('SHA256', $pass)))) {
             $login_info = array('department_id' => $user['department_id'], 'division_type' => $user['division_type'], 'name' => $user['name'], 'login_id' => $user['login_id'], 'email' => $user['mail'], 'user_id' => $user['user_id'], 'expired' => time() + 30 * 60);
             \Fuel\Core\Session::set('login_info', $login_info);
             $url = \Fuel\Core\Uri::base();
             if ($user['division_type'] == 2) {
                 $url = \Fuel\Core\Uri::base() . '?division=2';
             }
             if ($user['division_type'] == 3) {
                 $url = \Fuel\Core\Uri::base() . '?division=3';
             }
             \Fuel\Core\Response::redirect(($uri = \Fuel\Core\Session::get('uri_before_login')) ? $uri : $url);
         }
         \Fuel\Core\Session::set_flash('error', 'ログインIDもしくはパスワードが正しくありません');
     }
     $this->template->title = 'UOS求人システム';
     $this->template->content = \View::forge('login/index');
 }
Exemplo n.º 3
0
 public function post_login()
 {
     $data = (object) Input::post();
     if (Auth::login($data->username, $data->password)) {
         return \Response::redirect('admin/home');
     }
     return \Response::redirect('admin/login');
 }
Exemplo n.º 4
0
 public function post_add()
 {
     $model = Model_Blog::forge();
     $model->set(Input::post());
     $model->set(BLOG_CREATED_DATE, DB::expr('now()'));
     $model->set(DELETE_FLG, '0');
     $model->save();
     Response::redirect(Config::get('base_url'));
 }
Exemplo n.º 5
0
 public static function post_photo_to_fb_by_url($data)
 {
     $data = json_decode($data);
     $flag = false;
     $facebook = new \Libs\Facebook();
     $page = \Model_Pages::find(\Fuel\Core\Input::post('page_id'));
     $flag = $facebook->post_photo_by_url($page->long_lived_access_token, $page->fanpage_id, $data);
     return $flag;
 }
Exemplo n.º 6
0
 /**
  * @author Bui Dang <*****@*****.**>
  * action Save group
  */
 public function action_ajaxsave()
 {
     $group = new \Model_Mgroups();
     $groupid = \Input::post('groupid');
     $group_name = Input::post('groupname');
     $data = array('group_id' => $groupid, 'group_name' => $group_name);
     $status = $group->create_group($data);
     return Response::forge(json_encode($status));
 }
Exemplo n.º 7
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * list media
  */
 public function action_get_partner()
 {
     $m_group_id = Input::post('m_group_id');
     if (!isset($m_group_id) || $m_group_id == '') {
         exit(json_encode($this->_partners));
     }
     $m_partner = new \Model_Mpartner();
     $partners = $this->_partners + array_column($m_partner->get_partner_group($m_group_id, $this->_partner_type), 'branch_name', 'partner_code');
     return Response::forge(json_encode($partners));
 }
Exemplo n.º 8
0
 public static function get_new_data_photo_by_url()
 {
     $content = array('message' => \Fuel\Core\Input::post('message'), 'url' => \Fuel\Core\Input::post('link'));
     if (empty(\Fuel\Core\Input::post('publish_instantly'))) {
         $content['published'] = false;
         $content['scheduled_publish_time'] = \Libs\Datetime::get_timestamp(\Fuel\Core\Input::post('scheduled_publish_time'));
     }
     $result = array('author' => \Fuel\Core\Session::get('user_id'), 'page_id' => \Fuel\Core\Input::post('page_id'), 'modifier' => \Fuel\Core\Session::get('user_id'), 'type' => \Fuel\Core\Input::post('type'), 'push_facebook_on' => \Fuel\Core\Input::post('push_facebook_on'), 'date_created' => \Libs\Datetime::get_current_timestamp(), 'date_modified' => \Libs\Datetime::get_current_timestamp(), 'content' => json_encode($content));
     return $result;
 }
Exemplo n.º 9
0
 public function post_list()
 {
     $page = (int) Input::post('page') !== 0 ? (int) Input::post('page') : 1;
     $category_id = Input::post('category_id');
     $type = !empty($category_id) && Model_Base_Category::valid_field('id', $category_id) ? true : false;
     $total = $type ? Model_Base_Product::admin_count_by_category($category_id) : Model_Base_Product::count_all();
     $limit = _DEFAULT_LIMIT_;
     $offset = $page * $limit - $limit < $total ? $page * $limit - $limit : _DEFAULT_OFFSET_;
     $this->data['product'] = $type ? Model_Base_Product::admin_get_by_category($category_id, $offset, $limit) : Model_Base_Product::get_all($offset, $limit);
     $this->data['success'] = true;
     return $this->response($this->data);
 }
Exemplo n.º 10
0
 public function post_list()
 {
     $page = (int) Input::post('page') !== 0 ? (int) Input::post('page') : 1;
     $code = Input::post('code');
     $category_id = Model_Base_Category::get_id_by_code($code);
     $total = Model_Base_Product::count_by_category($category_id);
     $limit = _DEFAULT_LIMIT_;
     $offset = $page * $limit - $limit < $total ? $page * $limit - $limit : _DEFAULT_OFFSET_;
     $this->data['products'] = Model_Base_Product::get_by_category($category_id, $offset, $limit);
     $this->data['success'] = true;
     return $this->response($this->data);
 }
Exemplo n.º 11
0
 public function action_edit($id = null)
 {
     if (\Fuel\Core\Input::method() == 'POST') {
         $id = \Fuel\Core\Input::post('id');
     }
     if (!($user = Model_User::find($id))) {
         \Fuel\Core\Session::set_flash('error', 'Could not find user # ' . $id);
         \Fuel\Core\Response::redirect('admin/users');
     }
     $val = Model_User::validate('edit');
     if (\Fuel\Core\Input::method() == 'POST') {
         if ($val->run()) {
             $user->username = \Fuel\Core\Input::post('username');
             $user->email = \Fuel\Core\Input::post('email');
             $user->group = \Fuel\Core\Input::post('group');
             $user->first_name = \Fuel\Core\Input::post('first_name');
             $user->last_name = \Fuel\Core\Input::post('last_name');
             $user->target_billable = \Fuel\Core\Input::post('target_billable');
             $user->target_unbillable = \Fuel\Core\Input::post('target_unbillable');
             try {
                 if ($user->save()) {
                     Session::set_flash('success', e('Updated user #' . $id));
                     Response::redirect('admin/users');
                 } else {
                     Session::set_flash('error', e('Could not update user #' . $id));
                 }
             } catch (\SimpleUserUpdateException $ex) {
                 // duplicate email address
                 if ($ex->getCode() == 2) {
                     Fuel\Core\Session::set_flash('error', 'Email already exists.');
                 } elseif ($ex->getCode() == 3) {
                     Fuel\Core\Session::set_flash('error', 'Username already exists.');
                 } else {
                     Fuel\Core\Session::set_flash('error', $ex->getMessage());
                 }
             }
         } else {
             if (Input::method() == 'POST') {
                 Session::set_flash('error', $val->error());
             }
         }
     }
     $this->template->set_global('user', $user, false);
     $this->template->set_global('val', $val, false);
     $this->template->set_global('groups', $this->get_groups_list());
     $this->template->title = "Users";
     $this->template->content = View::forge('admin/users/edit');
 }
Exemplo n.º 12
0
 public function action_change_status()
 {
     if ($contact_id = Input::post('contact_id')) {
         $user_login = Session::get('login_info');
         $contact = \Model_Contact::find_by_pk($contact_id);
         if (Input::post('status') == 0) {
             $contact->set(array('status' => 1, 'user_id' => $user_login['user_id'], 'update_at' => date('Y-m-d H:i:s')));
         }
         if (Input::post('status') == 1) {
             $contact->set(array('status' => 0, 'user_id' => null, 'update_at' => null));
         }
         $contact->save();
         Response::redirect(Uri::base() . 'support/contacts?' . Session::get('url_filter_contacts'));
     }
     Response::redirect(Uri::base() . 'support/contacts?' . Session::get('url_filter_contacts'));
 }
Exemplo n.º 13
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * delete sssale
  */
 public function action_delete()
 {
     if (Input::method() == 'POST') {
         $sssale_id = Input::post('sssale_id');
         $result = 'error-' . Input::post('panel_index');
         $message = \Constants::$message_delete_error;
         if (isset($sssale_id) && ($sssale = \Model_Sssale::find_by_pk($sssale_id))) {
             if ($sssale->delete_data()) {
                 $result = 'success';
                 $message = \Constants::$message_delete_success;
             }
         }
         Session::set_flash($result, $message);
     }
     $url = Session::get('sssale_url') ? Session::get('sssale_url') : Uri::base() . 'master/sslist';
     return Response::redirect($url);
 }
Exemplo n.º 14
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);
 }
Exemplo n.º 15
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * action delete user
  */
 public function action_delete()
 {
     if (Input::method() == 'POST') {
         $user_id = Input::post('user_id', null);
         $result = 'error';
         if (!\Model_Muser::find_by_pk($user_id)) {
             $message = 'ユーザーは存在しません';
         } else {
             $message = \Constants::$message_delete_error;
             $user = new \Model_Muser();
             if ($user->delete_data($user_id)) {
                 $result = 'success';
                 $message = \Constants::$message_delete_success;
             }
         }
         Session::set_flash($result, $message);
     }
     $url = Session::get('users_url') ? Session::get('users_url') : Uri::base() . 'master/users';
     return Response::redirect($url);
 }
Exemplo n.º 16
0
 /**
  * @author Thuanth6589 <*****@*****.**>
  * action delete media
  */
 public function action_delete()
 {
     if (Input::method() == 'POST') {
         $result = 'error';
         $m_media_id = Input::post('m_media_id', null);
         if (!\Model_Mmedia::find_by_pk($m_media_id)) {
             $message = '媒体は存在しません';
         } else {
             $umedia = new \Model_Umedia();
             $message = \Constants::$message_delete_error;
             if ($umedia->delete_media($m_media_id)) {
                 $result = 'success';
                 $message = \Constants::$message_delete_success;
             }
         }
         Session::set_flash($result, $message);
     }
     $url = Session::get('medias_url') ? Session::get('medias_url') : Uri::base() . 'master/medias';
     return Response::redirect($url);
 }
Exemplo n.º 17
0
 public function action_edit($id = null)
 {
     $comment = Model_Comment::find($id);
     if (\Fuel\Core\Input::post()) {
         $comment->name = \Fuel\Core\Input::post('name');
         $comment->comment = \Fuel\Core\Input::post('comment');
         if ($comment->save()) {
             Fuel\Core\Session::set_flash('success', 'Updated comment #' . $id);
             Fuel\Core\Response::redirect('messages/view/' . $comment->message_id);
         } else {
             Fuel\Core\Session::set_flash('error', 'Could not update comment #' . $id);
         }
     } else {
         $this->template->set_global('comment', $comment, false);
         $this->template->set_global('message', $comment->message_id, false);
     }
     $data["subnav"] = array('edit' => 'active');
     $this->template->title = 'Comments &raquo; Edit';
     $data['form'] = View::forge('comments/_form');
     $this->template->content = View::forge('comments/edit', $data);
 }
Exemplo n.º 18
0
 public function post_add_image_with_url()
 {
     $data = Libs\Helper\Input::get_new_data_photo_by_url();
     if (!empty(Input::post('push_facebook_on'))) {
         //*** Call api
         if (!Libs\Helper\Features::post_photo_to_fb_by_url($data['content'])) {
             //Unset push_facebook_on
             $data['push_facebook_on'] = 0;
             Session::set_flash('warning', 'Cannot post to facebook. Please try again later');
         }
     }
     //*** Add to DB
     if (!Model_Posts::add_new_post($data)) {
         Session::set_flash('error', 'Cannot add new post');
         \Fuel\Core\Response::redirect('fanpage/index');
     }
     Session::set_flash('success', 'Added new post');
     Response::redirect('fanpage/dashboard/' . Input::post('page_id'));
 }
Exemplo n.º 19
0
 public function action_fields($id, $type)
 {
     $pass = Model_Pass::find($id);
     if (\Fuel\Core\Input::method() == 'POST') {
         if ($type == 'primary') {
             $pass->set_primary_field(\Fuel\Core\Input::post('label', ''), \Fuel\Core\Input::post('value', ''));
             Session::set_flash('success', e('Added ' . $type . ' field.'));
         } else {
             $pass->set_field(Model_Field::string2type($type), \Fuel\Core\Input::post('key', ''), \Fuel\Core\Input::post('label', ''), \Fuel\Core\Input::post('value', ''), \Fuel\Core\Input::post('others', ''));
             Session::set_flash('success', e('Added ' . $type . ' field.'));
             \Fuel\Core\Response::redirect('admin/pass/fields/' . $pass->id . '/' . $type);
         }
     }
     if ($type == 'primary') {
         $this->template->set_global('field', $pass->primary_field(), false);
         $this->template->content = View::forge('admin/pass/primaryfields');
     } else {
         $this->template->set_global('fields', $pass->{$type . '_fields'}(), false);
         $this->template->content = View::forge('admin/pass/fields');
     }
     $this->template->set_global('type', $type, false);
     $this->template->set_global('pass', $pass, false);
     $this->template->title = "Pass " . $type . ' fields';
 }
Exemplo n.º 20
0
 public function action_create($what = null)
 {
     is_null($what) and \Fuel\Core\Response::redirect('filemanager');
     try {
         if (\Fuel\Core\Input::method() == 'POST') {
             if ($what == 'dir') {
                 $dir = \Fuel\Core\File::create_dir('/var/www/html/' . $this->_dir . '/', \Fuel\Core\Input::post('dir_name'), 0777);
                 if ($dir) {
                     \Fuel\Core\Response::redirect('filemanager');
                 }
             }
         }
     } catch (Exception $e) {
         die($e->getMessage());
     }
     \Fuel\Core\Response::redirect('filemanager');
 }
Exemplo n.º 21
0
 /**
  *
  * @return boolean is true str1!=str2
  */
 public function action_index()
 {
     $data_interview = array();
     if (!($person_id = Input::get('person_id')) or !\Model_Person::find($person_id)) {
         Response::redirect(Uri::base() . 'job/persons');
     }
     if ($data = Input::post()) {
         if (isset($data['anamnesis'])) {
             $data['anamnesis'] = json_encode($this->remove_value_empty($data['anamnesis']));
         }
         if (isset($data['medical_history'])) {
             $data['medical_history'] = json_encode($this->remove_value_empty($data['medical_history'], array('name', 'year')));
         }
         if (isset($data['surgical_history'])) {
             $data['surgical_history'] = json_encode($this->remove_value_empty($data['surgical_history'], array('name', 'year')));
         }
         if (isset($data['working_arrangements'])) {
             $data['working_arrangements'] = $this->convertarraytostring($data['working_arrangements']);
         }
         if (isset($data['weekend'])) {
             $data['weekend'] = $this->convertarraytostring($data['weekend']);
         }
         if (isset($data['special_license'])) {
             $data['special_license'] = $this->convertarraytostring($data['special_license']);
         }
         if (isset($data['other'])) {
             $data['other'] = $this->convertarraytostring($data['other']);
         }
         if (isset($data['mechanic_qualification'])) {
             $data['mechanic_qualification'] = $this->convertarraytostring($data['mechanic_qualification']);
         }
         if (isset($data['PC'])) {
             $data['PC'] = $this->convertarraytostring($data['PC']);
         }
         if (isset($data['start_time_hh']) or isset($data['start_time_mm'])) {
             $data['start_time'] = $this->merge_hh_mm($data['start_time_hh'], $data['start_time_mm']);
         }
         if (isset($data['end_time_hh']) or isset($data['end_time_mm'])) {
             $data['end_time'] = $this->merge_hh_mm($data['end_time_hh'], $data['end_time_mm']);
         }
         if (isset($data['weekend_start_time_hh']) or isset($data['weekend_start_time_mm'])) {
             $data['weekend_start_time'] = $this->merge_hh_mm($data['weekend_start_time_hh'], $data['weekend_start_time_mm']);
         }
         if (isset($data['weekend_end_time_hh']) or isset($data['weekend_end_time_mm'])) {
             $data['weekend_end_time'] = $this->merge_hh_mm($data['weekend_end_time_hh'], $data['weekend_end_time_mm']);
         }
         $data['person'] = $person_id;
         $data = \Model_Interview::_set($data);
         $interview_id = null;
         if (isset($data['interview_id']) and $data['interview_id'] != '') {
             $interview_id = $data['interview_id'];
             unset($data['interview_id']);
         }
         $interview = new \Model_Interview();
         if ($interview->save_data($data, $interview_id)) {
             Session::set_flash('success', \Constants::$message_create_success);
         } else {
             Session::set_flash('error', \Constants::$message_create_error);
         }
     }
     if ($interview_data = \Model_Interview::find_one_by('person', $person_id)) {
         $data_interview['interviews'] = $interview_data;
     }
     $this->template->title = 'UOS求人システム';
     $this->template->content = \View::forge('interview/index', $data_interview);
 }
Exemplo n.º 22
0
 /**
  * @param $module string
  * @return mixed
  * @throws Exception
  */
 public function action_ajax($module)
 {
     $result = array('error' => false, 'message' => '');
     $params = Input::all();
     try {
         if (array_intersect_key(Input::get(), Input::post())) {
             throw new Exception('Get and post mustn\'t have the same keys');
         }
         $class_name = 'Model_' . $module;
         if (!class_exists($class_name) or $class_name::ajax() !== true) {
             return Response::forge(\View::forge('errors/404.twig', array('msg' => "That page couldn't be found!")), 404);
         }
         //TODO: check for crsf token
         $class = new $class_name();
         // NOTE: it is possible to process each kind of request by using
         // GET, POST, DELETE, PUT
         // But not all of the browsers supports this methods for using in forms
         $method = Input::get('method', 'GET');
         switch ($method) {
             case 'INSERT':
                 if (!($message = $class::validation($params))) {
                     $result['error'] = true;
                     $result['message'] = $class::get_message('insert_failed');
                 } else {
                     $class::insert($params);
                     $result['message'] = $class::get_message('insert_success');
                 }
                 break;
             case 'UPDATE':
                 $action = Input::get('action', 'update');
                 if (!method_exists($class, $action)) {
                     throw new Exception("Method {$action} doesn't exists");
                 }
                 $message = $class::$action($params);
                 $result['message'] = $class::get_message($message);
                 break;
             case 'DELETE':
                 $id = Input::get('id', false);
                 if (!$id) {
                     throw new Exception('On delete method \'id\' is required');
                 }
                 if (method_exists($class, 'delete')) {
                     $class::delete($id);
                     $result['message'] = $class::get_message('delete_message');
                 }
                 break;
             case 'GET':
                 $action = Input::get('action', false);
                 if (!$action) {
                     throw new Exception('For get method parameter \'action\' is required');
                 }
                 if (method_exists($class, $action)) {
                     $result['data'] = $class::$action($params);
                     $result['message'] = $class::get_message($action);
                 }
                 break;
         }
     } catch (Exception $e) {
         $result = array('error' => true, 'message' => $e->getMessage());
     }
     if (Input::is_ajax()) {
         $result = Format::forge()->to_json($result);
         return Response::forge($result);
     } else {
         if (isset($params['redirect_url'])) {
             Response::forge()->redirect($params['redirect_url']);
         } else {
             Response::forge()->redirect_back('/');
         }
     }
 }
Exemplo n.º 23
0
            </div>
            
            <div class="control-group">
                    <?php 
echo Form::label('Priority', 'priority', array('class' => 'control-label input-sm'));
?>
                <div class="controls">
                    <select name="priority" class="form-control" required="">
                        <?php 
foreach ($priorities as $key => $val) {
    ?>
                        <option value="<?php 
    echo $key;
    ?>
" <?php 
    if (\Fuel\Core\Input::post('priority', isset($projecttask) ? $projecttask->priority : 0) == $key) {
        echo ' selected ';
    }
    ?>
> <?php 
    echo strtoupper($val);
    ?>
 </option>
                        <?php 
}
?>
                    </select>
                </div>
            </div>
        
        <div class="control-group">
Exemplo n.º 24
0
    ?>
</span>
                </div>
                <?php 
}
?>
            </div>
            
            <div class="control-group <?php 
echo !$val->error('group') ?: 'has-error';
?>
">
                <label class="control-label" for="email">Group:</label>
                <div class="controls">
                    <?php 
echo Fuel\Core\Form::select('group', \Fuel\Core\Input::post('group', isset($user) ? $user->group : 1), $groups, array('class' => 'form-control'));
?>
                </div>

                <?php 
if ($val->error('group')) {
    ?>
                <div class="controls">
                    <span class="control-label"><?php 
    echo $val->error('group')->get_message('You must select a group');
    ?>
</span>
                </div>
                <?php 
}
?>
Exemplo n.º 25
0
 public function action_get_m_ss_access()
 {
     $ss_id = \Fuel\Core\Input::post('ss_id');
     $model_ss = new \Model_Mss();
     $info_ss = $model_ss->get_ss_info($ss_id);
     return new \Response($info_ss['0']['access'], 200, array());
 }
Exemplo n.º 26
0
 /**
  * @author: Bui Cong Dang (dangbcd6591@seta-asia.com.vn)
  * @params: Event change department filter user in form
  **/
 public function action_change_department($id_department = null)
 {
     if (Input::post()) {
         $id_department = Input::post('department_id');
         if ($id_department == null || $id_department == '') {
             return false;
         }
         $partner = new \Model_Mpartner();
         $arr_user = $partner->get_filter_user_department($id_department);
         return Response::forge(json_encode($arr_user));
     }
 }
Exemplo n.º 27
0
					3L</label>
				<div class="input-group">
					<div class="input-group-addon">入社時貸出</div>
					<?php 
echo \Fuel\Core\Form::input('the_loan', \Fuel\Core\Input::post('the_loan', isset($interviews) ? $interviews->the_loan : ''), array('class' => 'form-control', 'size' => '5'));
?>
					<div class="input-group-addon">枚</div>
				</div>
				<label id="form_the_loan-error" class="error" for="form_the_loan"></label>
			</td>
		</tr>
		<tr>
			<th class="text-right">担当者記入</th>
			<td>
				<?php 
echo \Fuel\Core\Form::textarea('notes', \Fuel\Core\Input::post('notes', isset($interviews) ? $interviews->notes : ''), array('class' => 'form-control', 'cols' => '80', 'rows' => '5'));
?>
				<span class="text-info">※文字数無制限</span>
			</td>
		</tr>
	</table>

	<div class="text-center">
		<button type="submit" class="btn btn-primary btn-sm">
			<i class="glyphicon glyphicon-pencil icon-white"></i>
			保存
		</button>
	</div>
<?php 
echo \Fuel\Core\Form::close();
?>
Exemplo n.º 28
0
<?php 
echo Form::label('メールアドレス', 'email');
?>
(*) :
<?php 
echo Form::input('email', Input::post('email'));
?>
</p>

<p>
<?php 
echo Form::label('コメント', 'comment');
?>
(*) :
<?php 
echo Form::textarea('comment', Input::post('comment'), array('cols' => 70, 'rows' => 6));
?>
</p>


<div class="actions">
<?php 
echo Form::submit('submit', '確認');
?>
</div>

<p>
<?php 
echo Form::close();
?>
</p>
Exemplo n.º 29
0
 public function action_index()
 {
     $data = array();
     $ujob_obj = new \Model_Ujob();
     $job_id = \Fuel\Core\Input::get('job_id', '');
     $copy_job_id = \Fuel\Core\Input::get('copy_job_id', '');
     $job_id_get_data = $copy_job_id ? $copy_job_id : $job_id;
     $data_default = $ujob_obj->get_info_job($job_id_get_data);
     if ($data_default['job_id'] == null && $job_id) {
         \Fuel\Core\Response::redirect(\Fuel\Core\Uri::base() . 'job/job');
     }
     if ($copy_job_id) {
         $data_default['edit_data'] = null;
     }
     $data = $data_default;
     $data['old_data'] = $data_default;
     $data['old_data']['job_add'] = array();
     $data['old_data']['job_recruit'] = array();
     $data['old_data']['m_image'] = array();
     $data['job_add'] = array();
     $data['job_recruit'] = array();
     $data['m_image'] = array();
     $label = array('group' => 'グループ', 'partner' => '取引先(受注先)', 'ss' => 'SS', 'sslist' => '売上形態');
     $data_filter['field'] = array('step' => 4, 'type' => 1, 'label' => $label);
     if (\Fuel\Core\Input::method() == 'POST') {
         $data_post = \Fuel\Core\Input::post();
         if (!isset($data_post['employment_mark'])) {
             $data_post['employment_mark'] = array();
         }
         if (!isset($data_post['work_time_view'])) {
             $data_post['work_time_view'] = array();
         }
         if (!isset($data_post['trouble'])) {
             $data_post['trouble'] = array();
         }
         $check = true;
         if (!\Model_Sssale::find_by_pk($data_post['sssale_id'])) {
             \Fuel\Core\Session::set_flash('report', '売上形態は存在しません');
             $check = false;
         }
         foreach ($data_post['media_list'] as $k => $v) {
             if ($v == '') {
                 unset($data_post['media_list'][$k]);
                 continue;
             }
             if (!\Model_Mmedia::find_by_pk($v)) {
                 \Fuel\Core\Session::set_flash('report', '媒体は存在しません');
                 $check = false;
                 break;
             }
         }
         if ($check) {
             $this->save($ujob_obj, $job_id, $data_post);
         }
     }
     if ($data_default['edit_data']) {
         $data = json_decode($data_default['edit_data'], true);
         $data_default_edit = $ujob_obj->get_info_job('');
         $data = $data + $data_default_edit;
         $data = \Utility::set_standard_data_job($data, false);
         $ujob_obj->convert_job_add_recruit($data);
         $data['m_image'] = $ujob_obj->get_list_m_image($data['image_list']);
         /*Get old data*/
         $data['old_data'] = $data_default;
         $data['old_data']['job_add'] = $ujob_obj->get_list_job_add($job_id);
         $data['old_data']['job_recruit'] = $ujob_obj->get_list_job_recruit($job_id);
         $data['old_data']['m_image'] = $ujob_obj->get_list_m_image($data['old_data']['image_list']);
     } else {
         if ($job_id_get_data) {
             $data['job_add'] = $ujob_obj->get_list_job_add($job_id_get_data);
             $data['job_recruit'] = $ujob_obj->get_list_job_recruit($job_id_get_data);
             $data['m_image'] = $ujob_obj->get_list_m_image($data['image_list']);
             $data['old_data']['job_add'] = $data['job_add'];
             $data['old_data']['job_recruit'] = $data['job_recruit'];
             $data['old_data']['m_image'] = $data['m_image'];
         }
     }
     $data['is_show_old'] = array();
     if ($job_id) {
         $data['is_show_old'] = $this->_compare_other_data_json($data['old_data'], $data_default['edit_data']);
     }
     $data_filter['datafilter'] = \Presenter_Group_Filter::edit($data_filter['field']['step'], $data_filter['field']['type'], $data['sssale_id'], $data['old_data']['sssale_id']);
     $data['interview_des'] = '面接は勤務地または近隣にて行います。';
     $data['apply_method'] = '下記のフリーダイヤルまたは「応募する」ボタンより、応募シートに必要事項を入力の上、送信して下さい。※応募書類は返却致しません。ご了承ください。';
     $data['apply_process'] = '追って、こちらからご連絡差し上げます。※ご連絡は平日に致します。★ネット応募は24h受付中!!';
     $this->template->title = 'UOS求人システム';
     $this->template->content = \Fuel\Core\View::forge('job/index', $data);
     $this->template->content->filtergroup = \Presenter::forge('group/filter')->set('custom', $data_filter);
 }
Exemplo n.º 30
0
 public function action_approval()
 {
     if ($value = Input::post()) {
         $person = new \Model_Person();
         $person_id = $value['person_id'];
         if ($person->approval_person($person_id)) {
             $return = 'success';
             $messege = \Constants::$message_approval_success;
         } else {
             $return = 'error';
             $messege = \Constants::$message_approval_error;
         }
         Session::set_flash($return, $messege);
         Response::redirect(Uri::base() . 'job/persons?' . \Session::get('url_filter_persons'));
     }
     Response::redirect(Uri::base() . 'job/persons');
 }