<?php 
class MembershipController extends AppController{
var $name = 'Membership';
var $uses = array('Member');
var $helpers = array('Form', 'Html', 'Text','Javascript', 'Time', 'Number','Paginator','Cache','Ajax', 'Session');
var $components=array('RequestHandler');

//------------------------------MEMBERS BEGIN --------------------------------------
function index(){
		$this->paginate['limit'] = 50;
   		$this->paginate['order'] = array('date' => 'desc');
   		//$this->paginate['fields'] = array('title','status','date','id');
		$this->set('main_categories', $this->paginate('Member'));
	}

function disable_member($id=null){
	$this->Member->updateAll(array('status'=>'1'),array('id'=>$id));
	$this->paginate['limit'] = 50;
   	$this->paginate['order'] = array('date' => 'desc');
	$this->set('main_categories', $this->paginate('Member'));
   	$this->render('index');
}

function enable_member($id=null){
	$this->Member->updateAll(array('status'=>'0'),array('id'=>$id));
	$this->paginate['limit'] = 50;
   	$this->paginate['order'] = array('date' => 'desc');
	$this->set('main_categories', $this->paginate('Member'));
   	$this->render('index');
}

function view_enable_members(){
		$this->paginate['limit'] = 50;
   		$this->paginate['order'] = array('date' => 'desc');
   		//$this->paginate['fields'] = array('title','date','status','id');
		$this->paginate['conditions']= array('status'=>'1');
		$this->set('status','1');
   		$this->set('main_categories', $this->paginate('Member'));
		$this->render('index');
		
	}
	
function view_disable_members(){
		$this->paginate['limit'] = 50;
   		$this->paginate['order'] = array('date' => 'desc');
   		//$this->paginate['fields'] = array('title','date','status','id');
		$this->paginate['conditions']= array('status'=>'0');
		$this->set('status','0');
   		$this->set('main_categories', $this->paginate('Member'));
		$this->render('index');
		
	}
	
function view_details($id=null){
	$data=$this->Member->find('all',array('conditions'=>array('id'=>$id)));
	$this->set(compact('data'));
	
}

//---------------------------MEMBER END ------------------------------------------------------------------------------	


}
?>