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

class Printercategory extends MY_Controller {


 public function __construct()
    {
        parent::__construct();
        $this->load->database();
        $this->load->model('printer/printercategory_model');

     if(!isset($_SESSION['owner_id'])){
            header( "location: ".$this->base_url );
        }

    }
	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{


$data['tab'] = 'printercategory';
$data['title'] = 'Printer Category';
		$this->deshboardlayout('printer/printercategory',$data);
}






 function Update()
    {

$data = json_decode(file_get_contents("php://input"),true);
if(!isset($data)){
exit();
}

		$success = $this->printercategory_model->Update($data);

}



    function Get()
    {


 $list = $this->printercategory_model->Get();


		if($list)
		{
			echo '{ "list" : '.$list.'}';
		}
		else{
			echo 'no';
		}

}



   function Getcashier()
    {


 $list = $this->printercategory_model->Getcashier();

echo $list;

}



function Cashierprinteripupdate()
    {

$data = json_decode(file_get_contents("php://input"),true);
if(!isset($data)){
exit();
}

		$success = $this->printercategory_model->Cashierprinteripupdate($data);

}







function Update_kitchen()
   {

$data = json_decode(file_get_contents("php://input"),true);
if(!isset($data)){
exit();
}		

   $success = $this->printercategory_model->Update_kitchen($data);

}



   function Get_kitchen()
   {


$list = $this->printercategory_model->Get_kitchen();


   if($list)
   {
     echo '{ "list" : '.$list.'}';
   }
   else{
     echo 'no';
   }

}







	}
