Ejemplo n.º 1
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);
 }
Ejemplo n.º 2
0
 /**
  * @author Bui Dang <*****@*****.**>
  * action list contact
  */
 public function action_index()
 {
     $data = array();
     $filters = array();
     $keyword = array();
     if (Input::get()) {
         Session::set('url_filter_contacts', http_build_query(\Input::get()));
         $arr_remove = array('', null);
         $filters = array_diff(Input::get(), $arr_remove);
         if (isset($filters['end_date'])) {
             $filters['end_date'] = $filters['end_date'] . ' 23:59:59';
         }
         if (isset($filters['keyword']) and trim($filters['keyword']) != '') {
             $keyword = array_unique(explode(' ', trim($filters['keyword'])));
         }
     }
     $contacts = new \Model_Contact();
     $pagination = \Uospagination::forge('pagination', array('pagination_url' => Uri::base() . 'support/contacts?' . Session::get('url_filter_contacts'), 'total_items' => $contacts->count_data($filters, $keyword), '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['pagination'] = $pagination;
     $data['contacts'] = $contacts->get_data($filters, $keyword);
     $this->template->title = 'UOS求人システム';
     $this->template->content = \View::forge('contacts/index', $data);
 }
Ejemplo n.º 3
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.º 4
0
 public function action_index()
 {
     $export = \Input::get('export', false);
     //set cookie order
     \Fuel\Core\Cookie::set('person_url', Uri::base() . 'job/orders');
     $this->template->title = 'UOS求人システム';
     //get search value
     $search_arr = \Input::get();
     //set return url after edit
     $pagination_url = \Uri::base() . 'job/orders/index';
     $return_url = \Uri::current();
     if (\Input::get('flag') != null) {
         $pagination_url = \Uri::base() . 'job/orders/index' . '?' . http_build_query($_GET);
         $return_url = \Uri::current() . '?' . http_build_query($_GET);
     }
     //config pagination
     $config = array('pagination_url' => $pagination_url, 'total_items' => count(\Model_Orders::get_all_order_list(null, null, $search_arr)), 'per_page' => \Constants::$default_limit_pagination, 'uri_segment' => 'page', 'num_links' => \Constants::$default_num_links, 'show_last' => true);
     if ($export) {
         $config['per_page'] = 100000;
     } else {
         //setcookie
         \Cookie::set('return_url_search', $return_url, 60 * 60 * 24);
     }
     //setup pagination
     $pagination = \Uospagination::forge('orders-pagination', $config);
     $model_group = new \Model_Mgroups();
     $data['listgroup'] = $model_group->get_type(1);
     $model_partner = new \Model_Mpartner();
     $data['listpartner'] = $model_partner->get_filter_partner(array('type' => 1));
     //get list media
     $model_media = new \Model_Mmedia();
     $data['listmedias'] = $model_media->get_list_all_media();
     if (is_array($data['listmedias']) == false) {
         $data['listmedias'] = array();
     }
     //get list post
     $model_post = new \Model_Mpost();
     $data['listpost'] = $model_post->get_list_all();
     //get list ss
     $model_ss = new \Model_Mss();
     $data['list_all_ss'] = $model_ss->get_list_all_ss();
     //get all orders
     $model_order = new \Model_Orders();
     $data['listorders'] = \Model_Orders::get_all_order_list($pagination->per_page, $pagination->offset, $search_arr);
     if ($export) {
         $csv_data = $model_order->csv_process($data['listorders']);
         \Model_Orders::export($csv_data);
     }
     foreach ($data['listorders'] as $key => $value) {
         $data['listorders'][$key]['image_content'] = base64_encode($data['listorders'][$key]['image_content']);
         $data['listorders'][$key]['price'] = \Model_Orders::cost_of_order($value);
     }
     $this->template->content = \View::forge('orders/index', $data);
 }
Ejemplo n.º 5
0
 /**
  * @author Bui Dang <*****@*****.**>
  * action list group
  */
 public function action_index()
 {
     if ($filter = Input::get()) {
         Session::set('url_filter_group', http_build_query($filter));
         //Set url filter
     }
     $data = array();
     $groups = new \Model_Mgroups();
     $keywork = Input::get('keywork');
     $data['groups'] = $groups->get_all($keywork);
     $pagination = \Uospagination::forge('pagination', array('pagination_url' => \Uri::base() . 'master/groups?' . http_build_query(Input::get()), 'total_items' => count($data['groups']), 'per_page' => \Constants::$default_limit_pagination, 'num_links' => \Constants::$default_num_links, 'uri_segment' => 'page', 'show_last' => true));
     $data['pagination'] = $pagination;
     $data['groups'] = $groups->get_all($keywork, $pagination->offset, $pagination->per_page);
     $this->template->title = 'UOS求人システム';
     $this->template->content = \View::forge('groups/index', $data);
 }
Ejemplo n.º 6
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);
 }
