Ejemplo n.º 1
0
    $fieldid = $data['id'];
    $fieldname = $data['fieldname'];
    echo "<tr><td class=\"fieldlabel\">" . $fieldname . "</td><td class=\"fieldarea\" colspan=\"3\"><input type=\"text\" name=\"customfields[" . $fieldid . "]\" size=\"30\" value=\"" . $customfields[$fieldid] . "\" /></td></tr>";
}
echo "</table>\n<p align=\"center\"><input type=\"submit\" value=\"";
echo $aInt->lang("global", "search");
echo "\" class=\"button\"></p>\n</form>\n\n  </div>\n</div>\n\n<br />\n\n";
$filters->store();
$criteria = array("userid" => $userid, "clientname" => $clientname, "companyname" => $companyname, "email" => $email, "address" => $address, "country" => $country, "status" => $status, "state" => $state, "clientgroup" => $clientgroup, "phonenumber" => $phonenumber, "currency" => $currency, "cardlastfour" => $cardlastfour, "customfields" => $customfields);
$clientsModel->execute($criteria);
$numresults = $pageObj->getNumResults();
if ($filters->isActive() && $numresults == 1) {
    $client = $pageObj->getOne();
    redir("userid=" . $client['id'], "clientssummary.php");
} else {
    $clientlist = $pageObj->getData();
    foreach ($clientlist as $client) {
        $linkopen = "<a href=\"clientssummary.php?userid=" . $client['id'] . "\"" . ($client['groupcolor'] ? " style=\"background-color:" . $client['groupcolor'] . "\"" : "") . ">";
        $linkclose = "</a>";
        $tbl->addRow(array("<input type=\"checkbox\" name=\"selectedclients[]\" value=\"" . $client['id'] . "\" class=\"checkall\">", $linkopen . $client['id'] . $linkclose, $linkopen . $client['firstname'] . $linkclose, $linkopen . $client['lastname'] . $linkclose, $client['companyname'], "<a href=\"mailto:" . $client['email'] . "\">" . $client['email'] . "</a>", $client['services'] . " (" . $client['totalservices'] . ")", $client['datecreated'], "<span class=\"label " . strtolower($client['status']) . "\">" . $client['status'] . "</span>"));
    }
    $tbl->setMassActionURL("sendmessage.php?type=general&multiple=true");
    $tbl->setMassActionBtns("<input type=\"submit\" value=\"" . $aInt->lang("global", "sendmessage") . "\" class=\"btn\" />");
    echo $tbl->output();
    unset($clientlist);
    unset($clientsModel);
}
$content = ob_get_contents();
ob_end_clean();
$aInt->content = $content;
$aInt->display();
Ejemplo n.º 2
0
    $pageObj->digestCookieData();
    $tbl = new WHMCS_ListTable($pageObj);
    $tbl->setColumns(array("checkall", array("id", $aInt->lang("fields", "id")), array("ordernum", $aInt->lang("fields", "ordernum")), array("date", $aInt->lang("fields", "date")), $aInt->lang("fields", "clientname"), array("paymentmethod", $aInt->lang("fields", "paymentmethod")), array("amount", $aInt->lang("fields", "total")), $aInt->lang("fields", "paymentstatus"), array("status", $aInt->lang("fields", "status")), ""));
    $criteria = array("clientid" => $clientid, "amount" => $amount, "orderid" => $orderid, "ordernum" => $ordernum, "orderip" => $orderip, "orderdate" => $orderdate, "clientname" => $clientname, "paymentstatus" => $paymentstatus, "status" => $status);
    $ordersModel = new WHMCS_Orders($pageObj);
    $ordersModel->execute($criteria);
    $numresults = $pageObj->getNumResults();
    if ($filters->isActive() && $numresults == 1) {
        $order = $pageObj->getOne();
        redir("action=view&id=" . $order['id']);
    } else {
        $orderlist = $pageObj->getData();
        foreach ($orderlist as $order) {
            $tbl->addRow(array("<input type=\"checkbox\" name=\"selectedorders[]\" value=\"" . $order['id'] . "\" class=\"checkall\">", "<a href=\"" . $PHP_SELF . "?action=view&id=" . $order['id'] . "\"><b>" . $order['id'] . "</b></a>", $order['ordernum'], $order['date'], $order['clientname'], $order['paymentmethod'], $order['amount'], $order['paymentstatusformatted'], $order['statusformatted'], "<a href=\"#\" onClick=\"doDelete('" . $order['id'] . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Delete\"></a>"));
        }
        $tbl->setMassActionBtns("<input type=\"submit\" name=\"massaccept\" value=\"" . $aInt->lang("orders", "accept") . "\" class=\"btn-success\" onclick=\"return confirm('" . $aInt->lang("orders", "acceptconfirm", "1") . "')\" /> <input type=\"submit\" name=\"masscancel\" value=\"" . $aInt->lang("orders", "cancel") . "\" onclick=\"return confirm('" . $aInt->lang("orders", "cancelconfirm", "1") . "')\" /> <input type=\"submit\" name=\"massdelete\" value=\"" . $aInt->lang("orders", "delete") . "\" class=\"btn-danger\" onclick=\"return confirm('" . $aInt->lang("orders", "deleteconfirm", "1") . "')\" /> <input type=\"submit\" name=\"sendmessage\" value=\"" . $aInt->lang("global", "sendmessage") . "\" />");
        echo $tbl->output();
        unset($orderlist);
        unset($ordersModel);
    }
} else {
    if ($action == "view") {
        if ($whmcs->get_req_var("activate")) {
            check_token("WHMCS.admin.default");
            $errors = acceptOrder($id, $vars);
            wSetCookie("OrderAccept", $errors);
            redir("action=view&id=" . $id . "&activated=true");
            exit;
        }
        if ($whmcs->get_req_var("cancel")) {
            check_token("WHMCS.admin.default");
Ejemplo n.º 3
0
    $aInt->jquerycode = $jquerycode;
    $filters->store();
    $criteria = array("clientid" => $clientid, "clientname" => $clientname, "invoicenum" => $invoicenum, "lineitem" => $lineitem, "paymentmethod" => $paymentmethod, "invoicedate" => $invoicedate, "duedate" => $duedate, "datepaid" => $datepaid, "totalfrom" => $totalfrom, "totalto" => $totalto, "status" => $status);
    $invoicesModel->execute($criteria);
    $numresults = $pageObj->getNumResults();
    if ($filters->isActive() && $numresults == 1) {
        $invoice = $pageObj->getOne();
        redir("action=edit&id=" . $invoice['id'], "invoices.php");
    } else {
        $invoicelist = $pageObj->getData();
        foreach ($invoicelist as $invoice) {
            $linkopen = "<a href=\"invoices.php?action=edit&id=" . $invoice['id'] . "\">";
            $linkclose = "</a>";
            $tbl->addRow(array("<input type=\"checkbox\" name=\"selectedinvoices[]\" value=\"" . $invoice['id'] . "\" class=\"checkall\">", $linkopen . $invoice['invoicenum'] . $linkclose, $invoice['clientname'], $invoice['date'], $invoice['duedate'], "<a href=\"invoices.php?action=invtooltip&id=" . $invoice['id'] . "&userid=" . $invoice['userid'] . generate_token("link") . "\" class=\"invtooltip\" lang=\"\">" . $invoice['totalformatted'] . "</a>", $invoice['paymentmethod'], $invoice['statusformatted'], $linkopen . "<img src=\"images/edit.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Edit\">" . $linkclose, "<a href=\"#\" onClick=\"doDelete('" . $invoice['id'] . "');return false\"><img src=\"images/delete.gif\" width=\"16\" height=\"16\" border=\"0\" alt=\"Delete\"></a>"));
        }
        $tbl->setMassActionBtns("<input type=\"submit\" value=\"" . $aInt->lang("invoices", "markpaid") . "\" class=\"btn-success\" name=\"markpaid\" onclick=\"return confirm('" . $aInt->lang("invoices", "markpaidconfirm", "1") . "')\" /> <input type=\"submit\" value=\"" . $aInt->lang("invoices", "markunpaid") . "\" name=\"markunpaid\" onclick=\"return confirm('" . $aInt->lang("invoices", "markunpaidconfirm", "1") . "')\" /> <input type=\"submit\" value=\"" . $aInt->lang("invoices", "markcancelled") . "\" name=\"markcancelled\" onclick=\"return confirm('" . $aInt->lang("invoices", "markcancelledconfirm", "1") . "')\" /> <input type=\"submit\" value=\"" . $aInt->lang("invoices", "duplicateinvoice") . "\" name=\"duplicateinvoice\" onclick=\"return confirm('" . $aInt->lang("invoices", "duplicateinvoiceconfirm", "1") . "')\" /> <input type=\"submit\" value=\"" . $aInt->lang("invoices", "sendreminder") . "\" name=\"paymentreminder\" onclick=\"return confirm('" . $aInt->lang("invoices", "sendreminderconfirm", "1") . "')\" /> <input type=\"submit\" value=\"" . $aInt->lang("global", "delete") . "\" class=\"btn-danger\" name=\"massdelete\"  onclick=\"return confirm('" . $aInt->lang("invoices", "massdeleteconfirm", "1") . "')\" />");
        echo $tbl->output();
        unset($clientlist);
        unset($invoicesModel);
    }
} else {
    if ($action == "edit") {
        $result = select_query("tblinvoices", "userid,paymentmethod", array("id" => $id));
        $data = mysql_fetch_array($result);
        $userid = $data[0];
        $oldpaymentmethod = $data[1];
        if ($saveoptions) {
            check_token("WHMCS.admin.default");
            update_query("tblinvoices", array("date" => toMySQLDate($invoicedate), "duedate" => toMySQLDate($datedue), "paymentmethod" => $paymentmethod, "invoicenum" => $invoicenum, "taxrate" => $taxrate, "taxrate2" => $taxrate2, "status" => $status), array("id" => $id));
            updateInvoiceTotal($id);
            if ($oldpaymentmethod != $paymentmethod) {