Example #1
0
<div class="container">
	<div class="row">

		<?php 
include 'partials/add_goal_form.php';
?>
      
        <?php 
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_SESSION['Email'])) {
    $sessionEmail = $_SESSION['Email'];
}
?>
		
		<div class="col-md-9">
          
			<?php 
$GoalIndex = new GoalIndex();
$Goals = Goal::get_current_user_goals();
$GoalIndex->print_goals($Goals);
?>
			
		</div>
	</div>
</div>
Example #2
0
    }
}
?>
          
              <?php 
$str = count($CompletedGoals) / $TotalGoals;
$percent = round($str * 100) . '%';
?>
        
            <p>Percentage of Total Goals Completed:</p><h3> <?php 
echo $percent;
?>
</h3>
        
            <?php 
$CurrentUserGoals = Goal::get_current_user_goals();
$TotalUserGoals = $CurrentUserGoals->rowCount();
$CompletedUserGoals = [];
while ($Goal = $CurrentUserGoals->fetchObject()) {
    if ($Goal->completed) {
        array_push($CompletedUserGoals, $Goal);
    }
}
if ($TotalUserGoals) {
    $strUser = count($CompletedUserGoals) / $TotalUserGoals;
    $percentUser = round($strUser * 100) . '%';
}
?>
            
        <?php 
if (!empty($percentUser)) {