Example #1
0
        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");
            changeOrderStatus($id, "Cancelled");
            redir("action=view&id=" . $id . "&cancelled=true");
            exit;
        }
        if ($whmcs->get_req_var("fraud")) {
            check_token("WHMCS.admin.default");
            changeOrderStatus($id, "Fraud");
            redir("action=view&id=" . $id . "&frauded=true");
            exit;
Example #2
0
$result = select_query("tblorders", "", array("id" => $orderid, "status" => "Pending"));
$data = mysql_fetch_array($result);
$orderid = $data['id'];
if (!$orderid) {
    $apiresults = array("result" => "error", "message" => "Order ID not found or Status not Pending");
    return null;
}
$ordervars = array();
if (isset($_REQUEST['serverid'])) {
    $ordervars['api']['serverid'] = $_REQUEST['serverid'];
}
if (isset($_REQUEST['serviceusername'])) {
    $ordervars['api']['username'] = $_REQUEST['serviceusername'];
}
if (isset($_REQUEST['servicepassword'])) {
    $ordervars['api']['password'] = $_REQUEST['servicepassword'];
}
if (isset($_REQUEST['registrar'])) {
    $ordervars['api']['registrar'] = $_REQUEST['registrar'];
}
if (isset($_REQUEST['sendregistrar'])) {
    $ordervars['api']['sendregistrar'] = $_REQUEST['sendregistrar'];
}
if (isset($_REQUEST['autosetup'])) {
    $ordervars['api']['autosetup'] = $_REQUEST['autosetup'];
}
if (isset($_REQUEST['sendemail'])) {
    $ordervars['api']['sendemail'] = $_REQUEST['sendemail'];
}
acceptOrder($orderid, $ordervars);
$apiresults = array("result" => "success");