\ExistentialHorse
System-wide previous periods statistics archive aka Existential Horse
Synopsis
class ExistentialHorse
{
- // constants
- const URL_ME = '?module=exhorse';
- const PROUTE_YEAR = 'yearsel';
- const COLOR_GOOD = '009f04';
- const COLOR_BAD = 'b50000';
- const ICON_RISE = 'skins/rise_icon.png';
- const ICON_DRAIN = 'skins/drain_icon.png';
- const TABLE_HORSE = 'exhorse';
- const TABLE_SIGNUPS = 'userreg';
- const TABLE_PAYMENTS = 'payments';
- const TABLE_CATV_USERS = 'ukv_users';
- const TABLE_CATV_TARIFFS = 'ukv_tariffs';
- const TABLE_CATV_PAYMENTS = 'ukv_payments';
- const TABLE_SWITCHES = 'switches';
- const TABLE_SWDEAD = 'switchdeadlog';
- const TABLE_ONU = 'pononu';
- const TABLE_DOCSIS = 'modems';
- const TABLE_WDYC = 'wdycinfo';
- const TABLE_SIGREQ = 'sigreq';
- const TABLE_CAPABS = 'capab';
- // members
- protected array $altCfg = ;
- protected array $allInetUsers = ;
- protected array $storeTmp = ;
- protected bool $complexFlag = false;
- protected array $complexMasks = ;
- protected array $monthSignups = ;
- protected array $usersCities = ;
- protected string $curmonth = '';
- protected bool $ukvFlag = false;
- protected string $ukvIllegal = '';
- protected string $ukvSocial = '';
- protected string $ukvComplex = '';
- protected string $ukvDebtLimit = '';
- protected bool $pbxFlag = false;
- protected bool $teleponyFlag = false;
- protected bool $askoziaFlag = false;
- protected bool $ponFlag = false;
- protected bool $docsisFlag = false;
- protected string $showYear = '';
- protected $messages = '';
- protected array $cashIds = ;
- protected $horseDb = '';
- // methods
- public void __construct()
- protected void initMessages()
- protected void initDb()
- protected void loadConfig()
- public void setYear()
- protected void initTmp()
- protected void loadUserData()
- protected void loadSignups()
- protected void loadUserCities()
- protected int isActive()
- protected bool isComplex()
- protected void preprocessUserData()
- protected void preprocessFinanceData()
- protected void preprocessUkvData()
- protected void preprocessEquipmentData()
- protected void preprocessAskoziaData()
- protected void preprocessTeleponyData()
- protected void preprocessWdycData()
- protected void preprocessMisc()
- protected void saveHorseData()
- public void runHorse()
- protected array loadStoredData()
- public void cleanupDb()
- public string renderReport()
Constants
Name | Value |
---|---|
URL_ME | '?module=exhorse' |
PROUTE_YEAR | 'yearsel' |
COLOR_GOOD | '009f04' |
COLOR_BAD | 'b50000' |
ICON_RISE | 'skins/rise_icon.png' |
ICON_DRAIN | 'skins/drain_icon.png' |
TABLE_HORSE | 'exhorse' |
TABLE_SIGNUPS | 'userreg' |
TABLE_PAYMENTS | 'payments' |
TABLE_CATV_USERS | 'ukv_users' |
TABLE_CATV_TARIFFS | 'ukv_tariffs' |
TABLE_CATV_PAYMENTS | 'ukv_payments' |
TABLE_SWITCHES | 'switches' |
TABLE_SWDEAD | 'switchdeadlog' |
TABLE_ONU | 'pononu' |
TABLE_DOCSIS | 'modems' |
TABLE_WDYC | 'wdycinfo' |
TABLE_SIGREQ | 'sigreq' |
TABLE_CAPABS | 'capab' |
Members
protected
- $allInetUsers
—
array
All of available internet users as login=>userdata - $altCfg
—
array
System alter.ini config as key=>value - $askoziaFlag
—
bool
Is Askozia PBX integration enabled? - $cashIds
—
array
Castypes array with cash values - $complexFlag
—
bool
Is complex tariffs feature enabled? - $complexMasks
—
array
Array of complex tariffs strings masks - $curmonth
—
string
Contains current year and month in format Y-m - $docsisFlag
—
bool
Docsis enabled flag - $horseDb
—
Horse-data database abstraction layer placeholder - $messages
—
System messages helper object placeholder - $monthSignups
—
array
Contains all current month internet user signups - $pbxFlag
—
bool
Is any PBX integration enabled? - $ponFlag
—
bool
PON enabled flag - $showYear
—
string
Year to display results - $storeTmp
—
array
Temporary storage for horseRun saving data - $teleponyFlag
—
bool
Is TelePony enabled? - $ukvComplex
—
int
Contains complex users tariff id - $ukvDebtLimit
—
int
Contains month count for debt limit calculation - $ukvFlag
—
bool
Is UKB subsystem enabled? - $ukvIllegal
—
int
Contains UKV illegal users tariff id - $ukvSocial
—
int
Contains social users tariff id - $usersCities
—
array
Contains users to cities bindings as login=>cityname
Methods
protected
- initDb() — Inits database abstraction layer
- initMessages() — Creates message helper object for further usage
- initTmp() — Inits empty temporary array with default struct.
- isActive() — Detects user activity state
- isComplex() — Detect is user complex or not?
- loadConfig() — Preloads alter config, for further usage as key=>value
- loadSignups() — Loads signups by current month
- loadStoredData() — Loads stats data from database
- loadUserCities() — Preloads user and cities mappings into protected property
- loadUserData() — Loads all of available inet users into protected property
- preprocessAskoziaData() — Askozia PBX data fetching and processing
- preprocessEquipmentData() — Collects and stores equipment data
- preprocessFinanceData() — Preprocess monthly signups data
- preprocessMisc() — Preprocessing tickets, sigreqs, capabs and other single data inputs
- preprocessTeleponyData() — Telepony CDR data fetching and processing
- preprocessUkvData() — Performs all UKV users/payments/signups preprocessing
- preprocessUserData() — Do some user preprocessing
- preprocessWdycData() — WDYC data loading and preprocessing
- saveHorseData() — Saves current storeTmp into database
public
- __construct() — Creates new existential horse instance
- cleanupDb() — Cleans previous days data if current month day is the last or all previous records for this this month.. i hope.
- renderReport() — Renders report for some year
- runHorse() — Do all data preprocessing and store results into database
- setYear() — Sets year to render results