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

class LapPark extends CI_Controller
{

	function __construct()
	{
		parent::__construct();
		check_not_login(); // kode akses login diambil dari helper
		$this->load->model(['Supl_m']);

		$this->load->library('form_validation');
	}

	public function index()
	{
		//	$data['lokcabID'] = $this->Lokcab_m->get();
		//	$data['rowx'] = $this->pesanbrg_m->getkasircek();
		$data['buysparepart'] = $this->Supl_m->buy_sparepartcek();
		$data['totpesbrgkasir'] = $this->Supl_m->gettotalpesbrgcabkasiraja();
		$this->template->load('template', 'lapPark', $data);
	}

	public function updateharbrg()
	{
		$post = $this->input->post(null, TRUE);
		$this->Supl_m->updateharbrg($post);
		if ($this->db->affected_rows() > 0) {
			$this->session->set_flashdata('success', 'Harga barang Berhasil Di Update');
		}
		redirect($_SERVER['HTTP_REFERER']);
	}
}
