<?php 
define("PUBLIC_ACCESS", 1);
?>

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

<head>
  <meta http-equiv="Content-Language" content="en-us">
  <title>Controls</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/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>

</head>
<body>

<?php 

  define("PUBLIC_ACCESS", 1);
  // Include the MVC class definitions
  $docRoot = $_SERVER['DOCUMENT_ROOT'];
  $toolkit = "$docRoot/toolkit";
  require_once ("$toolkit/selectlist.php");
  require_once ("$toolkit/notetext.php");
  require_once ("$toolkit/inputhidden.php");
  require_once ("$toolkit/inputtext.php");
  require_once ("$toolkit/summdetail.php");
  require_once ("$toolkit/summsubdet.php");
  require_once ("$toolkit/putbutton.php");
  require_once ("$docRoot/sys/init.php");
  require_once ("$docRoot/module/controls/model.php");
  require_once ("$docRoot/module/controls/view.php");
  require_once ("$docRoot/module/controls/controller.php");

  // Initialize model
  $controls = new modControls();
  $controlsController = new modControlsController($controls);

//$data = $_POST['action'];
//print_r ("data=$data");
  //If one of the forms has been submitted, call the relevant controller action
  if (isset($_POST['action'])) $controlsController->{$_POST['action']}($_POST);
 
  $controlsView = new modControlsView($controls);
  echo $controlsView->output();

?>
</body>
</html>

