Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by http://DeZender.Net
- * @ deZender (PHP7 Decoder for ionCube Encoder)
- *
- * @ Version : 4.1.0.1
- * @ Author : DeZender
- * @ Release on : 29.08.2020
- * @ Official site : http://DeZender.Net
- *
- */
- namespace EdgeHosting;
- function xero_output($vars)
- {
- if (!\WHMCS\Database\Capsule::table('mod_xero')->get()) {
- if (!$_GET['install'] && !$_GET['sync']) {
- return include __DIR__ . '/install.phtml';
- }
- else if ($_GET['install']) {
- install_defaults();
- }
- }
- try {
- $whmcsxero = new WHMCSXero(getXeroRedirectUri());
- if (isset($_POST['updatesettings'])) {
- $gatewayfields = [];
- $gatewayfees = [];
- $gatewayfeesex = [];
- $groupfields = [];
- $taxratefields = [];
- foreach ($_POST as $field => $value) {
- if (\strpos($field, 'gateway_') === 0) {
- $gatewayfields[\str_replace('gateway_', '', $field)] = $value;
- }
- else if (\strpos($field, 'gatewayfees_') === 0) {
- $gatewayfees[\str_replace('gatewayfees_', '', $field)] = $value;
- }
- else if (\strpos($field, 'gatewayfeesex_') === 0) {
- $gatewayfeesex[\str_replace('gatewayfeesex_', '', $field)] = $value;
- }
- else if (\strpos($field, 'group_') === 0) {
- $groupfields[$_POST['groupname_' . \str_replace('group_', '', $field)]] = $value;
- }
- else if (\strpos($field, 'taxes_') === 0) {
- $taxratefields[\str_replace(['taxes_', '_'], ['', '.'], $field)] = $value;
- }
- }
- \WHMCS\Database\Capsule::table('mod_xero')->truncate();
- \WHMCS\Database\Capsule::table('mod_xero')->insert([
- ['setting' => 'synccontacts', 'value' => $_POST['contactsenable'] == 'on'],
- ['setting' => 'syncproducts', 'value' => $_POST['productsenable'] == 'on'],
- ['setting' => 'syncinvoices', 'value' => $_POST['invoicesenable'] == 'on'],
- ['setting' => 'syncpayments', 'value' => $_POST['paymentsenable'] == 'on'],
- ['setting' => 'syncxeropayments', 'value' => $_POST['xeropaymentsenable'] == 'on'],
- ['setting' => 'nextinvoice', 'value' => $_POST['startinvoice']],
- ['setting' => 'nexttransaction', 'value' => $_POST['nexttransaction']],
- ['setting' => 'onlytransaction', 'value' => $_POST['onlytransaction']],
- ['setting' => 'brandingtheme', 'value' => $_POST['brandingtheme']],
- ['setting' => 'nextcredit', 'value' => $whmcsxero->getSetting('nextcredit')],
- ['setting' => 'acc_rec', 'value' => isset($_POST['settingspage']) ? $_POST['acc_rec'] : $whmcsxero->getSetting('acc_rec')],
- ['setting' => 'gateways', 'value' => isset($_POST['settingspage']) ? \serialize($gatewayfields) : $whmcsxero->getSetting('gateways')],
- ['setting' => 'gatewayfees', 'value' => isset($_POST['settingspage']) ? \serialize($gatewayfees) : $whmcsxero->getSetting('gatewayfees')],
- ['setting' => 'gatewayfeesex', 'value' => isset($_POST['settingspage']) ? \serialize($gatewayfeesex) : $whmcsxero->getSetting('gatewayfeesex')],
- ['setting' => 'taxrates', 'value' => isset($_POST['settingspage']) ? \serialize($taxratefields) : $whmcsxero->getSetting('taxrates')],
- ['setting' => 'groups', 'value' => isset($_POST['settingspage']) ? \serialize($groupfields) : $whmcsxero->getSetting('groups')],
- ['setting' => 'xerotoken', 'value' => $whmcsxero->getSetting('xerotoken')],
- ['setting' => 'xerotenant', 'value' => isset($_POST['settingspage']) ? $_POST['xerotenant'] : $whmcsxero->getSetting('xerotenant')],
- ['setting' => 'xerorefreshtoken', 'value' => $whmcsxero->getSetting('xerorefreshtoken')],
- ['setting' => 'xerotokenexpiry', 'value' => $whmcsxero->getSetting('xerotokenexpiry')]
- ]);
- \header('Location: ' . $vars['modulelink']);
- exit();
- }
- $action = (isset($_GET['action']) ? $_GET['action'] : NULL);
- if ($action == 'settings') {
- $whmcspaymentgateways = \WHMCS\Database\Capsule::table('tblpaymentgateways')->where('setting', 'name')->groupBy('gateway')->get();
- $whmcsproductgroups = \array_map(function($each) {
- return $each['name'];
- }, \json_decode(\json_encode(\WHMCS\Database\Capsule::table('tblproductgroups')->select('name')->get()), true));
- $whmcsproductgroups[] = 'Addons';
- $whmcsproductgroups[] = 'Domains';
- $whmcsproductgroups[] = 'Late Fees';
- $whmcsproductgroups[] = 'Setup Fees';
- $whmcsproductgroups[] = 'Project Management';
- $whmcstaxcountries = \WHMCS\Database\Capsule::table('tbltax')->where('level', 1)->groupBy('country')->groupBy('taxrate')->get();
- $taxrates1 = \array_map(function($each) {
- ...................................................................
- ........................................
- .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement