} $emails = array(); $result = select_query("tblemails", "", array("userid" => $client->getID()), $orderby, $sort, $limit); while ($data = mysql_fetch_array($result)) { $id = $data['id']; $date = $data['date']; $subject = $data['subject']; $date = fromMySQLDate($date, 1, 1); $emails[] = array("id" => $id, "date" => $date, "subject" => $subject); } $ca->assign("emails", $emails); $smartyvalues = array_merge($smartyvalues, clientAreaTablePageNav($numitems)); } else { if ($action == "cancel") { checkContactPermission("orders"); $service = new WHMCS_Service($id, $client->getID()); if ($service->isNotValid()) { redir("action=products", "clientarea.php"); } $allowedstatuscancel = array("Active", "Suspended"); if (!in_array($service->getData("status"), $allowedstatuscancel)) { redir("action=productdetails&id=" . $id); } $ca->setTemplate("clientareacancelrequest"); $ca->addToBreadCrumb("clientarea.php?action=productdetails&id=" . $id, $whmcs->get_lang("clientareaproductdetails")); $ca->addToBreadCrumb("cancel&id=" . $id, $whmcs->get_lang("clientareacancelrequest")); $clientsdetails = getClientsDetails($client->getID()); $smartyvalues['id'] = $service->getData("id"); $smartyvalues['groupname'] = $service->getData("groupname"); $smartyvalues['productname'] = $service->getData("productname"); $smartyvalues['domain'] = $service->getData("domain");
if (is_array($fieldsarray)) { foreach ($fieldsarray as $k => $v) { $tbl->add($k, $v, 1); } } } } $hookret = run_hook("AdminClientServicesTabFields", array("id" => $id)); foreach ($hookret as $hookdat) { foreach ($hookdat as $k => $v) { $tbl->add($k, $v, 1); } } $addonshtml = ""; $aInt->sortableTableInit("nopagination"); $service = new WHMCS_Service($id); $addons = $service->getAddons(); foreach ($addons as $vals) { $tabledata[] = array($vals['regdate'], $vals['name'], $vals['pricing'], $vals['status'], $vals['nextduedate'], "<a href=\"" . $PHP_SELF . "?userid=" . $userid . "&id=" . $id . "&aid=" . $vals['id'] . "\"><img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Edit\"></a>", "<a href=\"#\" onClick=\"doDeleteAddon('" . $vals['id'] . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Delete\"></a>"); } $addonshtml = $aInt->sortableTable(array($aInt->lang("addons", "regdate"), $aInt->lang("addons", "name"), $aInt->lang("global", "pricing"), $aInt->lang("fields", "status"), $aInt->lang("fields", "nextduedate"), "", ""), $tabledata); $tbl->add($aInt->lang("addons", "title"), $addonshtml . "<div style=\"padding:5px 25px;\"><a href=\"clientsservices.php?userid=" . $userid . "&id=" . $id . "&aid=add\"><img src=\"images/icons/add.png\" border=\"0\" align=\"top\" /> Add New Addon</a></div>", 1); $customfields = getCustomFields("product", $packageid, $id, true); foreach ($customfields as $customfield) { $tbl->add($customfield['name'], $customfield['input'], 1); } $tbl->add($aInt->lang("services", "overrideautosusp"), $frm->checkbox("overideautosuspend", $aInt->lang("services", "nosuspenduntil"), $overideautosuspend) . " " . $frm->date("overidesuspenduntil", $overidesuspenduntil), 1); $tbl->add($aInt->lang("services", "endofcycle"), $frm->checkbox("autoterminateendcycle", $aInt->lang("services", "reason"), $autoterminateendcycle) . " " . $frm->text("autoterminatereason", $autoterminatereason, "60"), 1); $tbl->add($aInt->lang("fields", "adminnotes"), $frm->textarea("notes", $notes, "4", "100%"), 1); echo $tbl->output(); echo "\n<br />\n<div align=\"center\">" . $frm->submit($aInt->lang("global", "savechanges"), "btn btn-primary") . " " . $frm->reset($aInt->lang("global", "cancelchanges")) . "<br />\n<a href=\"#\" onclick=\"showDialog('delete');return false\" style=\"color:#cc0000\"><strong>" . $aInt->lang("global", "delete") . "</strong></a></div>";
public function setServiceID($serviceid, $userid = "") { $service = new WHMCS_Service($serviceid, $userid); if ($service->isNotValid()) { return false; } if ($service->getData("status") != "Active") { return false; } $this->productinfo = array("id" => $service->getData("id"), "userid" => $service->getData("userid"), "pid" => $service->getData("pid"), "groupname" => $service->getData("groupname"), "productname" => $service->getData("productname"), "firstpaymentamount" => $service->getData("firstpaymentamount"), "amount" => $service->getData("amount"), "domain" => $service->getData("domain"), "nextduedate" => $service->getData("nextduedate"), "billingcycle" => $service->getData("billingcycle"), "upgradepackages" => $service->getData("upgradepackages") ? unserialize($service->getData("upgradepackages")) : array(), "configoptionsupgrade" => $service->getData("configoptionsupgrade"), "tax" => $service->getData("tax")); return true; }