Exemple #1
0
function useInvite($accountsDb, $code)
{
    $invite = getProperty($accountsDb->invites, $code);
    $now = time();
    if (outstanding($invite)) {
        $invite->accepted = true;
        saveAccountsDb($accountsDb);
        logEvent("use-invite", $invite);
    }
    return $invite && $invite->accepted;
}
Exemple #2
0
// ############################################
define('ADMIN_PERMISSION', 'ALL');
require 'includes/application_top.php';
global ${$link};
require DIR_FS_LANGUAGES . $language . '/index.php';
$theweek = date('Y-m-d 00:00:01', strtotime('monday this week - 1 days'));
// # logic to update running outstanding orders count in order Manager tab
if (isset($_GET['orders']) && $_GET['orders'] == 'outstanding') {
    function outstanding()
    {
        $outstanding_query = tep_db_query("SELECT COUNT(0) FROM orders WHERE (orders_status = '1' OR orders_status ='2')");
        $outstanding = tep_db_num_rows($outstanding_query) > 0 ? tep_db_result($outstanding_query, 0) : 0;
        tep_db_free_result($outstanding_query);
        return $outstanding;
    }
    echo outstanding();
    exit;
}
if (isset($_GET['orders']) && $_GET['orders'] == 'orders_shipped') {
    function orders_shipped()
    {
        $orders_shipped_query = tep_db_query("SELECT COUNT(DISTINCT orders_id) AS ct\r\n\t\t\t\t\t\t\t\t\t\t\t\t   FROM orders_status_history\r\n\t\t\t\t\t\t\t\t\t\t\t\t   WHERE date_added >= CURDATE()\r\n\t\t\t\t\t\t\t\t\t\t\t\t   AND orders_status_id = '3'\r\n\t\t\t\t\t\t\t\t\t\t\t\t  ");
        $orders_shipped = tep_db_num_rows($orders_shipped_query) > 0 ? tep_db_result($orders_shipped_query, 0) : 0;
        tep_db_free_result($orders_shipped_query);
        return $orders_shipped;
    }
    echo orders_shipped();
    exit;
}
if (isset($_GET['orders']) && $_GET['orders'] == 'orders_returns') {
    function orders_returns()