Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <input type=button onclick='document.location="index.php?csinal=1"' value='gomb'>
  2. <?php
  3.  
  4. $path = '/home/a3872568/public_html/Zend/library';
  5. set_include_path(get_include_path() . PATH_SEPARATOR . $path);
  6.  
  7. require_once '/home/a3872568/public_html/Zend/library/Zend/Loader.php';
  8. Zend_Loader::loadClass('Zend_Gdata');
  9. Zend_Loader::loadClass('Zend_Gdata_AuthSub');
  10. Zend_Loader::loadClass('Zend_Gdata_ClientLogin');
  11. Zend_Loader::loadClass('Zend_Gdata_Calendar');
  12.  
  13. $user = 'myaccount@gmail.com';
  14. $pass = 'mypassword';
  15. $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME; // predefined service name for calendar
  16. $client = Zend_Gdata_ClientLogin::getHttpClient($user,$pass,$service);
  17.  
  18. function createEvent ($client, $title = 'Tennis with Beth',
  19. $desc='Meet for a quick lesson', $where = 'On the courts',
  20. $startDate = '2011-06-30', $startTime = '10:00pm',
  21. $endDate = '2011-06-30)', $endTime = '10:06pm', $tzOffset = '+01')
  22. {
  23. $gdataCal = new Zend_Gdata_Calendar($client);
  24. $newEvent = $gdataCal->newEventEntry();
  25.  
  26. $newEvent->title = $gdataCal->newTitle($title);
  27. $newEvent->where = array($gdataCal->newWhere($where));
  28. $newEvent->content = $gdataCal->newContent("$desc");
  29.  
  30. $when = $gdataCal->newWhen();
  31. $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
  32. $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
  33. $newEvent->when = array($when);
  34.  
  35. // Upload the event to the calendar server
  36. // A copy of the event as it is recorded on the server is returned
  37. $createdEvent = $gdataCal->insertEvent($newEvent);
  38. return $createdEvent->id->text;
  39. }
  40. if(isset($_GET[csinal]))
  41. createEvent($client, 'New Years Party',
  42. 'Ring in the new year with Kim and I',
  43. 'Our house',
  44. '2011-06-30', '10:00pm', '2011-06-30', '10:06pm', '+01' );
  45.  
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement