<?php

class Pemanggil_obat extends CI_Controller {

	public function __construct()
	{
		parent::__construct();

		$this->load->model('pengaturan_model');
		$this->load->model('data_panggil_obat_model');
	}

	public function cek()
	{		
		$query = $this->data_panggil_obat_model->tabel_data();

		$jml = 1;

		if(empty($query)) $jml = 0;

		$data = array(
			'jumlah' => $jml,
			'data' => $query
		);

		echo json_encode($data);
	}

	public function add()
	{		
		$context = $this->input->post();

		$query = $this->data_panggil_obat_model->add_data($context);
		echo json_encode($query);
	}

	public function update_status()
	{		
		$context = $this->input->post();

		$query = $this->data_panggil_obat_model->update_status($context);
		echo json_encode($query);
	}
}

?>