Пример #1
0
function checkActiveGateway()
{
    if (count(getGatewaysArray())) {
        return true;
    }
    return false;
}
Пример #2
0
function widget_open_invoices($vars)
{
    global $_ADMINLANG, $currency;
    $title = $_ADMINLANG['home']['openinvoices'];
    if (!function_exists("getGatewaysArray")) {
        require ROOTDIR . "/includes/gatewayfunctions.php";
    }
    $gatewaysarray = getGatewaysArray();
    $content = '<table class="table table-condensed">
<tr style="background-color:#efefef;font-weight:bold;text-align:center"><td>' . $_ADMINLANG['fields']['invoicenum'] . '</td><td>' . $_ADMINLANG['fields']['clientname'] . '</td><td>' . $_ADMINLANG['fields']['invoicedate'] . '</td><td>' . $_ADMINLANG['fields']['duedate'] . '</td><td>' . $_ADMINLANG['fields']['totaldue'] . '</td><td>' . $_ADMINLANG['fields']['paymentmethod'] . '</td><td width="20"></td></tr>
';
    $id = '';
    $query = "SELECT tblinvoices.*,tblinvoices.total-COALESCE((SELECT SUM(amountin) FROM tblaccounts WHERE tblaccounts.invoiceid=tblinvoices.id),0) AS invoicebalance,tblclients.firstname,tblclients.lastname FROM tblinvoices INNER JOIN tblclients ON tblclients.id=tblinvoices.userid WHERE tblinvoices.status='Unpaid' ORDER BY duedate,date ASC LIMIT 0,5";
    $result = full_query($query);
    while ($data = mysql_fetch_array($result)) {
        $id = $data["id"];
        $invoicenum = $data["invoicenum"];
        $userid = $data["userid"];
        $firstname = $data["firstname"];
        $lastname = $data["lastname"];
        $date = $data["date"];
        $duedate = $data["duedate"];
        $total = $data["total"];
        $invoicebalance = $data["invoicebalance"];
        $paymentmethod = $data["paymentmethod"];
        $paymentmethod = $gatewaysarray[$paymentmethod];
        $date = fromMySQLDate($date);
        $duedate = fromMySQLDate($duedate);
        $currency = getCurrency($userid);
        if (!$invoicenum) {
            $invoicenum = $id;
        }
        $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td><a href="invoices.php?action=edit&id=' . $id . '">' . $invoicenum . '</a></td><td>' . $firstname . ' ' . $lastname . '</td><td>' . $date . '</td><td>' . $duedate . '</td><td>' . formatCurrency($total) . '</td><td>' . $paymentmethod . '</td><td><a href="invoices.php?action=edit&id=' . $id . '"><img src="images/edit.gif" border="0" /></a></td></tr>';
    }
    if (!$id) {
        $content .= '<tr bgcolor="#ffffff" style="text-align:center;"><td colspan="7">' . $_ADMINLANG['global']['norecordsfound'] . '</td></tr>';
    }
    $content .= '</table>
<div class="widget-footer">
    <a href="invoices.php?status=Unpaid" class="btn btn-info btn-sm">' . $_ADMINLANG['home']['viewall'] . ' &raquo;</a>
</div>';
    return array('title' => $title, 'content' => $content);
}
Пример #3
0
                         infoBox($aInt->lang("orders", "statusrefundfailed"), $aInt->lang("orders", "statusrefundnoauto"), "error");
                     } else {
                         infoBox($aInt->lang("orders", "statusrefundsuccess"), $aInt->lang("orders", "statusrefundsuccessmsg"), "success");
                     }
                 }
             }
         }
     }
 }
 if ($whmcs->get_req_var("updatenotes")) {
     check_token("WHMCS.admin.default");
     update_query("tblorders", array("notes" => $notes), array("id" => $id));
     exit;
 }
 echo $infobox;
 $gatewaysarray = getGatewaysArray();
 require ROOTDIR . "/includes/countries.php";
 $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));
Пример #4
0
 sort($ordertemplates);
 foreach ($ordertemplates as $template) {
     $thumbnail = "../templates/orderforms/" . $template . "/thumbnail.gif";
     if (!file_exists($thumbnail)) {
         $thumbnail = "images/ordertplpreview.gif";
     }
     echo "<div style=\"float:left;padding:10px;text-align:center;\"><label><img src=\"" . $thumbnail . "\" width=\"165\" height=\"90\" style=\"border:5px solid #fff;\" /><br /><input type=\"radio\" name=\"orderfrmtpl\" value=\"" . $template . "\"";
     if ($template == $orderfrmtpl) {
         echo " checked";
     }
     echo "> " . ucfirst($template) . "</label></div>";
 }
 echo "</td></tr>\n<tr><td class=\"fieldlabel\"><br></td><td class=\"fieldarea\"></td></tr>\n<tr><td class=\"fieldlabel\">";
 echo $aInt->lang("products", "availablepgways");
 echo "</td><td class=\"fieldarea\">";
 $gateways = getGatewaysArray();
 foreach ($gateways as $gateway => $name) {
     echo "<label><input type=\"checkbox\" name=\"gateways[" . $gateway . "]\"" . (!in_array($gateway, $disabledgateways) ? " checked" : "") . " /> " . $name . "</label><br />";
 }
 echo "</td></tr>\n<tr><td class=\"fieldlabel\"><br></td><td class=\"fieldarea\"></td></tr>\n<tr><td class=\"fieldlabel\">";
 echo $aInt->lang("fields", "hidden");
 echo "</td><td class=\"fieldarea\"><label><input type=\"checkbox\" name=\"hidden\"";
 if ($hidden == "on") {
     echo " checked";
 }
 echo "> ";
 echo $aInt->lang("products", "hiddengroupdesc");
 echo "</label></td></tr>\n";
 if ($ids) {
     echo "<tr><td class=\"fieldlabel\"><br></td><td class=\"fieldarea\"></td></tr>\n<tr><td class=\"fieldlabel\">";
     echo $aInt->lang("products", "directcartlink");
Пример #5
0
        $where = "WHERE did='" . mysql_real_escape_string($deptid) . "'";
    }
    $result = full_query("SELECT status, COUNT(*) AS count FROM tbltickets " . $where . " GROUP BY status");
    while ($data = mysql_fetch_array($result)) {
        $statuses[$data['status']] = $data['count'];
    }
    foreach ($statuses as $status => $ticketcount) {
        $apiresults['supportstatuses']['status'][] = array("title" => $status, "count" => $ticketcount);
    }
    $deptartments = array();
    $result = full_query("SELECT id, name FROM tblticketdepartments");
    while ($data = mysql_fetch_assoc($result)) {
        $deptartments[$data['id']] = $data['name'];
    }
    foreach ($deptartments as $deptid => $deptname) {
        $apiresults['supportdepartments']['department'][] = array("id" => $deptid, "name" => $deptname, "count" => get_query_val("tbltickets", "COUNT(id)", array("did" => $deptid)));
    }
    $gateways = array();
    $result = select_query("tblpaymentgateways", "gateway,value", array("setting" => "name"));
    while ($data = mysql_fetch_assoc($result)) {
        $gateways[$data['gateway']] = $data['value'];
    }
    if (!function_exists("getGatewaysArray")) {
        require ROOTDIR . "/includes/gatewayfunctions.php";
    }
    $paymentmethods = getGatewaysArray();
    foreach ($paymentmethods as $module => $name) {
        $apiresults['paymentmethods']['paymentmethod'][] = array("module" => $module, "displayname" => $name);
    }
}
$apiresults['requesttime'] = date("Y-m-d H:i:s");