function main() { $acts = loadAccounts(); $fb = $acts['facebook']; $ig = $acts['instagram']; $twit = $acts['twitter']; print "<pre>FB:\n"; foreach ($fb as $key => $id) { $stats = fbStats($id); if (isset($stats)) { saveStats($stats, $id, "facebook"); } } print "\nTwit:\n"; foreach ($twit as $key => $id) { $stats = twitStats($id); if (isset($stats)) { saveStats($stats, $id, "twitter"); } } print "\nIG:\n"; foreach ($ig as $key => $id) { $stats = igStats($id); if (isset($stats)) { saveStats($stats, $id, "instagram"); } } print "</pre>"; }
<?php global $user, $dbc; include MAIN_DIR . '/php/ajax.php'; $accountTypes = loadTypes('account_types'); $assets = loadAccounts('asset'); $payments = loadAccounts('payment', date('Y-m-d')); $assetSummary = getSummary('assets'); $paymentsSummary = getSummary('payments'); function loadSummary($summaryArray, $type = 'assets') { global $accountTypes; $total = 0; //var_dump( $summaryArray ); foreach ($summaryArray['summary'] as $key => $summary) { if (isset($summary['min_payment'])) { $total_due += $summary['min_payment']; } $total += $summary['total']; $type = $accountType[$summary['type']]; ?> <tr class="summary-row summary-<?php echo $type; ?> "> <?php foreach ($summary as $key => $value) { $class = "summary-{$key}"; $html = ''; if (is_numeric($value)) {