<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Barang extends CI_Controller {
	public function __construct() {
		parent::__construct();
		cek_login();
		akses('admin');
	}

	public function data() {
		$conf = [
			'title' => 'Data Barang'
		];
		
		$this -> layout -> load('layout', 'barang/data/index', $conf);
	}

	public function barcode() {
		$conf = [
			'jml' => $_GET['jml'],
			'id'  => $_GET['id']
		];
		
		$this -> load -> view('barang/data/barcode_cetak', $conf);
	}

	public function kategori() {
		$conf = [
			'title' => 'Data Kategori'
		];
		
		$this -> layout -> load('layout', 'barang/kategori/index', $conf);
	}

	public function satuan() {
		$conf = [
			'title' => 'Data satuan'
		];
		
		$this -> layout -> load('layout', 'barang/satuan/index', $conf);
	}

	public function supplier() {
		$conf = [
			'title' => 'Data supplier'
		];
		
		$this -> layout -> load('layout', 'barang/supplier/index', $conf);
	}

	public function opname($aksi = '') {
		if($aksi == 'tambah') {
			$conf = [
				'title' => 'Tambah Stok Opname'
			];
			
			$this -> layout -> load('layout', 'barang/opname/tambah', $conf);

		} else {
			$conf = [
				'title' => 'Data Opname'
			];
			
			$this -> layout -> load('layout', 'barang/opname/data', $conf);
		}
	}

	function tes() {
		// $this -> db -> truncate('kategori');
		// $data = $this -> app -> get_barang_satuan(1);
		// echo '<pre>';
		// print_r($data);
		$this -> load -> view('barang/data/barcode_cetak');
	}
}

// Controller Barang
// Kode ini dibuat dan dikembangkan oleh codelingker