<?php
defined('BASEPATH') OR exit('No direct script access allowed');
Class HeadingMaster Extends MY_Controller{
	function __construct()
	{
		parent::__construct();	
		$this->load->model('admin_api/HeadingMaster_model');
		$this->config->load('my_constants');
	}

	public function add_headingMaster()
	{
		$data['active_headingMaster'] = 'open';
		$data['title'] = 'headingMaster List';
		$data['header_title'] = 'headingMaster';
		$data['headingMaster_info'] = $this->HeadingMaster_model->get_headingMaster_list();
		//print_r($data['package_info']);exit();
		$data['main_content'] = 'admin/HeadingMaster/add_headingMaster';
        $this->load->view('admin/includes/template', $data);
	}

	
	
	public function save_headingMaster()
	{
		$post_data = $this->input->post();
			$query=$this->HeadingMaster_model->save_headingMaster($post_data);
			if($query){
				$this->session->set_flashdata('success_message', 'headingMaster Added successfully!');

				redirect('admin/HeadingMaster/add_headingMaster','refresh');
			}else{
				$this->session->set_flashdata('failure_message', 'You are fail to Add headingMaster!');
				redirect('admin/HeadingMaster/add_headingMaster','refresh');
			}
	}
	
	
		public function update_headingMaster()
	{
		$post_data = $this->input->post();
			$query=$this->HeadingMaster_model->update_headingMaster($post_data);
			if($query){
				$this->session->set_flashdata('success_message', 'Master Product Updated successfully!');

				redirect('admin/HeadingMaster/add_headingMaster','refresh');
			}else{
				$this->session->set_flashdata('failure_message', 'You are fail to Updated Master Product!');
				redirect('admin/HeadingMaster/add_headingMaster','refresh');
			}
	}

	public function delete_headingMaster($id=NULL)
	{
	
	//	$post_data = $this->input->post();
			$query=$this->HeadingMaster_model->delete_headingMaster($id);
			if($query){
				$this->session->set_flashdata('success_message', 'Master Product Deleted successfully!');

				redirect('admin/HeadingMaster/add_headingMaster','refresh');
			}else{
				$this->session->set_flashdata('failure_message', 'You are fail to Deleted Master Product!');
				redirect('admin/HeadingMaster/add_headingMaster','refresh');
			}
	}
	

}?>