<?php
include_once('common.php');
?>
<?php

require_once('lib/nusoap.php');
// include('lib/class.nusoap_base.php');
// include('lib/class.soapclient.php');
// include('lib/class.wsdl.php');
// include('lib/class.soap_transport_http.php');

/**
 * Class responsible for App logic
 * reservation, free times...
 */ 
function array_to_object($array) 
{ 
    return is_array($array) ? (object) array_map(__FUNCTION__,$array) : $array;
}
 
$client = new nusoap_client('http://87.127.13.154:896/DiaryWebService.svc?wsdl','wsdl');
$client ->soap_defencoding = 'UTF-8';
// echo "<pre>";
// print_r ($client);
// echo "</pre>"; die;

// $res1 = $client->call('Validate');
// echo "<pre>";
// print_r ($res1);
// echo "</pre>"; //die;

// $param1 = array('argstring1'=>'854088','argString2'=>'09/03/2021 10:30 11:15','argString3'=>'Sandeep,false,SE11 1DX,10/01/1995,07978555222,san@gmail.com');
// $result1 = $client->call('PostAppointment',$param1);
// echo "<pre>";
// print_r ($result1);
// echo "</pre>";

$param = array('site'=>'576642','Password'=>'OpenGate7','SenderIP'=>'62.133.6.123');
$result = $client->call('GetAppointments',$param);

echo "<pre>";
print_r ($result);
echo "</pre>"; die;
ob_start();
session_start();
$_SESSION["GetAppointmentsResult"] = $result['GetAppointmentsResult'] ;
ob_get_clean();
define('HOSTNAME', $_SESSION["GetAppointmentsResult"]);