<?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>Crew</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/slider.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="/ext/bigint/BigInteger.min.js"></script>
  <script src="/site/js/main.js"></script>
  
<style>
  body {
    font-size:16px;
    font-weight:500;
    color:#000;
  } 

.btn {
    width:80px;    
  }

#to_mileage, #from_mileage {
  width:60px;
} 
  
button#putto_measures.btn,button#duptravelfrom.btn,button#putfrom_measures.btn {
    margin-top:20px;
}
  
div.modal.fade.in {
  top:2%;
}

.arrows > a {
  margin-top:10px;
}  
  
#outer-container {
  position: relative;
}

#scrollable {
  border:1px solid #ccc;
  overflow-y:auto;
}

#scrollable {
  border:1px solid #ccc;
  height:11em;
  overflow-y:auto;
  /* Styles for your scrollable div here. */
}

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

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


</style>  

</head>

<body>

<?php 

date_default_timezone_set("Canada/Eastern");

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

// Class object definitions for the UI Controls used
require_once ("$toolkit/confirmmodal.php");
require_once ("$toolkit/settimemodal.php");
require_once ("$toolkit/selectlistadd.php");
require_once ("$toolkit/listselects.php");
require_once ("$toolkit/selectlist.php");
require_once ("$toolkit/inputtextv0.php");
require_once ("$toolkit/inputhidden.php");
require_once ("$toolkit/selecthourminv0.php");
require_once ("$toolkit/multiselect3.php");
require_once ("$toolkit/multiselect2.php");
require_once ("$toolkit/selectradio.php");
require_once ("$toolkit/timesheet.php");
require_once ("$toolkit/putrequest.php");
require_once ("$toolkit/putbutton.php");

// Class definitions for the Controls instantiator and Menu generator 
require_once ("$docRoot/sys/init.php");
require_once ("$docRoot/sys/menu.php");

// Model and view class object definitions for the module
require_once ("$docRoot/crew/model.php");
require_once ("$docRoot/crew/view.php");

$lo_id = (isset($_SESSION['login'])) ? $_SESSION['login'] : 0;
$pw_id = isset($_SESSION['projectworkevent']) ? $_SESSION['projectworkevent'] : 0;
$lw_id = isset($_SESSION['loginworkday']) ? $_SESSION['loginworkday'] : 0;
$wo_id = isset($_SESSION['workday']) ? $_SESSION['workday'] : 0;

//print_r ("pw:$pw_id lw:$lw_id wo:$wo_id");

// Instantiate the model and view
$crew = new modCrew($lo_id, $pw_id, $wo_id);
$crewView = new modCrewView($crew);

// Output html layout and javascript
echo $crewView->output();

?>

<script>

//var pw_id = parseInt (<?php echo $pw_id ?>);

//if (pw_id == 0) {
//alert (pw_id);
//  $('#hdrcrew').off('click');
//  document.getElementById('hdrmsgcrew').innerHTML='Pre-select a Project Workday';    
//}

</script>
</body>
</html>

