load->model('backend_model'); $in["action"] = WRENCHBOARD_SESSION_VERIFY; $in['sessionid'] = $_SESSION['session_id']; $in['member_id'] = $_SESSION['member_id']; $res = $this->backend_model->wrenchboard_api($in, $out); if ($res != PHP_API_OK) { redirect(home); } $this->data = $this->getSessionArray(); } public function getSessionArray() { $data["current_date"] = date('l jS \of F Y h:i:s A'); $data['username'] = $_SESSION['username']; // = $this->input->post('username'); $data['name'] = $_SESSION['name']; // = $this->input->post('username'); $data['firstname'] = $_SESSION['firstname']; // = $ret->firstname; $data['lastname'] = $_SESSION['lastname']; // = $ret->lastname; $data['email'] = $_SESSION['email']; // = $ret->email; $data['member_id'] = $_SESSION['member_id']; $this->load->model('dash_model'); $out = $this->dash_model->getDashData($data); $data['active_task'] = $out['active_task']; $data['active_pass_due'] = $out['active_pass_due']; $data['current_balance'] = $out['current_balance']; $data['new_message'] = $out['new_message']; $data['escrow_balance'] = $out['escrow_balance']; $data['description'] = $out["description"]; //$data = $_SESSION['secure_data']; $data['member_id'] = $_SESSION['member_id']; // = $ret->email; $_SESSION["active_offers_count"] = $out['active_offers_count']; $_SESSION["offers_interest_count"] = $out["offers_interest_count"]; $_SESSION['new_message'] = $out["new_message"]; $this->refreshAccountDetail($_SESSION['member_id']); return $data; } private function refreshAccountDetail($member_id) { $this->load->model('account_model'); $qr = $this->account_model->loadAccountData($member_id); // print_r($qr); $_SESSION['current_balance'] = $qr[0]['balance']; $_SESSION['active_task'] = $this->account_model->loadActiveTaskCount($member_id); $_SESSION['state'] = $qr[0]['state']; $_SESSION['city'] = $qr[0]['city']; $_SESSION['country'] = $qr[0]['country']; $_SESSION['post_jobs'] = $qr[0]['post_jobs']; $_SESSION['refer'] = $qr[0]['refer']; $in = array(); $in['action'] = WRENCHBOARD_SESSION_VERIFY; $in['sessionid'] = $_SESSION['session_id']; $in['member_id'] = $_SESSION['member_id']; $this->load->model('backend_model'); $out = array(); $res = $this->backend_model->wrenchboard_api($in, $out); if ($res != PHP_API_OK) { redirect(home); } } protected function RenderUserPage($page_name, $data) { $this->load->view('users/view_header_user', $data); $this->load->view($page_name, $data); $this->load->view('users/view_footer_user', $data); } }