Ejemplo n.º 1
0
 /**
  * @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);
 }
Ejemplo n.º 2
0
 public function action_index()
 {
     $data = array();
     $model_par = new \Model_Mpartner();
     $model_ss = new \Model_Mss();
     $model_job = new \Model_Job();
     $model_or = new \Model_Orders();
     $m_user = new Model_Muser();
     $m_person = new Model_Person();
     $data['m_partner'] = $model_par->count_data(array('status' => 1));
     $data['m_ss'] = $model_ss->count_data(array('status' => '0'));
     $data['job'] = $model_job->count_data();
     $data['or'] = count($model_or->get_all_order_list(null, null, array('unapproved' => '0')));
     $data['person_inactive'] = $m_person->count_data(array('status' => '0'));
     $this->template->title = 'UOS求人システム';
     $this->template->content = View::forge('default/top', $data);
     $user_info = \Fuel\Core\Session::get('login_info');
     $division = $user_info['division_type'];
     $department_id = $user_info['department_id'];
     if ($division == 2) {
         $data['count_partner'] = $model_par->count_data(array('department_id' => $department_id, 'status' => '1'));
         $data['count_ss'] = $model_ss->count_data(array('department_id' => $department_id, 'status' => '0'));
         $data['count_job'] = $model_job->count_job_department_id(array('department_id' => $department_id, 'status' => '0'));
         $data['count_order'] = count($model_or->get_all_order_list(null, null, array('department_id' => $department_id, 'unapproved' => '0')));
         $data['list_user'] = $m_user->get_data(array('department_id' => $department_id, 'order_by_time' => 1));
         $data['link_partner'] = \Fuel\Core\Uri::base() . 'master/partners?department_id=' . $department_id . '&status=1';
         $data['link_ss'] = \Fuel\Core\Uri::base() . 'master/sslist?department_id=' . $department_id . '&status=0';
         $data['link_job'] = \Fuel\Core\Uri::base() . 'job/jobs?department_id=' . $department_id . '&status=0';
         $data['link_order'] = \Fuel\Core\Uri::base() . 'job/orders?department_id=' . $department_id . '&unapproved=0&flag=1';
         $array_user = array();
         foreach ($data['list_user'] as $user) {
             $array_user[] = $user->user_id;
         }
         $list_person = $m_person->get_person_division_2($array_user);
         foreach ($list_person as $person) {
             foreach ($array_user as $k => $v) {
                 if ($person['interview_user_id'] == $v || $person['agreement_user_id'] == $v || $person['training_user_id'] == $v || $person['partner_user_id'] == $v) {
                     if ($person['contact_result'] == 0) {
                         $data['count'][$v]['contact_result'] = isset($data['count'][$v]['contact_result']) ? $data['count'][$v]['contact_result'] + 1 : 1;
                     }
                     if ($person['review_date'] == '') {
                         $data['count'][$v]['review_date'] = isset($data['count'][$v]['review_date']) ? $data['count'][$v]['review_date'] + 1 : 1;
                     }
                     if ($person['review_result'] == 0) {
                         $data['count'][$v]['review_result'] = isset($data['count'][$v]['review_result']) ? $data['count'][$v]['review_result'] + 1 : 1;
                     }
                     if ($person['adoption_result'] == 0) {
                         $data['count'][$v]['adoption_result'] = isset($data['count'][$v]['adoption_result']) ? $data['count'][$v]['adoption_result'] + 1 : 1;
                     }
                     if ($person['contract_date'] == '') {
                         $data['count'][$v]['contract_date'] = isset($data['count'][$v]['contract_date']) ? $data['count'][$v]['contract_date'] + 1 : 1;
                     }
                     if ($person['contract_result'] == 0) {
                         $data['count'][$v]['contract_result'] = isset($data['count'][$v]['contract_result']) ? $data['count'][$v]['contract_result'] + 1 : 1;
                     }
                     if ($person['hire_date'] == '') {
                         $data['count'][$v]['hire_date'] = isset($data['count'][$v]['hire_date']) ? $data['count'][$v]['hire_date'] + 1 : 1;
                     }
                     if ($person['employee_code'] == '') {
                         $data['count'][$v]['employee_code'] = isset($data['count'][$v]['employee_code']) ? $data['count'][$v]['employee_code'] + 1 : 1;
                     }
                     if ($person['work_confirmation'] == 0) {
                         $data['count'][$v]['work_confirmation'] = isset($data['count'][$v]['work_confirmation']) ? $data['count'][$v]['work_confirmation'] + 1 : 1;
                     }
                 }
             }
         }
         $data['pagination'] = \Uospagination::forge('pagination', array('pagination_url' => Uri::base() . '?division=2', 'total_items' => count($data['list_user']), 'per_page' => \Constants::$default_limit_pagination, 'num_links' => \Constants::$default_num_links, 'uri_segment' => 'page', 'show_last' => true));
         $this->template->content = View::forge('default/division2', $data);
     } elseif ($division == 3) {
         $this->division3();
     } else {
         $this->template->content = View::forge('default/top', $data);
     }
 }