<?php 

class modLocationDefinitionView {
  
  public function __construct(modLocationDefinition $locationDefinition) {
    if (isset($locationDefinition)) {
    
      $lo_id = isset($_SESSION['login']) ? $_SESSION['login'] : 0;
      $this->op_id = isset($_SESSION['operation']) ? $_SESSION['operation'] : 0;

      $menu = new MainMenu('locationdefinition', $lo_id);
      $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 id='divlocationdefinition' style='border:1px solid black;border-bottom:0px'>  

  <div class='container'>	
    <div class='row'>
      <div class='col-md-12'>
        <table class='table table-bordered'>
          <tbody>
            <tr>
              <td colspan='8'> 
                <label>Property-Part Definition</label>
              </td>
            </tr>
            <tr>
              <td colspan='4' style='width:50%;'>
    $this->selPartNameLayout
              </td>
              <td colspan='4' rowspan='3' style='width:50%;'>
    $this->addPartBoundsLayout
              </td>
            </tr>
            <tr>
              <td style='width:13%;'>          
    $this->inpLongAxisLayout
              </td>
              <td style='width:13%;'>          
    $this->inpShortAxisLayout
              </td>
              <td colspan='2' rowspan='2' style='width:24%;'>
    $this->inpLocationDescrLayout
              </td>
            </tr>
            <tr>
              <td colspan='2' style='width:25%;'>          
    $this->selOrientationLayout
              </td>
            </tr>
            <tr>
              <td colspan='8'> 
                <label>Description</label>
              </td>
            </tr>
            <tr>
              <td colspan='2' style='width:25%;'>
    $this->selTopographyLayout
              </td>
              <td colspan='2' style='width:25%;'>
    $this->selLandUseLayout
              </td>
              <td colspan='2' style='width:25%;'> 
    $this->selGeoFeatureLayout
              </td>
              <td colspan='2' style='width:25%;'> 
    $this->selNamedFeatureLayout
              </td>
            </tr>
            <tr>
              <td colspan='4' style='width:50%;'>
    $this->inpAdditionalDescrLayout
              </td>
              <td colspan='4' style='width:50%;'>
    $this->frmLocationDefinitionLayout
              </td>
            </tr>
            <tr>
              <td colspan='6'>
              <div id='valmsgfrmLocationDefinition' style='color:red'></div>
              </td>
            </tr>
            <tr>          
              <td colspan='8'>
    $this->togPartFeaturesLayout
    $this->togPartImagesLayout
              </td>
            </tr>  
          </tbody>
        </table>
        <div class='panel1 slidetogPartImages'>		  
    $this->imgPartLocationLayout
        </div>
        <div class='panel1 slidetogPartFeatures'>		  
          <table class='table table-bordered'>
            <tbody>
              <tr>
                <td colspan='2'>
    $this->mulFeatureLocationLayout          
                </td>
              </tr>
              <tr>
                <td width='90%'>
    $this->inpFopLocationDescrLayout
                </td>
                <td width='10%'>
    $this->frmPartFeatureLayout
                </td>
              </tr>
              <tr>
                <td colspan='6'>
                <div id='valmsgfrmPartFeature' style='color:red'></div>
                </td>
              </tr>
              <tr>          
                <td colspan='2'>
    $this->togFopImagesLayout
                </td>
              </tr>  
            </tbody>
          </table>
          <div class='panel12 slidetogFopImages'>		  
    $this->imgFeatureLocationLayout
          </div>
      $this->sumPartFeaturesLayout
        </div>    
     $this->sumLocationDefinitionsLayout
    $this->delLocationDefinitionLayout
      </div>
    </div>
  </div>
</div>  

$this->afterMenu     
  
<script>

function logMessage (message) {
//  $('#logmessages').append ('<tr>' + message + '</tr>');
}

if ($this->op_id == 0) {
  document.getElementById('divlocationdefinition').style.display='none';
  document.getElementById('hdrmsglocationdefinition').innerHTML=
    'Pre-select an Operation';    
}

$this->frmLocationDefinitionScript
$this->frmPartFeatureScript
$this->selPartNameScript
$this->inpLocationDescrScript
$this->addPartBoundsScript
$this->inpLongAxisScript
$this->inpShortAxisScript
$this->selOrientationScript
$this->inpFopMapIdScript
$this->inpAdditionalDescrScript
$this->selGeoFeatureScript
$this->selNamedFeatureScript
$this->selTopographyScript
$this->selLandUseScript
$this->imgPartLocationScript
$this->mulFeatureLocationScript          
$this->inpFopLocationDescrScript
$this->imgFeatureLocationScript
$this->togPartFeaturesScript
$this->togPartImagesScript
$this->togFopImagesScript
$this->sumLocationDefinitionsScript
$this->sumPartFeaturesScript
$this->delLocationDefinitionScript

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

?>