public function bankaccount() { $bankData = array('bank_name' => $this->input->post('bank_name'), 'value' => $this->input->post('value')); $update = new \Models\Update(); $update->bankData($bankData); // $profile = new \Models\Update(); // // $this->view->blogData = $blog->getBlogData(); // if (!$_POST["data"]) { // echo "Invalid data"; //// exit; // } // $data = json_decode($_POST["data"]); // foreach ($data->items as $item) { // $col_id = preg_replace('/[^\d\s]/', '', $item->column); // // $panel_id = preg_replace('/[^\d\s]/', '', $item->panel_id); // // $this->db->prepare("UPDATE panels SET column_id=?, sort_no=?, collapsed=? WHERE panel_id=? AND blog_id=?", array($col_id, $item->order, $item->collapsed, $panel_id, $this->view->blogData['blog_id']))->execute(); // } // echo "success"; }
public function profile() { $select = new \Models\Select(); $this->view->profile = $select->getProfile(); if ($this->input->post('salary_wage') == 'true') { $data = array('salary' => $this->input->post('salary'), 'wage' => $this->input->post('wage')); $update = new \Models\Update(); $update->userSalary($data); } if ($this->input->post('bank') == 'true') { $bankData = array('bank_name' => $this->input->post('bank_name'), 'value' => $this->input->post('value')); $update = new \Models\Update(); $update->bankData($bankData); } if ($this->input->post('cash') == 'true') { $cashData = array('bank_name' => 'cash', 'value' => $this->input->post('value')); $update = new \Models\Update(); $update->cashMoney($cashData); } if ($this->input->post('bills') == 'true') { $billsData = array('food' => $this->input->post('food'), 'household' => $this->input->post('household')); $update = new \Models\Update(); $update->userBills($billsData); } $select = new \Models\Select(); $profile = $select->getProfile(); $this->view->profile = $profile; $money = $select->getMoney(); $this->view->money = $money; $managebudgets = new \Models\Managebudgets(); $budgets = $managebudgets->getBudgets(); $this->view->appendToLayout('sidebar', 'index.sidebar'); $this->view->appendToLayout('mainpanel', 'index.mainpanel'); $this->view->appendToLayout('userprofile', 'index.userprofile'); $this->view->appendToLayout('footer', 'index.footer'); $this->view->display('index_in'); }