<?php

define("COMMISSION_MODULE_DIR","./modules/commission");
define("COMMISSION_MODULE_DIR_ADMIN","../modules/commission");

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

if($isAdmin){

	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.classes.php');
	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.functions.php');
	if($action == "functions"){
		include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.functions.php');
	}


}else{

	include_once(COMMISSION_MODULE_DIR . '/commission.classes.php');
	if($action == "functions"){
		include_once(COMMISSION_MODULE_DIR . '/commission.functions.php');
	}
}

if($action == "import"){
	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.import.php');
}elseif($action == "import_csv"){
	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.import_csv.php');
}
elseif($action == "workingpanel"){
	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.workingpanel.php');
}
elseif($action == "viewresult"){
	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.viewresult.php');
}
elseif($action == "report"){
	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.report.php');
}
elseif($action == "salesmanreport"){
	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.salesmanreport.php');
}
elseif($action == "viewhistory"){

	include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.viewhistory.php');
}
elseif($action == "functions"){
	//include_once(COMMISSION_MODULE_DIR_ADMIN . '/commission.functions.php');
}
?>
