Esempio n. 1
0
echo "{$dates['6']}";
?>
)</td>
  </tr>

<?php 
$date = new DateTime();
$date_by_week = $date->setISODate($year, $week_no, 0);
//30th week 5th day
$first = $date->format("Y-m-d");
$date_by_week = $date->setISODate($year, $week_no, 6);
$last = $date->format("Y-m-d");
$subs = "T00:00:00Z";
$first_date_of_week = $first . $subs;
$last_date_of_week = $last . $subs;
$client = new CalendarClient("Amal", "aaa");
$resMessage = $client->getEvents("{$first_date_of_week}", "{$last_date_of_week}");
if ($resMessage) {
    $simplexml = new SimpleXMLElement($resMessage->str);
    $i = 0;
    $j = 0;
    $k = 0;
    while ($temp = $simplexml->event[$i]->name) {
        $name[] = trim($temp);
        $i++;
    }
    while ($temp = $simplexml->event[$j]->start_date_time) {
        $start_time[] = trim($temp);
        $j++;
    }
    while ($temp = $simplexml->event[$k]->end_date_time) {
Esempio n. 2
0
	</fieldset>
	<div class="buttonrow">
		<input value="Delete" class="button" type="submit" name="Submit"/>
	</div>

</fieldset>

	</form>

	
	</div><!-- /form-container -->
	
	
	  
<!-- End of Content  -->

<?php 
if (isset($_POST['Submit'])) {
    $start_time = $_POST['start_time'];
    $end_time = $_POST['end_time'];
    $client = new CalendarClient("Amal", "aaa");
    $return_val = $client->deleteEvents($start_time, $end_time);
    print_r($return_val);
}
?>
<br>
<br>
<a href="get_event_client.php">Back to the calender</a>
</body>
</html>
Esempio n. 3
0
	
	</div>
	
	
	  
<!-- End of Content  -->

<?php 
/*get the values from the form and send them to the service to add values.*/
if (isset($_POST['Submit'])) {
    $name = $_POST['event'];
    $start_time = $_POST['start_time'];
    $end_time = $_POST['end_time'];
    $description = $_POST['description'];
    $event = new Event();
    $event->name = $name;
    $event->startDateTime = $start_time;
    $event->endDateTime = $end_time;
    $event->description = $description;
    $client = new CalendarClient($username, $password);
    $returnMessage = $client->addEvent($event);
    print_r($returnMessage);
}
?>
<br>
<br>
<a href="get_event_client.php">Back to the calender</a>
</body>
</html>
Esempio n. 4
0
        echo "<p>Please re-enter the data and submit</p></div>";
    } else {
        $errorFree = true;
    }
}
$username = $_POST['username'];
$password = $_POST['password'];
$repassword = $_POST['repassword'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
$address = $_POST['address'];
$country = $_POST['country'];
$postal_code = $_POST['postal_code'];
if ($username != NULL) {
    $return_val = CalendarClient::register($username, $password, $first_name, $last_name, $email, $address, $country, $postal_code);
    print_r($return_val);
}
?>
  
<?php 
if (!isset($errorFree) || !isset($_POST['posted'])) {
    ?>

	<form action="#" method="post">
	
	<p class="legend"><strong>Note:</strong> Required fields are marked with an asterisk (<em>*</em>)</p>
		<input type="hidden" name="posted" value="true" />
	<fieldset>
		<legend>User Details</legend>
		
Esempio n. 5
0
</fieldset>

	</form>

	
	</div>
	
	
	  
<!-- End of Content  -->

<?php 
/*get the values from the form and send them to the service to add values.*/
if (isset($_POST['Submit'])) {
    $name = $_POST['event'];
    $start_time = $_POST['start_time'];
    $end_time = $_POST['end_time'];
    $description = $_POST['description'];
    $obj = new Event($name, $start_time, $end_time, $description);
    $client = new CalendarClient("Amal", "aaa");
    $returnMessage = $client->addEvent($obj);
    print_r($returnMessage);
}
?>
<br>
<br>
<a href="get_event_client.php">Back to the calender</a>
</body>
</html>
Esempio n. 6
0
echo "{$dates['6']}";
?>
)</td>
  </tr>

<?php 
$date = new DateTime();
$date_by_week = $date->setISODate($year, $week_no, 0);
//30th week 5th day
$first = $date->format("Y-m-d");
$date_by_week = $date->setISODate($year, $week_no, 6);
$last = $date->format("Y-m-d");
$subs = "T00:00:00Z";
$first_date_of_week = $first . $subs;
$last_date_of_week = $last . $subs;
$client = new CalendarClient($username, $password);
$events_response = $client->getEvents("{$first_date_of_week}", "{$last_date_of_week}");
if ($events_response && $events_response->return && is_array($events_response->return)) {
    foreach ($events_response->return as $event) {
        $name[] = $event->name;
        $start_time[] = $event->startDateTime;
        $end_time[] = $event->endDateTime;
    }
}
$daysize = sizeof($name);
$day = array();
$time = array();
$event = array();
for ($i = 0; $i < $daysize; $i++) {
    $day_number = strftime("%w", strtotime($start_time[$i]));
    switch ($day_number) {
Esempio n. 7
0
 public static function register($name, $password, $first, $last, $email, $address, $country, $postal_code)
 {
     // we need to create a static function for the register, since it doesn't need any signed in
     $client = new WSClient(array("wsdl" => "Calendar.wsdl", "classmap" => CalendarClient::getClassmap(), "to" => self::ENDPOINT));
     $proxy = $client->getProxy();
     $return_val = $proxy->register(array("username" => $name, "password" => $password, "firstName" => $first, "lastName" => $last, "email" => $email, "address" => $address, "country" => $country, "postalCode" => $postal_code));
     return $return_val;
 }
Esempio n. 8
0
<?php

require_once "CalendarClient.php";
session_start();
ob_start();
$username = $_POST["username"];
$password = $_POST["password"];
$result = $_POST["Submit"];
/*Get the values entered by the form and send them to the service to check whether the user name and password are correct.*/
$message = "";
if (isset($_POST['Submit'])) {
    $_SESSION["username"] = $_POST['username'];
    $_SESSION["password"] = $_POST['password'];
    try {
        // create CalendarClient..
        $client = new CalendarClient($username, $password);
        $response = $client->login();
        if ($response && $response->success == "SUCCESS") {
            header('Location: get_event_client.php');
        } else {
            $message .= "<div id=\"errors\">";
            $message .= "<p><em>Oops... the following errors were encountered:</em></p>";
            $message .= "<ul>";
            if ($response == NULL) {
                $message .= "<li>login failed, There is a problem in the connnection</li>";
            } else {
                $message .= "<li>login failed, username or password is incorrect</li>";
            }
            $message .= "</ul>";
        }
    } catch (Exception $e) {