コード例 #1
0
ファイル: orders.php プロジェクト: billyprice1/whmcs
 echo $aInt->lang("fields", "amount");
 echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"amount\" value=\"";
 echo $amount = $filters->get("amount");
 echo "\" size=\"10\"></td><td class=\"fieldlabel\">";
 echo $aInt->lang("fields", "ipaddress");
 echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"orderip\" value=\"";
 echo $orderip = $filters->get("orderip");
 echo "\" size=\"20\"></td></tr>\n</table>\n\n<img src=\"images/spacer.gif\" height=\"8\" width=\"1\"><br>\n<div align=\"center\"><input type=\"submit\" value=\"";
 echo $aInt->lang("global", "search");
 echo "\" class=\"button\"></div>\n\n</form>\n\n  </div>\n</div>\n\n<br>\n\n";
 $filters->store();
 $aInt->deleteJSConfirm("doDelete", "orders", "confirmdelete", "orders.php?action=delete&id=");
 $name = "orders";
 $orderby = "id";
 $sort = "DESC";
 $pageObj = new WHMCS_Pagination($name, $orderby, $sort);
 $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>"));
     }
コード例 #2
0
ファイル: clients.php プロジェクト: billyprice1/whmcs
 * @ Version  : 5.2.15
 * @ Author   : MTIMER
 * @ Release on : 2013-12-24
 * @ Website  : http://www.mtimer.cn
 *
 **/
