芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/breadwinnerv2/application/controllers/Dashboard.php
load->library("Aauth"); if (!$this->aauth->is_loggedin()) { redirect('/user/', 'refresh'); exit; } $this->load->model('dashboard_model'); $this->load->model('tools_model'); } public function index() { $today = date("Y-m-d"); $month = date("m"); $year = date("Y"); if ($this->aauth->get_user()->roleid > 3) { $data['todayin'] = $this->dashboard_model->todayInvoice($today); $data['todayitems'] = $this->dashboard_model->todayItems($today); $data['incomechart'] = $this->dashboard_model->incomeChart($today, $month, $year); $data['expensechart'] = $this->dashboard_model->expenseChart($today, $month, $year); $data['countmonthlychart'] = $this->dashboard_model->countmonthlyChart(); $data['monthin'] = $this->dashboard_model->monthlyInvoice($month, $year); $data['todaysales'] = $this->dashboard_model->todaySales($today); $data['monthsales'] = $this->dashboard_model->monthlySales($month, $year); $data['todayinexp'] = $this->dashboard_model->todayInexp($today); $data['recent_payments'] = $this->dashboard_model->recent_payments(); $data['tasks'] = $this->dashboard_model->tasks($this->aauth->get_user()->id); $data['recent'] = $this->dashboard_model->recentInvoices(); $data['goals'] = $this->tools_model->goals(1); $data['stock'] = $this->dashboard_model->stock(); $head['usernm'] = $this->aauth->get_user()->username; $head['title'] = 'Dashboard'; $this->load->view('fixed/header', $head); $this->load->view('dashboard', $data); $this->load->view('fixed/footer'); } else if ($this->aauth->get_user()->roleid == -1) { $this->load->model('projects_model', 'projects'); $head['usernm'] = $this->aauth->get_user()->username; $head['title'] = 'Project List'; $data['totalt'] = $this->projects->project_count_all(); $this->load->view('fixed/header', $head); $this->load->view('projects/index', $data); $this->load->view('fixed/footer'); } else if ($this->aauth->get_user()->roleid == 1) { $head['title'] = "Products"; $head['usernm'] = $this->aauth->get_user()->username; $this->load->view('fixed/header', $head); $this->load->view('products/products'); $this->load->view('fixed/footer'); } else { $head['title'] = "Manage Invoices"; $head['usernm'] = $this->aauth->get_user()->username; $this->load->view('fixed/header', $head); $this->load->view('invoices/invoices'); $this->load->view('fixed/footer'); } } }