whoami7 - Manager
:
/
home
/
papecmvm
/
public_html
/
documents
/
6204_Rajpara
/
2020
/
k_november
/
receipt
/
Upload File:
files >> //home/papecmvm/public_html/documents/6204_Rajpara/2020/k_november/receipt/Item.php.tar
home/papecmvm/public_html/application/controllers/webapp/master/Item.php 0000644 00000006311 14670346540 0022651 0 ustar 00 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Item 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['item'] = $this->model->getItemModel(); //echo "<pre>"; print_r ($data['item']); echo "</pre>"; die; $this->load->view("webapp/master/item/view_item", $data); } public function add() { if($this->input->post('save')=='save') { $data = array( 'cid'=>$this->input->post('cid'), 'gid'=>$this->input->post('gid'), 'uid'=>$this->input->post('uid'), 'item_name'=>$this->input->post('item_name'), 'hsn'=>$this->input->post('hsn') ); $this->model->insertData('tbl_item', $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/item'); }else{ $data['unit'] = $this->model->getDatamodel('tbl_unit'); $data['group'] = $this->model->getDatamodel('tbl_group'); $data['cat'] = $this->model->getDatamodel('tbl_item_cat'); $this->load->view("webapp/master/item/add_item", $data); } } public function edit($enc_id) { $id = $this->model->decryptdata($enc_id); if($this->input->post('save')=='save') { $data = array( 'cid'=>$this->input->post('cid'), 'gid'=>$this->input->post('gid'), 'uid'=>$this->input->post('uid'), 'item_name'=>$this->input->post('item_name'), 'hsn'=>$this->input->post('hsn') ); $where = array('id' => $enc_id); $this->model->UpdateData('tbl_item', $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/item'); }else{ $data['unit'] = $this->model->getDatamodel('tbl_unit'); $data['group'] = $this->model->getDatamodel('tbl_group'); $data['cat'] = $this->model->getDatamodel('tbl_item_cat'); $where = array('id' => $id); $data['item'] = $this->model->DetailData('tbl_item', $where); $this->load->view("webapp/master/item/add_item", $data); } } public function trash($enc_id) { $id = $this->model->decryptdata($enc_id); $where = array('id' => $id); $this->model->DeleteData('tbl_item', $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/item'); } }
Copyright ©2021 || Defacer Indonesia