<?php
session_start();

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

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

// Die check constant for indirectly accessed php  
define("PUBLIC_ACCESS", 1);
?>

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

<head>
  <meta http-equiv="Content-Language" content="en-us">
  <title>Site Definition</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/stickythead.css">
  <link rel="stylesheet" href="/site/css/bootstrap.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="/site/js/main.js"></script>

<style>

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

th {
    background-color:grey;
}
.btn {
    width:160px;    
}

td > * {
  width: 100%;
}

div > * {
  width: 100%;
}

label {
  margin-bottom:0px;
}  

.thumbs {
    padding: 1px;
}
.thumb {
    float:left;
    position:relative;
    width: 70px;
    margin-right: 10px;
}
.thumb img{
    /* ... */
    width:100px;
    height:75px;
}    

.thumb:hover img {
    position:relative;
    top:0px;
    left:35px;
    width:600px;
    height:450px;
    display:inline;
    z-index:999;
}

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

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

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

#outer-container {
    position: relative;
}

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

#putaddPolygonPoints {
    position:absolute;
    width:80px;
    bottom:5px;
    right:20px;
}

#putaddRecRationale, #putaddSiteInterpret, #putaddConcentrations {
    position:absolute;
    width:80px;
    bottom:5px;
    right:20px;
}

#putaddProjectFrameworks {
    position:absolute;
    width:80px;
    bottom:5px;
    right:20px;
}

#putaddRelatedOrganizations {
    position:absolute;
    width:80px;
    bottom:5px;
    right:20px;
}

#putaddContactJobstatuses {
    position:absolute;
    width:80px;
    bottom:5px;
    right:20px;
}

</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/contextselector.php");
require_once ("$toolkit/formdatahandler.php");
require_once ("$toolkit/imagecapture.php");
require_once ("$toolkit/inputtext.php");
require_once ("$toolkit/putbutton.php");
require_once ("$toolkit/selectoption.php");
require_once ("$toolkit/summarytable.php");
require_once ("$toolkit/toggleslider.php");

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

// Model and view class object definitions for the module
require_once ("$docRoot/sitedefinition/model.php");
require_once ("$docRoot/sitedefinition/view.php");
 
$lo_id = (isset($_SESSION['login'])) ? $_SESSION['login'] : 0;
$pw_id  = isset($_SESSION['projectworkevent']) ? $_SESSION['projectworkevent'] : 0;
$pp_id  = isset($_SESSION['projectparcel']) ? $_SESSION['projectparcel'] : 0;
$pwo_id = isset($_SESSION['dailyoperation']) ? $_SESSION['dailyoperation'] : 0;
$su_id  = isset($_SESSION['propertypart']) ? $_SESSION['propertypart'] : 0;
$cu_id  = isset($_SESSION['sitedefinition']) ? $_SESSION['sitedefinition'] : 0;

print_r ("pp:$pp_id su:$su_id pwo:$pwo_id cu:$cu_id");

// Model and view class object definitions for the module
$siteDefinition = new modSiteDefinition($lo_id, $pw_id, $pp_id, $pwo_id, $su_id,$cu_id);
$siteDefinitionView = new modSiteDefinitionView($siteDefinition);

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

?>

</body>
</html>

