Advertisement
EthanNAustin

Theater Meetings

Nov 27th, 2017
490
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 15.68 KB | None | 0 0
  1. <?php
  2. //--room variable---
  3. $rm=2;
  4.  
  5. // SET Default Timezone for Date Time Operations
  6. date_default_timezone_set('America/Chicago');
  7.  
  8. $today = date("Y-m-d");
  9. //$today = '2014-06-02T00:00:00Z';
  10. $now = date("Y-m-d H:i:s");
  11.  
  12. $host = 'email@address.domain';
  13. $username = 'username';
  14. $password = 'userpassowrd';
  15.  
  16. $localTZ = 'US/Central';
  17. $daysahead = '1'; // 1 Equals Today Only
  18.  
  19. $roomidAry = Array();
  20. $roomidAry['1'] = "artcon";
  21. $roomidAry['2'] = "theater";
  22.  
  23. $rmNameAry = Array();
  24. $rmNameAry['1'] = "ROOM NAME1";
  25. $rmNameAry['2'] = "ROOM NAME2";
  26.  
  27. require_once ('php-ews/EWS_Exception.php');
  28. require_once ('php-ews/EWSAutodiscover.php');
  29. require_once ('php-ews/EWSType.php');
  30. require_once ('php-ews/ExchangeWebServices.php');
  31. require_once ('php-ews/NTLMSoapClient.php');
  32.  
  33. require_once ('php-ews/NTLMSoapClient/Exchange.php');
  34.  
  35. require_once ('php-ews/EWSType/FindItemType.php');
  36. require_once ('php-ews/EWSType/ItemQueryTraversalType.php');
  37. require_once ('php-ews/EWSType/ItemResponseShapeType.php');
  38. require_once ('php-ews/EWSType/DefaultShapeNamesType.php');
  39. require_once ('php-ews/EWSType/CalendarViewType.php');
  40. require_once ('php-ews/EWSType/NonEmptyArrayOfBaseFolderIdsType.php');
  41. require_once ('php-ews/EWSType/DistinguishedFolderIdType.php');
  42. require_once ('php-ews/EWSType/DistinguishedFolderIdNameType.php');
  43. require_once ('php-ews/EWSType/EmailAddressType.php');
  44. require_once ('php-ews/EWSType/FindItemType.php');
  45.  
  46.  
  47. $EWScalendar = $roomidAry[$rm] .'@retrostudios.com';
  48. $ews = new ExchangeWebServices ($host, $username, $password);
  49. $request = new EWSType_FindItemType();
  50. $request->Traversal = EWSType_ItemQueryTraversalType::SHALLOW;
  51. $request->ItemShape = new EWSType_ItemResponseShapeType();
  52. $request->ItemShape->BaseShape = EWSType_DefaultShapeNamesType::DEFAULT_PROPERTIES;
  53. $request->CalendarView = new EWSType_CalendarViewType();
  54. $request->CalendarView->StartDate = date ('c',strtotime("$today"));
  55. $request->CalendarView->EndDate = date ('c',strtotime("$today + $daysahead days"));
  56. $request->ParentFolderIds = new EWSType_NonEmptyArrayOfBaseFolderIdsType();
  57. $request->ParentFolderIds->DistinguishedFolderId = new EWSType_DistinguishedFolderIdType();
  58. $request->ParentFolderIds->DistinguishedFolderId->Id = EWSType_DistinguishedFolderIdNameType::CALENDAR;
  59.  
  60. $mailBox = new EWSType_EmailAddressType();
  61. $mailBox->EmailAddress = $roomidAry[$rm] . '@retrostudios.com';
  62. $request->ParentFolderIds->DistinguishedFolderId->Mailbox = $mailBox;
  63. $response = $ews->FindItem($request);
  64.  
  65. $TotalItemCount = $response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView;
  66.  
  67. function currentmeeting($rm) {
  68.     global $roomidAry, $rmNameAry, $ews, $request, $startdt, $enddt, $ItemID, $now;
  69.    
  70.     $nwshng = "";
  71.    
  72.     $mailBox = new EWSType_EmailAddressType();
  73.     $mailBox->EmailAddress = $roomidAry[$rm] . '@retrostudios.com';
  74.     $request->ParentFolderIds->DistinguishedFolderId->Mailbox = $mailBox;
  75.     $response = $ews->FindItem($request);
  76.    
  77.     $TotalItemCount = $response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView;
  78.    
  79.     if ($TotalItemCount>1) {
  80.         // LOOP through the Event Data and Parse each item
  81.         for ($ItemID = 0; $ItemID < $TotalItemCount; $ItemID++) {
  82.             $subject = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->Subject;
  83.            
  84.             //--do something with item data--
  85.             //Trigger Now Showing 5 minutes early by minusing 5 minutes from Start Time
  86.             $startdt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->Start) - (5 * 60);
  87.             $enddt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->End);
  88.            
  89.             $nowdt = strtotime($now);
  90.             //--IF Meeting is Currently On--
  91.             if ($enddt>$nowdt && $startdt<$nowdt) {
  92.                 $nwshng = $subject;
  93.             }
  94.         }
  95.     } elseif ($TotalItemCount==1) {
  96.         //--ONLY one appointment in CALENDAR--
  97.         $subject = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->Subject;
  98.        
  99.         for ($ItemID = 0; $ItemID < $TotalItemCount; $ItemID++) {
  100.            
  101.             //--do something with item data--
  102.             //Trigger Now Showing 5 minutes early by minusing 5 minutes from Start Time
  103.             $startdt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->Start) - (5 * 60);
  104.             $enddt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->End);
  105.            
  106.             $nowdt = strtotime($now);
  107.             //--IF Meeting is Currently On--
  108.             if ($enddt>$nowdt && $startdt<$nowdt) {
  109.                 $nwshng = $subject;
  110.             }
  111.         }
  112.     }
  113.     return($nwshng);
  114. }
  115.  
  116. function meetings($rm) {
  117.     global $roomidAry, $rmNameAry, $ews, $request, $startdt, $enddt, $ItemID, $now, $meetingvar;
  118.    
  119.     $mailBox = new EWSType_EmailAddressType();
  120.     $mailBox->EmailAddress = $roomidAry[$rm] . '@retrostudios.com';
  121.     $request->ParentFolderIds->DistinguishedFolderId->Mailbox = $mailBox;
  122.     $response = $ews->FindItem($request);
  123.    
  124.     $TotalItemCount = $response->ResponseMessages->FindItemResponseMessage->RootFolder->TotalItemsInView;
  125.    
  126.     if ($TotalItemCount>1) {
  127.         // LOOP through the Event Data and Parse each item
  128.         for ($ItemID = 0; $ItemID < $TotalItemCount; $ItemID++) {
  129.             $subject = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->Subject;
  130.            
  131.             //--do something with item data--
  132.             $startdt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->Start);
  133.             $enddt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem[$ItemID]->End);
  134.            
  135.             $nowdt = strtotime($now);
  136.             //--IF Meeting is Over Strike Through--
  137.             //if ($enddt<$nowdt) {
  138.             if ($enddt<$nowdt) {
  139.                 $csstext = " text-decoration:line-through; ";
  140.             }else{
  141.                 $csstext = " ";
  142.             }
  143.            
  144.             //--has the meeting been canceled?--
  145.             if (!strpos('~~' . $subject, 'Canceled:')) {
  146.                 $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";
  147.             }
  148.            
  149.         }
  150.     } elseif ($TotalItemCount==1) {
  151.         //--ONLY one appointment in CALENDAR--
  152.         $subject = $response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->Subject;
  153.        
  154.         //--do something with item data--
  155.         for ($ItemID = 0; $ItemID < $TotalItemCount; $ItemID++) {
  156.             $startdt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->Start);
  157.             $enddt = strtotime($response->ResponseMessages->FindItemResponseMessage->RootFolder->Items->CalendarItem->End);
  158.            
  159.             $nowdt = strtotime($now);
  160.             //--IF Meeting is Over Strike Through--
  161.             if ($enddt<$nowdt) {
  162.                 $csstext = " text-decoration:line-through; ";
  163.             }else{
  164.                 $csstext = " ";
  165.             }
  166.             //--has the meeting been canceled?--
  167.             if (!strpos('~~' . $subject, 'Canceled:')) {
  168.                 $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";
  169.             }
  170.         }
  171.     }
  172.     return($meetingvar);
  173. }
  174. ?>
  175.  
  176. <html>
  177. <head>
  178. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  179. <meta http-equiv="refresh" content="60">
  180. <style>
  181. .vibrate-3{-webkit-animation:vibrate-3 .5s linear infinite both;animation:vibrate-3 .5s linear infinite both}
  182.  
  183. @-webkit-keyframes vibrate-3 {
  184.   0% {
  185.     -webkit-transform: translate(0);
  186.             transform: translate(0);
  187.   }
  188.   10% {
  189.     -webkit-transform: translate(-1px, -1px);
  190.             transform: translate(-1px, -1px);
  191.   }
  192.   20% {
  193.     -webkit-transform: translate(1px, -1px);
  194.             transform: translate(1px, -1px);
  195.   }
  196.   30% {
  197.     -webkit-transform: translate(-1px, 1px);
  198.             transform: translate(-1px, 1px);
  199.   }
  200.   40% {
  201.     -webkit-transform: translate(1px, 1px);
  202.             transform: translate(1px, 1px);
  203.   }
  204.   50% {
  205.     -webkit-transform: translate(-1px, -1px);
  206.             transform: translate(-1px, -1px);
  207.   }
  208.   60% {
  209.     -webkit-transform: translate(1px, -1px);
  210.             transform: translate(1px, -1px);
  211.   }
  212.   70% {
  213.     -webkit-transform: translate(-1px, 1px);
  214.             transform: translate(-1px, 1px);
  215.   }
  216.   80% {
  217.     -webkit-transform: translate(-1px, -1px);
  218.             transform: translate(-1px, -1px);
  219.   }
  220.   90% {
  221.     -webkit-transform: translate(1px, -1px);
  222.             transform: translate(1px, -1px);
  223.   }
  224.   100% {
  225.     -webkit-transform: translate(0);
  226.             transform: translate(0);
  227.   }
  228. }
  229. @keyframes vibrate-3 {
  230.   0% {
  231.     -webkit-transform: translate(0);
  232.             transform: translate(0);
  233.   }
  234.   10% {
  235.     -webkit-transform: translate(-1px, -1px);
  236.             transform: translate(-1px, -1px);
  237.   }
  238.   20% {
  239.     -webkit-transform: translate(1px, -1px);
  240.             transform: translate(1px, -1px);
  241.   }
  242.   30% {
  243.     -webkit-transform: translate(-1px, 1px);
  244.             transform: translate(-1px, 1px);
  245.   }
  246.   40% {
  247.     -webkit-transform: translate(1px, 1px);
  248.             transform: translate(1px, 1px);
  249.   }
  250.   50% {
  251.     -webkit-transform: translate(-1px, -1px);
  252.             transform: translate(-1px, -1px);
  253.   }
  254.   60% {
  255.     -webkit-transform: translate(1px, -1px);
  256.             transform: translate(1px, -1px);
  257.   }
  258.   70% {
  259.     -webkit-transform: translate(-1px, 1px);
  260.             transform: translate(-1px, 1px);
  261.   }
  262.   80% {
  263.     -webkit-transform: translate(-1px, -1px);
  264.             transform: translate(-1px, -1px);
  265.   }
  266.   90% {
  267.     -webkit-transform: translate(1px, -1px);
  268.             transform: translate(1px, -1px);
  269.   }
  270.   100% {
  271.     -webkit-transform: translate(0);
  272.             transform: translate(0);
  273.   }
  274. }
  275.  
  276.  
  277. @font-face {
  278.     font-family: 'Gill Sans Ultra Bold';
  279.     src: url(/RTV/fonts/GILB____.TTF);
  280. }
  281. div {
  282.     width:      100%;
  283.     border:     0px;
  284.     margin:     0px;
  285.     padding:    0px;
  286. }
  287. table {
  288.     width:      100%;
  289.     border:     0px;
  290.     margin:     0px;
  291.     padding:    0px;
  292. }
  293. td {
  294.     margin: 0px;
  295.     padding:0px;
  296. }
  297. .nowsoon {
  298.     font-family: 'Gill Sans Ultra Bold';
  299.     font-weight: bold;
  300.     text-transform: uppercase;
  301.     font-size: 72pt;
  302.     color: #990000;
  303.     text-align:center;
  304.     padding-top:45px;
  305.     display: table;
  306.     margin: 0 auto;
  307.     text-shadow:    0 1px 0 #99cccc,
  308.                     0 2px 0 #99c9c9,
  309.                     0 3px 0 #99bbbb,
  310.                     0 4px 0 #99b9b9,
  311.                     0 5px 0 #99aaaa,
  312.                     0 6px 1px rgba(0,0,0,.1),
  313.                     0 0 5px rgba(0,0,0,.1),
  314.                     0 1px 3px rgba(0,0,0,.3),
  315.                     0 3px 5px rgba(0,0,0,.2),
  316.                     0 5px 10px rgba(0,0,0,.25),
  317.                     0 10px 10px rgba(0,0,0,.2),
  318.                     0 20px 20px rgba(0,0,0,.15);
  319. }
  320.  
  321. .coming {
  322.     width:1300px;
  323.     font-family: 'Gill Sans Ultra Bold';
  324.     font-weight: bold;
  325.     text-transform: uppercase;
  326.     font-size: 50pt;
  327.     color: #eaeaea;
  328.     display: table;
  329.     margin: 0 auto;
  330.     text-shadow:    0 1px 0 #ccc,
  331.                     0 2px 0 #c9c9c9,
  332.                     0 3px 0 #bbb,
  333.                     0 4px 0 #b9b9b9,
  334.                     0 5px 0 #aaa,
  335.                     0 6px 1px rgba(0,0,0,.1),
  336.                     0 0 5px rgba(0,0,0,.1),
  337.                     0 1px 3px rgba(0,0,0,.3),
  338.                     0 3px 5px rgba(0,0,0,.2),
  339.                     0 5px 10px rgba(0,0,0,.25),
  340.                     0 10px 10px rgba(0,0,0,.2),
  341.                     0 20px 20px rgba(0,0,0,.15);
  342. }
  343. </style>
  344.  
  345. <style>
  346. //body {
  347. //  background: #000;
  348. //}
  349.  
  350. #wrapper {
  351.   margin: auto;
  352.   position: absolute;
  353.   top: 0;
  354.   right: 0;
  355.   bottom: 0;
  356.   left: 0;
  357.   width: 1920px;
  358.   height: 1080px;
  359. }
  360.  
  361. ul {
  362.   list-style: none;
  363.   padding: 0;
  364.   margin: 0;
  365. }
  366.  
  367. li {
  368.   padding: 0;
  369.   width: 27px;
  370.   height: 27px;
  371.   background: radial-gradient(ellipse at center, rgba(255,255,200,0.5) 30%,rgba(255,255,150,0.8) 100%);
  372.   border-radius: 100%;
  373.   position: relative;
  374.   animation: chase 600ms infinite;
  375. }
  376.  
  377. li:before {
  378.   content: "";
  379.   display: block;
  380.   background: rgba(255,255,255,0.5);
  381.   width: 5px;
  382.   height: 5px;
  383.   border-radius: 20% 100%;
  384.   position: absolute;
  385.   right: 6px;
  386.   top: 6px;
  387. }
  388.  
  389. li:nth-child(3n+1) {
  390.   animation-delay: 0s;
  391. }
  392.  
  393. li:nth-child(3n+2) {
  394.   animation-delay: 400ms;
  395. }
  396.  
  397. li:nth-child(3n+3) {
  398.   animation-delay: 800ms;
  399. }
  400.  
  401. #top {
  402.   position: absolute;
  403.   top: 8;
  404.   left: -3;
  405. }
  406.  
  407. #top li {
  408.   float: left;
  409.   margin-right: 6px;
  410. }
  411.  
  412. #right {
  413.   position: absolute;
  414.   top: 0;
  415.   right: 0;
  416. }
  417.  
  418. #right li {
  419.   margin-bottom: 5px;
  420. }
  421.  
  422. #bottom {
  423.   position: absolute;
  424.   bottom: 775;
  425.   right: 0;
  426.   transform: rotate(180deg);
  427. }
  428.  
  429. #bottom li {
  430.   float: left;
  431.   margin-right: 6px;
  432. }
  433.  
  434. #left {
  435.   position: absolute;
  436.   bottom: 0;
  437.   left: 0;
  438.   transform: rotate(180deg);
  439. }
  440.  
  441. #left li {
  442.   margin-bottom: 5px;
  443. }
  444.  
  445. @keyframes chase {
  446.   0% {
  447.     box-shadow: inset 0px 0px 40px 12px rgba(255,255,220,0.9),
  448.                       0px 0px 40px 10px rgba(255,255,190,0.9);
  449.   }
  450.   100% {
  451.     box-shadow: inset 0px 0px 0px 0px rgba(255,255,220,0),
  452.                       0px 0px 0px 0px rgba(255,255,190,0);
  453.   }
  454. }
  455. </style>
  456.  
  457. <title>Theater</title>
  458. </head>
  459.  
  460. <body>
  461. <div id="wrapper">
  462.   <ul id="top">
  463.     <li></li>
  464.     <li></li>
  465.     <li></li>
  466.     <li></li>
  467.     <li></li>
  468.     <li></li>
  469.     <li></li>
  470.     <li></li>
  471.     <li></li>
  472.     <li></li>
  473.     <li></li>
  474.     <li></li>
  475.     <li></li>
  476.     <li></li>
  477.     <li></li>
  478.     <li></li>
  479.     <li></li>
  480.     <li></li>
  481.     <li></li>
  482.     <li></li>
  483.     <li></li>
  484.     <li></li>
  485.     <li></li>
  486.     <li></li>
  487.     <li></li>
  488.     <li></li>
  489.     <li></li>
  490.     <li></li>
  491.     <li></li>
  492.     <li></li>
  493.     <li></li>
  494.     <li></li>
  495.     <li></li>
  496.     <li></li>
  497.     <li></li>
  498.     <li></li>
  499.     <li></li>
  500.     <li></li>
  501.     <li></li>
  502.     <li></li>
  503.     <li></li>
  504.     <li></li>
  505.     <li></li>
  506.     <li></li>
  507.     <li></li>
  508.     <li></li>
  509.     <li></li>
  510.     <li></li>
  511.     <li></li>
  512.     <li></li>
  513.     <li></li>
  514.     <li></li>
  515.     <li></li>
  516.     <li></li>
  517.     <li></li>
  518.     <li></li>
  519.     <li></li>
  520.     <li></li>
  521.   </ul>
  522.  
  523.   <ul id="bottom">
  524.     <li></li>
  525.     <li></li>
  526.     <li></li>
  527.     <li></li>
  528.     <li></li>
  529.     <li></li>
  530.     <li></li>
  531.     <li></li>
  532.     <li></li>
  533.     <li></li>
  534.     <li></li>
  535.     <li></li>
  536.     <li></li>
  537.     <li></li>
  538.     <li></li>
  539.     <li></li>
  540.     <li></li>
  541.     <li></li>
  542.     <li></li>
  543.     <li></li>
  544.     <li></li>
  545.     <li></li>
  546.     <li></li>
  547.     <li></li>
  548.     <li></li>
  549.     <li></li>
  550.     <li></li>
  551.     <li></li>
  552.     <li></li>
  553.     <li></li>
  554.     <li></li>
  555.     <li></li>
  556.     <li></li>
  557.     <li></li>
  558.     <li></li>
  559.     <li></li>
  560.     <li></li>
  561.     <li></li>
  562.     <li></li>
  563.     <li></li>
  564.     <li></li>
  565.     <li></li>
  566.     <li></li>
  567.     <li></li>
  568.     <li></li>
  569.     <li></li>
  570.     <li></li>
  571.     <li></li>
  572.     <li></li>
  573.     <li></li>
  574.     <li></li>
  575.     <li></li>
  576.     <li></li>
  577.     <li></li>
  578.     <li></li>
  579.     <li></li>
  580.     <li></li>
  581.     <li></li>
  582.   </ul>  
  583. </div>
  584. <div class="nowsoon">
  585. <?php
  586. $curmeet = currentmeeting($rm);
  587.  
  588. if ($curmeet=="") {
  589.     echo "<div style='width: 100%; height: 150px; vertical-align: text-top; margin-top: 50px'>COMING SOON!</div></div>";
  590. }else{
  591.     echo "NOW SHOWING";
  592. }
  593. ?>
  594. <br/>
  595. <?php
  596.     if (!$curmeet=="") {
  597.         echo currentmeeting($rm);
  598.     }
  599. ?>
  600. </div>
  601. <div style="padding-top:125px;">
  602. <?php
  603.     $mgt = meetings($rm);
  604.     if (strlen($mgt)) {
  605.         echo $mgt;
  606.     } else {
  607.         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";
  608.     }
  609. ?>
  610. </div>
  611. </body>
  612. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement