} */ // Check year in query, match to a dlog table $year1 = idate('Y', strtotime($date1)); $year2 = idate('Y', strtotime($date2)); if ($year1 != $year2) { echo "<div id='alert'><h4>Reporting Error</h4>\n\t\t\t<p>Fannie cannot run reports across multiple years.<br>\n\t\t\tPlease retry your query.</p></div>"; exit; } else { $table = 'dlog_' . $year1; } //$table = 'dtransactions'; $date2a = $date2 . " 23:59:59"; $date1a = $date1 . " 00:00:00"; $gross = gross($table, $date1, $date2); $hash = hash_total($table, $date1, $date2); $staff_total = staff_total($table, $date1, $date2); $hoo_total = hoo_total($table, $date1, $date2); $bene_total = bene_total($table, $date1, $date2); $bod_total = bod_total($table, $date1, $date2); $misc_total = miscDisc($table, $date1, $date2); $tenDisc = tenDisc($table, $date1, $date2); extract(MADcoupon($table, $date1, $date2)); // we use compact+extract here to return mult. values from function extract(foodforall($table, $date1, $date2)); // we use compact+extract here to return mult. values from function extract(SSDdiscount($table, $date1, $date2)); $a = array($staff_total, $bene_total, $hoo_total, $bod_total, $MADcoupon, $foodforall, $SSDdiscount2, $misc_total, $tenDisc); $totalDisc = array_sum($a); if (isset($sales)) { $ICQ = "SELECT ROUND(SUM(total),2) AS coupons\n\t\t\tFROM " . DB_LOGNAME . ".{$table}\n\t\t\tWHERE datetime >= '{$date1a}' AND datetime <= '{$date2a}'\n\t\t\tAND trans_subtype IN('IC')\n\t\t\tAND trans_status <> 'X'\n\t\t\tAND emp_no <> 9999";
// Check year in query, match to a dlog table $year1 = idate('Y', strtotime($date1)); $year2 = idate('Y', strtotime($date2)); if ($year1 != $year2) { echo "<div id='alert'><h4>Reporting Error</h4>\n\t\t\t<p>Fannie cannot run reports across multiple years.<br>\n\t\t\tPlease retry your query.</p></div>"; exit; } else { $table = 'dlog_' . $year1; } $date2a = $date2 . " 23:59:59"; $date1a = $date1 . " 00:00:00"; include 'reportFunctions.php'; echo $date1a; $gross = gross($table, $date1a, $date2a); if (isset($sales)) { $hash = hash_total($table, $date1a, $date2a); $members_total = members_total($table, $date1a, $date2a); $nonmembers_total = nonmembers_total($table, $date1a, $date2a); /* $staff_total = staff_total($table,$date1a,$date2a); $hoo_total = hoo_total($table,$date1a,$date2a); $bene_total = bene_total($table,$date1a,$date2a); $bod_total = bod_total($table,$date1a,$date2a); $MADcoupon = MADcoupon($table,$date1a,$date2a); $foodforall = foodforall($table,$date1a,$date2a); $a = array($staff_total,$bene_total,$hoo_total,$bod_total,$MADcoupon,$foodforall); */ // changed the array above to simply add members total and nonmembers total $a = array($members_total, $nonmembers_total); $totalDisc = array_sum($a);