<?php 

class modMultiSelect2View {
  private $scope;
    
  public function __construct(modMultiSelect2 $multiSelect2) {
    if (isset($multiSelect2)) {

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

      $menu = new MainMenu('multiselect2', $multiSelect2->lo_id);
      $this->beforeMenu = $menu->before();
      $this->afterMenu  = $menu->after();
      
      $panelFields = new FieldInit('multiselect2'); 
      $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='divmultiselect2' style='border:1px solid black;border-bottom:none;'>
    <div class='row'>
      <div class='col-md-12'>
        <table class='table table-condensed'>
          <tr>
            <td colspan='3'>
    Set Up Foreign Exchange Traded Products by Country 
            </td>
          </tr>
          <tr>
            <td style='width:35%'>
            </td>
            <td style='width:25%'>
    $this->selCountryLayout
            </td>
            <td style='width:40%'>
            </td>
          </tr>
          <tr>
            <td colspan='3'>
    $this->mulMultiSelect2Layout
            </td>
          </tr>
          <tr>
            <td colspan='3'>
    $this->rerMultiSelect2Layout
            </td>
          </tr>
        </table>
      </div> 
    </div>
  </div>
    $this->afterMenu
</div>	

<script>

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

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

  
$this->mulMultiSelect2Script
$this->selCountryScript

</script>
  ";
 
  return $layout;
  }	

}

?>