$value) { $mails .= "$value"; if($arraysize > 1){ $mails .= ", "; $arraysize--; } $string .= "ATTENDEE;CN=\"$key\";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:$value \r\n" ; } $domain = 'wiaswuaschd.de'; //Create Email Headers $mime_boundary = "----Meeting Booking----".MD5(TIME()); $headers = "From: ".$from_name." <".$from_address.">\n"; $headers .= "Reply-To: ".$from_name." <".$from_address.">\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n"; $headers .= "Content-class: urn:content-classes:calendarmessage\n"; //Create Email Body (HTML) $message = "--$mime_boundary\r\n"; $message .= "Content-Type: text/html; charset=UTF-8\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; $message .= "\n"; $message .= "\n"; $message .= '

'.$description.'

'; $message .= "\n"; $message .= "\n"; $message .= "--$mime_boundary\r\n"; $ical = 'BEGIN:VCALENDAR' . "\r\n" . 'PRODID:-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN' . "\r\n" . 'VERSION:2.0' . "\r\n" . 'METHOD:REQUEST' . "\r\n" . 'BEGIN:VTIMEZONE' . "\r\n" . 'TZID:W. Europe Standard Time' . "\r\n" . 'BEGIN:STANDARD' . "\r\n" . 'DTSTART:16011028T030000' . "\r\n" . 'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10' . "\r\n" . 'TZOFFSETFROM:+0200' . "\r\n" . 'TZOFFSETTO:+0100' . "\r\n" . 'END:STANDARD' . "\r\n" . 'BEGIN:DAYLIGHT' . "\r\n" . 'DTSTART:16010325T020000' . "\r\n" . 'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3' . "\r\n" . 'TZOFFSETFROM:+0100' . "\r\n" . 'TZOFFSETTO:+0200' . "\r\n" . 'END:DAYLIGHT' . "\r\n" . 'END:VTIMEZONE' . "\r\n" . 'BEGIN:VEVENT' . "\r\n" . 'ORGANIZER;CN="'.$from_name.'":MAILTO:'.$from_address. "\r\n" . $string . 'LAST-MODIFIED:' . date("Ymd\TGis") . "\r\n" . 'UID:'.date("Ymd\TGis", strtotime($startTime)).rand()."@".$domain."\r\n" . 'DTSTAMP:'.date("Ymd\TGis"). "\r\n" . 'DTSTART;TZID="W. Europe Standard Time":'.date("Ymd\THis", strtotime($startTime)). "\r\n" . 'DTEND;TZID="W. Europe Standard Time":'.date("Ymd\THis", strtotime($endTime)). "\r\n" . 'TRANSP:OPAQUE'. "\r\n" . 'SEQUENCE:2'. "\r\n" . 'SUMMARY:' . $subject . "\r\n" . 'LOCATION:' . $location . "\r\n" . 'CLASS:PUBLIC'. "\r\n" . 'PRIORITY:5'. "\r\n" . 'END:VEVENT'. "\r\n" . 'END:VCALENDAR'. "\r\n"; $message .= 'Content-Type: text/calendar;name="meeting.ics";method=REQUEST'."\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; $message .= $ical; $mailsent = mail($mails, $subject, $message, $headers); return ($mailsent)?(true):(false); } function setcountdown($Countdowndate) { global $con; # setzt die Variable CON für die Datenbank verbindung $sql = $con->query("UPDATE timestamp SET timestamp='{$Countdowndate}'"); } #bestellform für welchen user bestellt wird function print_user() { global $con; # setzt die Variable CON für die Datenbank verbindung $lesen= $con->query("SELECT UserID,CONCAT(Lname, ' ',Fname) as 'Name',Email FROM user where isactive = 1 order by UserID ASC"); echo ''; } function send_invite() { global $con; echo '



'; $post = $_POST; unset($post['Einladen']); foreach($post as $key => $value) { if($key == "Mail"){ $mails = $value; }else{ switch($key){ case 'Betreff' : $Betreff = $value; break; case 'Ort' : $Ort = $value; break; case 'Startdate' : $Startdate = $value; break; case 'Enddate' : $Enddate = $value; break; case 'Nachricht' : $Nachricht = $value; break; } } } $EmpfArray = array(); $elemente = sizeof($mails); for($x=0;$x<$elemente;$x++){ $name = $con->query("SELECT CONCAT(Lname, ' ',Fname) as 'Name' FROM user where Email='{$mails[$x]}'")->fetch_object()->Name; $EmpfArray[$name] = $mails[$x]; } setcountdown($Startdate); $from_name = "Waiswuaschd Admin"; $from_address = "admin@waiswuaschd.de"; sendIcalEvent($from_name, $from_address, $EmpfArray, $Startdate, $Enddate, $Betreff, $Nachricht, $Ort); } if(isset($_POST['Einladen'])){ send_invite(); } #Setzen des Titels und der Headline für include Dateien $webpagetitle = "Einladung erstellen"; #Header und menü einbinden include "Includes/Header.php"; include "Includes/Menu.php"; #html Content ausgeben ?>