define("ADMINAREA", true);
require "../init.php";
$aInt = new WHMCS_Admin("List Clients");
$aInt->title = $aInt->lang("clients", "viewsearch");
$aInt->sidebar = "clients";
$aInt->icon = "clients";
$name = "clients";
$orderby = "id";
$sort = "DESC";
$pageObj = new WHMCS_Pagination($name, $orderby, $sort);
$pageObj->digestCookieData();
$tbl = new WHMCS_ListTable($pageObj);
$tbl->setColumns(array("checkall", array("id", $aInt->lang("fields", "id")), array("firstname", $aInt->lang("fields", "firstname")), array("lastname", $aInt->lang("fields", "lastname")), array("companyname", $aInt->lang("fields", "companyname")), array("email", $aInt->lang("fields", "email")), $aInt->lang("fields", "services"), array("datecreated", $aInt->lang("fields", "created")), array("status", $aInt->lang("fields", "status"))));
$clientsModel = new WHMCS_Clients($pageObj);
$filters = new WHMCS_Filter();
ob_start();
echo $aInt->Tabs(array($aInt->lang("global", "searchfilter")), true);
$userid = $filters->get("userid");
$country = $filters->get("country");
echo "<div id=\"tab0box\" class=\"tabbox\">\n  <div id=\"tab_content\">\n\n<form action=\"clients.php\" method=\"post\">\n<table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n<tr><td width=\"15%\" class=\"fieldlabel\">";
echo $aInt->lang("fields", "clientname");
echo "</td><td class=\"fieldarea\"><input type=\"text\" name=\"clientname\" size=\"30\" value=\"";
echo $clientname = $filters->get("clientname");
echo "\" /></td><td width=\"15%\" class=\"fieldlabel\">";
echo $aInt->lang("fields", "companyname");
コード例 #3
0
function domaincloud_output($vars)
{
    require_once "config.php";
    $uid = isset($_REQUEST['userid']) ? $_REQUEST['userid'] : "";
    $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : "";
    $domainid = isset($_REQUEST['domainid']) ? $_REQUEST['domainid'] : "";
    $document_download = isset($_REQUEST['dl']) ? $_REQUEST['dl'] : "";
    $document_name = isset($_REQUEST['doc_name']) ? $_REQUEST['doc_name'] : "";
    $domainname = isset($_POST["domainname"]) ? $_POST["domainname"] : "";
    $domain_status = isset($_POST["domain_status"]) ? $_POST["domain_status"] : "";
    $transfersecret = isset($_POST["transfersecret"]) ? $_POST["transfersecret"] : "";
    $current_date = date('Y-m-d');
    $aInt = new WHMCS_Admin();
    $name = "";
    $orderby = "id";
    $sort = "DESC";
    $pageObj = new WHMCS_Pagination($name, $orderby, $sort);
    $pageObj->digestCookieData();
    $domainsModel = new WHMCS_DomainDocuments($pageObj);
    ob_start();
    echo "\n    <a href=\"addonmodules.php?module=domaincloud\" style=\"text-decoration: none\">\n        <span style=\"background-color: #84B429; padding: 5px; color: #fff;\">\n            &larr;<i class=\"fa fa-home\"></i> Go to Dashboard\n        </span>\n    </a><br /><br />";
    echo $aInt->Tabs(array($aInt->lang("global", "searchfilter")), true) . "\n    <div id=\"tab0box\" class=\"tabbox\" style=\"display: block;\">\n        <div id=\"tab_content\">\n            <form action=\"addonmodules.php?module=domaincloud\" method=\"post\">\n                <table class=\"form\" width=\"100%\" border=\"0\" cellspacing=\"2\" cellpadding=\"3\">\n                    <tbody>\n                        <tr>\n                            <td width=\"15%\" class=\"fieldlabel\">Domain Name</td>\n                            <td class=\"fieldarea\"><input type=\"text\" name=\"domainname\" size=\"30\" value=\"\"></td>\n                        </tr>\n                    </tbody>\n                </table>\n                <p align=\"center\"><input type=\"submit\" id=\"search-clients\" value=\"Search\" class=\"button\"></p>\n            </form>\n        </div>\n    </div>\n    <br />\n    <script type=\"text/javascript\">\n        \$(document).ready(function() {\n            \$(\".tabbox\").css(\"display\",\"none\");\n            var selectedTab;\n            \$(\".tab\").click(function(){\n                var elid = \$(this).attr(\"id\");\n                \$(\".tab\").removeClass(\"tabselected\");\n                \$(\"#\"+elid).addClass(\"tabselected\");\n                \$(\".tabbox\").slideUp();\n                if (elid != selectedTab) {\n                    selectedTab = elid;\n                    \$(\"#\"+elid+\"box\").slideDown();\n                } else {\n                    selectedTab = null;\n                    \$(\".tab\").removeClass(\"tabselected\");\n                }\n                \$(\"#tab\").val(elid.substr(3));\n            });\n        });\n    </script>\n    ";
    $criteria = array("domainname" => $domainname, "domainid" => $domainid);
    $section = new WHMCS_DomainCloudFunctions($domainid);
    $tbl = new WHMCS_AddonListTable($pageObj);
    $tbl->setColumns(array("checkall", "Domain", "Identity Document", "Legality Document", "Other Document", "Registration Date", "Special Action", "Domain Status", "Payment"));
    $domainsModel->execute($criteria);
    $numresults = $pageObj->getNumResults();
    $domainlist = $pageObj->getData();
    foreach ($domainlist as $dom) {
        $linkopen = "<a href=\"clientsdomains.php?userid=" . $dom['userid'] . "&id=" . $dom['id'] . "\">";
        $linkclose = "</a>";
        $actionlink = "<a href=\"addonmodules.php?module=domaincloudReseller&amp;userid=" . $dom['id'] . "&amp;action=generate_key\" style=\"text-decoration: none;\"><span class=\"label active\">Generate New Key <i class=\"fa fa-comment-o\"></i></span></a> " . ($dom['disabled'] ? "<a href=\"addonmodules.php?module=domaincloudReseller&amp;userid=" . $dom['id'] . "&amp;action=enable_api\" style=\"text-decoration: none;\"><span class=\"label upload\">Enable API <i class=\"fa fa-comment-o\"></i></span></a>" : "<a href=\"addonmodules.php?module=domaincloudReseller&amp;userid=" . $dom['id'] . "&amp;action=disable_api\" style=\"text-decoration: none;\"><span class=\"label closed\">Disable API <i class=\"fa fa-comment-o\"></i></span></a>");
        $tbl->addRow(array("<input type=\"checkbox\" name=\"selecteddomains[]\" value=\"" . $dom['id'] . "\" class=\"checkall\">", $linkopen . $dom['domain'] . $linkclose, ($dom['id_doc_storage_name'] ? "<a href=\"addonmodules.php?module=domaincloud&amp;userid=" . $dom['userid'] . "&amp;a=download_1&amp;domainid=" . $dom['id'] . "&amp;doc_name=" . $dom['id_doc_storage_name'] . "\" style=\"text-decoration: none;\"><span class=\"label check\">Manage <i class=\"fa fa-comment-o\"></i></span></a> &#124; " : "") . "<a href=\"addonmodules.php?module=domaincloud&amp;userid=" . $dom['userid'] . "&amp;a=upload_1&amp;domainid=" . $dom['id'] . "\" style=\"text-decoration: none;\"><span class=\"label upload\">Upload <i class=\"fa fa-upload\"></i></span></a>", ($dom['le_doc_storage_name'] ? "<a href=\"addonmodules.php?module=domaincloud&amp;userid=" . $dom['userid'] . "&amp;a=download_2&amp;domainid=" . $dom['id'] . "&amp;doc_name=" . $dom['le_doc_storage_name'] . "\" style=\"text-decoration: none;\"><span class=\"label check\">Manage <i class=\"fa fa-comment-o\"></i></span></a> &#124; " : "") . "<a href=\"addonmodules.php?module=domaincloud&amp;userid=" . $dom['userid'] . "&amp;a=upload_2&amp;domainid=" . $dom['id'] . "\" style=\"text-decoration: none;\"><span class=\"label upload\">Upload <i class=\"fa fa-upload\"></i></span></a>", ($dom['su_doc_storage_name'] ? "<a href=\"addonmodules.php?module=domaincloud&amp;userid=" . $dom['userid'] . "&amp;a=download_3&amp;domainid=" . $dom['id'] . "&amp;doc_name=" . $dom['su_doc_storage_name'] . "\" style=\"text-decoration: none;\"><span class=\"label check\">Manage <i class=\"fa fa-comment-o\"></i></span></a> &#124; " : "") . "<a href=\"addonmodules.php?module=domaincloud&amp;userid=" . $dom['userid'] . "&amp;a=upload_3&amp;domainid=" . $dom['id'] . "\" style=\"text-decoration: none;\"><span class=\"label upload\">Upload <i class=\"fa fa-upload\"></i></span></a>", $dom['registrationdate'], "<a href=\"addonmodules.php?module=domaincloud&amp;userid=" . $dom['userid'] . "&amp;a=transfer&amp;domainid=" . $dom['id'] . "\" style=\"text-decoration: none;\"><span class=\"label check\">Renew via Transfer</span></a>", $dom['domain_status'] == 3 ? "<span class=\"label active\">Approved</span>" : ($dom['domain_status'] == 2 ? "<span class=\"label pending\">Review</span>" : ($dom['domain_status'] == 1 ? "<span class=\"label closed\">Rejected</span>" : "")), $dom['status'] == 'Paid' ? "<span class=\"label active\">" . $dom['status'] . "</span>" : "<span class=\"label cancelled\">" . $dom['status'] . "</span>"));
    }
    echo $tbl->output("domaincloud");
    $output = ob_get_contents();
    ob_end_clean();
    echo $output;
    if ($uid && $action && $domainid) {
        $query = full_query("\n            SELECT t.*, m.domain AS coza_domain, m.id_doc_storage_name, m.le_doc_storage_name, m.su_doc_storage_name, m.domain_approval_date, m.domain_status\n                FROM tbldomains t\n                LEFT JOIN mod_domaincloudregistrar m ON t.id = m.domainid\n                WHERE t.id = " . $domainid . "\n            ");
        $rows = mysql_fetch_array($query);
        $domain = $rows['domain'];
        if ($_FILES["file"]["error"] > 0) {
            echo "Error: " . $_FILES["file"]["error"] . "<br>";
        } else {
            if ($_FILES["file"]["name"] != null) {
                $ext = pathinfo($_FILES["file"]["name"], PATHINFO_EXTENSION);
                $filename = md5($uid . $domain . $action) . "." . $ext;
                move_uploaded_file($_FILES["file"]["tmp_name"], $upload_path . $filename);
                $domainparts = explode(".", $domain, 2);
                $config = getregistrarconfigoptions('domainku');
                $data = array("action" => 'UploadFile', "token" => $config['Token'], "authemail" => $config['AuthEmail'], "sld" => $domainparts[0], "tld" => $domainparts[1], "file" => '@' . $upload_path . $filename . ';filename=' . $filename . ';type=' . $_FILES['file']['type'], "user_action" => $action, "doc_type" => $_POST['doc_type']);
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_URL, $api_endpoint);
                curl_setopt($ch, CURLOPT_TIMEOUT, 0);
                curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
                curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
                curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
                curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($ch, CURLOPT_HEADER, false);
                $output = curl_exec($ch);
                if ($output == false) {
                    $res = array("error" => curl_error($ch));
                } else {
                    $res = json_decode($output, true);
                }
                curl_close($ch);
                if (empty($res['error'])) {
                    $values = array("userid" => $uid, "domain" => $domain);
                    if ($action == "upload_1") {
                        $values["id_doc_storage_name"] = $filename;
                        $values["id_doc_type"] = $_POST["doc_type"];
                    }
                    if ($action == "upload_2") {
                        $values["le_doc_storage_name"] = $filename;
                        $values["le_doc_type"] = $_POST["doc_type"];
                    }
                    if ($action == "upload_3") {
                        $values["su_doc_storage_name"] = $filename;
                        $values["su_doc_type"] = $_POST["doc_type"];
                    }
                    if ($rows["coza_domain"] == $domain && $filename) {
                        $query = update_query("mod_domaincloudregistrar", $values, array("domainid" => $domainid));
                    } else {
                        $values['domainid'] = $domainid;
                        $values['domain_registration_date'] = $rows['registrationdate'];
                        $values['domain_status'] = "2";
                        $query = insert_query("mod_domaincloudregistrar", $values);
                    }
                    $query = update_query("tbldomains", array("registrar" => "domainku"), array("id" => $domainid));
                    redir("module=domaincloud");
                }
            }
        }
        if (strpos($action, 'upload') !== false) {
            echo $section->outputUploadSection($domain, $action);
        } elseif (strpos($action, 'dl') !== false) {
            $file = $upload_path . $document_name;
            if (file_exists($file)) {
                header('Content-Description: File Transfer');
                header('Content-Type: application/octet-stream');
                header('Content-Disposition: attachment; filename=' . basename($file));
                header('Content-Transfer-Encoding: binary');
                header('Expires: 0');
                header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                header('Pragma: public');
                header('Content-Length: ' . filesize($file));
                ob_clean();
                flush();
                readfile($file);
                exit;
            }
        } elseif (strpos($action, 'download') !== false) {
            echo $section->outputDownloadSection($domain, $domainid, $uid, $document_name, $action, $domain_status);
            $file = $upload_path . $document_name;
            if ($rows["coza_domain"] == $domain && $domain_status != "") {
                $mvalues = array("domain_status" => $domain_status);
                $params = array();
                $params['userid'] = $uid;
                $params['domainid'] = $domainid;
                $domainparts = explode(".", $domain, 2);
                $params['sld'] = $domainparts[0];
                $params['tld'] = $domainparts[1];
                $params['regperiod'] = $rows['registrationperiod'];
                $params['registrar'] = $rows['registrar'];
                $params['regtype'] = $rows['type'];
                if ($domain_status == 3) {
                    if ($rows['type'] == 'Register') {
                        $result_epp = RegRegisterDomain($params);
                    } elseif ($rows['type'] == 'Transfer') {
                        $params['transfersecret'] = $rows['transfersecret'];
                        $result_epp = RegTransferDomain($params);
                    }
                    if (!$result_epp['error']) {
                        $mvalues['domain_approval_date'] = $current_date;
                        echo "\n                        <div class=\"infobox\">\n                            <strong><span class=\"title\">Registrar Status</span></strong><br />" . $result_epp['status'] . "\n                        </div>\n                        ";
                    } else {
                        $mvalues['domain_status'] = $rows['domain_status'];
                        echo "\n        \t\t\t\t<div class=\"infobox\">\n        \t\t\t\t\t<strong><span class=\"title\">Registrar Error</span></strong><br>" . $result_epp['error'] . "\n        \t\t\t\t</div>\n        \t\t\t\t";
                    }
                }
                $query = update_query("mod_domaincloudregistrar", $mvalues, array("domainid" => $domainid));
            }
        } elseif (strpos($action, 'transfer') !== false) {
            echo "\n            <form method=\"post\">\n                EPP Code: <input type=\"textbox\" name=\"transfersecret\" id=\"transfersecret\" value=\"\">\n                <input type=\"submit\" value=\"Submit Domain Renewal via Transfer\">\n            </form>";
            if (!empty($transfersecret)) {
                $params = array();
                $params['userid'] = $uid;
                $params['domainid'] = $rows['id'];
                $domainparts = explode(".", $domain, 2);
                $params['sld'] = $domainparts[0];
                $params['tld'] = $domainparts[1];
                $params['regperiod'] = $rows['registrationperiod'];
                $params['registrar'] = $rows['registrar'];
                $params['regtype'] = 'transfer';
                $params['transfersecret'] = $transfersecret;
                $result_epp = RegTransferDomain($params);
                if (!$result_epp['error']) {
                    # Set domain approval to 'Approved'.
                    $query = update_query("mod_domaincloudregistrar", array("domain_approval_date" => $current_date, "domain_status" => 3), array("domainid" => $rows['id']));
                    # Check domain status, if 'Pending Transfer' set it to 'Active'.
                    $query = update_query("tbldomains", array("status" => "Active"), array("domainid" => $rows['id'], "status" => "Pending Transfer"));
                    echo "\n                    <div class=\"infobox\">\n                        <strong><span class=\"title\">Registrar Status</span></strong><br />Command completed successfully.\n                    </div>\n                    ";
                } else {
                    echo "\n    \t\t\t\t<div class=\"infobox\">\n    \t\t\t\t\t<strong><span class=\"title\">Registrar Error</span></strong><br>" . $result_epp['error'] . "\n    \t\t\t\t</div>\n    \t\t\t\t";
                }
            }
        }
    }
}
コード例 #4
0
ファイル: invoices.php プロジェクト: billyprice1/whmcs
    $filters->redir();
}
if ($whmcs->get_req_var("delete")) {
    check_token("WHMCS.admin.default");
    checkPermission("Delete Invoice");
    delete_query("tblinvoices", array("id" => $invoiceid));
    logActivity("Deleted Invoice - Invoice ID: " . $invoiceid);
    $filters->redir();
}
ob_start();
if ($action == "") {
    $aInt->deleteJSConfirm("doDelete", "invoices", "delete", $_SERVER['PHP_SELF'] . "?status=" . $status . "&delete=true&invoiceid=");
    $name = "invoices";
    $orderby = "duedate";
    $sort = "DESC";
    $pageObj = new WHMCS_Pagination($name, $orderby, $sort);
    $pageObj->digestCookieData();
    $tbl = new WHMCS_ListTable($pageObj);
    $tbl->setColumns(array("checkall", array("id", $aInt->lang("fields", "invoicenum")), array("clientname", $aInt->lang("fields", "clientname")), array("date", $aInt->lang("fields", "invoicedate")), array("duedate", $aInt->lang("fields", "duedate")), array("total", $aInt->lang("fields", "total")), array("paymentmethod", $aInt->lang("fields", "paymentmethod")), array("status", $aInt->lang("fields", "status")), "", ""));
    $invoicesModel = new WHMCS_Invoices($pageObj);
    if (checkPermission("View Income Totals", true)) {
        $invoicetotals = $invoicesModel->getInvoiceTotals();
        if (count($invoicetotals)) {
            echo "<div class=\"contentbox\" style=\"font-size:18px;\">";
            foreach ($invoicetotals as $vals) {
                echo "<b>" . $vals['currencycode'] . "</b> " . $aInt->lang("status", "paid") . ": <span class=\"textgreen\"><b>" . $vals['paid'] . "</b></span> " . $aInt->lang("status", "unpaid") . ": <span class=\"textred\"><b>" . $vals['unpaid'] . "</b></span> " . $aInt->lang("status", "overdue") . ": <span class=\"textblack\"><b>" . $vals['overdue'] . "</b></span><br />";
            }
            echo "</div><br />";
        }
    }
    echo $aInt->Tabs(array($aInt->lang("global", "searchfilter")), true);