<?php

	

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

	require_once APPPATH."controllers/Secure_area.php";



	class Master extends Secure_area {

		

		function __construct() {

			// Call the Model constructor

			parent::__construct();

			$this->load->database();

			$this->load->model('CategoryModel');

			$this->load->model('MasterModel');

			$this->load->model('ServiceModel');

			$this->load->model('CustomerModel');

			$this->load->helper('url');

			$this->load->library('parser');

		}

		

		public function index() {

			

		}

		

		

		

	

	public function notifications() {

		$notify_data = $this->MasterModel->getorders_notify();

			$data['notify_list'] = $notify_data;

			//print_R($data['notify_list'] );

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

			

			

	}	

	public function notifications_count() {

		$notify_data = $this->MasterModel->getorders_notify();

			$data['notify_list'] = $notify_data;

		echo count($data['notify_list']);

			

	}

	

		public function save_pincode() {

			$area_name = $this->input->post("area_name");

			$pincode = $this->input->post('pincode');

			

			

			

			$pincode_id = $this->input->post('pincode_id');

			if ($this->input->post('add')) {

					$cat_button = 'add';

				} 

				else if ($this->input->post('update')) {

				$cat_button = 'update';

			}

			$res = $this->MasterModel->insert_pincode($area_name,$pincode,$cat_button,$pincode_id);

		}

		

	

		

		public function myformAjax() { 

			$id = $this->input->post("cat_id");

			

			$data['sub_cat_data'] = $this->MasterModel->get_subcat_data($id);



			$this->load->view('planView/get_sub_cat_data', $data);

			

		}

		

	

			public function edit_pincode($id) {

			$pincodelist = $this->MasterModel->getpincodes();

			$data['pincodeList'] = $pincodelist;

			$list = $this->MasterModel->edit_pincode($id);

			$data['edit_data']=$list;

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

		}

			

	

		public function view_category($id) {

			$data['view_category'] = $this->CategoryModel->view_category($id);

			$this->load->view('categoryView/view_category', $data, FALSE);

		}

		

		public function delete_category($id) {

			$t=$this->CategoryModel->delete_category($id);

			$categorylist = $this->CategoryModel->getcategories();

			$data['category_list'] = $categorylist;

			

			$this->load->view('categoryView/category', $data);

		}	

		public function active_pincode($id) {

			$t=$this->MasterModel->activedeactive_pincode($id);

			$categorylist = $this->CategoryModel->getcategories();

			

		$pincodelist = $this->MasterModel->getpincodes();

			$data['pincodeList'] = $pincodelist;

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

		}	

		public function delete_vendor_enq($id) {

			$t=$this->MasterModel->delete_vendor_enq($id);

			$vendor_list = $this->MasterModel->getVendorsEnquires();

			$data['vendor_list'] = $vendor_list;

			

			$this->load->view('vendorView/vendorsEnquiry',$data);

		}

		public function approve_vendor_enq($id) {

			$t=$this->MasterModel->approve_vendor_enq($id);

			$vendor_list = $this->MasterModel->getVendorsEnquires();

			$data['vendor_list'] = $vendor_list;

			

			$this->load->view('vendorView/vendorsEnquiry',$data);

		}		

	}

	

?>

