芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/www/breadwinnerv2/application/controllers/Accounts.php
load->model('accounts_model', 'accounts'); $this->load->library("Aauth"); if (!$this->aauth->is_loggedin()) { redirect('/user/', 'refresh'); } if ($this->aauth->get_user()->roleid < 4) { exit('
Sorry! You have insufficient permissions to access this section
'); } } public function index() { $data['accounts'] = $this->accounts->accountslist(); $head['usernm'] = $this->aauth->get_user()->username; $head['title'] = 'Accounts'; $this->load->view('fixed/header', $head); $this->load->view('accounts/list', $data); $this->load->view('fixed/footer'); } public function view() { $acid = $this->input->get('id',true); $data['account'] = $this->accounts->details($acid); $head['usernm'] = $this->aauth->get_user()->username; $head['title'] = 'View Account'; $this->load->view('fixed/header', $head); $this->load->view('accounts/view', $data); $this->load->view('fixed/footer'); } public function add() { $head['usernm'] = $this->aauth->get_user()->username; $head['title'] = 'Add Account'; $this->load->view('fixed/header', $head); $this->load->view('accounts/add'); $this->load->view('fixed/footer'); } public function addacc() { $accno = $this->input->post('accno',true); $holder = $this->input->post('holder',true); $intbal = $this->input->post('intbal',true); $acode = $this->input->post('acode',true); if ($accno) { $this->accounts->addnew($accno, $holder, $intbal, $acode); } } public function delete_i() { $id = $this->input->post('deleteid',true); if ($id) { $this->db->delete('accounts', array('id' => $id)); echo json_encode(array('status' => 'Success', 'message' => $this->lang->line('ACC_DELETED'))); } else { echo json_encode(array('status' => 'Error', 'message' => $this->lang->line('ERROR'))); } } //view for edit public function edit() { $catid = $this->input->get('id',true); $this->db->select('*'); $this->db->from('accounts'); $this->db->where('id', $catid); $query = $this->db->get(); $data['account'] = $query->row_array(); $head['usernm'] = $this->aauth->get_user()->username; $head['title'] = 'Edit Account'; $this->load->view('fixed/header', $head); $this->load->view('accounts/edit', $data); $this->load->view('fixed/footer'); } public function editacc() { $acid = $this->input->post('acid',true); $accno = $this->input->post('accno',true); $holder = $this->input->post('holder',true); $acode = $this->input->post('acode',true); if ($acid) { $this->accounts->edit($acid, $accno, $holder, $acode); } } public function balancesheet() { $head['title'] = "Balance Summary"; $head['usernm'] = $this->aauth->get_user()->username; $data['accounts'] = $this->accounts->accountslist(); $this->load->view('fixed/header', $head); $this->load->view('transactions/balance', $data); $this->load->view('fixed/footer'); } public function account_stats() { $this->accounts->account_stats(); } }