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

class Add_special_discount_offer extends CI_Controller {

	
	public function __construct()
        {
                parent::__construct();
                $this->load->library('session');
                $this->load->model('admin/Add_special_discount_offer_model');
                if(!isset($_SESSION['admin'])){redirect('admin/Login');}
        }

	

	public function index()
	{
		$data['data'] = $this->Add_special_discount_offer_model->get_all();
		$this->load->view('admin/header');
		$this->load->view('admin/add-special-discount-offer', $data);
		$this->load->view('admin/footer');
	}

	public function insert()
	{
		// $slug = preg_replace('/[^a-z0-9]+/i', '-', trim(strtolower($patr)));
		$data = $this->Add_special_discount_offer_model->db_insert();
		if($data == 1){
			$this->session->set_flashdata("success"," Data sucessfully Saved.");
				redirect('admin/Add_special_discount_offer');
		}else{
			$this->session->set_flashdata("error"," Data Not Insert.");
				redirect('admin/Add_special_discount_offer');
		}
	}

	
}
