$invoiceaction = $aInt->lang("billableitems", "invoiceduedate"); } else { if ($invoiceaction == "4") { $invoiceaction = $aInt->lang("billableitems", "recurringcycle"); } } } } } if ($invoicecount) { $invoiced = $aInt->lang("global", "yes"); } else { $invoiced = $aInt->lang("global", "no"); } $managelink = "<a href=\"billableitems.php?action=manage&id=" . $id . "\">"; $tabledata[] = array("<input type=\"checkbox\" name=\"bitem[" . $id . "]\" class=\"checkall\" />", $managelink . $id . "</a>", $aInt->outputClientLink($userid, $firstname, $lastname, $companyname, $groupid), $managelink . $description . "</a>", $hours, $amount, $invoiceaction, $invoiced, $managelink . "<img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "edit") . "\"></a>", "<a href=\"#\" onClick=\"doDelete('" . $id . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "delete") . "\"></a>"); } $tableformurl = $_SERVER['PHP_SELF'] . "?status=" . $status; $tableformbuttons = "<input type=\"submit\" name=\"invoice\" value=\"" . $aInt->lang("billableitems", "invoicenextcronrun") . "\" onclick=\"return confirm('" . $aInt->lang("billableitems", "invoicenextcronrunconfirm", "1") . "')\" /> <input type=\"submit\" name=\"delete\" value=\"" . $aInt->lang("global", "delete") . "\" class=\"btn-danger\" onclick=\"return confirm('" . $aInt->lang("global", "deleteconfirm", "1") . "')\" />"; echo $aInt->sortableTable(array("checkall", array("id", $aInt->lang("fields", "id")), $aInt->lang("fields", "clientname"), array("description", $aInt->lang("fields", "description")), array("hours", $aInt->lang("billableitems", "hours")), array("amount", $aInt->lang("fields", "amount")), array("invoiceaction", $aInt->lang("billableitems", "invoiceaction")), array("invoicecount", $aInt->lang("status", "invoiced")), "", ""), $tabledata, $tableformurl, $tableformbuttons); } else { if ($action == "manage") { $jquery = ""; if ($id) { $pagetitle = $aInt->lang("billableitems", "edititem"); $result = select_query("tblbillableitems", "", array("id" => $id)); $data = mysql_fetch_array($result); $id = $data['id']; $userid = $data['userid']; $description = $data['description']; $hours = $data['hours'];
$result = select_query("tblorders", "tblorders.*,tblclients.firstname,tblclients.lastname,tblclients.email,tblclients.companyname,tblclients.address1,tblclients.address2,tblclients.city,tblclients.state,tblclients.postcode,tblclients.country,tblclients.groupid,(SELECT status FROM tblinvoices WHERE id=tblorders.invoiceid) AS invoicestatus", array("tblorders.id" => $id), "", "", "", "tblclients ON tblclients.id=tblorders.userid"); $data = mysql_fetch_array($result); $id = $data['id']; if (!$id) { exit("Order not found... Exiting..."); } $ordernum = $data['ordernum']; $userid = $data['userid']; $date = $data['date']; $amount = $data['amount']; $paymentmethod = $data['paymentmethod']; $paymentmethod = $gatewaysarray[$paymentmethod]; $orderstatus = $data['status']; $showpending = get_query_val("tblorderstatuses", "showpending", array("title" => $orderstatus)); $amount = $data['amount']; $client = $aInt->outputClientLink($userid, $data['firstname'], $data['lastname'], $data['companyname'], $data['groupid']); $address = $data['address1']; if ($data['address2']) { $address .= ", " . $data['address2']; } $address .= "<br />" . $data['city'] . ", " . $data['state'] . ", " . $data['postcode'] . "<br />" . $countries[$data['country']]; $ipaddress = $data['ipaddress']; $clientemail = $data['email']; $invoiceid = $data['invoiceid']; $nameservers = $data['nameservers']; $nameservers = explode(",", $nameservers); $transfersecret = $data['transfersecret']; $transfersecret = $transfersecret ? unserialize($transfersecret) : array(); $renewals = $data['renewals']; $promocode = $data['promocode']; $promotype = $data['promotype'];
$id2 = $data['id']; $date = $data['date']; $relid = $data['relid']; $reason = $data['reason']; $type = $data['type']; $date = fromMySQLDate($date, "time"); $domain = $data['domain']; $productname = $data['productname']; $groupname = $data['groupname']; $productid = $data['productid']; $userid = $data['userid']; $firstname = $data['firstname']; $lastname = $data['lastname']; $companyname = $data['companyname']; $groupid = $data['groupid']; $nextduedate = $data['nextduedate']; $nextduedate = fromMySQLDate($nextduedate); $xname = "<a href=\"clientshosting.php?userid=" . $userid . "&id=" . $productid . "\">" . $groupname . " - " . $productname . "</a><br>" . $aInt->outputClientLink($userid, $firstname, $lastname, $companyname, $groupid); if ($domain) { $xname .= " (" . $domain . ")"; } $type = $type == "Immediate" ? $aInt->lang("clients", "cancelrequestimmediate") : $aInt->lang("clients", "cancelrequestendofperiod") . ("<br>(" . $nextduedate . ")"); $tabledata[] = array($date, $xname, "<textarea rows=3 cols=64 readonly>" . $reason . "</textarea>", $type, "<a href=\"#\" onClick=\"doDelete('" . $id2 . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "delete") . "\"></a>"); } echo $aInt->sortableTable(array($aInt->lang("fields", "date"), $aInt->lang("fields", "product"), $aInt->lang("fields", "reason"), $aInt->lang("fields", "type"), ""), $tabledata); $content = ob_get_contents(); ob_end_clean(); $aInt->content = $content; $aInt->jquerycode = $jquerycode; $aInt->jscode = $jscode; $aInt->display();
$query .= db_escape_string($orderby); } $query .= " " . db_escape_string($order); $numresults = full_query($query); $numrows = mysql_num_rows($numresults); $query .= " LIMIT " . (int) $page * $limit . "," . (int) $limit; $result = full_query($query); while ($data = mysql_fetch_array($result)) { $id = $data['id']; $userid = $data['userid']; $date = $data['date']; $duedate = $data['duedate']; $total = $data['total']; $paymentmethod = $data['paymentmethod']; $paymentmethod = $gatewaysarray[$paymentmethod]; $date = fromMySQLDate($date); $duedate = fromMySQLDate($duedate); $firstname = $data['firstname']; $lastname = $data['lastname']; $companyname = $data['companyname']; $groupid = $data['groupid']; $currency = getCurrency($userid); $total = formatCurrency($total); $tabledata[] = array("<a href=\"invoices.php?action=edit&id=" . $id . "\">" . $id . "</a>", $aInt->outputClientLink($userid, $firstname, $lastname, $companyname, $groupid), $date, $duedate, $total, "<input type=\"button\" value=\"View Processing Window\" onClick=\"openCCDetails(" . $id . ");return false\">"); } echo $aInt->sortableTable(array(array("id", $aInt->lang("fields", "id")), array("clientname", $aInt->lang("fields", "clientname")), array("date", $aInt->lang("fields", "invoicedate")), array("duedate", $aInt->lang("fields", "duedate")), array("total", $aInt->lang("fields", "total")), $aInt->lang("supportticketescalations", "actions")), $tabledata); $content = ob_get_contents(); ob_end_clean(); $aInt->content = $content; $aInt->jscode = $jscode; $aInt->display();
$currency = $data['currency']; $date = $data['date']; $date = fromMySQLDate($date); $description = $data['description']; $amountin = $data['amountin']; $fees = $data['fees']; $amountout = $data['amountout']; $gateway = $data['gateway']; $transid = $data['transid']; $invoiceid = $data['invoiceid']; $firstname = $data['firstname']; $lastname = $data['lastname']; $companyname = $data['companyname']; $groupid = $data['groupid']; $currencyid = $data['currencyid']; $clientlink = $userid ? $aInt->outputClientLink($userid, $firstname, $lastname, $companyname, $groupid) : "-"; $currency = $userid ? getCurrency("", $currencyid) : getCurrency("", $currency); $amountin = formatCurrency($amountin); $fees = formatCurrency($fees); $amountout = formatCurrency($amountout); if ($invoiceid != "0") { $description .= " (<a href=\"invoices.php?action=edit&id=" . $invoiceid . "\">#" . $invoiceid . "</a>)"; } if ($transid != "") { $description .= "<br>Trans ID: " . $transid; } $gateway = $gatewaysarray[$gateway]; $tabledata[] = array($clientlink, $date, $gateway, $description, $amountin, $fees, $amountout, "<a href=\"" . $PHP_SELF . "?action=edit&id=" . $id . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "edit") . "\"></a>", "<a href=\"#\" onClick=\"doDelete('" . $id . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "delete") . "\"></a>"); } echo $aInt->sortableTable(array($aInt->lang("fields", "clientname"), $aInt->lang("fields", "date"), $aInt->lang("fields", "paymentmethod"), $aInt->lang("fields", "description"), $aInt->lang("transactions", "amountin"), $aInt->lang("transactions", "fees"), $aInt->lang("transactions", "amountout"), "", ""), $tabledata, $tableformurl, $tableformbuttons); if (checkPermission("View Income Totals", true)) {
$date = $data['date']; $userid = $data['clientid']; $visitors = $data['visitors']; $balance = $data['balance']; $withdrawn = $data['withdrawn']; $firstname = $data['firstname']; $lastname = $data['lastname']; $companyname = $data['companyname']; $groupid = $data['groupid']; $currency = $data['currency']; $signups = $data['signups']; $currency = getCurrency("", $currency); $balance = formatCurrency($balance); $withdrawn = formatCurrency($withdrawn); $date = fromMySQLDate($date); $tabledata[] = array("<input type=\"checkbox\" name=\"selectedclients[]\" value=\"" . $id . "\" class=\"checkall\" />", "<a href=\"affiliates.php?action=edit&id=" . $id . "\">" . $id . "</a>", $date, $aInt->outputClientLink($userid, $firstname, $lastname, $companyname, $groupid), $visitors, $signups, $balance, $withdrawn, "<a href=\"" . $PHP_SELF . "?action=edit&id=" . $id . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "edit") . "\"></a>", "<a href=\"#\" onClick=\"doDelete('" . $id . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"" . $aInt->lang("global", "delete") . "\"></a>"); } $tableformurl = "sendmessage.php?type=affiliate&multiple=true"; $tableformbuttons = "<input type=\"submit\" value=\"" . $aInt->lang("global", "sendmessage") . "\" class=\"button\">"; echo $aInt->sortableTable(array("checkall", array("id", $aInt->lang("fields", "id")), array("date", $aInt->lang("affiliates", "signupdate")), array("clientname", $aInt->lang("fields", "clientname")), array("visitors", $aInt->lang("affiliates", "visitorsref")), $aInt->lang("affiliates", "signups"), array("balance", $aInt->lang("fields", "balance")), array("withdrawn", $aInt->lang("affiliates", "withdrawn")), "", ""), $tabledata, $tableformurl, $tableformbuttons); } else { if ($action == "edit") { if ($pay == "true") { $error = AffiliatePayment($affaccid, ""); if ($error) { infoBox($aInt->lang("affiliates", "paymentfailed"), $error); } else { infoBox($aInt->lang("affiliates", "paymentsuccess"), $aInt->lang("affiliates", "paymentsuccessdetail")); } } echo $infobox;
} } $initiatevscapture = function_exists($paymentmethod . "_initiatepayment") ? true : false; if (function_exists($paymentmethod . "_adminstatusmsg")) { $gatewaymsg = call_user_func($paymentmethod . "_adminstatusmsg", array("invoiceid" => $id, "userid" => $userid, "date" => $date, "duedate" => $duedate, "datepaid" => $datepaid, "subtotal" => $subtotal, "tax" => $tax, "tax2" => $tax2, "total" => $total, "status" => $status)); if (is_array($gatewaymsg)) { infoBox($gatewaymsg['title'], $gatewaymsg['msg'], $gatewaymsg['type']); echo $infobox; } } run_hook("ViewInvoiceDetailsPage", array("invoiceid" => $id)); echo $aInt->Tabs(array($aInt->lang("invoices", "summary"), $aInt->lang("invoices", "addpayment"), $aInt->lang("invoices", "options"), $aInt->lang("fields", "credit"), $aInt->lang("invoices", "refund"), $aInt->lang("fields", "notes"))); echo "\n<div id=\"tab0box\" class=\"tabbox\">\n <div id=\"tab_content\">\n\n<table width=100%><tr><td width=50%>\n\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"35%\" class=\"fieldlabel\">"; echo $aInt->lang("fields", "clientname"); echo "</td><td class=\"fieldarea\">"; echo $aInt->outputClientLink($userid, $firstname, $lastname, $companyname, $groupid); echo " (<a href=\"clientsinvoices.php?userid="; echo $userid; echo "\">"; echo $aInt->lang("invoices", "viewinvoices"); echo "</a>)</td></tr>\n"; if ($invoicenum) { echo "<tr><td class=\"fieldlabel\">"; echo $aInt->lang("fields", "invoicenum"); echo "</td><td class=\"fieldarea\">"; echo $invoicenum; echo "</td></tr>"; } echo "<tr><td class=\"fieldlabel\">"; echo $aInt->lang("fields", "invoicedate"); echo "</td><td class=\"fieldarea\">";
$nextduedate = $data['nextduedate']; $status = $data['domainstatus']; $notes = $data['notes']; $firstname = $data['firstname']; $lastname = $data['lastname']; $companyname = $data['companyname']; $groupid = $data['groupid']; $currency = $data['currency']; if (!$domain) { $domain = "(" . $aInt->lang("addons", "nodomain") . ")"; } $linkvalue = $dtype == "other" ? "" : " <a href=\"http://" . $domain . "\" target=\"_blank\" style=\"color:#cc0000\"><small>www</small></a>"; if ($billingcycle == "One Time" || $billingcycle == "Free Account") { $nextduedate = "0000-00-00"; $amount = $firstpaymentamount; } $currency = getCurrency("", $currency); $amount = formatCurrency($amount); $regdate = fromMySQLDate($regdate); $nextduedate = $nextduedate == "0000-00-00" ? "-" : fromMySQLDate($nextduedate); $billingcycle = $aInt->lang("billingcycles", str_replace(array("-", "account", " "), "", strtolower($billingcycle))); $tabledata[] = array("<input type=\"checkbox\" name=\"selectedclients[]\" value=\"" . $id . "\" class=\"checkall\" />", "<a href=\"clientshosting.php?userid=" . $userid . "&id=" . $id . "\">" . $id . "</a>", $dpackage . " <span class=\"label " . strtolower($status) . "\">" . $status . "</span>", "<a href=\"clientshosting.php?userid=" . $userid . "&id=" . $id . "\">" . $domain . "</a>" . $linkvalue, $aInt->outputClientLink($userid, $firstname, $lastname, $companyname, $groupid), $amount, $billingcycle, $nextduedate); } $tableformurl = "sendmessage.php?type=product&multiple=true"; $tableformbuttons = "<input type=\"submit\" value=\"" . $aInt->lang("global", "sendmessage") . "\" class=\"button\">"; echo $aInt->sortableTable(array("checkall", array("id", $aInt->lang("fields", "id")), array("product", $aInt->lang("fields", "product")), array("domain", $aInt->lang("fields", "domain")), array("clientname", $aInt->lang("fields", "clientname")), array("amount", $aInt->lang("fields", "price")), array("billingcycle", $aInt->lang("fields", "billingcycle")), array("nextduedate", $aInt->lang("fields", "nextduedate"))), $tabledata, $tableformurl, $tableformbuttons); $content = ob_get_contents(); ob_end_clean(); $aInt->content = $content; $aInt->jquerycode = $jquerycode; $aInt->display();
$customfieldsarray[$k] = $customfield[$k]; } saveCustomFields($id, $customfieldsarray); $adminname = getAdminName(); addTicketLog($id, "Custom Field Values Modified by " . $adminname); } AdminRead($id); if ($replyingadmin && $replyingadmin != $_SESSION['adminid']) { $result = select_query("tbladmins", "", array("id" => $replyingadmin)); $data = mysql_fetch_array($result); $replyingadmin = ucfirst($data['username']); $smartyvalues['replyingadmin'] = array("name" => $replyingadmin, "time" => $replyingtime); } $clientname = $contactname = $clientgroupcolour = ""; if ($pauserid) { $clientname = strip_tags($aInt->outputClientLink($pauserid)); } if ($pacontactid) { $contactname = strip_tags($aInt->outputClientLink(array($pauserid, $pacontactid))); } $staffinvolved = array(); $result = select_query("tblticketreplies", "DISTINCT admin", array("tid" => $id)); while ($data = mysql_fetch_array($result)) { if (trim($data[0])) { $staffinvolved[] = $data[0]; } } $addons_html = run_hook("AdminAreaViewTicketPage", array("ticketid" => $id)); $smartyvalues['addons_html'] = $addons_html; $department = getDepartmentName($deptid); if (!$lastreply) {
$result = select_query("tblquotes", "", $where, $orderby, $order, $page * $limit . ("," . $limit)); while ($data = mysql_fetch_array($result)) { $id = $data['id']; $subject = $data['subject']; $userid = $data['userid']; $firstname = $data['firstname']; $lastname = $data['lastname']; $companyname = $data['companyname']; $stage = $data['stage']; $total = $data['total']; $validuntil = $data['validuntil']; $lastmodified = $data['lastmodified']; $validuntil = fromMySQLDate($validuntil); $lastmodified = fromMySQLDate($lastmodified); if ($userid) { $clientlink = $aInt->outputClientLink($userid); } else { $clientlink = "" . $firstname . " " . $lastname; if ($companyname) { $clientlink .= " (" . $companyname . ")"; } } $tabledata[] = array("<a href=\"quotes.php?action=manage&id=" . $id . "\">" . $id . "</a>", "<a href=\"quotes.php?action=manage&id=" . $id . "\">" . $subject . "</a>", $clientlink, $stage, $total, $validuntil, $lastmodified, "<a href=\"quotes.php?action=manage&id=" . $id . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Edit\"></a>", "<a href=\"#\" onClick=\"doDelete('" . $id . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Delete\"></a>"); } echo $aInt->sortableTable(array(array("id", "ID"), array("subject", "Subject"), "Client Name", array("stage", "Stage"), array("total", "Total"), array("validuntil", "Valid Until"), array("lastmodified", "Last Modified"), "", ""), $tabledata, $tableformurl, $tableformbuttons); } else { if ($action == "manage") { if ($id) { $addons_html = run_hook("AdminAreaViewQuotePage", array("quoteid" => $id)); $result = select_query("tblquotes", "", array("id" => $id)); $data = mysql_fetch_array($result);
$registrar = $data['registrar']; $nextduedate = $data['nextduedate']; $expirydate = $data['expirydate']; $subscriptionid = $data['subscriptionid']; $registrationdate = $data['registrationdate']; $registrationperiod = $data['registrationperiod']; $status = $data['status']; $firstname = $data['firstname']; $lastname = $data['lastname']; $companyname = $data['companyname']; $groupid = $data['groupid']; $currency = $data['currency']; if (!$domain) { $domain = "(No Domain)"; } $currency = getCurrency("", $currency); $amount = formatCurrency($amount); $registrationdate = fromMySQLDate($registrationdate); $nextduedate = fromMySQLDate($nextduedate); $expirydate = fromMySQLDate($expirydate); $registrationperiod .= 1 < $registrationperiod ? " " . $aInt->lang("domains", "years") : " " . $aInt->lang("domains", "year"); $tabledata[] = array("<input type=\"checkbox\" name=\"selectedclients[]\" value=\"" . $id . "\" class=\"checkall\" />", "<a href=\"clientsdomains.php?userid=" . $userid . "&domainid=" . $id . "\">" . $id . "</a>", "<a href=\"clientsdomains.php?userid=" . $userid . "&id=" . $id . "\">" . $domain . "</a> <a href=\"http://www." . $domain . "\" target=\"_blank\" style=\"color:#cc0000\"><small>www</small></a>" . " <span class=\"label " . strtolower($status) . "\">" . $status . "</span>", $aInt->outputClientLink($userid, $firstname, $lastname, $companyname, $groupid), $registrationperiod, ucfirst($registrar), $amount, $nextduedate, $expirydate); } $tableformurl = "sendmessage.php?type=domain&multiple=true"; $tableformbuttons = "<input type=\"submit\" value=\"" . $aInt->lang("global", "sendmessage") . "\" class=\"button\">"; echo $aInt->sortableTable(array("checkall", array("id", $aInt->lang("fields", "id")), array("domain", $aInt->lang("fields", "domain")), array("clientname", $aInt->lang("fields", "clientname")), array("registrationperiod", $aInt->lang("fields", "regperiod")), array("registrar", $aInt->lang("fields", "registrar")), array("recurringamount", $aInt->lang("fields", "price")), array("nextduedate", $aInt->lang("fields", "nextduedate")), array("expirydate", $aInt->lang("fields", "expirydate"))), $tabledata, $tableformurl, $tableformbuttons); $content = ob_get_contents(); ob_end_clean(); $aInt->content = $content; $aInt->jquerycode = $jquerycode; $aInt->display();