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

require_once(str_replace("\\","/",APPPATH).'helpers/Secure_area_adm.php');
class Request_note extends Secure_area_adm {
	public function __construct()
	{
		parent::__construct();
		$this->load->model('M_general');


        $data['jenis_page'] = "front_office/";
		$data['controller_dir'] = 'request_note/';
		$data['controller'] = 'rekam_medis';
		$data['parent_controller'] = 'rekam_medis';


        $this->load->vars($data);
	}
	
	public function index()
	{
		$data['active']='pengajuan';
		$data['judul']='Amprahan';
		$data['title'] = 'Pengajuan ';
		$data['desc_judul']='Menampilkan semua pengajuan';
		$data['page'] = 'request_note/send_req_index';
		$data['tgl'] = isset($_POST['tgl']) ? $_POST['tgl'] : date('Y-m-d');
		$data['breadcumb'][]=array('icon'=>'unlock',
        									'link'=>'',
        									'judul'=>'Transaksi');
		
		
		$this->load->view('template',$data);
	}



	public function setujui($id)
	{
		$data=array(
		  	'approve'=>'1',
		  	'date_approve'=>date('Y-m-d')
		);
		
		if($this->M_general->update_db_custom('bbmc_tr_amprahan_request_new', 'id_amprahan_request_new',$id, $data)==true)
		{
			$this->M_general->msg_box('success','Data berhasil di setujui');			
		}
		else {
			$this->M_general->msg_box('error','Ooops... Terjadi Kesalahan... Silahkan hubungi admin...');
		}

		redirect('request_note');
	}


	
}
