<?php 

class modSiteVisitView {
    
  public function __construct(modSitevisit $siteVisit) {
    if (isset($siteVisit)) {

      $this->loginName = $siteVisit->login_name;
      $this->pw_id = $siteVisit->pw_id;

      $menu = new MainMenu('sitevisit', $siteVisit->lo_id);
      $this->beforeMenu = $menu->before();
      $this->afterMenu  = $menu->after();

      $controlsControl = new EntryInit('sitevisit'); 
      $entryInit = $controlsControl->get("entryInit");
      foreach ($entryInit as $control) {
//print_r ($control);
//print_r ("<br>");        
        eval ($control);
      }
    }  
  }
  
  public function output() {

    $layout = "
    
$this->beforeMenu 

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

  <div class='container'>
    <div class='row' style='margin-top:10px;'>
      <div class='col-md-12'>
        <table class='table table-condensed'>
          <tr>
            <td colspan='3' style='width:30%'>
    $this->inpPartNameLayout
            </td>
            <td colspan='1' style='width:10%'>
    $this->inpPartMapAreaLayout
            </td>
            <td colspan='3' style='width:30%'>
    $this->selAssessmentTypeLayout
            </td>
            <td colspan='2' style='width:20%'>
    $this->inpMapCodeLayout
            </td>
            <td colspan='1' style='width:10%'>
            </td>
          </tr>
          <tr>
            <td colspan='4' style='width:40%'>
    $this->inpPartLandUseLayout
            </td>
            <td colspan='3' rowspan='3' style='width:30%'>
    $this->inpStrategyModLayout
            </td>
            <td colspan='3' rowspan='5' style='width:30%'>
    $this->inpFieldNoteLayout        
            </td>
          </tr>
          <tr>
            <td colspan='4' style='width:40%'>
    $this->inpPartLocationLayout
            </td>
          </tr>    
          <tr>
            <td colspan='4' style='width:40%'>
            </td>
          </tr>
          <tr>
            <td colspan='4' style='width:40%'>
    $this->selGroundCoverLayout
            </td>
            <td colspan='3' rowspan='2' style='width:30%'>
    $this->inpRationaleNoteLayout
            </td>
          </tr>
          <tr>
            <td colspan='3' style='width:30%'>
    $this->selGroundConditionLayout
            </td>
            <td colspan='1' style='width:10%'>
    $this->selGroundVisibilityLayout
            <td>
          </tr>
          <tr>
            <td colspan='8' style='width:80%'>
            </td>
            <td colspan='2' style='width:20%'>
    $this->frmSiteVisitLayout
            </td>
          </tr>
          <tr>
            <td colspan='10'>
              <div id='valmsgfrmSiteVisit' style='color:red'></div>
            </td>
          </tr>    
        </table>
      </div>
    </div>
    
    <div class='row' style='margin-top:10px;'>
      <div class='col-md-12'>
    $this->sumSiteVisitsLayout
      </div>
    </div>

  </div>
</div>

$this->afterMenu

<script>  

document.getElementById('tagsitevisit').click();
document.getElementById('loginsitevisit').innerHTML='Login: $this->loginName'

if ($this->pw_id == 0) {
  document.getElementById('divsitevisit').style.display='none';
  document.getElementById('hdrmsgsitevisit').innerHTML=
    'Pre-select a Location';    
}

$this->frmSiteVisitScript
$this->inpPartNameScript
$this->inpPartMapAreaScript
$this->selAssessmentTypeScript
$this->inpMapCodeScript
$this->inpPartLandUseScript
$this->inpStrategyModScript
$this->inpFieldNoteScript        
$this->inpPartLocationScript
$this->selGroundCoverScript
$this->inpRationaleNoteScript
$this->selGroundConditionScript
$this->selGroundVisibilityScript
$this->sumSiteVisitsScript

</script>
  ";

  return $layout;
  }	

}

?>