Exemplo 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);
 }
Exemplo n.º 2
0
 function beforeModify(&$data)
 {
     if ($data['salary'] + 0 == 0) {
         throw $this->exception('Specify salary', 'ValidityCheck')->setField('salary');
     }
     parent::beforeModify($data);
 }
Exemplo n.º 3
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);
 }
Exemplo n.º 4
0
 public function before()
 {
     parent::before();
     if ($this->id == 'null') {
         $this->id = '_new';
     }
     $this->requested_person = Model_Person::find($this->id);
     $this->requested_person === null ? $this->requested_person = Model_Person::forge() : null;
 }
Exemplo n.º 5
0
	function defineFields(){
		parent::defineFields();

		$this->addField('name')
			->mandatory(true);

		$this->addField('days_worked')
			->system(true)
			->datatype('int');

		$this->addField('salary')
			->mandatory(true)
			->datatype('money');

		$this->addField('money_owed')
            ->caption('Owed')
			->calculated(true);
	}
Exemplo n.º 6
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.º 7
0
<?php

$person = Model_Person::find($person_id);
?>

<div class="panel panel-default">
	<div class="panel-heading">応募者</div>
	<div class="panel-body">
		<table class="table table-striped">
			<tr>
				<th class="text-right">氏名</th>
				<td><?php 
echo isset($person->name) ? $person->name : '';
?>
</td>
				<th class="text-right">生年月日</th>
				<td>
					<?php 
echo isset($person->birthday) ? date('Y/n/j', strtotime($person->birthday)) : '';
?>
					(応募時の年齢:
					<?php 
if (isset($person->birthday) and isset($person->application_date)) {
    $from = new DateTime($person->birthday);
    $to = new DateTime($person->application_date);
    echo floor((strtotime($person->application_date) - strtotime($person->birthday)) / 31536000);
} else {
    echo 'Unknown';
}
?>
才)
Exemplo n.º 8
0
 public function get_division_3()
 {
     $data = array('sssale_list' => array(), 'person_list' => array(), 'employment_list' => array());
     $user_info = \Fuel\Core\Session::get('login_info');
     $order_obj = new Model_Orders();
     $partner_obj = new Model_Mpartner();
     $mss_obj = new Model_Mss();
     $person_obj = new Model_Person();
     $employment_obj = new Model_Employment();
     $sssale_obj = new Model_Sssale();
     $list_order_id = array();
     $list_sssale_id = array();
     $order_list = $order_obj->get_list_oders_login($user_info['user_id']);
     /*where 1*/
     if (count($order_list)) {
         foreach ($order_list as $row) {
             $list_order_id[] = $row['order_id'];
         }
     }
     /*where 2*/
     $list_partner_code = array();
     $list_ss_id = array();
     $partner_list = $partner_obj->get_list_partner_login($user_info['user_id']);
     if (count($partner_list)) {
         foreach ($partner_list as $row) {
             $list_partner_code[] = $row['partner_code'];
         }
     }
     if (count($list_partner_code)) {
         $mss_list = $mss_obj->get_all_ss_by_list_partner_code($list_partner_code);
         $mss_list_id = '';
         $sssale_array = array();
         if (count($mss_list)) {
             foreach ($mss_list as $row) {
                 $mss_list_id .= $row['ss_id'] . ',';
                 $ss_array_list[$row['ss_id']] = $row['ss_name'];
             }
             $sssale_list = $sssale_obj->get_list_sssale('ss_id IN (' . trim($mss_list_id, ',') . ')');
             foreach ($sssale_list as $row) {
                 $list_sssale_id[] = $row['sssale_id'];
             }
         }
     }
     $person_list = $person_obj->get_person_division_3($list_sssale_id, $list_order_id);
     $list_person_id = array();
     if (count($person_list)) {
         $list_sssale_id = array();
         foreach ($person_list as $row) {
             $list_person_id[] = $row['person_id'];
             $list_sssale_id[] = (int) $row['sssale_id'];
         }
         $list_employment = $employment_obj->get_list_data($list_person_id);
         $list_sssale_of_person = $sssale_obj->get_list_sssale('sssale_id IN (' . implode(',', $list_sssale_id) . ')');
         $list_employment_array = array();
         $list_sssale = array();
         foreach ($list_employment as $row) {
             $list_employment_array[$row['person_id']] = $row;
         }
         $list_ss_id = array();
         $list_sssale_of_ss = array();
         foreach ($list_sssale_of_person as $row) {
             $list_ss_id[] = (int) $row['ss_id'];
             $list_sssale_of_ss[$row['sssale_id']] = (int) $row['ss_id'];
         }
         $list_ss_of_person = $mss_obj->get_list_ss('ss_id IN (' . implode(',', $list_ss_id) . ')');
         $list_ss_name = array();
         foreach ($list_ss_of_person as $row) {
             $list_ss_name[$row['ss_id']] = $row['ss_name'];
         }
         $list_person_ss_name = array();
         foreach ($list_sssale_of_ss as $sssale_id => $ss_id) {
             $list_person_ss_name[$sssale_id] = $list_ss_name[$ss_id];
         }
         $data['person_list'] = $person_list;
         $data['sssale_list'] = $list_person_ss_name;
         $data['employment_list'] = $list_employment_array;
     }
     return $data;
 }
Exemplo 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);
     }
 }
Exemplo n.º 10
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.º 11
0
 public function approval_person($person_id)
 {
     if (!isset($person_id) || !($person = Model_Person::find($person_id))) {
         Session::set_flash('error', '取引先は存在しません');
         Response::redirect(Uri::base() . 'job/persons?' . \Session::get('url_filter_persons'));
     }
     //Set array partner to save array field
     if ($edit_data = json_decode($person->edit_data, true)) {
         $edit_data = $this->_set_data_update($edit_data);
         $edit_data['status'] = \Constants::$_status_person['approval'];
         $edit_data['edit_data'] = null;
         $person->set($edit_data);
         if ($person->save()) {
             return true;
         } else {
             return false;
         }
     } else {
         $edit_data['status'] = \Constants::$_status_person['approval'];
         $person->set($edit_data);
         if ($person->save()) {
             return true;
         } else {
             return false;
         }
     }
     return false;
 }
Exemplo n.º 12
0
 public function testAssociateOneToManyPrimaryKey()
 {
     $category = new Category(3);
     $person = new Model_Person();
     $person->setName('Bob');
     $person->store();
     $person_2 = new Model_Person();
     $person_2->setName("Barbara");
     $person_2->store();
     $person_ids = array($person->getPersonId(), $person_2->getPersonId());
     $category->associateModel_People($person_ids);
     $category->store();
     $db_person_ids = array_map('current', self::$db->query('SELECT person_id FROM people WHERE category_id = 3')->fetchAllRows());
     self::$db->query("DELETE FROM people WHERE person_id > 4");
     $this->assertEquals($person_ids, $db_person_ids);
 }
Exemplo n.º 13
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');
 }
Exemplo n.º 14
0
 public function init()
 {
     parent::init();
     $this->addCondition('gender', 'M');
 }
Exemplo n.º 15
0
 function init()
 {
     parent::init();
     $this->hasOne('Mother');
     $this->hasMany('Books');
 }
Exemplo n.º 16
0
 function init()
 {
     parent::init();
     $this->addField('days_worked')->system(true)->datatype('int');
     $this->addField('salary')->mandatory('Salary is required')->datatype('money');
 }