/** * Update Credit Limit For Customer */ public function updateCreditLimit() { if (!isLoggedin()) { redirect($this->data["base_url"] . 'users/login'); } $userid = $this->uri->segment(3); $this->data["creditLimits"] = $this->user_model->getListOfCreditLimitsByCustID($userid); $this->data["roles"] = $this->user_model->getListOfRoles(); $this->data["currentUser"] = getLoggedinUser(); if (roleOfLoggedinUser() != 4) { $this->data['disabled'] = "disabled"; } else { $this->data['disabled'] = ''; } $this->data["user"] = $this->user_model->getUserDetailsByUserID($userid); if ($this->data["user"]->role_id != 2) { redirect($this->data["base_url"] . 'dashboard/'); } $this->data["profile"] = $this->user_model->getProfilesDetailsByUserID($userid); $this->data["zones"] = $this->user_model->getListOfZones(); $this->data["title"] = 'Update Credit Limit | ' . $this->data["user"]->username . " | Progati Creative Ltd"; $this->data["brands"] = $this->user_model->getListOfUsersByRoleId(1); $this->load->library('form_validation'); $this->form_validation->set_rules('brand_id', 'Brand Id', 'trim|callback_brand_selected'); $this->form_validation->set_rules('credit_limit', 'Credit Limit', 'trim|required|numeric'); $this->form_validation->set_rules('initial_balance', 'Initial Balance', 'trim|required|numeric'); $this->form_validation->set_error_delimiters('<div class="error text-red">', '</div>'); $this->data["action_status"] = $this->data["success_status"] = $this->data["error_status"] = FALSE; $this->data['brand_id'] = $this->input->post('brand_id'); $this->data['credit_limit'] = $this->input->post('credit_limit'); if ($this->form_validation->run() == FALSE) { $this->data["action_status"] = $this->session->flashdata("action_status"); $this->data["success_status"] = $this->session->flashdata("success_status"); $this->data["error_status"] = $this->session->flashdata("error_status"); $this->load->view('headers/update_profile_header', $this->data); $this->load->view('headers/common_header', $this->data); $this->load->view("dashboard/left_sidebar", $this->data); $this->load->view("users/update_credit_limit", $this->data); $this->load->view("footers/update_profile_footer", $this->data); } else { $data["customer_id"] = $userid; $data['company_id'] = $this->input->post('brand_id'); $data['credit_limit'] = $this->input->post('credit_limit'); $data['initial_balance'] = $this->input->post('initial_balance'); $response = $this->user_model->addCreditLimit($data); if ($response) { $this->session->set_flashdata("action_status", "Credit Limit has been updated successfully."); $this->session->set_flashdata("success_status", true); } else { $this->session->set_flashdata("action_status", "Something went wrong. Try again."); $this->session->set_flashdata("error_status", true); } redirect($this->data["base_url"] . "users/updateCreditLimit/" . $userid); } }
* @author Kevin Jardine <*****@*****.**> * @copyright Curverider Ltd 2008-2009 * @link http://elgg.org/ */ require_once dirname(dirname(__FILE__)) . '/openid_server_include.php'; require_once 'lib/common.php'; require_once 'lib/session.php'; $iframe_template = <<<END <iframe width="%s" height="%s" src="%s" > </iframe>'); END; $openid_url = getLoggedinUser(); $store = getOpenIDServerStore(); $sites = $store->getAutoLoginSites(); $request = getRequestInfo(); if ($request) { $return_url = $request->return_to; setRequestInfo(null); } else { $return_url = $CONFIG->wwwroot; } // TODO: get this to work with posts $iframes = ''; foreach ($sites as $site) { $iframes .= sprintf($iframe_template, $site->width, $site->height, sprintf($site->auto_login, $openid_url)); } $body = elgg_view("openid_server/forms/autologin", array('iframes' => $iframes, 'return_to' => $return_url));