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

class Controller_Thesale extends Controller {

    public function action_sale()
    {
	if(!Auth::instance()->logged_in()){
	    Request::instance()->redirect("");
	}
	
	$category_model = Model::factory('category');
	$categories_arr	= $category_model->getCategories();
	
	if($_POST)
	{
	    
	    $sale_model = Model::factory('sale');
	    $sale_model->createSale($_POST);
	}
	$data = array("categories_arr" => $categories_arr);
	$view = View::factory("sale",$data);
	$this->request->response = $view;
    }	

} 