function isDoneAllocating() { $mysqli = new mysqli(SERVERNAME, USERNAME, PASSWORD, DATABASE); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit; } if ($yearQuery = $mysqli->prepare("SELECT done_allocating FROM year WHERE year_id = ?")) { /* bind parameters for markers */ $yearQuery->bind_param("i", $_SESSION['viewing_year']); if ($yearQuery->execute()) { $yearResult = $yearQuery->get_result(); $done_allocating = array(); while ($row = $yearResult->fetch_assoc()) { $done_allocating[] = $row; } $done_allocating = $done_allocating[0]['done_allocating']; } else { error_log("Didn't work"); } $yearQuery->close(); } $mysqli->close(); return $done_allocating || isFinanceCommittee(); }
<div class="sidebar"> <div class="logo-header"> <div class="shrink">DU</div> <div class="header-wrapper"> <div class="header-title"> <a href="index.php"> bu<span>DU</span>get </a> </div> </div> </div> <?php if (isFinanceCommittee() && $_SESSION['user']['id'] == $_SESSION['viewing_user_id']) { ?> <div class="event-area"> <div class="priority-card"> <div class="priority-name"><h4>Finance Committee Members Cannot Have A Budget.</h4></div> <hr class="not-mobile"> <div class="priority-name">Select an organization to begin budget management.</div> </div> </div> <?php } else { ?> <div class="event-area"> <div class="priority-card"> <i title="Highest Priority" class="material-icons priority-icon">arrow_upward</i> <div class="priority-name">Highest Priority</div> </div> <ul <?php if (canEdit()) {
$subheadArray = array(); while ($row = $subheadResult->fetch_assoc()) { $subheadArray[] = $row; } $subheadArray = $subheadArray[0]; } else { error_log("Didn't work"); } $subheadQuery->close(); } /* close connection */ $mysqli->close(); ?> <?php if (isFinanceCommittee()) { ?> <div class="sub-header" style="left: 0;"> <div class="column turn-column"> <div class="turn-text"> FUNDS </div> </div> <div class="column"> $<span id="funds-subheader"><?php echo money_format("%i", $subheadArray['funds']); ?> </span> </div> <div class="column turn-column"> <div class="turn-text">
error_log("Didn't work"); } $sidebarQuery->close(); } /* close connection */ $mysqli->close(); if (empty($sidebarArray)) { echo '<div class="peak-card empty" style="text-align: center; box-shadow: none;">No Events</div>'; } ?> <?php foreach ($sidebarArray as $event) { ?> <li class="peak-card<?php if ($event['visited'] && isFinanceCommittee()) { echo ' red'; } ?> " id='event_<?php echo $event['event_id']; ?> '> <i class="material-icons event-icon"><?php echo chooseIcon($event['event_type']); ?> </i> <div class="event-name"><?php echo $event['event_name']; ?> </div>
echo $expenditure['expend_id']; ?> " id="expend_price_quote_second" class="detail <?php if (canEdit()) { echo 'editable-input'; } ?> "><?php if ($expenditure['second_source']) { echo $expenditure['second_source']; } ?> </span></p> <?php if (isDoneAllocating() || isFinanceCommittee()) { ?> <hr> <p><span class="detail-heading">Allocation Amount</span><br>$<span number="<?php echo $expenditure['expend_id']; ?> " id="expend_allocation" class="detail <?php if (isAdmin()) { echo 'editable-input'; } ?> "><?php if ($expenditure['allocated']) { echo $expenditure['allocated'];
<?php require "include/analytics/header.php"; ?> <div class="main" style="margin-left: 0;"> <div class="content" style="padding-top: 4em;"> <div class="content-area"> <div class="grid"> <div class="tile desktop-12 tablet-12"> <h1>Analytics</h1> </div> <?php if (isDoneAllocating()) { ?> <?php if (isset($_SESSION['viewing_user_id']) && (!isFinanceCommittee() || isFinanceCommittee() && $_SESSION['viewing_user_id'] != $_SESSION['user']['id'])) { require "include/analytics/individual.php"; } else { if (isLoggedIn()) { ?> <div class="tile desktop-12 tablet-12"> <h1>Cannot View Organization Analytics</h1> <hr> <p>Please select an org to get its organizational analytics.</p> </div> <?php } else { ?> <div class="tile desktop-12 tablet-12"> <h1>Cannot View Organization Analytics</h1> <hr>
} else { echo "Click below to edit..."; } ?> </div> <?php if (canEdit()) { ?> <nav class="container"> <?php if (isset($_POST['viewing_event'])) { ?> <a id="add-expenditure-button" tooltip="Add Expenditure" class="buttons"><i class="material-icons">add_circle_outline</i></a> <a id="delete-event-button" tooltip="Delete Event" class="buttons"><i class="material-icons">delete</i></a> <?php if ($_SESSION['user']['role'] == 'org' || $_SESSION['viewing_user_id'] != $_SESSION['user']['id'] && isFinanceCommittee()) { ?> <a href="/include/budget/eventQueries/addEvent.php?adding_user_id=<?php echo $_SESSION['viewing_user_id']; ?> " tooltip="Add Event" class="buttons"><i class="material-icons">add</i></a> <?php } ?> <?php if (isAdmin()) { ?> <?php echo isVisitedIcon(); ?> <?php