<?php 

class modLocationDefinitionView {
  
  public function __construct(modLocationDefinition $locationDefinition) {
    if (isset($locationDefinition)) {

      $menu = new MainMenu('locationdefinition');
      $this->beforeMenu = $menu->before();
      $this->afterMenu  = $menu->after();
        
      $controlsControls = new EntryInit('locationdefinition');
      $entryInit = $controlsControls->get("entryInit");
      foreach ($entryInit as $control) {
//print_r ($control);
//print_r ("<br>");        
        eval ($control);
      }
    }  
  }
  
  public function output() {

  $layout = "

$this->beforeMenu 

<div class='container'>	
  <div class='row'>
    <div class='col-md-12'>
      <table class='table table-bordered'>
        <tbody>
    $this->su_idKeyLayout
          <tr>
            <td colspan='2' style='width:50%;'>
    $this->selPartNameLayout
            </td>
            <td colspan='2' style='width:50%;'> 
    $this->inputLocDescrLayout
            </td>
          </tr>
          <tr>
            <td style='width:25%;'>          
    $this->inputLongAxisLayout
            </td>
            <td style='width:25%;'>          
    $this->inputShortAxisLayout
            </td>
            <td style='width:25%;'>          
    $this->selectOrientationLayout
            </td>
            <td style='width:25%;'>          
    $this->inputMapIdLayout
            </td>
          </tr>
          <tr>
            <td colspan='2'> 
              <label>
    Study-Area Division: Description
              </label>
            </td>
            <td colspan='2' rowspan='2' style='width:50%;'>
    $this->inputAddDescrLayout
            </td>
          </tr>
          <tr>
            <td style='width:25%;'>
    $this->selectTopographyLayout
            </td>
            <td style='width:25%;'>
    $this->selectLandUseLayout
            </td>
          <tr>
           </tr>          
           <tr>          
            <td colspan='4'>
    $this->putSpatialUnitLayout
            </td>
          </tr>
          <tr>          
            <td colspan='4'>
    $this->togImagesLayout
    $this->togBoundsLayout
    $this->togGeomorphLayout
    $this->togFeatPotLayout
            </td>
          </tr>  
        </tbody>
      </table>
      <div id='slide-bounds' class='slide-panel'>		  
    $this->partBoundsLayout
      </div>
      <div id='slide-geomorph' class='slide-panel'>		  
    $this->geomorphNamesLayout
      </div>
      <div id='slide-images' class='slide-panel'>		  
    $this->imageDivisionsLayout
      </div>
      <div id='slide-featpot' class='slide-panel'>		  
    $this->featuresOfPotentialLayout
      </div>
    $this->summDivisionsLayout
    $this->delSpatialUnitLayout
    </div>
  </div>
</div>

$this->afterMenu     
  
<script>

$(document).ready(function(){
  $('#togspatialunit').click(function(){
    $('.slide-panel').each (function () {
      if ($(this).prop('id') != 'slide-bounds')
        $(this).slideUp('slow');
    });  
    $('#slide-bounds').toggle('slow');
  });
});
  
$(document).ready(function(){
  $('#tog2spatialunit').click(function(){
    $('.slide-panel').each (function () {
      if ($(this).prop('id') != 'slide-geomorph')
        $(this).slideUp('slow');
    });  
    $('#slide-geomorph').toggle('slow');
  });
});

$(document).ready(function(){
  $('#tog3spatialunit').click(function(){
    $('.slide-panel').each (function () {
      if ($(this).prop('id') != 'slide-images')
        $(this).slideUp('slow');
    });  
    $('#slide-images').toggle('slow');
  });
});
  
$(document).ready(function(){
  $('#tog4spatialunit').click(function(){
    $('.slide-panel').each (function () {
      if ($(this).prop('id') != 'slide-featpot')
        $(this).slideUp('slow');
    });  
    $('#slide-featpot').toggle('slow');
  });
});

$this->partBoundsScript
$this->geomorphNamesScript
$this->imageDivisionsScript
$this->featuresOfPotentialScript
$this->summDivisionsScript
$this->selPartNameScript

</script>
    ";
	
    return $layout;
 
  }
}

?>