X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=inc%2Fclass.eq.inc.php;h=a20f1561cd580d7dd35c28e72c180a3878655a6d;hb=525cd8ffa4cd9ccd70b524e54dddd8a610371284;hp=9e6f8e2df09cd95c9eb7f1be7e12d719c75e0b6f;hpb=4988a4401709530d1d8ca1f640a6d0c207e74f44;p=eq%2F.git diff --git a/inc/class.eq.inc.php b/inc/class.eq.inc.php index 9e6f8e2..a20f156 100644 --- a/inc/class.eq.inc.php +++ b/inc/class.eq.inc.php @@ -217,9 +217,10 @@ class eq // in the past $num_months for this Family $header_row="Families"; for($m=$num_months; $m >= 0; $m--) { - $month = date('m/Y', strtotime('-'.$m.' month')); - $month_start = date('Y-m', strtotime('-'.$m.' month')); $month_start .= "-01"; - $month_end = date('Y-m', strtotime('-'.$m.' month')); $month_end .= "-31"; + if(`date '+%d'` == 31) { $d = 1; } else { $d = 0; } + $month = date('m/Y', strtotime('-'.$m.' month -'.$d.' day')); + $month_start = date('Y-m', strtotime('-'.$m.' month -'.$d.' day')); $month_start .= "-01"; + $month_end = date('Y-m', strtotime('-'.$m.' month -'.$d.' day')); $month_end .= "-31"; $sql = "SELECT * FROM eq_visit WHERE date >= '$month_start' AND date <= '$month_end' ". " AND companionship=" . $unique_companionships[$j]['companionship']. " AND family=". $family_id; @@ -931,9 +932,10 @@ class eq $header_row .= "$year"; } else { - $month = date('m/Y', strtotime('-'.$m.' month')); - $month_start = date('Y-m', strtotime('-'.$m.' month')); $month_start .= "-01"; - $month_end = date('Y-m', strtotime('-'.$m.' month')); $month_end .= "-31"; + if(`date '+%d'` == 31) { $d = 1; } else { $d = 0; } + $month = date('m/Y', strtotime('-'.$m.' month -'.$d.' day')); + $month_start = date('Y-m', strtotime('-'.$m.' month -'.$d.' day')); $month_start .= "-01"; + $month_end = date('Y-m', strtotime('-'.$m.' month -'.$d.' day')); $month_end .= "-31"; $sql = "SELECT * FROM eq_ppi WHERE date >= '$month_start' AND date <= '$month_end' ". "AND elder=" . $elder_id . " AND eqpresppi=0"; $this->db2->query($sql,__LINE__,__FILE__);