<?php 

class modLiveSearchFieldView {
  private $scope;
    
  public function __construct(modLiveSearchField $liveSearchField) {
    if (isset($liveSearchField)) {

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

      $menu = new MainMenu('livesearchfield', $liveSearchField->lo_id);
      $this->beforeMenu = $menu->before();
      $this->afterMenu  = $menu->after();
      
      $panelFields = new FieldInit('livesearchfield'); 
      $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='divlivesearchfield' style='height:20em;border:1px solid black;border-bottom:none;'>
    <div class='row'>
      <div class='col-md-12'>
        <table class='table table-condensed'>
          <tr>
            <td style='width:34%'>
    $this->selActiveStatusLayout
            </td>
            <td style='width:33%'>
            </td>
            <td style='width:33%'>
            </td>
          </tr>
          <tr>
            <td style='width:34%'>
    $this->livLiveSelectorLayout
            </td>
            <td style='width:33%'>
            </td>
            <td style='width:33%'>
            </td>
          </tr>
          <tr>
            <td colspan='3'>
            <div id='valmsgfrmLiveSelector' style='color:red'></div>
            </td>
          </tr>
        </table>
      </div> 
    </div>

  </div>
$this->afterMenu
</div>	


<script src='js/panel.js'></script>

<script>

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

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


$this->selActiveStatusScript
$this->livLiveSelectorScript

</script>
  ";
 
  return $layout;
  }	

}

?>