Ejemplo n.º 7
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);
 }
Ejemplo n.º 8
0
 public function action_index()
 {
     $this->template->title = 'UOS求人システム';
     $data = array();
     //get search value
     if ($search_arr = \Input::get()) {
         Session::set('url_filter_concierges', http_build_query(\Input::get()));
     }
     //set return url after edit
     $pagination_url = \Uri::base() . 'support/concierges/index';
     $return_url = \Uri::current();
     if (\Input::get()) {
         $pagination_url = \Uri::base() . 'support/concierges/index' . '?' . http_build_query($_GET);
         $return_url = \Uri::current() . '?' . http_build_query($_GET);
     }
     //setcookie
     \Cookie::set('register_url_search', $return_url, 60 * 60 * 24);
     //config pagination
     $config = array('pagination_url' => $pagination_url, 'total_items' => count(\Model_Concierges::get_register_list(null, null, $search_arr)), 'per_page' => \Constants::$default_limit_pagination, 'uri_segment' => 'page', 'num_links' => \Constants::$default_num_links, 'show_last' => true);
     //setup pagination
     $pagination = \Uospagination::forge('concierges-pagination', $config);
     $data['listall'] = \Model_Concierges::get_register_list($pagination->per_page, $pagination->offset, $search_arr);
     $this->template->content = \View::forge('concierges/index', $data);
 }
Ejemplo n.º 9
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);
     }
 }
