Ejemplo n.º 1
0
        } else {
            header('Location: viewticket.php?tid=' . $ticket['results']['reference'] . '&c=' . $ticket['results']['id']);
        }
    }
}
## Ticket updates
foreach ($ticket['results']['updates'] as $key => $value) {
    if (!$value['private']) {
        $replies[] = array('name' => $value['author']['name'] ? $value['author']['name'] : $value['author']['first_name'] . ' ' . $value['author']['last_name'], 'message' => nl2br(($value['message'] ? $value['message'] : strip_tags($value['html_body'])) . ($value['signature_text'] ? "<div class='signature'><p>" . $value['signature_text'] . "</p></div>" : "")), 'admin' => $value['author']['type'] == 'User' ? true : false, 'userid' => $value['author']['type'] == 'User' ? false : true, 'date' => fromMySQLDate($value['posted_at'], 'time'), 'user' => $value['author']['type'] == 'User' ? "{$value['author']['first_name']} {$value['author']['last_name']}" : "{$value['from_name']}");
    }
}
## Logged in?
if ($ca->isLoggedIn()) {
    $result = mysql_query("SELECT CONCAT_WS(' ', firstname, lastname) as full_name, email FROM tblclients WHERE id=" . $ca->getUserID());
    $client = mysql_fetch_array($result, MYSQL_ASSOC);
    $ca->assign('email', $client['email']);
    $ca->assign('clientname', $client['full_name']);
}
## Assign vars to the template
$ca->assign('tid', $ticket['results']['reference']);
$ca->assign('subject', $ticket['results']['subject']);
$ca->assign('date', fromMySQLDate($ticket['results']['submitted_at'], time));
$ca->assign('department', $ticket['results']['department']['name']);
$ca->assign('urgency', "<span style='color:#{$ticket['results']['priority']['colour']}'>{$ticket['results']['priority']['name']}</span>");
$ca->assign('status', "<span style='color:#{$ticket['results']['status']['colour']}'>{$ticket['results']['status']['name']}</span>");
$ca->assign('showclosebutton', $settings['close_ticket'] ? true : false);
$ca->assign('descreplies', array_reverse($replies));
$ca->assign('replies', array_reverse($replies));
$ca->assign('c', $_GET['c']);
$ca->setTemplate('viewticket');
$ca->output();
Ejemplo n.º 2
0
<?php

// To be seen by admin only
define("ADMINAREA", true);
require "../init.php";
include_once '../includes/hooks/inc/oms_utils.php';
$ca = new WHMCS_ClientArea();
$ca->setPageTitle("VM statistics");
$ca->addToBreadCrumb('index.php', $whmcs->get_lang('globalsystemname'));
$ca->initPage();
global $oms_user, $oms_password, $oms_hostname, $whmcs_upload_folder;
// execute an external program to get all the info from oms
$id = exec("{$whmcs_code_folder}/vmsummary.py {$oms_hostname} {$oms_user} {$oms_password} " . "{$whmcs_code_folder}/{$whmcs_upload_folder}/omssstats.csv", $arrEntries);
$vms = array();
foreach ($arrEntries as $vmdata) {
    $vms[] = explode(";", $vmdata);
}
$ca->assign('vms', $vms);
$ca->assign('upload_folder', $whmcs_upload_folder);
$ca->setTemplate('omsvmstats');
$ca->output();
Ejemplo n.º 3
0
<?php

