Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input type=button onclick='document.location="index.php?csinal=1"' value='gomb'>
- <?php
- include '/Zend/Gdata/Calendar.php';
- include '/Zend/Gdata/ClientLogin.php';
- $user = 'myusername';
- $pass = 'mypassword';
- $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
- $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
- function createEvent ($client, $title = 'Tennis with Beth',
- $desc='Meet for a quick lesson', $where = 'On the courts',
- $startDate = 'date(o-m-D)', $startTime = 'date(g:ia)',
- $endDate = 'date(o-m-D)', $endTime = 'date(g:i+6a)', $tzOffset = '+01')
- {
- $gdataCal = new Zend_Gdata_Calendar($client);
- $newEvent = $gdataCal->newEventEntry();
- $newEvent->title = $gdataCal->newTitle($title);
- $newEvent->where = array($gdataCal->newWhere($where));
- $newEvent->content = $gdataCal->newContent("$desc");
- $when = $gdataCal->newWhen();
- $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
- $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
- $newEvent->when = array($when);
- // Upload the event to the calendar server
- // A copy of the event as it is recorded on the server is returned
- $createdEvent = $gdataCal->insertEvent($newEvent);
- return $createdEvent->id->text;
- }
- if(isset($_GET[csinal]))
- createEvent($client, 'New Years Party',
- 'Ring in the new year with Kim and I',
- 'Our house',
- 'date(o-m-D)', 'date(g:ia)', 'date(o-m-D)', 'date(g:i+6a)', '+01' );
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement