//************************************** UPCOMING APPOINTMENTS ENDS ****************************************** //*************************** PAST APPOINTMENTS **************************************************** echo "<div class='container'> "; echo "<h2>Past Appointments</h2>"; echo "<ul class='list-group'>"; $appList = $appointment->retrieveAppointments($userType, $userEmail, "past"); $rating = new Rating(); for ($i = 0; $i < count($appList); $i++) { $captain_id = $appList[$i]->getCaptainId(); $user_id_from_book = $appList[$i]->getUserId(); $captList = $captain->retrieveCaptainFromBook($captain_id); //$userList = $user->retrieveUserFromId($appList[$i]->getUserId()); $captName = $captList[0]->getFirstName() . " " . $captList[0]->getLastName(); //$userName = $userList[0]->getFirstName() . " " . $userList[0]->getLastName(); $app_id = $appList[$i]->getAppointmentId(); $ratingScore = $rating->retrieveScoreApp($app_id, $captain_id, $user_id_from_book); echo "<li class='list-group-item'>Appointment with Captain " . $captName . " at " . $appList[$i]->getAppointmentDate(); if ($userType == "Customer") { echo "</br>Rate " . $captName . " <div class='captRate' id='rate-" . $captain_id . "-" . $user_id_from_book . "-" . $app_id . "' data-score='" . $ratingScore . "'></div><button class='btn btn-primary rateButton' id='button-" . $captain_id . "-" . $user_id_from_book . "-" . $app_id . "'>Rate</button> "; } elseif ($userType == "Captain") { echo "Your rating <div class='captRate' id='rate-" . $captain_id . "-" . $user_id_from_book . "-" . $app_id . "' data-score='" . $ratingScore . "'></div> "; } echo "</li>"; } echo "</ul></div> "; //************************************** PAST APPOINTMENTS ENDS ****************************************** if ($userType == "Customer") { $cancelMsg = "You will lose your deposit and notifications will be sent to all parties involved."; } else { $cancelMsg = "The deposit will be refunded back to the customer and notifications will be sent to all parties involved."; }