示例#1
0
/**
 *
 * @ WHMCS FULL DECODED & NULLED
 *
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
function initialiseClientArea($pagetitle, $pageicon, $breadcrumbnav)
{
    global $whmcs;
    global $CONFIG;
    global $_LANG;
    global $templates_compiledir;
    global $in_ssl;
    global $clientsdetails;
    global $smarty;
    global $smartyvalues;
    include_once ROOTDIR . "/includes/smarty/Smarty.class.php";
    $smarty = new Smarty();
    $smarty->caching = 0;
    $smarty->template_dir = ROOTDIR . "/templates/";
    $smarty->compile_dir = $templates_compiledir;
    $filename = $_SERVER['PHP_SELF'];
    $filename = substr($filename, strrpos($filename, "/"));
    $filename = str_replace("/", "", $filename);
    $filename = explode(".", $filename);
    $filename = $filename[0];
    $breadcrumb = array();
    $parts = explode(" > ", $breadcrumbnav);
    foreach ($parts as $part) {
        $parts2 = explode("\">", $part, 2);
        $link = str_replace("<a href=\"", "", $parts2[0]);
        $breadcrumb[] = array("link" => $link, "label" => strip_tags($parts2[1]));
    }
    $smarty->assign("template", $whmcs->get_sys_tpl_name());
    $smarty->assign("language", $whmcs->get_client_language());
    $smarty->assign("LANG", $_LANG);
    $smarty->assign("companyname", $CONFIG['CompanyName']);
    $smarty->assign("logo", $CONFIG['LogoURL']);
    $smarty->assign("charset", $CONFIG['Charset']);
    $smarty->assign("pagetitle", $pagetitle);
    $smarty->assign("pageicon", $pageicon);
    $smarty->assign("filename", $filename);
    $smarty->assign("breadcrumb", $breadcrumb);
    $smarty->assign("breadcrumbnav", $breadcrumbnav);
    $smarty->assign("todaysdate", date("l, jS F Y"));
    $smarty->assign("date_day", date("d"));
    $smarty->assign("date_month", date("m"));
    $smarty->assign("date_year", date("Y"));
    $smarty->assign("token", generate_token("plain"));
    if ($CONFIG['SystemSSLURL']) {
        $smarty->assign("systemsslurl", $CONFIG['SystemSSLURL'] . "/");
    }
    if ($in_ssl && $CONFIG['SystemSSLURL']) {
        $smarty->assign("systemurl", $CONFIG['SystemSSLURL'] . "/");
    } else {
        if ($CONFIG['SystemURL'] != "http://www.yourdomain.com/whmcs") {
            $smarty->assign("systemurl", $CONFIG['SystemURL'] . "/");
        }
    }
    if (isset($_SESSION['uid'])) {
        $smarty->assign("loggedin", true);
        if (!function_exists("getClientsDetails")) {
            require ROOTDIR . "/includes/clientfunctions.php";
        }
        $clientsdetails = getClientsDetails();
        $smarty->assign("clientsdetails", $clientsdetails);
        $smarty->assign("clientsstats", getClientsStats($_SESSION['uid']));
        if (isset($_SESSION['cid'])) {
            $result = select_query("tblcontacts", "id,firstname,lastname,email,permissions", array("id" => $_SESSION['cid'], "userid" => $_SESSION['uid']));
            $data = mysql_fetch_array($result);
            $loggedinuser = array("contactid" => $data['id'], "firstname" => $data['firstname'], "lastname" => $data['lastname'], "email" => $data['email']);
            $contactpermissions = explode(",", $data[4]);
        } else {
            $loggedinuser = array("userid" => $_SESSION['uid'], "firstname" => $clientsdetails['firstname'], "lastname" => $clientsdetails['lastname'], "email" => $clientsdetails['email']);
            $contactpermissions = array("profile", "contacts", "products", "manageproducts", "domains", "managedomains", "invoices", "tickets", "affiliates", "emails", "orders");
        }
        $smarty->assign("loggedinuser", $loggedinuser);
        $smarty->assign("contactpermissions", $contactpermissions);
    }
    if ($CONFIG['AllowLanguageChange'] == "on") {
        $smarty->assign("langchange", "true");
    }
    $setlanguage = "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'];
    $count = 0;
    foreach ($_GET as $k => $v) {
        $prefix = $count == 0 ? "?" : "&";
        $setlanguage .= $prefix . htmlentities($k) . "=" . htmlentities($v);
        ++$count;
    }
    $setlanguage .= "\" name=\"languagefrm\" id=\"languagefrm\"><strong>" . $_LANG['language'] . ":</strong> <select name=\"language\" onchange=\"languagefrm.submit()\">";
    foreach ($whmcs->getValidLanguages() as $lang) {
        $setlanguage .= "<option";
        if ($lang == $whmcs->get_client_language()) {
            $setlanguage .= " selected=\"selected\"";
        }
        $setlanguage .= ">" . ucfirst($lang) . "</option>";
    }
    $setlanguage .= "</select></form>";
    $smarty->assign("setlanguage", $setlanguage);
    $currenciesarray = array();
    $result = select_query("tblcurrencies", "id,code,`default`", "", "code", "ASC");
    while ($data = mysql_fetch_array($result)) {
        $currenciesarray[] = array("id" => $data['id'], "code" => $data['code'], "default" => $data['default']);
    }
    if (count($currenciesarray) == 1) {
        $currenciesarray = "";
    }
    $smarty->assign("currencies", $currenciesarray);
    $smarty->assign("twitterusername", $whmcs->get_config("TwitterUsername"));
    $smarty->assign("condlinks", WHMCS_ClientArea::getconditionallinks());
    $smartyvalues = array();
}
示例#2
0
$jquerycode = "\$(\"#addfile\").click(function () {\n    \$(\"#addfileform\").slideToggle();\n    return false;\n});\n\$(\".csajaxtoggle\").click(function () {\n\tvar csturl = \"clientssummary.php?userid=" . $userid . generate_token("link") . "&csajaxtoggle=\"+\$(this).attr(\"id\");\n\tvar cstelm = \"#\"+\$(this).attr(\"id\");\n\t\$.get(csturl, function(data){\n\t\t \$(cstelm).html(data);\n\t});\n});\n";
ob_start();
if ($geninvoices) {
    infoBox($aInt->lang("invoices", "gencomplete"), (int) $_SESSION['adminclientgeninvoicescount'] . " Invoices Created");
}
if ($addfunds) {
    infoBox($aInt->lang("clientsummary", "createaddfunds"), $aInt->lang("clientsummary", "createaddfundssuccess") . " - <a href=\"invoices.php?action=edit&id=" . (int) $invoiceid . "\">" . $aInt->lang("fields", "invoicenum") . $invoiceid . "</a>");
}
if ($pwreset) {
    infoBox($aInt->lang("clients", "resetsendpassword"), $aInt->lang("clients", "passwordsuccess"));
}
if ($affactivated) {
    infoBox($aInt->lang("clientsummary", "activateaffiliate"), $aInt->lang("clientsummary", "affiliateactivatesuccess"));
}
echo $infobox;
$clientstats = getClientsStats($userid);
$clientsdetails['status'] = $aInt->lang("status", strtolower($clientsdetails['status']));
$clientsdetails['autocc'] = $clientsdetails['disableautocc'] ? $aInt->lang("global", "no") : $aInt->lang("global", "yes");
$clientsdetails['taxstatus'] = $clientsdetails['taxexempt'] ? $aInt->lang("global", "yes") : $aInt->lang("global", "no");
$clientsdetails['overduenotices'] = $clientsdetails['overideduenotices'] ? $aInt->lang("global", "no") : $aInt->lang("global", "yes");
$clientsdetails['latefees'] = $clientsdetails['latefeeoveride'] ? $aInt->lang("global", "no") : $aInt->lang("global", "yes");
$clientsdetails['splitinvoices'] = $clientsdetails['separateinvoices'] ? $aInt->lang("global", "yes") : $aInt->lang("global", "no");
$templatevars['clientsdetails'] = $clientsdetails;
include "../includes/countries.php";
$templatevars['clientsdetails']['countrylong'] = $countries[$clientsdetails['country']];
$result = select_query("tblcontacts", "", array("userid" => $userid));
$contacts = array();
while ($data = mysql_fetch_array($result)) {
    $contacts[] = array("id" => $data['id'], "firstname" => $data['firstname'], "lastname" => $data['lastname'], "email" => $data['email']);
}
$templatevars['contacts'] = $contacts;
示例#3
0
 public function initPage()
 {
     global $whmcs;
     global $_LANG;
     global $clientsdetails;
     $this->startSmartyIfNotStarted();
     if ($this->isLoggedIn()) {
         $this->assign("loggedin", true);
         if (!function_exists("getClientsDetails")) {
             require ROOTDIR . "/includes/clientfunctions.php";
         }
         $clientsdetails = getClientsDetails();
         $this->assign("clientsdetails", $clientsdetails);
         $this->assign("clientsstats", getClientsStats($_SESSION['uid']));
         if (isset($_SESSION['cid'])) {
             $result = select_query("tblcontacts", "id,firstname,lastname,email,permissions", array("id" => $_SESSION['cid'], "userid" => $_SESSION['uid']));
             $data = mysql_fetch_array($result);
             $loggedinuser = array("contactid" => $data['id'], "firstname" => $data['firstname'], "lastname" => $data['lastname'], "email" => $data['email']);
             $contactpermissions = explode(",", $data[4]);
         } else {
             $loggedinuser = array("userid" => $_SESSION['uid'], "firstname" => $clientsdetails['firstname'], "lastname" => $clientsdetails['lastname'], "email" => $clientsdetails['email']);
             $contactpermissions = array("profile", "contacts", "products", "manageproducts", "domains", "managedomains", "invoices", "tickets", "affiliates", "emails", "orders");
         }
         $this->assign("loggedinuser", $loggedinuser);
         $this->assign("contactpermissions", $contactpermissions);
         return null;
     }
     $this->assign("loggedin", false);
 }
示例#4
0
}
if (!function_exists("getClientsDetails")) {
    require ROOTDIR . "/includes/clientfunctions.php";
}
$where = array();
if ($clientid) {
    $where['id'] = $clientid;
} else {
    if ($email) {
        $where['email'] = $email;
    }
}
$result = select_query("tblclients", "id", $where);
$data = mysql_fetch_array($result);
$clientid = $data['id'];
if (!$clientid) {
    $apiresults = array("result" => "error", "message" => "Client Not Found");
    return null;
}
$clientsdetails = getClientsDetails($clientid);
$currency_result = full_query("SELECT code FROM tblcurrencies WHERE id=" . (int) $clientsdetails['currency']);
$currency = mysql_fetch_assoc($currency_result);
$clientsdetails['currency_code'] = $currency['code'];
if ($responsetype == "xml") {
    $apiresults = array("result" => "success", "client" => $clientsdetails);
} else {
    $apiresults = array_merge(array("result" => "success"), $clientsdetails);
}
if ($stats || $responsetype == "xml") {
    $apiresults = array("result" => "success", "client" => $clientsdetails, "stats" => getClientsStats($clientid));
}