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

class Service extends CI_Controller
{

public function get_services()
	{
		$this->load->model('Services_model');
		$this->load->library('Token');
		$productArray = [];
		$headers = $this->input->request_headers();

// 		if ($this->token->token_post($headers)) {

			if (is_null($this->Services_model->get_all_services()))
				$productArray = ['code' => '99', 'message' => 'No Services available!', 'data' => ''];
			else {
				$productArray = ['code' => '00', 'message' => 'All Services Retrieved', 'data' => $this->Services_model->get_all_services()];
			}
// 		} else
// 			$productArray = ['code' => '99', 'msg' => 'Unauthorized Access! [Invalid/Expired Token]'];

		header('Content-Type: application/json');
		echo json_encode($productArray);
	}

}
?>