Browse Source

Added 'Participants Enrolled' in viewExperience.php

Victor Hernandez 3 years ago
parent
commit
44c0bd3bd0
1 changed files with 8 additions and 3 deletions
  1. 8
    3
      viewExperience.php

+ 8
- 3
viewExperience.php View File

@@ -40,6 +40,12 @@
40 40
 	$rowProject = mysqli_fetch_assoc($resultProject);
41 41
 
42 42
 
43
+	// FETCH NUMBER OF STUDENTS ENROLLED IN EXPERIENCE
44
+	$queryTotalStudents = "SELECT * FROM student_participate_experience WHERE id_experience = '$experienceID'";
45
+	$resultTotalStudents = mysqli_query($connection, $queryTotalStudents);
46
+	$studentCount = $resultTotalStudents->num_rows;
47
+
48
+
43 49
 	include_once 'header.php';
44 50
 	
45 51
 ?>
@@ -70,6 +76,7 @@
70 76
 								<h4><b style="color:#fff;">Description:</b> <span style="color:rgb(216,216,216);"><?php echo $row1['description']; ?></span></h4>
71 77
 								<h4><b style="color:#fff;">Type:</b> <span style="color:rgb(216,216,216);"><?php echo $row1['type']; ?></span></h4>
72 78
 								<h4><b style="color:#fff;">Duration:</b> <span style="color:rgb(216,216,216);"><?php echo $row1['duration_weeks']; ?> week<?php if((int)$row1['duration_weeks'] > 1) echo "s"; ?></span></h4>
79
+								<h4><b style="color:#fff;">Participants Enrolled:</b> <span style="color:rgb(216,216,216);"><?php echo $studentCount; ?></span></h4>
73 80
 							</blockquote>
74 81
             	
75 82
 						</div><!--col-->
@@ -277,9 +284,7 @@
277 284
 							// ELSE, DISPLAY A MESSAGE TO THE USER LETTING THEM KNOW THEY DON'T HAVE ONE
278 285
 							if(mysqli_num_rows($result4) > 0):
279 286
 							
280
-								$queryTotalStudents = "SELECT * FROM student_participate_experience WHERE id_experience = '$experienceID'";
281
-								$resultTotalStudents = mysqli_query($connection, $queryTotalStudents);
282
-								$studentCount = $resultTotalStudents->num_rows;
287
+
283 288
 								
284 289
 						?>
285 290
 						<table class="table table-hover table-striped table-responsive">