<?php 

class modCrewView {
  private $pw_id;
  private $searchCrewLayout;
  private $searchCrewScript;
  private $selectParcelLayout;
  private $selectParcelScript;
  private $selectDateLayout;
  private $selectDateScript;
  private $status;
 
   
  public function __construct(modCrew $crew) {
    if (isset($crew)) {
      $this->pp_id = $crew->get("pp_id"); 
      $this->status = $crew->get("status"); 

      $menu = new MainMenu('crew');
      $this->beforeMenu = $menu->before();
      $this->afterMenu  = $menu->after();

      $crewControls = new EntryInit('crew');
      $entryInit = $crewControls->get("entryInit");
      foreach ($entryInit as $control) {
//print_r ("$control<br>");          
        eval ($control);
      }
    }
  }

  public function output() {
  
    $layout = "
$this->beforeMenu
<div style='border:1px solid black;border-bottom:0px'>  
  <div class='container'>
    <div class='row' style='margin-top:10px;margin-bottom:10px;'>
      <div class='col-sm-8'>
    $this->assignCrewLayout
      </div>
      <div class='col-sm-4'>
        <table class='table'>
          <tr>
            <td>
          $this->projectRolesLayout
            </td>
          </tr>
        </table>        
      </div>
    </div>
  </div>    
  <div class='container'>
    <div class='row' style='margin-top:10px;margin-bottom:10px;'>
      <div class='col-md-6'>
        <h4>Travel to project:</h4>
        <table class='table table-condensed'>
        $this->tr_idtoKeyLayout
          <tr>
            <td style:'width:20%'>
          $this->toTypeLayout
            </td>
            <td colspan='4' rowspan='3' style:'width:80%'>
          $this->toTravelLayout
            </td>
          </tr>
          <tr>
            <td style:'width:20%'>
          $this->toVehicleLayout
            </td>
          </tr>
          <tr>
            <td style:'width:20%'>
          $this->delTravelToLayout
            </td>
          </tr>
          <tr>
            <td style:'width:20%'>

            </td>
            <td style:'width:20%'>
          $this->toStartTimeLayout
            </td style:'width:20%'>
            <td>
          $this->toDurationLayout
            </td style:'width:20%'>
            <td>
           $this->toMileageLayout
            </td style:'width:20%'>
            <td style:'width:20%;vertical-align:bottom;'>
          $this->putToMeasuresLayout
          $this->putToMeasuresReqLayout
            </td>
          </tr>
        </table>
      </div>  

      <div class='col-md-6'>
        <h4>Travel from project:</h4>
        <table class='table'>
        $this->tr_idfromKeyLayout
          <tr>
            <td>
          $this->fromTypeLayout
            </td>
            <td colspan='4' rowspan='3'>
          $this->fromTravelLayout
            </td>
          </tr>
          <tr>
            <td>
          $this->fromVehicleLayout
            </td>
          </tr>
          <tr>
            <td>
          $this->delTravelFromLayout
            </td>
          </tr>
          <tr>
            <td>
          $this->dupToFromLayout
            </td>
            <td>
          $this->fromStartTimeLayout
            </td>
            <td>
          $this->fromDurationLayout
            </td>
            <td>
          $this->fromMileageLayout
            </td>
            <td>
          $this->putFromMeasuresLayout
          $this->putFromMeasuresReqLayout
            </td>
          </tr>
        </table>
      </div> 
    </div>
  </div>
</div>

$this->cnfDeleteRoleLayout
$this->afterMenu
<script>

$this->assignCrewScript

$this->projectRolesScript

$this->toTypeScript

$this->fromTypeScript

$this->toTravelScript 

$this->fromTravelScript

$this->toVehicleScript

$this->fromVehicleScript 

$this->toDriverScript

$this->toStartTimeScript

$this->toEndTimeScript

$this->toDurationScript

$this->fromDurationScript

$this->fromDriverScript

$this->delTravelToScript

$this->delTravelFromScript

$this->putToMeasuresReqScript

$this->putFromMeasuresReqScript

$this->cnfDeleteRoleScript

</script>

    ";
	
  return $layout;
  } 
}

?>