$endDate = new DateTime($_POST['end_date']);
        } catch (Exception $e) {
            return $e->getMessage();
        }
    } else {
        // default to last day of this month
        $dateArr = getdate();
        $endDate->setDate($dateArr['year'], $dateArr['mon'] + 1, 0);
    }
    return $endDate;
}
$error = '';
$message = '';
// set default vars
// Set budget date to first day of month
$startDate = getStartDate();
$endDate = getEndDate();
$doAutoSink = false;
if (isset($_POST['prev_month'])) {
    // go back one month
    $dateArr = getdate($startDate->getTimestamp());
    // first day of last month to last day of last month
    $startDate->setDate($dateArr['year'], $dateArr['mon'] - 1, 1);
    $endDate->setDate($dateArr['year'], $dateArr['mon'], 0);
    // 		$interval = new DateInterval('P1M');
    // 		$interval->invert = 1;
    // 		$startDate->add($interval);
    // 		$endDate->add($interval);
} elseif (isset($_POST['next_month'])) {
    // forward one month
    $dateArr = getdate($startDate->getTimestamp());
示例#2
0
文件: reports.php 项目: caseyi/BLIS
							<?php 
$page_elems->getProgressSpinner(LangUtil::$generalTerms['CMD_FETCHING']);
?>
						</span>
					</td>
				</tr>
			</table>
		</form>
	</div>
	
	<div id='summary_div' style='display:none;' class='reports_subdiv'>
			<b><?php 
echo LangUtil::$pageTerms['MENU_INFECTIONSUMMARY'];
?>
</b><?php 
echo getStartDate();
?>
		<br><br>
		<form name="get_summary" id="get_summary" action="reports_infection.php" method='post'>
			<table cellpadding="4px">
			<?php 
$site_list = get_site_list($_SESSION['user_id']);
if (count($site_list) == 1) {
    foreach ($site_list as $key => $value) {
        echo "<input type='hidden' name='location' id='location2' value='{$key}'></input>";
    }
} else {
    ?>
			
				<tr class="location_row" id="location_row">
				<td><?php 
					<div class="col-lg-12">
						<div class="panel panel-default">
							<div class="panel-heading">
								Project Stats
							</div>
							<div class="panel-body">
								<div class="row">
									<div class="col-lg-12">
										<p class="form-control-static">Project Description: <?php 
getProjectDescription();
?>
</p>
									</div>
									<div class="col-lg-6">
										<p class="form-control-static">Project Start Date: <?php 
getStartDate();
?>
</p>
									</div>
									<div class="col-lg-6">
										<p class="form-control-static">Estimated Completion Date: <?php 
getEstCompletionDate();
?>
</p>
									</div>
									<div class="col-lg-6">
										<p class="form-control-static">Number of Requirements: <?php 
getNumRequirements();
?>
</p>
									</div>