define("CLIENTAREA", true);
require "init.php";
require_once 'modules/addons/sirportly/sirportly_functions.php';
include_once "modules/addons/sirportly/markdown.php";
$ca = new WHMCS_ClientArea();
$ca->initPage();
$ca->setPageTitle($whmcs->get_lang('supportticketssubmitticket'));
$settings = sirportly_settings();
if (!sirportly_enabled()) {
    header('Location: /');
}
$ca->setTemplate('/modules/addons/sirportly/templates/default/knowledgebase.tpl');
$content = curl('/api/v2/knowledge/page', array('kb' => $settings['kb'], 'path' => ltrim($_SERVER['PATH_INFO'], '/')));
$ca->assign('tree', doc_nav($kb));
$ca->assign('title', $content['results']['page']['title']);
$ca->assign('content', Markdown($content['results']['page']['content']));
$ca->output();
Ejemplo n.º 4
0
require "init.php";
include_once 'includes/hooks/inc/oms_utils.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();
$DATE_FORMAT_INPUT = 'd-m-Y';
$DATE_FORMAT_OUTPUT = 'Y-m-d';
//get parameters
$start_date = $_GET['start_date'] ? DateTime::createFromFormat($DATE_FORMAT_INPUT, $_GET['start_date']) : date_sub(date_create(), date_interval_create_from_date_string("1 days"));
$end_date = $_GET['end_date'] ? DateTime::createFromFormat($DATE_FORMAT_INPUT, $_GET['end_date']) : date_create();
$user_id = mysql_real_escape_string($_GET['user_id']);
$datebetweenStr = "start_date: " . $start_date->format($DATE_FORMAT_INPUT) . " ... end_date: " . $end_date->format($DATE_FORMAT_INPUT);
$ca->assign('datebetween', $datebetweenStr);
$isAdmin = $_SESSION['adminid'];
if ($start_date && $end_date && $isAdmin > 0) {
    $sql = "SELECT clientid, SUM(amount) as credit FROM tblcredit WHERE  description LIKE 'OMS_USAGE%'  AND date BETWEEN '" . $start_date->format($DATE_FORMAT_OUTPUT) . "' AND '" . $end_date->format($DATE_FORMAT_OUTPUT) . "' ";
    if ($user_id) {
        $sql .= " AND clientid=" . $user_id;
    }
    $sql .= "  GROUP BY clientid ";
    $query = mysql_query($sql);
    $clients = array();
    while ($client = mysql_fetch_array($query)) {
        $clients[] = $client;
    }
    $ca->assign('clients', $clients);
}
$ca->setTemplate('omsusage');
$ca->output();
Ejemplo n.º 5
0
<?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();
Ejemplo n.º 6
0
<?php

