add(new DateInterval('P1Y')); $endingDate->sub(new DateInterval('P1D')); // Get the difference in days using SQL $startDate= date_format($startingDate,'Y-m-d'); $endDate= date_format($endingDate,'Y-m-d'); $sql = "select datediff('".$endDate."','".$startDate."')"; $fiscalDays = ew_ExecuteScalar($sql); $fiscalDays +=1; $todayDateTime = new DateTime(); $currDate= date('Y-m-d',strtotime($_SESSION['session_date'])); /*SJH 8/16/2023 - These variables are used in the calling page, device_data, as a function parameter. $diffPercent is not used in that page.*/ $sql = "select datediff('".$currDate."','".$startDate."')"; $diffDays = ew_ExecuteScalar($sql); $sql = "select datediff('".$endDate."','".$currDate."')"; $diffDays += 1; $daysRemaining = ew_ExecuteScalar($sql); $daysRemaining += 1; $diffPercent = $diffDays / $fiscalDays; // Get the date 15 days prior to today. To be used to determine if a device has not been reporting for more than 15 days. // **Note: not reporting changed from 30 days to 15 days on 10/13/2013 per Skip $notReportingDate = new DateTime($_SESSION['session_date']); $notReportingDate = $notReportingDate->sub(new DateInterval('P15D')); // Get the date 15 days prior to today. $date15daysago = new DateTime($_SESSION['session_date']); $date15daysago = $date15daysago->sub(new DateInterval('P15D')); $fiscalYear = $startingDate->format("Y")."-".$endingDate->format("Y"); $nextFiscalYear = ($startingDate->format("Y")+1)."-".($endingDate->format("Y")+1); ?>