Created
December 28, 2016 11:20
-
-
Save siddartha/a7cbc01fa96cd7a940d5997237d91caf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$today = date("Y-m-d"); | |
$month = date("Y-m"); $mpattern = '/^'.$month.'/'; | |
$yesterday = date('Y-m-d', strtotime("1 day ago" )); | |
foreach ($metrics_global as $k => $row) { | |
// DEBUG echo $k."-(".$row['met_date']." / ".$row['earn'].")<br />"; | |
$total+= $row['earn']; | |
if (in_array($yesterday, $row)) {$hier = $row['earn'];} | |
if ($k>22){ $last7days+=$row['earn'];} | |
if ($k<30){ $last30days+=$row['earn'];} | |
if (preg_match ($mpattern, $row['met_date'], $m)) {$thismonth+= $row['earn'];} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
testing comments for gist