define("CLIENTAREA", true);
//define("FORCESSL",true); // Uncomment to force the page to use https://
require "init.php";
$ca = new WHMCS_ClientArea();
$ca->setPageTitle("Console");
$ca->addToBreadCrumb('index.php', $whmcs->get_lang('globalsystemname'));
$ca->addToBreadCrumb('console.php', 'Console');
$ca->initPage();
$ca->requireLogin();
$ca->setTemplate('console');
$ca->output();
Ejemplo n.º 7
0
//define("FORCESSL", true); // Uncomment to force the page to use https://
require "init.php";
require 'modules/addons/facturacom/wrapperapp.php';
$ca = new WHMCS_ClientArea();
$ca->setPageTitle("Facturación de servicios");
$ca->initPage();
$ca->requireLogin();
if ($ca->isLoggedIn()) {
    WrapperConfig::load();
    $configEntity = WrapperConfig::configEntity();
    // Getting invoices by client from factura.com
    $invoices = (array) WrapperHelper::getInvoices($ca->getUserID());
    $clientInvoices = array();
    //object to array
    foreach ($invoices['data'] as $key => $value) {
        $clientInvoices[$key] = (array) $value;
    }
    // Getting invoices from whmcs
    $whmcsInvoices = WrapperHelper::getWhmcsInvoices($ca->getUserID());
    $ca->assign('clientW', $ca->getUserID());
    $ca->assign('whmcsInvoices', $whmcsInvoices);
    $ca->assign('clientInvoices', $clientInvoices);
    $ca->assign('systemURL', $configEntity['systemURL']);
    $ca->assign('apiUrl', $configEntity['apiUrl']);
    $ca->assign('serieInvoices', $configEntity['serie']);
} else {
    # User is not logged in
}
# Define the template filename to be used without the .tpl extension
$ca->setTemplate('customer_area/clientfacturacion');
$ca->output();
Ejemplo n.º 8
0
        }
    }
    return $res;
}
if ($domain) {
    $domain = trim($domain);
    if (substr(strtolower($domain), 0, 7) == "http://") {
        $domain = substr($domain, 7);
    }
    if (substr(strtolower($domain), 0, 4) == "www.") {
        $domain = substr($domain, 4);
    }
    if (ip_dorgula($domain)) {
        $sonuc = ip_sorgula($domain);
    } elseif (domain_dorgula($domain)) {
        $sonuc = domain_sorgula($domain);
    } else {
        die("Invalid Input!");
    }
}
$domain_parts = explode(".", $domain);
$tld = strtolower(array_pop($domain_parts));
$whoissunucu = $whoissunuculari[$tld];
if ($whoissunucu == "whois.nic.tr") {
    $sonuc = iconv('ISO-8859-9', 'UTF-8', $sonuc);
}
$sonuc = str_replace(array_keys($ifadeler), array_values($ifadeler), $sonuc);
$ca->assign('domain', $domain);
$ca->assign('whois', $sonuc);
$ca->setTemplate('whois2');
$ca->output();
Ejemplo n.º 9
0
}
if ($action == "addfunds") {
    $ca->addToBreadCrumb("clientarea.php?action=addfunds", $whmcs->get_lang("addfunds"));
}
if ($action == "masspay") {
    $ca->addToBreadCrumb("clientarea.php?action=masspay" . ($all ? "&all=true" : "") . "#", $whmcs->get_lang("masspaytitle"));
}
if ($action == "quotes") {
    $ca->addToBreadCrumb("clientarea.php?action=quotes", $whmcs->get_lang("quotestitle"));
}
$client = new WHMCS_Client(WHMCS_Session::get("uid"));
$currency = $client->getCurrency();
$ca->assign("action", $action);
$ca->assign("clientareaaction", $action);
if ($action == "") {
    $ca->setTemplate("clientareahome");
    require "includes/ticketfunctions.php";
    $tickets = array();
    $statusfilter = "";
    $result = select_query("tblticketstatuses", "title", array("showactive" => "1"));
    while ($data = mysql_fetch_array($result)) {
        $statusfilter .= "'" . $data[0] . "',";
    }
    $statusfilter = substr($statusfilter, 0, 0 - 1);
    $result = select_query("tbltickets", "", "userid='" . mysql_real_escape_string($client->getID()) . ("' AND status IN (" . $statusfilter . ")"), "lastreply", "DESC");
    while ($data = mysql_fetch_array($result)) {
        $id = $data['id'];
        $tid = $data['tid'];
        $c = $data['c'];
        $deptid = $data['did'];
        $date = $data['date'];
Ejemplo n.º 10
0
     $dept = array();
     foreach ($departments['results'] as $key => $value) {
         if (!$value['private']) {
             $dept[$value['id']] = array('id' => $value['id'], 'name' => $value['name']);
         }
     }
     ## Fetch the statuses
     $priorities = curl('/api/v2/objects/priorities');
     $priority = array();
     foreach ($priorities['results'] as $key => $value) {
         $priority[] = array('id' => $value['id'], 'name' => $value['name']);
     }
     $ca->assign('department', $dept[$_GET['deptid'] ? $_GET['deptid'] : $_POST['deptid']]['name']);
     $ca->assign('departments', $dept);
     $ca->assign('priorities', $priority);
     $ca->setTemplate("../../modules/addons/sirportly/templates/{$CONFIG['Template']}/supportticketsubmit-steptwo");
     break;
 case '3':
     $ca->assign('tid', $_SESSION['tid']);
     $ca->assign('c', $_SESSION['c']);
     $_SESSION['tid'] = '';
     $_SESSION['c'] = '';
     $ca->setTemplate("supportticketsubmit-confirm");
     break;
 default:
     $departments = curl('/api/v2/objects/departments');
     $dept = array();
     foreach ($departments['results'] as $key => $value) {
         if (!$value['private']) {
             $dept[] = array('id' => $value['id'], 'name' => $value['name']);
         }