whoami7 - Manager
:
/
home
/
papecmvm
/
public_html
/
application
/
controllers
/
webapp
/
master
/
Upload File:
files >> //home/papecmvm/public_html/application/controllers/webapp/master/Tax.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Tax 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['tax'] = $this->model->getDatamodel('tbl_tax'); $this->load->view("webapp/master/tax/view", $data); } public function add() { if($this->input->post('save')=='save') { $sgst = implode('|', $this->input->post('sgst')); $cgst = implode('|', $this->input->post('cgst')); $ugst = implode('|', $this->input->post('ugst')); $igst = implode('|', $this->input->post('igst')); $data = array( 'sgst'=>$sgst, 'cgst'=>$cgst, 'ugst'=>$ugst, 'igst'=>$igst ); $this->model->insertData('tbl_tax', $data); redirect('webapp/master/tax'); }else{ $this->load->view("webapp/master/tax/add"); } } public function edit() { if($this->input->post('save')=='save') { $sgst = implode('|', array_filter($this->input->post('sgst'))); $cgst = implode('|', array_filter($this->input->post('cgst'))); $ugst = implode('|', array_filter($this->input->post('ugst'))); $igst = implode('|', array_filter($this->input->post('igst'))); $data = array( 'sgst'=>$sgst, 'cgst'=>$cgst, 'ugst'=>$ugst, 'igst'=>$igst ); $where = array('id' => '1'); $this->model->UpdateData('tbl_tax', $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> Tax has been updated. </div>'); redirect('webapp/master/tax'); }else{ $data['tax'] = $this->model->getDatamodel('tbl_tax'); $this->load->view("webapp/master/tax/add", $data); } } }
Copyright ©2021 || Defacer Indonesia