forked from opennode/opennode-whmcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
omsclientusage.php
31 lines (22 loc) · 1.28 KB
/
omsclientusage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require ("init.php");
require_once (dirname(__FILE__) . '/includes/hooks/inc/oms_config.php');
require_once (__DIR__ . '/Classes/Autoloader.php');
$ca = new WHMCS_ClientArea();
$ca -> setPageTitle("Resource consumption summary");
$ca -> addToBreadCrumb('index.php', $whmcs -> get_lang('globalsystemname'));
$ca -> addToBreadCrumb('oms_usage.php', 'OMS usage');
$ca -> initPage();
//get parameters
$user_id = mysql_real_escape_string($_GET['user_id']);
$clientId = $_SESSION['uid'];
global $product_core_name, $product_disk_name, $product_memory_name, $oms_usage_db, $whmcs_admin_user, $whmcs_admin_password, $whmcs_api_url, $oms_usage_db;
$whmcsDbService = new \Opennode\Whmcs\Service\WhmcsDbService();
$whmcsExternalService = new \Opennode\Whmcs\Service\WhmcsExternalService($whmcs_admin_user, $whmcs_admin_password, $whmcs_api_url, $oms_usage_db);
$omsReduction = new \Opennode\Whmcs\Service\OmsReductionService($product_core_name, $product_disk_name, $product_memory_name, $oms_usage_db, $whmcsExternalService, $whmcsDbService);
$confChanges = $omsReduction -> findClientConfChanges($clientId, null, null);
$parsedChanges = $omsReduction -> parseClientConfChanges($confChanges, $clientId);
$ca -> assign('omsconfs', $parsedChanges);
$ca -> setTemplate('omsclientusage');
$ca -> output();
?>