if (isset($_POST['requestingUser'])) {
     $requestingUser = $_POST['requestingUser'];
     $username = $_POST['username'];
     $appointments = $_POST['appointments'];
     $requestType = $_POST['requestType'];
 }
 /*
 $recurrAppointments=array();
 foreach ($appointments as $appointment) {
 	array_push($recurrAppointments,"appointment"=>appointment);
 }
 */
 try {
     $client = new SoapClient($wsdl, array('location' => $location));
     if ($requestType == "User") {
         $result = $client->scheduleUserAppointments(array('requestingUser' => $requestingUser, 'appointment' => $appointments));
     } else {
         if ($requestType == "Mentor") {
             $result = $client->scheduleMentorAppointments(array('requestingUser' => $requestingUser, 'appointment' => $appointments));
         } else {
             if ($requestType == "Host") {
                 $result = $client->scheduleHostAppointments(array('requestingUser' => $requestingUser, 'appointment' => $appointments));
             }
         }
     }
     echo json_encode($result->appointment);
     //print_r($result->appointment);
 } catch (SoapFault $soapfault) {
     //echo $soapfault->getMessage();
     echo $soapfault->getTraceAsString();
 } catch (Exception $e) {
Example #2
0
$end = '';
// $_GET['end'];
$resourceType = $_GET['resourceType'];
$course = $_GET['course'];
$affiliationId = '';
// $_GET['affiliationId'];
$availabilityStatus = '';
// $_GET['availabilityStatus'];
$requestType = 'User';
// $_GET['requestType'];
echo "\$username: {$username}<br>";
echo "\$start: {$start}<br>";
echo "\$end: {$end}<br>";
echo "\$resourceType: {$resourceType}<br>";
echo "\$course: {$course}<br>";
try {
    $appointment = array('id' => $id, 'userName' => $username, 'start' => $start, 'end' => $end, 'resourceType' => $resourceType, 'course' => $course, 'affiliationId' => $affiliationId, 'availabilityStatus' => $availabilityStatus, 'action' => NULL);
    $params = array('requestingUser' => $requestingUser, 'appointment' => $appointment);
    $client = new SoapClient($wsdl, array('location' => $location));
    $result = $client->scheduleUserAppointments($params);
    echo json_encode($result->appointment);
} catch (SoapFault $soapfault) {
    //echo $soapfault->getMessage();
    echo $soapfault->getTraceAsString();
} catch (Exception $e) {
    echo $e->getMessage();
}
?>