Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //--room variable---
- $rm=2;
- // SET Default Timezone for Date Time Operations
- date_default_timezone_set('America/Chicago');
- $today = date("Y-m-d");
- //$today = '2014-06-02T00:00:00Z';
- $now = date("Y-m-d H:i:s");
- $host = 'email@address.domain';
- $username = 'username';
- $password = 'userpassowrd';
- $localTZ = 'US/Central';
- $daysahead = '1'; // 1 Equals Today Only
- $roomidAry = Array();
- $roomidAry['1'] = "artcon";
- $roomidAry['2'] = "theater";
- $rmNameAry = Array();
- $rmNameAry['1'] = "ROOM NAME1";
- $rmNameAry['2'] = "ROOM NAME2";
- require_once ('php-ews/EWS_Exception.php');
- require_once ('php-ews/EWSAutodiscover.php');
- require_once ('php-ews/EWSType.php');
- require_once ('php-ews/ExchangeWebServices.php');
- require_once ('php-ews/NTLMSoapClient.php');
- require_once ('php-ews/NTLMSoapClient/Exchange.php');
- require_once ('php-ews/EWSType/FindItemType.php');
- require_once ('php-ews/EWSType/ItemQueryTraversalType.php');
- require_once ('php-ews/EWSType/ItemResponseShapeType.php');
- require_once ('php-ews/EWSType/DefaultShapeNamesType.php');
- require_once ('php-ews/EWSType/CalendarViewType.php');
- require_once ('php-ews/EWSType/NonEmptyArrayOfBaseFolderIdsType.php');
- require_once ('php-ews/EWSType/DistinguishedFolderIdType.php');
- require_once ('php-ews/EWSType/DistinguishedFolderIdNameType.php');
- require_once ('php-ews/EWSType/EmailAddressType.php');
- require_once ('php-ews/EWSType/FindItemType.php');
- $EWScalendar = $roomidAry[$rm] .'@retrostudios.com';
- $ews = new ExchangeWebServices ($host, $username, $password);
- $request = new EWSType_FindItemType();
- $request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;
- $request->ItemShape = new EWSType_ItemResponseShapeType();
- $request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;
- $request->CalendarView = new EWSType_CalendarViewType();
- $request->CalendarView->StartDate = date ('c',strtotime("$today"));
- $request->CalendarView->EndDate = date ('c',strtotime("$today + $daysahead days"));
- $request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
- $request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
- $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
- $mailBox = new EWSType_EmailAddressType();
- $mailBox->EmailAddress = $roomidAry[$rm] . '@retrostudios.com';
- $request->ParentFolderIds->DistinguishedFolderId->Mailbox = $mailBox;
- $response = $ews->FindItem($request);
- $TotalItemCount = $response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView;
- function currentmeeting($rm) {
- global $roomidAry, $rmNameAry, $ews, $request, $startdt, $enddt, $ItemID, $now;
- $nwshng = "";
- $mailBox = new EWSType_EmailAddressType();
- $mailBox->EmailAddress = $roomidAry[$rm] . '@retrostudios.com';
- $request->ParentFolderIds->DistinguishedFolderId->Mailbox = $mailBox;
- $response = $ews->FindItem($request);
- $TotalItemCount = $response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView;
- if ($TotalItemCount>1) {
- // LOOP through the Event Data and Parse each item
- for ($ItemID = 0; $ItemID < $TotalItemCount; $ItemID++) {
- $subject = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->Subject;
- //--do something with item data--
- //Trigger Now Showing 5 minutes early by minusing 5 minutes from Start Time
- $startdt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->Start) - (5 * 60);
- $enddt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->End);
- $nowdt = strtotime($now);
- //--IF Meeting is Currently On--
- if ($enddt>$nowdt && $startdt<$nowdt) {
- $nwshng = $subject;
- }
- }
- } elseif ($TotalItemCount==1) {
- //--ONLY one appointment in CALENDAR--
- $subject = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->Subject;
- for ($ItemID = 0; $ItemID < $TotalItemCount; $ItemID++) {
- //--do something with item data--
- //Trigger Now Showing 5 minutes early by minusing 5 minutes from Start Time
- $startdt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->Start) - (5 * 60);
- $enddt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->End);
- $nowdt = strtotime($now);
- //--IF Meeting is Currently On--
- if ($enddt>$nowdt && $startdt<$nowdt) {
- $nwshng = $subject;
- }
- }
- }
- return($nwshng);
- }
- function meetings($rm) {
- global $roomidAry, $rmNameAry, $ews, $request, $startdt, $enddt, $ItemID, $now, $meetingvar;
- $mailBox = new EWSType_EmailAddressType();
- $mailBox->EmailAddress = $roomidAry[$rm] . '@retrostudios.com';
- $request->ParentFolderIds->DistinguishedFolderId->Mailbox = $mailBox;
- $response = $ews->FindItem($request);
- $TotalItemCount = $response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView;
- if ($TotalItemCount>1) {
- // LOOP through the Event Data and Parse each item
- for ($ItemID = 0; $ItemID < $TotalItemCount; $ItemID++) {
- $subject = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->Subject;
- //--do something with item data--
- $startdt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->Start);
- $enddt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->End);
- $nowdt = strtotime($now);
- //--IF Meeting is Over Strike Through--
- //if ($enddt<$nowdt) {
- if ($enddt<$nowdt) {
- $csstext = " text-decoration:line-through; ";
- }else{
- $csstext = " ";
- }
- //--has the meeting been canceled?--
- if (!strpos('~~' . $subject, 'Canceled:')) {
- $meetingvar = $meetingvar . "<table class='coming' cellspacing='0' cellpadding='0'><tr><td class='vibrate-3' style='white-space: nowrap; text-align: left; vertical-align: text-top;'>" . date("g:i A",$startdt) . "</td><td class='vibrate-3' style='display: block; word-wrap: break-word;". $csstext ."text-align: right; vertical-align: text-top;'>" . $subject . "</td></tr></table>\r\n</div>\r\n";
- }
- }
- } elseif ($TotalItemCount==1) {
- //--ONLY one appointment in CALENDAR--
- $subject = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->Subject;
- //--do something with item data--
- for ($ItemID = 0; $ItemID < $TotalItemCount; $ItemID++) {
- $startdt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->Start);
- $enddt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->End);
- $nowdt = strtotime($now);
- //--IF Meeting is Over Strike Through--
- if ($enddt<$nowdt) {
- $csstext = " text-decoration:line-through; ";
- }else{
- $csstext = " ";
- }
- //--has the meeting been canceled?--
- if (!strpos('~~' . $subject, 'Canceled:')) {
- $meetingvar = $meetingvar . "<table class='coming' cellspacing='0' cellpadding='0'><tr><td class='vibrate-3' style='white-space: nowrap; text-align: left; vertical-align: text-top;'>" . date("g:i A",$startdt) . "</td><td class='vibrate-3' style='display: block; word-wrap: break-word;". $csstext ."text-align: right; vertical-align: text-top;'>" . $subject . "</td></tr></table>\r\n</div>\r\n";
- }
- }
- }
- return($meetingvar);
- }
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="refresh" content="60">
- <style>
- .vibrate-3{-webkit-animation:vibrate-3 .5s linear infinite both;animation:vibrate-3 .5s linear infinite both}
- @-webkit-keyframes vibrate-3 {
- 0% {
- -webkit-transform: translate(0);
- transform: translate(0);
- }
- 10% {
- -webkit-transform: translate(-1px, -1px);
- transform: translate(-1px, -1px);
- }
- 20% {
- -webkit-transform: translate(1px, -1px);
- transform: translate(1px, -1px);
- }
- 30% {
- -webkit-transform: translate(-1px, 1px);
- transform: translate(-1px, 1px);
- }
- 40% {
- -webkit-transform: translate(1px, 1px);
- transform: translate(1px, 1px);
- }
- 50% {
- -webkit-transform: translate(-1px, -1px);
- transform: translate(-1px, -1px);
- }
- 60% {
- -webkit-transform: translate(1px, -1px);
- transform: translate(1px, -1px);
- }
- 70% {
- -webkit-transform: translate(-1px, 1px);
- transform: translate(-1px, 1px);
- }
- 80% {
- -webkit-transform: translate(-1px, -1px);
- transform: translate(-1px, -1px);
- }
- 90% {
- -webkit-transform: translate(1px, -1px);
- transform: translate(1px, -1px);
- }
- 100% {
- -webkit-transform: translate(0);
- transform: translate(0);
- }
- }
- @keyframes vibrate-3 {
- 0% {
- -webkit-transform: translate(0);
- transform: translate(0);
- }
- 10% {
- -webkit-transform: translate(-1px, -1px);
- transform: translate(-1px, -1px);
- }
- 20% {
- -webkit-transform: translate(1px, -1px);
- transform: translate(1px, -1px);
- }
- 30% {
- -webkit-transform: translate(-1px, 1px);
- transform: translate(-1px, 1px);
- }
- 40% {
- -webkit-transform: translate(1px, 1px);
- transform: translate(1px, 1px);
- }
- 50% {
- -webkit-transform: translate(-1px, -1px);
- transform: translate(-1px, -1px);
- }
- 60% {
- -webkit-transform: translate(1px, -1px);
- transform: translate(1px, -1px);
- }
- 70% {
- -webkit-transform: translate(-1px, 1px);
- transform: translate(-1px, 1px);
- }
- 80% {
- -webkit-transform: translate(-1px, -1px);
- transform: translate(-1px, -1px);
- }
- 90% {
- -webkit-transform: translate(1px, -1px);
- transform: translate(1px, -1px);
- }
- 100% {
- -webkit-transform: translate(0);
- transform: translate(0);
- }
- }
- @font-face {
- font-family: 'Gill Sans Ultra Bold';
- src: url(/RTV/fonts/GILB____.TTF);
- }
- div {
- width: 100%;
- border: 0px;
- margin: 0px;
- padding: 0px;
- }
- table {
- width: 100%;
- border: 0px;
- margin: 0px;
- padding: 0px;
- }
- td {
- margin: 0px;
- padding:0px;
- }
- .nowsoon {
- font-family: 'Gill Sans Ultra Bold';
- font-weight: bold;
- text-transform: uppercase;
- font-size: 72pt;
- color: #990000;
- text-align:center;
- padding-top:45px;
- display: table;
- margin: 0 auto;
- text-shadow: 0 1px 0 #99cccc,
- 0 2px 0 #99c9c9,
- 0 3px 0 #99bbbb,
- 0 4px 0 #99b9b9,
- 0 5px 0 #99aaaa,
- 0 6px 1px rgba(0,0,0,.1),
- 0 0 5px rgba(0,0,0,.1),
- 0 1px 3px rgba(0,0,0,.3),
- 0 3px 5px rgba(0,0,0,.2),
- 0 5px 10px rgba(0,0,0,.25),
- 0 10px 10px rgba(0,0,0,.2),
- 0 20px 20px rgba(0,0,0,.15);
- }
- .coming {
- width:1300px;
- font-family: 'Gill Sans Ultra Bold';
- font-weight: bold;
- text-transform: uppercase;
- font-size: 50pt;
- color: #eaeaea;
- display: table;
- margin: 0 auto;
- text-shadow: 0 1px 0 #ccc,
- 0 2px 0 #c9c9c9,
- 0 3px 0 #bbb,
- 0 4px 0 #b9b9b9,
- 0 5px 0 #aaa,
- 0 6px 1px rgba(0,0,0,.1),
- 0 0 5px rgba(0,0,0,.1),
- 0 1px 3px rgba(0,0,0,.3),
- 0 3px 5px rgba(0,0,0,.2),
- 0 5px 10px rgba(0,0,0,.25),
- 0 10px 10px rgba(0,0,0,.2),
- 0 20px 20px rgba(0,0,0,.15);
- }
- </style>
- <style>
- //body {
- // background: #000;
- //}
- #wrapper {
- margin: auto;
- position: absolute;
- top: 0;
- right: 0;
- bottom: 0;
- left: 0;
- width: 1920px;
- height: 1080px;
- }
- ul {
- list-style: none;
- padding: 0;
- margin: 0;
- }
- li {
- padding: 0;
- width: 27px;
- height: 27px;
- background: radial-gradient(ellipse at center, rgba(255,255,200,0.5) 30%,rgba(255,255,150,0.8) 100%);
- border-radius: 100%;
- position: relative;
- animation: chase 600ms infinite;
- }
- li:before {
- content: "";
- display: block;
- background: rgba(255,255,255,0.5);
- width: 5px;
- height: 5px;
- border-radius: 20% 100%;
- position: absolute;
- right: 6px;
- top: 6px;
- }
- li:nth-child(3n+1) {
- animation-delay: 0s;
- }
- li:nth-child(3n+2) {
- animation-delay: 400ms;
- }
- li:nth-child(3n+3) {
- animation-delay: 800ms;
- }
- #top {
- position: absolute;
- top: 8;
- left: -3;
- }
- #top li {
- float: left;
- margin-right: 6px;
- }
- #right {
- position: absolute;
- top: 0;
- right: 0;
- }
- #right li {
- margin-bottom: 5px;
- }
- #bottom {
- position: absolute;
- bottom: 775;
- right: 0;
- transform: rotate(180deg);
- }
- #bottom li {
- float: left;
- margin-right: 6px;
- }
- #left {
- position: absolute;
- bottom: 0;
- left: 0;
- transform: rotate(180deg);
- }
- #left li {
- margin-bottom: 5px;
- }
- @keyframes chase {
- 0% {
- box-shadow: inset 0px 0px 40px 12px rgba(255,255,220,0.9),
- 0px 0px 40px 10px rgba(255,255,190,0.9);
- }
- 100% {
- box-shadow: inset 0px 0px 0px 0px rgba(255,255,220,0),
- 0px 0px 0px 0px rgba(255,255,190,0);
- }
- }
- </style>
- <title>Theater</title>
- </head>
- <body>
- <div id="wrapper">
- <ul id="top">
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- </ul>
- <ul id="bottom">
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- <li></li>
- </ul>
- </div>
- <div class="nowsoon">
- <?php
- $curmeet = currentmeeting($rm);
- if ($curmeet=="") {
- echo "<div style='width: 100%; height: 150px; vertical-align: text-top; margin-top: 50px'>COMING SOON!</div></div>";
- }else{
- echo "NOW SHOWING";
- }
- ?>
- <br/>
- <?php
- if (!$curmeet=="") {
- echo currentmeeting($rm);
- }
- ?>
- </div>
- <div style="padding-top:125px;">
- <?php
- $mgt = meetings($rm);
- if (strlen($mgt)) {
- echo $mgt;
- } else {
- echo "<table class='coming' cellspacing='0' cellpadding='0'><tr><td class='vibrate-3' style='padding-top: 20px; display: block; word-wrap: break-word; text-align: center; vertical-align: text-top;'>OUT OF POPCORN<br/>CHECK BACK TOMORROW<br/><img src='nopopcorn.png' width='300px' style='padding-top: 20px;'/></td></tr></table>\r\n</div>\r\n";
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement