<?php 

class modImageCaptureView {
  private $scope;
    
  public function __construct(modImageCapture $imageCapture) {
    if (isset($imageCapture)) {

      $this->loginName = $imageCapture->login_name;
      $this->lo_id = $imageCapture->lo_id;

      $menu = new MainMenu('imagecapture', $imageCapture->lo_id);
      $this->beforeMenu = $menu->before();
      $this->afterMenu  = $menu->after();
      
      $panelFields = new FieldInit('imagecapture'); 
      $fields = $panelFields->get("fieldInit");
      foreach ($fields as $field) {
//print_r ($field);
//print_r ("<br>");        
        eval ($field);
      }
    }
  }  

  public function output() {

    $layout = "

<div class='container'>	
    $this->beforeMenu
  <div id='divimagecapture' style='border:1px solid black;border-bottom:none;'>
    <div class='row'>
      <div class='col-md-12'>
        <table class='table table-condensed'>
          <tr>
            <td>
    $this->selSpaceLayout
            </td>
            <td>
    $this->inpRefCodeLayout
            </td>
          </tr>
        </table>  
    $this->imgImageCaptureLayout
      </div>
    </div>	
  </div>
    $this->afterMenu
</div>	


<script>

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

if ($this->lo_id == 0) {
  document.getElementById('divimagecapture').style.display='none';
  document.getElementById('hdrmsgimagecapture').innerHTML='Login';    
}

$this->selSpaceScript
$this->inpRefCodeScript
$this->imgImageCaptureScript

</script>
  ";
 
  return $layout;
  }	

}

?>