whoami7 - Manager
:
/
home
/
papecmvm
/
public_html
/
application
/
controllers
/
webapp
/
master
/
Upload File:
files >> //home/papecmvm/public_html/application/controllers/webapp/master/Expense.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Expense extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('app', "model"); $CI = & get_instance(); $this->db = $CI->load->database('default', TRUE); $this->db2 = $CI->load->database('db2', TRUE); } public function index() { //$data['expense'] = $this->model->getDatamodel('tbl_expense'); $this->db2->from('tbl_expense'); $this->db2->order_by("eid", "DESC"); $data['expense'] = $this->db2->get()->result_array(); $this->load->view("webapp/master/expense/view", $data); } public function add() { if($this->input->post('save')=='save') { $data = array('ename'=>$this->input->post('ename')); $this->model->insertData('tbl_expense', $data); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Data has been Inserted. </div>'); redirect('webapp/master/expense'); }else{ $this->load->view("webapp/master/expense/add"); } } public function edit($enc_id) { $eid = $this->model->decryptdata($enc_id); if($this->input->post('save')=='save') { $data = array('ename'=>$this->input->post('ename')); $where = array('eid' => $enc_id); $this->model->UpdateData('tbl_expense', $data, $where); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Data has been Uploaded. </div>'); redirect('webapp/master/expense'); }else{ $where = array('eid' => $eid); $data['expense'] = $this->model->DetailData('tbl_expense', $where); $this->load->view("webapp/master/expense/add", $data); } } public function trash($enc_id) { $eid = $this->model->decryptdata($enc_id); $where = array('eid' => $eid); $this->model->DeleteData('tbl_expense', $where); $this->session->set_flashdata('msg', ' <div class="alert alert-success alert-dismissible" role="alert"> <button type="button" class="close" data-dismiss="alert" aria-label="Close"> <span aria-hidden="true">×</span></button> <strong>Success!</strong> Data has been Deleted. </div>'); redirect('webapp/master/expense'); } }
Copyright ©2021 || Defacer Indonesia