<?php
ini_set("display_errors", 1);
error_reporting( E_ALL);
define("TRUCKINVENTORY_MODULE_DIR","./modules/truckinventory");
define("TRUCKINVENTORY_MODULE_DIR_ADMIN","../modules/truckinventory");

$action = $_REQUEST['a'];
$isAdmin = stripos($_SERVER['SCRIPT_NAME'],"/admin/")===false?false:true;

if($isAdmin && $action == "functions"){

	include_once(TRUCKINVENTORY_MODULE_DIR_ADMIN . '/truckinventory.functions.php');
}elseif($action == "functions"){
	include_once(TRUCKINVENTORY_MODULE_DIR . '/truckinventory.functions.php');
}
elseif($action == "admin.manage"){
	include_once(TRUCKINVENTORY_MODULE_DIR_ADMIN . '/truckinventory.admin.manage.php');
}elseif($action == "addToTruck"){
	include_once(TRUCKINVENTORY_MODULE_DIR_ADMIN . '/truckinventory.addToTruck.php');
}elseif($action == "viewTruckInventory"){
	include_once(TRUCKINVENTORY_MODULE_DIR_ADMIN . '/truckinventory.viewTruckInventory.php');
}

?>
