Advertisement
EthanNAustin

Theater Meetings

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