Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. <input type=button onclick='document.location="index.php?csinal=1"' value='gomb'>
  2. <?php
  3.  
  4. include '/Zend/Gdata/Calendar.php';
  5. include '/Zend/Gdata/ClientLogin.php';
  6.  
  7. $user = 'myusername';
  8. $pass = 'mypassword';
  9. $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
  10. $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
  11.  
  12. function createEvent ($client, $title = 'Tennis with Beth',
  13. $desc='Meet for a quick lesson', $where = 'On the courts',
  14. $startDate = 'date(o-m-D)', $startTime = 'date(g:ia)',
  15. $endDate = 'date(o-m-D)', $endTime = 'date(g:i+6a)', $tzOffset = '+01')
  16. {
  17. $gdataCal = new Zend_Gdata_Calendar($client);
  18. $newEvent = $gdataCal->newEventEntry();
  19.  
  20. $newEvent->title = $gdataCal->newTitle($title);
  21. $newEvent->where = array($gdataCal->newWhere($where));
  22. $newEvent->content = $gdataCal->newContent("$desc");
  23.  
  24. $when = $gdataCal->newWhen();
  25. $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
  26. $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
  27. $newEvent->when = array($when);
  28.  
  29. // Upload the event to the calendar server
  30. // A copy of the event as it is recorded on the server is returned
  31. $createdEvent = $gdataCal->insertEvent($newEvent);
  32. return $createdEvent->id->text;
  33. }
  34. if(isset($_GET[csinal]))
  35. createEvent($client, 'New Years Party',
  36. 'Ring in the new year with Kim and I',
  37. 'Our house',
  38. 'date(o-m-D)', 'date(g:ia)', 'date(o-m-D)', 'date(g:i+6a)', '+01' );
  39.  
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement