<?php

define("MODULE_DIR","./modules/payment");
define("MODULE_DIR_ADMIN","../modules/payment");

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

if($isAdmin){
	define("CURRENT_MODULE_DIR","../modules/payment");


}else{
	define("CURRENT_MODULE_DIR","./modules/payment");


}
include_once(CURRENT_MODULE_DIR . '/payment.classes.php');
if(!$isAdmin && $action == "new"){
	include_once(MODULE_DIR . '/payment.new.php');
}elseif($action == "newmobile"){
	include_once(MODULE_DIR . '/payment.newmobile.php');
}
elseif($action == "aging"){
	include_once(MODULE_DIR . '/payment.aging.php');
}elseif($action == "completeaging"){
	include_once(MODULE_DIR_ADMIN . '/payment.completeaging.php');
}elseif($action == "completeagingbysalesman"){
	include_once(MODULE_DIR_ADMIN . '/payment.completeagingbysalesman.php');
}elseif($action == "view"){

	include_once(MODULE_DIR . '/payment.view.php');
}elseif($action == "viewReminder"){

	include_once(MODULE_DIR . '/payment.viewReminder.php');
}elseif($action == "viewStatement"){

	include_once(CURRENT_MODULE_DIR . '/payment.viewStatement.php');
}
elseif($action == "process"){
	include_once(MODULE_DIR . '/payment.process.php');
}elseif($action == "processReminder"){
	include_once(MODULE_DIR . '/payment.processReminder.php');
}
elseif($action == "receipt"){
	include_once(MODULE_DIR . '/payment.receipt.php');
}
elseif($action == "receiptReminder"){
	include_once(MODULE_DIR . '/payment.receiptReminder.php');
}
elseif($action == "printcheck"){
	include_once(MODULE_DIR . '/payment.printcheck.php');
}elseif($action == "paymenthistory"){
	include_once(MODULE_DIR . '/payment.paymenthistory.php');
}
elseif($isAdmin && $action == "functions"){
	include_once(MODULE_DIR_ADMIN . '/payment.functions.php');
}
elseif($isAdmin && $action == "new"){
	include_once(MODULE_DIR_ADMIN . '/payment.new.php');
}
elseif($isAdmin && $action == "newmobile"){

	include_once(MODULE_DIR_ADMIN . '/payment.newmobile.php');
}
elseif($action == "admin.paymenthistory"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.paymenthistory.php');
}elseif($action == "admin.viewpayment"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.viewpayment.php');
}elseif($action == "admin.viewpaymentReminder"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.viewpaymentReminder.php');
}elseif($action == "admin.cpdpayments"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.cpdpayments.php');
}elseif($isAdmin && $action == "functions"){
	include_once(MODULE_DIR_ADMIN . '/payment.functions.php');
}elseif($action == "functions"){
	include_once(MODULE_DIR . '/payment.functions.php');
}elseif($action == "pendingcredits"){
	include_once(MODULE_DIR_ADMIN . '/payment.pendingcredits.php');
}elseif($action == "paymentcashbox"){
	include_once(MODULE_DIR_ADMIN . '/payment.paymentcashbox.php');
}elseif($action == "createdeposit"){
	include_once(MODULE_DIR_ADMIN . '/payment.createdeposit.php');
}elseif($action == "viewdeposit"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.viewdeposit.php');
}elseif($action == "deposithistory"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.deposithistory.php');
}elseif($action == "createreconciliation"){
	include_once(MODULE_DIR_ADMIN . '/payment.createreconciliation.php');
}elseif($action == "admin.viewreconciliation"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.viewreconciliation.php');
}elseif($action == "admin.reconciliationhistory"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.reconciliationhistory.php');
}elseif($action == "admin.aging"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.aging.php');
}elseif($action == "admin.checksearch"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.checksearch.php');
}elseif($action == "salesmancompleteaging"){
	include_once(MODULE_DIR . '/payment.salesmancompleteaging.php');
}elseif($action == "statement"){
	//echo CURRENT_MODULE_DIR	;
	include_once(CURRENT_MODULE_DIR . '/payment.statement.php');
}elseif($action == "admin.paymentdetail"){
	include_once(MODULE_DIR_ADMIN . '/payment.admin.paymentdetail.php');
}elseif($action == "overdue"){
	//echo CURRENT_MODULE_DIR	;
	include_once(CURRENT_MODULE_DIR . '/payment.overdue.php');
}

?>
