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


class Basic_functions extends CI_Controller{
	
	
	public function __construct()
	{
		parent::__construct();
		
		$this->load->library(array('loginfunctions'));
		
		$this->load->model('Db_model') ;
	}

	//log out
	public function logout()
	{
		$this->loginfunctions->logout();
		
		redirect('Admin/') ;
	}
	
	//user log out
	public function user_logout()
	{
		$this->load->library('user_loginfunctions') ;
		
		$this->user_loginfunctions->logout();
		
		redirect('Customer/login/') ;
	}


	public function change_status($table,$field,$field_value,$id,$id_val,$target_controller,$target_function)
	{
		
		$this->Db_model->update($table,array($field=>$field_value),array($id=>$id_val));
		
		redirect($target_controller.'/'.$target_function);
		
	}
	
	

	
	

}
	