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

require_once(str_replace("\\","/",APPPATH).'helpers/Secure_area_adm.php');
class Kasir extends Secure_area_adm {

	public function __construct()
	{
		parent::__construct();
		$data['jenis_page'] = "front_office/";
		$data['controller_dir'] = 'kasir_dir/';
		$data['controller'] = 'kasir';
		$data['parent_controller'] = 'kasir';
		$data['active'] = 'kasir';
		//$data['smt_aktif'] = $this->db->get_where('pddikti_re_semester',array('a_smt_aktif'=>'1'))->row();
		$this->load->vars($data);
	}

	public function index()
	{
		//echo $this->session->userdata('id_cabang');
		//echo $this->session->userdata('userid');
		$data['judul'] ='Kasir';
		$data['page']  ='kasir/master';
		$data['desc_judul'] ='Menampilkan dan Mengelola Data Kasir';

		$data['breadcumb'][] = array('icon'=>'money',
																 'link'=>'',
																 'judul'=>'Kasir');

		//echo $this->session->userdata('userid');
		$this->load->view('template',$data);    
	}
	
	public function manual_posting() 
	{
		$data['judul'] = 'Manual Posting Transaksi';
		$data['desc_judul'] = 'Menambahkan Data Biaya Perawatan Pasien';
		$data['page'] = 'kasir/manual_posting';

		$data['breadcumb'][]=array('icon'=>'money',
												 			 'link'=>site_url('front_office/kasir_dir/kasir'),
															 'judul'=>'Kasir');

		$data['breadcumb'][]=array('icon'=>'plus',
															 'link'=>'',
															 'judul'=>$data['judul']);

		$this->db->select('id_agama as id, nm_agama text');
		$this->db->where('id_agama!=', '98');
		$this->db->where('deleted','0');
		$data['agama']=json_encode($this->db->get('pddikti_re_agama')->result());		

		$this->db->select('id_pekerjaan as id, nm_pekerjaan text');
		$this->db->where('deleted','0');
		$data['pekerjaan']=json_encode($this->db->get('pddikti_re_pekerjaan')->result());

		$this->db->select('id_jenj_didik as id, nm_jenj_didik text');
		$this->db->where('deleted','0');
		$data['pendidikan']=json_encode($this->db->get('pddikti_re_jenjang_pendidikan')->result());		

		$this->load->view('template',$data);
	}

	public function edit_data()
	{
		$data['judul'] = 'Edit Posting Transaksi';
		$data['desc_judul'] = 'Mengubah Data Biaya Perawatan Pasien';
		$data['page'] = 'kasir/edit_posting';

		$data['breadcumb'][]=array('icon'=>'money',
                               'link'=>site_url('front_office/kasir_dir/kasir'),												 			 
															 'judul'=>'Kasir');

		$data['breadcumb'][]=array('icon'=>'edit',
															 'link'=>'',
															 'judul'=>$data['judul']);													 

		$this->db->select('id_agama as id, nm_agama text');
		$this->db->where('id_agama!=', '98');
		$this->db->where('deleted','0');
		$data['agama']=json_encode($this->db->get('pddikti_re_agama')->result());		

		$this->db->select('id_pekerjaan as id, nm_pekerjaan text');
		$this->db->where('deleted','0');
		$data['pekerjaan']=json_encode($this->db->get('pddikti_re_pekerjaan')->result());

		$this->db->select('id_jenj_didik as id, nm_jenj_didik text');
		$this->db->where('deleted','0');
		$data['pendidikan']=json_encode($this->db->get('pddikti_re_jenjang_pendidikan')->result());		

		$this->load->view('template',$data);		
	}
  
}