<?php

   include_once("_nemo.cls.php");
   include_once("_nemo.list.cls.php");

//die("aaaaaa");
//echo session_name();
   $page = new Nemo();

//test commit push - this is only a coment to test the new pipeline using codecommit

//die("werewww");

//die("wreer");

//events

//page start
//print_rr($page->Pages);
   if($page->Pages["booking.php"]->Security->blnView == 1){
      $booking = new Booking(array("BookingID"));
      $booking->isSortable = 1;
      $page->Content .= $booking->getListToday();
   }

   if($page->Pages["usage.log.php"]->Security->blnView == 1){
      $usage = new NemoList("");
      $usage->isSortable = 0;
      $usage->ListSQL("
         SELECT sysLogin.strDateTime AS 'Date Time', sysLogin.strResult AS Result, sysLogin.strUsername AS Username, sysUser.strUser AS 'System User', sysUser.blnActive AS Active, sysSecurityGroup.strSecurityGroup AS 'Security Group'
         FROM (sysUser LEFT JOIN sysSecurityGroup ON sysUser.refSecurityGroupID = sysSecurityGroup.SecurityGroupID) RIGHT JOIN sysLogin ON sysUser.strEmail = sysLogin.strUsername
         WHERE sysLogin.strDateTime >= '". date("Y-m-d H:i:s", strtotime("-2 days")) ."'
         GROUP BY sysLogin.strDateTime, sysLogin.strResult, sysLogin.strUsername, sysLogin.strPassword, sysUser.strUser, sysUser.blnActive, sysSecurityGroup.strSecurityGroup
         ORDER BY sysLogin.strDateTime DESC");

      $page->Content .= $usage->renderTable("Usage Log");

      //print_rr(date("Y-m-d H:i:s", strtotime("-2 days")));
   }


   //$list->ListDATA();
   $page->Display();


//print_rr($page);

?>
