<?php

define("INVOICE_MODULE_DIR","./modules/invoice");
define("INVOICE_MODULE_DIR_ADMIN","../modules/invoice");

$action = $_REQUEST['a'];
$isAdmin = stripos($_SERVER['SCRIPT_NAME'],"/admin/")===false?false:true;
$currentMode = $isAdmin?INVOICE_MODULE_DIR_ADMIN:INVOICE_MODULE_DIR;
if($isAdmin && $action == "functions"){
	
	include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.functions.php');
}elseif($action == "functions"){
	include_once(INVOICE_MODULE_DIR . '/invoice.functions.php');	
}elseif($action == "picking"){
	include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.picking.php');	
}elseif($isAdmin && $action == "view"){
	include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.view.php');	
}elseif(!$isAdmin && $action == "view"){
	include_once(INVOICE_MODULE_DIR . '/invoice.view.php');	
}elseif($action == "managerview"){
	include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.managerview.php');	
}elseif($action == "customerview"){
	include_once(INVOICE_MODULE_DIR . '/invoice.customerview.php');	
}elseif($action == "queue"){
	include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.queue.php');	
}elseif($action == "review"){
	//include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.functions.php');
	include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.review.php');	
}elseif($action == "history"){
	include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.history.php');	
}elseif($action == "salespersonhistory"){
	include_once(INVOICE_MODULE_DIR . '/invoice.salespersonhistory.php');	
}else{
	include_once(INVOICE_MODULE_DIR_ADMIN . '/invoice.' . $action . '.php');	
}


?>