本文整理汇总了PHP中User_helper::get_user方法的典型用法代码示例。如果您正苦于以下问题:PHP User_helper::get_user方法的具体用法?PHP User_helper::get_user怎么用?PHP User_helper::get_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User_helper
的用法示例。
在下文中一共展示了User_helper::get_user方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: system_edit
private function system_edit()
{
if ($this->permissions['edit']) {
$user = User_helper::get_user();
$id = $user->id;
$uisc_id = $user->uisc_id;
$this->current_action = 'edit';
$ajax['status'] = true;
$data = array();
$data['title'] = $this->lang->line("EDIT_PROFILE");
$data['uisc_detail'] = $this->Profile_view_model->get_uisc_info($id, $uisc_id);
$data['secretary'] = $this->Profile_view_model->get_secretary_info($id, $uisc_id);
$data['entrepreneur'] = $this->Profile_view_model->get_entrepreneur_info($id, $uisc_id);
$data['device'] = $this->Profile_view_model->get_device_info($id, $uisc_id);
$data['investment'] = $this->Profile_view_model->get_investment_info($id, $uisc_id);
$data['trainings'] = $this->Profile_view_model->get_training_info($id, $uisc_id);
$data['electricity'] = $this->Profile_view_model->get_electricity_info($id, $uisc_id);
$data['center_location'] = $this->Profile_view_model->get_location_info($id, $uisc_id);
$data['qualification'] = $this->Profile_view_model->get_qualification_info($id, $uisc_id);
$data['resources'] = $this->Profile_view_model->get_resource_info($id, $uisc_id);
$ajax['system_content'][] = array("id" => "#system_wrapper_top_menu", "html" => $this->load_view("top_menu", "", true));
$ajax['system_content'][] = array("id" => "#system_wrapper", "html" => $this->load_view("profile/profile_view/system_add_edit", $data, true));
if ($this->message) {
$ajax['system_message'] = $this->message;
}
$ajax['system_page_url'] = $this->get_encoded_url('profile/profile_view/index/edit/' . $id);
$this->jsonReturn($ajax);
} else {
$ajax['status'] = true;
$ajax['system_message'] = $this->lang->line("YOU_DONT_HAVE_ACCESS");
$this->jsonReturn($ajax);
}
}
示例2: dcms_save
private function dcms_save()
{
$user = User_helper::get_user();
$data = array();
if (!$this->check_validation()) {
$ajax['status'] = false;
$ajax['system_message'] = $this->message;
$this->jsonReturn($ajax);
} else {
$data['suggestion'] = $this->input->post('suggestion');
$data['date'] = date('Y-m-d');
$data['uisc_id'] = $user->uisc_id;
$data['created'] = $user->id;
$data['user_id'] = $user->id;
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::add($this->config->item('table_suggestion'), $data);
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$this->dcms_add();
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
示例3: edit
public function edit($id)
{
$CI =& get_instance();
$user = User_helper::get_user();
$user_id = $user->id;
if ($this->input->post()) {
$this->form_validation->set_rules('category_name', $this->lang->line('ASSET_CATEGORY_NAME'), 'required', array('required' => $this->lang->line('ASSET_CATEGORY_NAME')));
if ($this->form_validation->run() == FALSE) {
$this->message = validation_errors();
$ajax['system_message'] = $this->message;
$this->jsonReturn($ajax);
} else {
$data = array('name' => $this->input->post('category_name'), 'parent' => $this->input->post('category_parent'), 'ordering' => $this->input->post('ordering'), 'author_id' => $user_id, 'update_date' => date("Y-d-m"));
$this->db->where('id', $id);
$this->db->update($CI->config->item('category_name'), $data);
$ajax['system_message'] = $this->lang->line("MSG_SAVED_SUCCESS");
$ajax['system_content'][] = array("id" => "#system_content", "html" => $this->load->view("category/admin", '', true));
$ajax['system_content'][] = array("id" => "#user_info", "html" => $this->load->view("user_info", "", true));
$ajax['system_content'][] = array("id" => "#right_side", "html" => $this->load->view("dashboard_right", "", true));
$ajax['system_page_url'] = $this->get_encoded_url('category/admin');
$this->jsonReturn($ajax);
}
}
$data['category'] = $this->Category_model->get_category_data($id);
$ajax['system_content'][] = array("id" => "#system_content", "html" => $this->load->view("category/edit", $data, true));
$ajax['system_content'][] = array("id" => "#user_info", "html" => $this->load->view("user_info", "", true));
$ajax['system_content'][] = array("id" => "#right_side", "html" => $this->load->view("dashboard_right", "", true));
$ajax['system_page_url'] = $this->get_encoded_url('category/edit/' . $id);
$this->jsonReturn($ajax);
}
示例4: system_save
public function system_save()
{
$id = $this->input->post("id");
$data = $this->input->post('task');
$user = User_helper::get_user();
if ($id > 0) {
$this->db->trans_start();
//DB Transaction Handle START
$data['modified_by'] = $user->user_id;
$data['modification_date'] = time();
Query_helper::update($this->config->item('table_task'), $data, array("id = " . $id));
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_UPDATE_SUCCESS");
$this->system_list();
} else {
$this->message = $this->lang->line("MSG_NOT_UPDATED_SUCCESS");
}
} else {
$this->db->trans_start();
//DB Transaction Handle START
$data['created_by'] = $user->user_id;
$data['creation_date'] = time();
Query_helper::add($this->config->item('table_task'), $data);
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$this->system_list();
} else {
$this->message = $this->lang->line("MSG_NOT_SAVED_SUCCESS");
}
}
}
示例5: login
public function login()
{
$user = User_helper::get_user();
if ($user) {
$this->dashboard_page();
} else {
if ($this->input->post()) {
if (User_helper::login($this->input->post("username"), $this->input->post("password"))) {
$user = User_helper::get_user();
$user_info['user_id'] = $user->id;
$user_info['login_time'] = time();
$user_info['ip_address'] = $this->input->ip_address();
$user_info['request_headers'] = json_encode($this->input->request_headers());
Query_helper::add($this->config->item('table_user_login_history'), $user_info);
$this->dashboard_page($this->lang->line("MSG_LOGIN_SUCCESS"));
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_USERNAME_PASSWORD_INVALID");
$this->jsonReturn($ajax);
}
} else {
$this->login_page();
//login page view
}
}
}
示例6: system_save
private function system_save()
{
$user = User_helper::get_user();
$id = $this->input->post("id");
if ($id > 0) {
if (!$this->permissions['edit']) {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("YOU_DONT_HAVE_ACCESS");
$this->jsonReturn($ajax);
die;
}
} else {
if (!$this->permissions['add']) {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("YOU_DONT_HAVE_ACCESS");
$this->jsonReturn($ajax);
die;
}
}
if (!$this->check_validation()) {
$ajax['status'] = false;
$ajax['system_message'] = $this->message;
$this->jsonReturn($ajax);
} else {
if ($id > 0) {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
} else {
$data = array();
$user_id = $user->id;
$uisc_id = $user->uisc_id;
$data['uisc_id'] = $uisc_id;
$data['user_id'] = $user_id;
$data['question'] = $this->input->post('question');
$data['user_type'] = $this->input->post('user_group');
$data['create_by'] = $user_id;
$data['create_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::add($this->config->item('table_faqs'), $data);
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_CREATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_add();
} else {
$this->system_list();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_CREATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
}
示例7: dcms_index
private function dcms_index()
{
$user = User_helper::get_user();
$ajax['status'] = true;
$data['title'] = $this->lang->line("PERFORMANCE_REPORT_TITLE");
$ajax['system_content'][] = array("id" => "#system_wrapper_top_menu", "html" => $this->load_view("top_menu", "", true));
$ajax['system_content'][] = array("id" => "#system_wrapper", "html" => $this->load_view("report/performance/performance_report_list", $data, true));
$ajax['system_page_url'] = $this->get_encoded_url('report/performance/performance_report');
$this->jsonReturn($ajax);
}
示例8: index
public function index()
{
$user = User_helper::get_user();
$ajax['status'] = true;
$data['title'] = $this->lang->line("PROFILE_UPDATE_STATUS_REPORT");
$ajax['system_content'][] = array("id" => "#system_wrapper_top_menu", "html" => $this->load_view("top_menu", "", true));
$ajax['system_content'][] = array("id" => "#system_wrapper", "html" => $this->load_view("report/profile_update_status/profile_update_status_report", $data, true));
$ajax['system_page_url'] = $this->get_encoded_url('report/profile_update_status/profile_update_status_report');
$this->jsonReturn($ajax);
}
示例9: system_save
private function system_save()
{
$user = User_helper::get_user();
$id = $this->input->post("id");
if ($id > 0) {
if (!$this->permissions['edit']) {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("YOU_DONT_HAVE_ACCESS");
$this->jsonReturn($ajax);
die;
}
} else {
if (!$this->permissions['add']) {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("YOU_DONT_HAVE_ACCESS");
$this->jsonReturn($ajax);
die;
}
}
if (!$this->check_validation()) {
$ajax['status'] = false;
$ajax['system_message'] = $this->message;
$this->jsonReturn($ajax);
} else {
$userDetail = array();
$userDetail['ques_id'] = $this->input->post('ques_id');
$userDetail['ques_ans'] = $this->input->post('ques_ans');
if ($id > 0) {
$userDetail['update_by'] = $user->id;
$userDetail['update_date'] = time();
$this->db->trans_start();
//DB Transaction Handle START
Query_helper::update($this->config->item('table_users'), $userDetail, array("id = " . $id));
$this->db->trans_complete();
//DB Transaction Handle END
if ($this->db->trans_status() === TRUE) {
$this->message = $this->lang->line("MSG_UPDATE_SUCCESS");
$save_and_new = $this->input->post('system_save_new_status');
if ($save_and_new == 1) {
$this->system_edit();
} else {
$this->system_edit();
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
}
} else {
$ajax['status'] = false;
$ajax['system_message'] = $this->lang->line("MSG_UPDATE_FAIL");
$this->jsonReturn($ajax);
}
}
}
示例10: index
public function index()
{
$user = User_helper::get_user();
$data['divisions'] = array();
$data['display_divisions'] = false;
$data['default_divisions'] = true;
$data['zillas'] = array();
$data['display_zillas'] = false;
$data['default_zillas'] = true;
$data['upazilas'] = array();
$data['display_upazilas'] = false;
$data['default_upazilas'] = true;
$data['unions'] = array();
$data['display_unions'] = false;
$data['default_unions'] = true;
if ($user->user_group_id == $this->config->item('SUPER_ADMIN_GROUP_ID') || $user->user_group_id == $this->config->item('A_TO_I_GROUP_ID') || $user->user_group_id == $this->config->item('DONOR_GROUP_ID') || $user->user_group_id == $this->config->item('MINISTRY_GROUP_ID')) {
$data['divisions'] = Query_helper::get_info($this->config->item('table_divisions'), array('divid value', 'divname text'), array());
$data['display_divisions'] = true;
$data['default_divisions'] = true;
} else {
$data['divisions'] = Query_helper::get_info($this->config->item('table_divisions'), array('divid value', 'divname text'), array('divid =' . $user->division));
$data['display_divisions'] = true;
$data['default_divisions'] = false;
$data['display_zillas'] = true;
if ($user->user_group_id == $this->config->item('DIVISION_GROUP_ID')) {
$data['zillas'] = Query_helper::get_info($this->config->item('table_zillas'), array('zillaid value', 'zillaname text'), array('visible = 1', 'divid = ' . $user->division));
$data['default_zillas'] = true;
$data['display_upazilas'] = false;
} else {
$data['zillas'] = Query_helper::get_info($this->config->item('table_zillas'), array('zillaid value', 'zillaname text'), array('visible = 1', 'divid = ' . $user->division, 'zillaid =' . $user->zilla));
$data['default_zillas'] = false;
$data['display_upazilas'] = true;
if ($user->user_group_id == $this->config->item('DISTRICT_GROUP_ID')) {
$data['upazilas'] = Query_helper::get_info($this->config->item('table_upazilas'), array('upazilaid value', 'upazilaname text'), array('visible = 1', 'zillaid = ' . $user->zilla));
$data['default_upazilas'] = true;
//$data['display_unions']=true;
} else {
$data['upazilas'] = Query_helper::get_info($this->config->item('table_upazilas'), array('upazilaid value', 'upazilaname text'), array('visible = 1', 'zillaid = ' . $user->zilla, 'upazilaid = ' . $user->upazila));
$data['default_upazilas'] = false;
$data['display_unions'] = true;
$data['unions'] = Query_helper::get_info($this->config->item('table_unions'), array('unionid value', 'unionname text'), array('visible = 1', 'zillaid = ' . $user->zilla, 'upazilaid=' . $user->upazila));
$data['default_unions'] = true;
//TODO
//increase report menu for union users
}
}
}
$ajax['status'] = true;
$data['title'] = $this->lang->line("REPORT_UISC_REGISTRATION_TITLE");
$ajax['system_content'][] = array("id" => "#system_wrapper_top_menu", "html" => $this->load_view("top_menu", "", true));
$ajax['system_content'][] = array("id" => "#system_wrapper", "html" => $this->load_view("report/registered_union_list", $data, true));
$ajax['system_page_url'] = $this->get_encoded_url('report/registered_union_list');
$this->jsonReturn($ajax);
}
示例11: index
public function index()
{
$user = User_helper::get_user();
$data['divisions'] = array();
$data['display_divisions'] = false;
$data['default_divisions'] = true;
$data['zillas'] = array();
$data['display_zillas'] = false;
$data['default_zillas'] = true;
$data['municipal'] = array();
$data['display_city_corporation'] = false;
$data['default_city_corporation'] = true;
$data['city_corporation_ward'] = array();
$data['display_city_corporation_ward'] = false;
$data['default_city_corporation_ward'] = true;
if ($user->user_group_level == $this->config->item('SUPER_ADMIN_GROUP_ID') || $user->user_group_level == $this->config->item('A_TO_I_GROUP_ID') || $user->user_group_level == $this->config->item('DONOR_GROUP_ID') || $user->user_group_level == $this->config->item('MINISTRY_GROUP_ID')) {
$data['divisions'] = Query_helper::get_info($this->config->item('table_divisions'), array('divid value', 'divname text'), array());
$data['display_divisions'] = true;
$data['default_divisions'] = true;
} else {
$data['divisions'] = Query_helper::get_info($this->config->item('table_divisions'), array('divid value', 'divname text'), array('divid =' . $user->division));
$data['display_divisions'] = true;
$data['default_divisions'] = false;
$data['display_zillas'] = true;
if ($user->user_group_level == $this->config->item('DIVISION_GROUP_ID')) {
$data['zillas'] = Query_helper::get_info($this->config->item('table_zillas'), array('zillaid value', 'zillaname text'), array('visible = 1', 'divid = ' . $user->division));
$data['default_zillas'] = true;
$data['display_city_corporation'] = false;
} else {
$data['zillas'] = Query_helper::get_info($this->config->item('table_zillas'), array('zillaid value', 'zillaname text'), array('visible = 1', 'divid = ' . $user->division, 'zillaid =' . $user->zilla));
$data['default_zillas'] = false;
$data['display_city_corporation'] = true;
if ($user->user_group_level == $this->config->item('DISTRICT_GROUP_ID')) {
$data['city_corporations'] = Query_helper::get_info($this->config->item('table_city_corporations'), array('citycorporationid value', 'citycorporationname text'), array('visible = 1', 'zillaid = ' . $user->zilla, 'divid=' . $user->division));
$data['default_city_corporation'] = true;
//$data['display_unions']=true;
} else {
$data['city_corporations'] = Query_helper::get_info($this->config->item('table_city_corporations'), array('citycorporationid value', 'citycorporationname text'), array('visible = 1', 'zillaid = ' . $user->zilla, 'divid=' . $user->division, 'citycorporationid=' . $user->citycorporation));
$data['default_city_corporation'] = false;
$data['display_city_corporation_ward'] = true;
$data['city_corporation_words'] = Query_helper::get_info($this->config->item('table_city_corporation_wards'), array('citycorporationwardid value', 'wardname text'), array('visible = 1', 'zillaid = ' . $user->zilla, 'divid=' . $user->division, 'citycorporationid = ' . $user->citycorporation));
$data['default_city_corporation_ward'] = true;
//TODO
//increase report menu for union users
}
}
}
$ajax['status'] = true;
$data['title'] = $this->lang->line("REPORT_COUNTRY_WISE_CITY_CORPORATION_MONTHLY_INCOME_TITLE");
$ajax['system_content'][] = array("id" => "#system_wrapper_top_menu", "html" => $this->load_view("top_menu", "", true));
$ajax['system_content'][] = array("id" => "#system_wrapper", "html" => $this->load_view("report/country_wise_city_corporation_monthly_income_list", $data, true));
$ajax['system_page_url'] = $this->get_encoded_url('report/country_wise_city_corporation_monthly_income_list');
$this->jsonReturn($ajax);
}
示例12: index
public function index()
{
$user = User_helper::get_user();
$ajax['status'] = true;
$data['title'] = $this->lang->line("SERVICE_BASED_REPORT");
$ajax['system_content'][] = array("id" => "#system_wrapper_top_menu", "html" => $this->load_view("top_menu", "", true));
$data['services'] = $this->services_report_list_model->get_services();
$ajax['system_content'][] = array("id" => "#system_wrapper", "html" => $this->load_view("report/services/services_report_list", $data, true));
$ajax['system_page_url'] = $this->get_encoded_url('report/services/services_report_list');
$this->jsonReturn($ajax);
}
示例13: index
public function index()
{
$user = User_helper::get_user();
$data['divisions'] = array();
$data['display_divisions'] = false;
$data['default_divisions'] = true;
$data['zillas'] = array();
$data['display_zillas'] = false;
$data['default_zillas'] = true;
$data['municipal'] = array();
$data['display_municipal'] = false;
$data['default_municipal'] = true;
$data['municipal_ward'] = array();
$data['display_municipal_ward'] = false;
$data['default_municipal_ward'] = true;
if ($user->user_group_level == $this->config->item('SUPER_ADMIN_GROUP_ID') || $user->user_group_level == $this->config->item('A_TO_I_GROUP_ID') || $user->user_group_level == $this->config->item('DONOR_GROUP_ID') || $user->user_group_level == $this->config->item('MINISTRY_GROUP_ID')) {
$data['divisions'] = Query_helper::get_info($this->config->item('table_divisions'), array('divid value', 'divname text'), array());
$data['display_divisions'] = true;
$data['default_divisions'] = true;
} else {
$data['divisions'] = Query_helper::get_info($this->config->item('table_divisions'), array('divid value', 'divname text'), array('divid =' . $user->division));
$data['display_divisions'] = true;
$data['default_divisions'] = false;
$data['display_zillas'] = true;
if ($user->user_group_level == $this->config->item('DIVISION_GROUP_ID')) {
$data['zillas'] = Query_helper::get_info($this->config->item('table_zillas'), array('zillaid value', 'zillaname text'), array('visible = 1', 'divid = ' . $user->division));
$data['default_zillas'] = true;
$data['display_municipal'] = false;
} else {
$data['zillas'] = Query_helper::get_info($this->config->item('table_zillas'), array('zillaid value', 'zillaname text'), array('visible = 1', 'divid = ' . $user->division, 'zillaid =' . $user->zilla));
$data['default_zillas'] = false;
$data['display_municipal'] = true;
if ($user->user_group_level == $this->config->item('DISTRICT_GROUP_ID')) {
$data['municipals'] = Query_helper::get_info($this->config->item('table_municipals'), array('municipalid value', 'municipalname text'), array('visible = 1', 'zillaid = ' . $user->zilla));
$data['default_municipal'] = true;
//$data['display_unions']=true;
} else {
$data['municipals'] = Query_helper::get_info($this->config->item('table_municipals'), array('municipalid value', 'municipalname text'), array('visible = 1', 'zillaid = ' . $user->zilla, 'municipalid = ' . $user->municipal));
$data['default_municipal'] = false;
$data['display_municipal_ward'] = true;
$data['municipal_wards'] = Query_helper::get_info($this->config->item('table_municipal_wards'), array('wardid value', 'wardname text'), array('visible = 1', 'zillaid = ' . $user->zilla, 'municipalid = ' . $user->municipal));
$data['default_municipal_ward'] = true;
//TODO
//increase report menu for union users
}
}
}
$ajax['status'] = true;
//$data['title']=$this->lang->line("REPORT_CABINET_MUNICIPAL_SERVICE_HOLDER_INCOME_TITLE");
//$ajax['system_content'][]=array("id"=>"#system_wrapper_top_menu","html"=>$this->load_view("top_menu","",true));
$ajax['system_content'][] = array("id" => "#go_location", "html" => $this->load_view("report/cabinet/cabinet_municipal_service_holder_income_list", $data, true));
//$ajax['system_page_url']=$this->get_encoded_url('report/cabinet/cabinet_municipal_service_holder_income_list');
$this->jsonReturn($ajax);
}
示例14: get_user_services
public function get_user_services()
{
$user = User_helper::get_user();
$CI =& get_instance();
$this->db->select('uisc_id, service_id, user_id');
$this->db->from($CI->config->item('table_services_uisc'));
$this->db->where('user_id', $user->id);
$this->db->where('status', $this->config->item('STATUS_ACTIVE'));
$services = $this->db->get()->result_array();
return $services;
}
示例15: get_permission
public static function get_permission($controller_name)
{
$CI =& get_instance();
$user = User_helper::get_user();
$CI->db->from($CI->config->item('table_user_group_role') . ' ugr');
$CI->db->select('ugr.*');
$CI->db->join($CI->config->item('table_task') . ' task', 'task.id = ugr.task_id', 'INNER');
$CI->db->like("controller", $controller_name, "after");
$CI->db->where("user_group_id", $user->user_group_id);
$result = $CI->db->get()->row_array();
return $result;
}