本文整理汇总了PHP中Constants::get_create_department方法的典型用法代码示例。如果您正苦于以下问题:PHP Constants::get_create_department方法的具体用法?PHP Constants::get_create_department怎么用?PHP Constants::get_create_department使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Constants
的用法示例。
在下文中一共展示了Constants::get_create_department方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_index
/**
* @author Thuanth6589 <thuanth6589@seta-asia.com.vn>
* 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);
}
示例2: isset
?>
disabled">
<?php
echo Fuel\Core\Form::select('department_id_edit', isset($edit_partner) ? $edit_partner->department_id : '', Constants::get_create_department(), array('class' => 'form-control', 'disabled'));
?>
</div>
</td>
</tr>
<tr>
<th class="text-right">担当営業</th>
<td>
<?php
//Get array department
$department = \Constants::get_create_department();
$user_id = '';
$arr_user = array();
$department_id = '';
if (isset($partner->user_id)) {
$user_id = $partner->user_id;
$department_id = Model_Mpartner::get_department_user($user_id);
$arr_user = Model_Mpartner::get_filter_user_department($department_id);
$arr_user = array_column($arr_user, 'name', 'user_id');
}
echo Fuel\Core\Form::select('department', $department_id, $department, array('class' => 'form-control'));
echo ' - ';
echo Fuel\Core\Form::select('user_id', $user_id, array('' => '担当者を選択してください') + $arr_user, array('class' => 'form-control'));
?>
<span class="text-info text-info-userid">※受注先の場合必須</span>
<label id="form_user_id-error" class="error" for="form_user_id"></label>