Ejemplo n.º 1
0
?>
)</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) {
        $end_time[] = trim($temp);
Ejemplo n.º 2
0
?>
)</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) {
        case 0: