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

class Event_data extends CI_Controller {
	public function __construct(){
		parent::__construct();
		$this->load->model('common_model');
		$this->load->model('users_model');
		if(get_cookie('admin_id'))
		{
			$this->session->set_userdata('admin_id',get_cookie('admin_id'));
		}
		if(!$this->session->userdata('admin_id'))
		{
			redirect('admin/login');
		}
	}
	public function postponed($enc_userID='',$status='')
	{
		if($enc_userID!='')
		{
			$eventId=base64_decode($enc_userID);
			if($status==1)
			{
				$newstatus = 1;
			}
			else
			{
				$newstatus = 0;
			}
			$this->common_model->UpdateData('evt_events',array('is_postponed'=>$newstatus),array('id'=>$eventId));
			$this->utility->setMsg('Event postponed status changed','SUCCESS');	
			redirect(base_url().'admin/event');
		}
		else
		{
			$this->utility->setMsg('Invalid id','ERROR');	
			redirect(base_url().'admin/event');
		}
	}
}