Hallo
Wieso hab ich bei:
nicht den Termin drin den ich im Formular reinschreibe?
Ich möchte auch, dass der Termineintrag nach dem absenden des Formulars geschieht. Ohne das "Connect Me!"
Ist das möglich?
Danke schion jetzt für eure Hilfe
Wieso hab ich bei:
PHP:
$event = new Google_Event();
$event->setSummary ($row_termin['ter_termin']);
$event->setLocation('Daheim');
$start = new Google_EventDateTime();
$start->setDateTime('2012-11-30T12:00:00.000-05:00');
$event->setStart($start);
$end = new Google_EventDateTime();
$end->setDateTime('2012-11-30T12:30:00.000-05:00');
$event->setEnd($end);
nicht den Termin drin den ich im Formular reinschreibe?
PHP:
<form action="<?php echo $editFormAction; ?>" method="POST" name="form2" id="form2">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Termin:</td>
<td><input type="text" name="ter_termin" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Wann:</td>
<td><input type="text" name="ter_wann" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Wo:</td>
<td><input type="text" name="ter_wo" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Start:</td>
<td><input type="text" name="ter_start" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Ende:</td>
<td><input type="text" name="ter_ende" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Treffpunkt:</td>
<td><input type="text" name="ter_treffpunkt" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Treffpunkt wo:</td>
<td><input type="text" name="ter_treffpunktwo" value="" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Tenue:</td>
<td><select name="txtTenue" id="txtTenue">
<option value=""></option>
<?php
do {
?>
<option value="<?php echo $row_tenue['ten_ID']?>"><?php echo $row_tenue['ten_tenue']?></option>
<?php
} while ($row_tenue = mysql_fetch_assoc($tenue));
$rows = mysql_num_rows($tenue);
if($rows > 0) {
mysql_data_seek($tenue, 0);
$row_tenue = mysql_fetch_assoc($tenue);
}
?>
</select></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Bemerkung:</td>
<td><textarea name="ter_bemerkung" cols="32"></textarea></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right"> </td>
<td><input type="submit" value="Datensatz einfügen" /></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form2" />
<input name="hiddenField" type="hidden" id="hiddenField" value="<?php echo $row_termin['ter_ID']; ?>" />
<?php
include 'src/Google_Client.php';
include 'src/contrib/Google_CalendarService.php';
$client = new Google_Client();
$client->setApplicationName("Google Calendar PHP Starter Application");
// Visit https://code.google.com/apis/console?api=calendar to generate your
// client id, client secret, and to register your redirect uri.
$client->setClientId('meineClientID');
$client->setClientSecret('meineClientSecret');
$client->setRedirectUri('meineRedirectUri');
$client->setDeveloperKey('meinDeveloperKey');
$cal = new Google_CalendarService($client);
if (isset($_GET['logout'])) {
unset($_SESSION['token']);
}
if (isset($_GET['code'])) {
$client->authenticate($_GET['code']);
$_SESSION['token'] = $client->getAccessToken();
header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']);
}
if (isset($_SESSION['token'])) {
$client->setAccessToken($_SESSION['token']);
$event = new Google_Event();
$event->setSummary ($row_termin['ter_termin']);
$event->setLocation('Daheim');
$start = new Google_EventDateTime();
$start->setDateTime('2012-11-30T12:00:00.000-05:00');
$event->setStart($start);
$end = new Google_EventDateTime();
$end->setDateTime('2012-11-30T12:30:00.000-05:00');
$event->setEnd($end);
$attendee1 = new Google_EventAttendee();
$attendee1->setEmail('emailanmich@gmail.com');
$attendees = array($attendee1);
$event->attendees = $attendees;
$event->setDescription($row_termin['ter_wo']);
$createdEvent = $cal->events->insert('emailanmich@gmail.com', $event); //Returns array not an object
echo $createdEvent->id();
echo 'Done!';
}
else {
$authUrl = $client->createAuthUrl();
print "<a class='login' href='$authUrl'>Connect Me!</a>";
}
if ($client->getAccessToken()) {
$calList = $cal->calendarList->listCalendarList();
print "<h1>Calendar List</h1><pre>" . print_r($calList[items][4], true) . "</pre>";
}
?>
</form>
Ich möchte auch, dass der Termineintrag nach dem absenden des Formulars geschieht. Ohne das "Connect Me!"
Ist das möglich?
Danke schion jetzt für eure Hilfe