Example #1
0
 include_once "class/Appointment.class.php";
 include_once "class/Captain.class.php";
 include_once "class/User.class.php";
 include_once "class/Rating.class.php";
 $appointment = new Appointment();
 $captain = new Captain();
 $user = new User();
 $appList = array();
 $captList = array();
 $userList = array();
 //*************************** UPCOMING APPOINTMENTS ****************************************************
 echo "<div class='container'> ";
 echo "<h1>My Appointments</h1>";
 echo "<h2>Upcoming Appointments</h2>";
 echo "<ul class='list-group'>";
 $userList = $user->retrieveUserFromId($userId);
 $userEmail = $userList[0]->getEmail();
 $appList = $appointment->retrieveAppointments($userType, $userEmail, "upcoming");
 $aa = $appList[0]->getCaptainId();
 for ($i = 0; $i < count($appList); $i++) {
     $captain_id = $appList[$i]->getCaptainId();
     $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();
     echo "<li class='list-group-item'>Appointment with Captain " . $captName . " at " . $appList[$i]->getAppointmentDate();
     /*
     echo "<div class='col-md-2 col-xs-6'>";
     
     echo "<form action='reschedule-appointment.php' method='POST'> <button type='submit' class='btn btn-warning'>Reschedule</button></form>";
Example #2
0
			<label for="welcomeUserName" id="welcomeUserName">Welcome, <?php 
        echo $captName;
        ?>
</label>
			<a class="btn btn-info" href="bookme/backend"> My Appointments</a>
			<a class=" btn btn-info" href="captain.php"> My Profile</a>
		    
            <button type="submit" class="btn btn-success">Logout</button>
          </form>	
				
		<?php 
    } elseif ($userType == "Customer") {
        include_once "class/User.class.php";
        $user = new User();
        $userDetail = array();
        $userDetail = $user->retrieveUserFromId($userId);
        $userName = $userDetail[0]->getFirstName() . " " . $userDetail[0]->getLastName();
        ?>
		 
		   <form class="navbar-form navbar-right" action="logout.php" method="POST">
		    <label for="welcomeUserName" id="welcomeUserName">Welcome, <?php 
        echo $userName;
        ?>
</label>
		     <a class="btn btn-info" href="appointment.php"> My Appointments</a>
		    
            <button type="submit" class="btn btn-success">Logout</button>
          </form>	
				
		<?php 
    }