public function index() { $this->load->view('layout/header'); $error = $this->session->flashdata('message'); $this->load->view('element/message', ['success' => $error]); $viewData = []; $response = $this->moneyzaurus->userData(); if ($response['code'] == 200 && $response['data']['success']) { $viewData['data'] = $response['data']['data']; } $parent = false; $response = $this->moneyzaurus->connectionList($parent); if ($response['code'] == 200) { $viewData['connections_child'] = $response['data']['data']; } $parent = true; $response = $this->moneyzaurus->connectionList($parent); if ($response['code'] == 200) { $viewData['connections_parent'] = $response['data']['data']; } $this->load->view('page/profile', $viewData); $this->load->view('page/connections', $viewData); $this->load->view('page/logout', $viewData); $this->load->view('layout/footer'); }
public function index() { $this->load->view('layout/header'); $error = $this->session->flashdata('message'); $this->load->view('element/message', ['success' => $error]); $filter = $this->input->get(['from', 'till', 'groups']); $from = $filter['from'] ?: date('Y-m-01', strtotime('-1 month')); $till = $filter['till'] ?: date('Y-m-t'); $responseData = []; $step = 500; $offset = 0; do { $response = $this->moneyzaurus->transactionsList($offset, $step, $from, $till, null, null, null); if ($response['code'] == 200 && $response['data']['success']) { $count = $response['data']['count']; $responseData = array_merge($responseData, $response['data']['data']); $offset += $step; } else { break; } } while ($count >= $step); $filterGroups = $filter['groups'] ?: []; $data = $this->prepareChartData($responseData, $filterGroups, $from, $till); $this->load->view('page/chart', ['data' => $data, 'from' => $from, 'till' => $till]); $this->load->view('layout/footer'); }
public function index() { $this->load->library('prediction'); $money = $this->input->get('money'); $date = $this->input->get('date'); $months = $this->input->get('months'); $data = $this->prediction->setTransactions($this->getAllTransactions($months ?: 3))->getData($money, $date); $this->load->view('layout/header'); $error = $this->session->flashdata('message'); $this->load->view('element/message', ['success' => $error]); $this->load->view('page/manager', $data); $this->load->view('layout/footer'); }
public function index() { $this->load->view('layout/header'); $error = $this->session->flashdata('message'); $id = $this->input->get('id'); if (!empty($id)) { $response = $this->moneyzaurus->transactionsId($id); if ($response['code'] != 200 || !$response['data']['success']) { $error = $response['data']['message']; } else { $data = $response['data']['data']; $get = ['id' => $data['id'], 'item' => $data['itemName'], 'group' => $data['groupName'], 'price' => $data['price'], 'date' => $data['date']]; } } else { $get = $this->input->get(['id', 'item', 'group', 'price', 'date']); } $response = $this->moneyzaurus->distinctItems('2000-01-01', 9999); if ($response['code'] != 200 || !$response['data']['success']) { $error = $response['data']['message']; $items = []; } else { $items = $response['data']['data']; } $response = $this->moneyzaurus->distinctGroups('2000-01-01', 9999); if ($response['code'] != 200 || !$response['data']['success']) { $error = $response['data']['message']; $groups = []; } else { $groups = $response['data']['data']; } $this->load->view('element/message', ['errors' => $error]); $data = ['id' => $id, 'item' => '', 'group' => '', 'price' => '', 'date' => empty($get['date']) ? date('Y-m-d') : $get['date']]; if (empty($get['date'])) { unset($get['date']); } $success = $this->input->get('success'); if (!$success) { $error = $this->session->flashdata('message'); $this->load->view('element/message', ['errors' => $error]); } else { $this->load->view('element/message', ['success' => 'Saved']); } $data = array_merge($data, $get); $data['distinct_items'] = $items; $data['distinct_groups'] = $groups; $this->load->view('page/transaction', $data); $this->load->view('layout/footer'); }
public function index() { $this->load->view('layout/header'); $error = $this->session->flashdata('message'); $this->load->view('element/message', ['success' => $error]); $offset = 0; $limit = 100; $filter = $this->input->get(['item', 'group', 'price', 'from', 'till']); $response = $this->moneyzaurus->transactionsList($offset, $limit, $filter['from'], $filter['till'], $filter['item'], $filter['group'], $filter['price'] * 100); if ($response['code'] == 200) { if ($response['data']['success']) { $this->load->view('page/data', ['count' => $response['data']['count'], 'data' => $response['data']['data'], 'filter' => $filter]); } } $this->load->view('layout/footer'); }
public function index() { $this->load->view('layout/header'); $token = $this->user->findToken(); if (!empty($token)) { $this->moneyzaurus->setToken($token); $data = $this->moneyzaurus->userData(); if ($data['code'] == 200) { if (!empty($data['data']['data']['id'])) { $this->load->helper('url'); redirect('/transaction'); } } } $error = $this->session->flashdata('message'); $success = $this->session->flashdata('success'); $this->load->view('element/message', ['errors' => $error, 'success' => $success]); $this->load->view('page/welcome'); $this->load->view('layout/footer'); }
/** * Fetch a specific flashdata item from the session array * * @access public * @param string * @return string */ function flashdata($key) { if ($this->is_custom_session) { return $this->session_driver->flashdata($key); } else { return parent::flashdata($key); } }