<?php 

class modLocationDefinitionView {
  
  public function __construct(modLocationDefinition $locationDefinition) {
    if (isset($locationDefinition)) {
    
      $this->loginName = $locationDefinition->login_name;
      $this->pw_id = $locationDefinition->pw_id;

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

  $layout = "

$this->beforeMenu 

<div id='divpropertypart' style='border:1px solid black;border-bottom:0px'>  

  <div class='container'>	
    <div class='row'>
      <div class='col-md-12'>
    $this->cxtLocationDefinitionLayout   
        <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->livPropertyPartLayout
              </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>  

<div id='debug' style='border:1px solid black;border-bottom:0px;'>  
  <div class='container'>	
    <div class='row' style='margin-top:10px;margin-bottom:10px;'>
      <div class='col-md-12'>
        <button class='btn btn-inverse' onclick='clearMessages();'>
          Clear
        </button>
        <table id='logmessages' class='table table-condensed'>
          <tr>
            <th>Funtion</th><th>Key</th><th>To</th><th>Value</th><th>Text</th>
            <th>Source</th><th>Index</th><th>Reason</th>
        </table>
      </div>
    </div>
  </div>
</div>

$this->afterMenu     
  
<script>

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

function clearMessages () {
  document.getElementById('logmessages').innerHTML = '';
}
  
document.getElementById('tagpropertypart').click();
document.getElementById('loginpropertypart').innerHTML='Login: $this->loginName'

if ($this->pw_id == 0) {
  document.getElementById('divpropertypart').style.display='none';
  document.getElementById('hdrmsgpropertypart').innerHTML=
    'Pre-select an Project';    
}

$this->frmLocationDefinitionScript
$this->frmPartFeatureScript
$this->cxtLocationDefinitionScript
$this->fkyProjectParcelScript
$this->livPropertyPartScript
$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;
 
  }
}

?>