Example #1
0
if (cfr('REPORTTARIFFS')) {
    $altCfg = $ubillingConfig->getAlter();
    $chartsCache = new UbillingCache();
    show_window(__('Popularity of tariffs among users'), web_TariffShowReport());
    show_window(__('Planned tariff changes'), web_TariffShowMoveReport());
    if (!isset($altCfg['GCHARTS_ENABLED'])) {
        $chartsEnabled = true;
    } else {
        if ($altCfg['GCHARTS_ENABLED']) {
            $chartsEnabled = true;
        } else {
            $chartsEnabled = false;
        }
    }
    //google charts
    if ($chartsEnabled) {
        $cachingTime = 3600;
        $moveCharts = $chartsCache->getCallback('REPORT_TARIFFS_MOVECHART', function () {
            return web_TariffShowMoveCharts();
        }, $cachingTime);
        $tariffCharts = $chartsCache->getCallback('REPORT_TARIFFS_TARIFFHCHART', function () {
            return web_TariffShowTariffCharts();
        }, $cachingTime);
        //rendering charts
        show_window(__('Graphs'), $tariffCharts . wf_delimiter() . $moveCharts);
        zb_BillingStats(true);
    }
} else {
    show_error(__('You cant control this module'));
}
Example #2
0
            $paymonth = mysql_real_escape_string($_GET['month']);
            show_window(__('Month payments'), web_PaymentsShow("SELECT * from `payments` WHERE `date` LIKE '" . $paymonth . "%'  ORDER by `date` DESC;"));
        }
    } else {
        //show finance analytics info
        if (wf_CheckPost(array('anyearsel'))) {
            $currentYear = $_POST['anyearsel'];
        } else {
            $currentYear = date("Y");
        }
        $yearinputs = wf_YearSelectorPreset('anyearsel', __('Year'), false, $currentYear) . ' ';
        $yearinputs .= wf_Submit(__('Show'));
        $yearform = wf_Form("", 'POST', $yearinputs, 'glamour');
        show_window(__('Analytics'), $yearform);
        $graphs = wf_Link("?module=report_finance", __('Back'), true, 'ubButton');
        $ubCache = new UbillingCache();
        //try to cache rendered charts
        $graphs .= $ubCache->getCallback('ANALYTICSCHARTS_' . $currentYear, function () {
            if (wf_CheckPost(array('anyearsel'))) {
                $currentYear = $_POST['anyearsel'];
            } else {
                $currentYear = date("Y");
            }
            return web_AnalyticsAllGraphs($currentYear);
        }, 3600);
        show_window('', $graphs);
    }
    zb_BillingStats(true);
} else {
    show_error(__('You cant control this module'));
}
Example #3
0
/**
 * Returns all available admin_login=>employee name pairs from cache if available
 * 
 * @return string serialized array
 */
function ts_GetAllEmployeeLoginsCached()
{
    $result = '';
    $cache = new UbillingCache();
    $cacheTime = 3600;
    $result = $cache->getCallback('EMPLOYEE_LOGINS', function () {
        return ts_GetAllEmployeeLogins();
    }, $cacheTime);
    return $result;
}
Example #4
0
 /**
  * Shows 
  * 
  * @return void
  */
 function web_EventsShowStats()
 {
     $cache = new UbillingCache();
     $cacheTime = 3600;
     // 1 hour
     $data = $cache->getCallback('EVENTVIEW_STATS', function () {
         return zb_GetEventStats();
     }, $cacheTime);
     $data .= __('From cache') . ' ' . wf_Link('?module=eventview&forcecache=true', wf_img('skins/icon_cleanup.png', __('Renew')));
     //cache cleanup subroutine
     if (wf_CheckGet(array('forcecache'))) {
         $cache->delete('EVENTVIEW_STATS');
         rcms_redirect('?module=eventview');
     }
     show_window(__('Month actions stats'), $data);
 }
Example #5
0
            }
        }
        $result = array("aaData" => $jsonAAData);
        return json_encode($result);
    }
    // Ajax data source display
    if (isset($_GET['ajax'])) {
        if ($hp_mode) {
            //default rendering
            if ($hp_mode == 1) {
                die(zb_AjaxOnlineDataSourceSafe());
            }
            //fast with caching, for huge databases.
            if ($hp_mode == 2) {
                $defaultJsonCacheTime = 600;
                $onlineJsonCache = new UbillingCache();
                $fastJsonReply = $onlineJsonCache->getCallback('HPONLINEJSON', function () {
                    return zb_AjaxOnlineDataSourceFast();
                }, $defaultJsonCacheTime);
                die($fastJsonReply);
            }
        }
    }
    if (!$hp_mode) {
        show_warning(__('ONLINE_HP_MODE=0 no more supported. Use 1 - safe or 2 - fast for large databases modes.'));
    } else {
        show_window(__('Users online'), renderUserListContainer());
    }
} else {
    show_error(__('Access denied'));
}