Ejemplo n.º 10
0
    public function get_search_data($export = false)
    {
        $config['where'] = array();
        $config_pagination = array();
        $rs = true;
        if (\Fuel\Core\Input::get('media_search', null) != null) {
            $config['where'][] = array('media_list', 'LIKE', '%,' . \Fuel\Core\Input::get('media_search') . ',%');
        }
        if (Fuel\Core\Input::get('group_search', null) != null) {
            $sql = 'select m_ss.ss_id from m_ss
				inner join m_partner on (m_ss.partner_code = m_partner.partner_code)
				where m_partner.m_group_id = :group_id';
            $group_id = Fuel\Core\Input::get('group_search');
            $_array = Fuel\Core\DB::query($sql)->bind('group_id', $group_id)->execute()->as_array();
            $ss_list_id[] = -1;
            foreach ($_array as $row) {
                $ss_list_id[] = $row['ss_id'];
            }
            $config['where'][] = array('ss_id', 'IN', $ss_list_id);
        }
        if (Fuel\Core\Input::get('partner_search')) {
            $ss_list_id = array();
            $list_ss_search = $this->get_list_ss('partner_code="' . Fuel\Core\Input::get('partner_search') . '"');
            $ss_list_id[] = -1;
            foreach ($list_ss_search as $row) {
                $ss_list_id[] = $row['ss_id'];
            }
            $config['where'][] = array('ss_id', 'IN', $ss_list_id);
        }
        if (\Fuel\Core\Input::get('address_1') || \Fuel\Core\Input::get('address_2')) {
            $filter = array('addr_1' => \Fuel\Core\Input::get('address_1', 0), 'addr_2' => \Fuel\Core\Input::get('address_2', ''));
            $ss_list_id = $this->mss->get_list_ss_addr($filter);
            if (!empty($ss_list_id)) {
                $config['where'][] = array('ss_id', 'IN', $ss_list_id);
            } else {
                $config['where'][] = array('ss_id', 'IN', array(-1));
            }
        }
        if (Fuel\Core\Input::get('ss_search')) {
            $config['where'][] = array('ss_id', '=', Fuel\Core\Input::get('ss_search'));
        }
        if (\Fuel\Core\Input::get('public_type_1') && \Fuel\Core\Input::get('public_type_2')) {
            $config['where'][] = array('public_type', '&9=', '9');
        } else {
            if (\Fuel\Core\Input::get('public_type_1')) {
                $config['where'][] = array('public_type', '&1=', '1');
            }
            if (\Fuel\Core\Input::get('public_type_2')) {
                $config['where'][] = array('public_type', '&8=', '8');
            }
        }
        if (\Fuel\Core\Input::get('status', null) != null) {
            $config['where'][] = array('status', '=', \Fuel\Core\Input::get('status'));
        }
        if (\Fuel\Core\Input::get('start_date')) {
            $config['where'][] = array('start_date', '>=', \Fuel\Core\Input::get('start_date'));
        }
        if (\Fuel\Core\Input::get('end_date')) {
            $config['where'][] = array('end_date', '<=', \Fuel\Core\Input::get('end_date'));
        }
        if (\Fuel\Core\Input::get('is_available', null) != null) {
            $config['where'][] = array('is_available', '=', \Fuel\Core\Input::get('is_available'));
        }
        if (\Fuel\Core\Input::get('department_id', null) != null) {
            $sql = 'select m_ss.ss_id from m_ss
				inner join m_partner on (m_ss.partner_code = m_partner.partner_code)
				where m_partner.department_id = :department_id';
            $department_id = Fuel\Core\Input::get('department_id');
            $_array = Fuel\Core\DB::query($sql)->bind('department_id', $department_id)->execute()->as_array();
            $department_ss_list_id[] = -1;
            foreach ($_array as $row) {
                $department_ss_list_id[] = $row['ss_id'];
            }
            $config['where'][] = array('ss_id', 'IN', $department_ss_list_id);
        }
        $config_pagination = $config['where'];
        $config_pagination = array('pagination_url' => \Uri::base() . 'job/jobs/index?' . http_build_query(\Input::get()), 'total_items' => $this->job->count('job_id', true, $config_pagination), 'per_page' => Constants::$default_limit_pagination, 'uri_segment' => 'page', 'num_links' => Constants::$default_num_links, 'show_last' => true);
        if ($export) {
            $config_pagination['per_page'] = 100000;
            // get all
        }
        $pagination = \Uospagination::forge('jobpage', $config_pagination);
        $config['limit'] = $pagination->per_page;
        $config['offset'] = $pagination->offset;
        $config['order_by'] = array('job_id' => 'desc');
        $res = $this->job->find($config);
        $list_ss_id = '';
        $list_sssale_id = '';
        $list_partner_id = '';
        $_arr_res = $_arr_res = array('res' => array(), 'res_ss' => array(), 'res_partner' => array(), 'res_sssale' => array());
        if (count($res)) {
            foreach ($res as $row) {
                if ($row['ss_id']) {
                    $list_ss_id .= $row['ss_id'] . ',';
                }
                if ($row['sssale_id']) {
                    $list_sssale_id .= $row['sssale_id'] . ',';
                }
            }
            $list_sssale_id = trim($list_sssale_id, ',');
            $list_ss_id = trim($list_ss_id, ',');
            $res_ss = array();
            if ($list_ss_id) {
                $res_ss = $this->get_list_ss('ss_id IN (' . $list_ss_id . ')');
                foreach ($res_ss as $row) {
                    $list_partner_id .= '"' . $row['partner_code'] . '",';
                }
                $list_partner_id = trim($list_partner_id, ',');
            }
            $list_sssale = array();
            if ($list_sssale_id) {
                $list_sssale = $this->get_list_sssale('sssale_id IN (' . $list_sssale_id . ')');
            }
            $list_partner = array();
            $list_group = array();
            if ($list_partner_id) {
                $list_partner = $this->get_list_partner('partner_code IN (' . $list_partner_id . ')');
                /*Get group name */
                $list_group_id = array();
                foreach ($list_partner as $row) {
                    $list_group_id[] = $row['m_group_id'];
                }
                $list_group = $this->mgroup->get_list_by_partner($list_group_id);
            }
            $_arr_res = array('res' => $res, 'res_ss' => $this->array_key_value($res_ss, 'ss_id'), 'res_partner' => $this->array_key_value($list_partner, 'partner_code'), 'res_sssale' => $this->array_key_value($list_sssale, 'sssale_id'), 'res_group' => $this->array_key_value($list_group, 'm_group_id'), 'paging' => $pagination);
        }
        return $_arr_res;
    }