<?php 
session_start();

require_once($_SERVER['DOCUMENT_ROOT'] . "/sys/access.php");

if(!$access->CheckLogin()){
  $access->RedirectToURL("/login/login.php");
  exit;
}

// Die check constant  
define("PUBLIC_ACCESS", 1);
?>

<!DOCTYPE html>
<html lang="en">

<head>
  <meta http-equiv="Content-Language" content="en-us">
  <title>Project</title>
  <meta charset="utf-8">

  <link rel="stylesheet" href="/ext/bootstrap/bootstrap.min.css">
  <link rel="stylesheet" href="/ext/bootstrap/bootstrap-theme.min.css">
  <link rel="stylesheet" href="/site/css/bootstrap.css">
  <link rel="stylesheet" href="/site/css/stickythead.css">
  <link rel="stylesheet" href="/site/css/multiselect.css">
  <link rel="stylesheet" href="/site/css/livesearch.css">
  <link rel="stylesheet" href="/site/css/style.css">

  <script src="/ext/jquery/jquery-3.1.1.min.js"></script>
  <script src="/ext/bootstrap/bootstrap.min.js"></script>
  <script src="/ext/jquery/jquery.stickytableheaders.min.js"></script>
  <script src="/site/js/main.js"></script>

</head>

<style>

body {
  font-size:16px;
  font-weight:500;
  color:#000;
}    

.cnf-modal {
  position:fixed;
  left:0;
  right:0;
  top:0;
  bottom:0;
  margin:auto;
  display:table;
}

.cnf-modal > .modal-content {
  display:table-cell;
}

.btn {
    width:80px;    
} 
  
label {
  margin-bottom:0px;
}

.table>td { 
  vertical-align:bottom;    
}

select, input {
 height:28px;
 width:100%;
}

input[type=checkbox] {
  height:20px;
  width:20px;
  vertical-align:middle;
}

.table-condensed {
  border-top:none;    
}
}

</style>  

<body>

<?php 

date_default_timezone_set("Canada/Eastern");

// Location of class definitions
$docRoot = $_SERVER['DOCUMENT_ROOT'];
$toolkit = $docRoot .  "/toolkit";

// UI Controls used
require_once ("$toolkit/confirmmodal.php");
require_once ("$toolkit/formdatahandler.php");
require_once ("$toolkit/inputtext.php");
require_once ("$toolkit/livesearch.php");
require_once ("$toolkit/putbutton.php");
require_once ("$toolkit/selectdate.php");
require_once ("$toolkit/selectoption.php");
require_once ("$toolkit/summarytable.php");
require_once ("$toolkit/timekeeper.php");

// Controls instantiator and Menu generator 
require_once ("$docRoot/sys/init.php");
require_once ("$docRoot/sys/menu.php");
  
// Object definitions for the module
require_once ("$docRoot/projectworkday/model.php");
require_once ("$docRoot/projectworkday/view.php");

$lo_id = (isset($_SESSION['login'])) ? $_SESSION['login'] : 0;
$pr_id = isset($_SESSION['fieldproject']) ? $_SESSION['fieldproject'] : 0;
$pw_id = isset($_SESSION['projectworkevent']) ? $_SESSION['projectworkevent'] : 0;

// Instantiate the model and view
$projectWorkday = new modProjectWorkday($lo_id, $pr_id, $pw_id);
$projectWorkdayView = new modProjectWorkdayView($projectWorkday);

// Insert html layout and javascript
echo $projectWorkdayView->output();

?>

</body>
</html>

