<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Register extends Controller {
    
    	public function action_registration($cat=0){
		if(Auth::instance()->get_user()){
			Request::instance()->redirect("");
			//Request::instance()->redirect("main/act");
		}
		else{
		        $sales = ORM::factory("sale")->where('id','=',$cat)->find();
    
			//$data = array( );
			//$this->request->response = View::factory('product', $data);
			
			$department_model 	= Model::factory('department');
			$university_model 	= Model::factory('university');
			
			$universities_arr 	= $university_model->getUniversities();
			$departments_arr  	= $department_model->getDepartments();
			
			$data = array(
					"universities_arr" 	=> $universities_arr,
					"sales" => $sales,
					"departments_arr"	=> $departments_arr);
			$outerdata = array("data" => $data);
			$view = View::factory("register", $data);
			$this->request->response = $view;
		}
	}
        
        
}