<?php   
if(!empty($hotelRoomRateData)){
 $mealPlanId = [];
 foreach($hotelRoomRateData as $val){
     $mealPlanId[$val['id']] = $val['meal_plan_type_id'];
 }
}
?>
<div class="form-group clearfix margintopbottom20">
                                  <h4>Package Rate</h4>
<div class="col-sm-12 padding-top10px" style="background:#EFEFEF;">
    
    
    <div class="form-group clearfix margintopbottom20">                     
                    <label class="col-sm-3 control-label labelalign col-sm-3-new" id="hotel_rate_season">
                        <?php echo $this->translate($this->formLabel($form->get('hotel_rate_season'))); ?>
                    </label>
                    <div class="col-sm-3 col-sm-4-new">
                        <?php echo $this->FormElement($form->get('hotel_rate_season')); ?>
                        <?php echo $this->formElementErrors($form->get('hotel_rate_season'), ['class' => 'error']); ?>
                    </div>
        
                    <label class="col-sm-3 control-label labelalign col-sm-3-new" id="room_id">
                        <?php echo $this->translate($this->formLabel($form->get('room_id'))); ?>
                    </label>
                    <div class="col-sm-3 col-sm-4-new">
                        <?php echo $this->FormElement($form->get('room_id')); ?>
                        <?php echo $this->formElementErrors($form->get('room_id'), ['class' => 'error']); ?>
                    </div>
    </div>
    
    

<div class="form-group clearfix margintopbottom20">
    
                    
            
                    <label class="col-sm-3 control-label labelalign col-sm-3-new" for="meal_plan_id">
                        <?php echo $this->translate($this->formLabel($form->get('meal_plan_id'))); ?>
                    </label>
                    <div class="col-sm-3 col-sm-4-new">
                        <?php echo $this->FormElement($form->get('meal_plan_id')->setValue($mealPlanId)); ?>
                        <?php echo $this->formElementErrors($form->get('meal_plan_id'), ['class' => 'error']); ?>
                    </div>
    
    <label class="col-sm-3 control-label labelalign col-sm-3-new" for="weekdays"> 
                        <?php echo $this->translate($this->formLabel($form->get('weekdays'))); ?>
                    </label>
                    <div class="col-sm-3 col-sm-4-new">                                    
                        <?php echo $this->FormElement($form->get('weekdays')); ?>
                        <?php echo $this->formElementErrors($form->get('weekdays'), ['class' => 'error']); ?>
                    </div>
                </div>
    
    
    <div class="form-group clearfix margintopbottom20">


        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="hotel_package_name">
            <?php echo $this->translate($this->formLabel($form->get('hotel_package_name'))); ?>
        </label>
        <div class="col-sm-3 col-sm-4-new">
            <?php echo $this->FormElement($form->get('hotel_package_name')->setAttribute('rel','vvhv')); ?>
            <?php echo $this->formElementErrors($form->get('hotel_package_name'), ['class' => 'error']); ?>
        </div>


        <label class="col-sm-3 control-label labelalign col-sm-3-new" id="package_minimum_nights">
            <?php echo $this->translate($this->formLabel($form->get('package_minimum_nights'))); ?>
        </label>
        <div class="col-sm-3 col-sm-4-new">
            <?php echo $this->FormElement($form->get('package_minimum_nights')); ?>
            <?php echo $this->formElementErrors($form->get('package_minimum_nights'), ['class' => 'error']); ?>
        </div>

    </div>
    
    
    <div class="form-group clearfix margintopbottom20">
                    <label class="col-sm-3 control-label labelalign col-sm-3-new" for="valid_from">
                        <?php echo $this->translate($this->formLabel($form->get('valid_from'))); ?>
                    </label>
                    <div class="col-sm-3 col-sm-4-new">
                        <?php echo $this->FormElement($form->get('valid_from')); ?>
                        <?php echo $this->formElementErrors($form->get('valid_from'), ['class' => 'error']); ?>
                    </div>

                    <label class="col-sm-3 control-label labelalign col-sm-3-new" for="valid_to"> 
                        <?php echo $this->translate($this->formLabel($form->get('valid_to'))); ?>
                    </label>
                    <div class="col-sm-3 col-sm-4-new">                                    
                        <?php echo $this->FormElement($form->get('valid_to')); ?>
                        <?php echo $this->formElementErrors($form->get('valid_to'), ['class' => 'error']); ?>
                    </div>
                </div>
    
    
    <div class="form-group clearfix margintopbottom20">                  
                    
                    <label class="col-sm-3 control-label labelalign col-sm-3-new" for="promotion_rate_type">
                        <?php echo $this->translate($this->formLabel($form->get('promotion_rate_type'))); ?>
                    </label>
                    <div class="col-sm-9 col-xs-9">
                        <?php echo $this->FormElement($form->get('promotion_rate_type')); ?>
                        <?php echo $this->formElementErrors($form->get('promotion_rate_type'), ['class' => 'error']); ?>
                    </div>

                </div>
    <div class="form-group clearfix margintopbottom20">        
        <?php echo $this->partial('basic-tax-edit.phtml'); ?>        
    </div>
    
    <div class="form-group clearfix margintop20 marginbottom20">
                  <?php echo $this->partial('rate-edit.phtml'); ?>
                </div>   
    
    
<div class="form-group clearfix margintopbottom20">        
        <?php echo $this->partial('service-charge-edit.phtml'); ?>        
    </div>
    
    
    <div class="form-group clearfix margintopbottom20">        
        <?php echo $this->partial('discount-rate-edit.phtml'); ?>        
    </div>
    

    
    <div class="form-group clearfix margintopbottom20">
                            <label class="col-sm-3 control-label labelalign col-sm-3-new" for="contract_rate_desc">
                                <?php echo $this->translate($this->formLabel($form->get('contract_rate_desc'))); ?>
                            </label>
                            <div class="col-sm-9 col-xs-9">
                                <?php echo $this->FormElement($form->get('contract_rate_desc')); ?>
                                <?php echo $this->formElementErrors($form->get('contract_rate_desc'), ['class' => 'error']); ?>
                            </div>
                        </div>



<table class="table hotel-rate table-bordered table-striped dataTable"  role="grid" aria-describedby="example1_info">
                            
                           
                                <tbody>
								 
									
									
									
                                    <tr>
                                        <td>&nbsp;</td>
                                        <td>&nbsp;</td>
                                        <td colspan="2" style="text-align: center;"><strong>SGL*</strong></td>
                                        <td colspan="2" style="text-align: center;"><strong>DBL*</strong></td>
                                        <td colspan="2" style="text-align: center;"><strong>TBL*</strong></td>
                                        <td colspan="2" style="text-align: center;"><strong>Child(2-12)*</strong></td>
                                        <td colspan="2" style="text-align: center;"><strong>Child(12-16)*</strong></td>
                                        <td colspan="2" style="text-align: center;"><strong>Extra With Bed</strong></td>
                                    </tr>
                                  <tr align="center">&nbsp;</tr>
                                  
                                  
                                  
                                  <?php if(!empty($mealPlanList)) { 
                                      foreach($mealPlanList as $mealPlan){
                                      $mealPlanName = strtolower(str_replace(' ', '', $mealPlan['name']));
                                      $roomData =[
                                          'mapping_id'=>$vehicleData['id'],
                                          'meal_plan_type_id'=>$mealPlan['id']                                          
                                      ];
                                      $roomRate = $this->mainMenu()->fetchRoomRate($roomData);
                                      ?>
                                  
                                    <tr class="rate" match="<?php echo $mealPlan['id'];?>">                                	
                                  <th class="hotel-roomtype-col" width="50px;"><?php echo $mealPlan['name'];?></th>
                                    <td class="hotel-roomtype-col10per">Rate </td>
         <td colspan="2">
            <?php echo $this->FormElement($form->get('sgl_rate_'.$mealPlanName)->setValue(isset($roomRate['sgl_rate'])?$roomRate['sgl_rate']:'')); ?>
            <?php echo $this->formElementErrors($form->get('sgl_rate_'.$mealPlanName), ['class' => 'error']); ?>
        </td>



            <td colspan="2">
                <?php echo $this->FormElement($form->get('dbl_rate_'.$mealPlanName)->setValue(isset($roomRate['dbl_rate'])?$roomRate['dbl_rate']:'')); ?>
                <?php echo $this->formElementErrors($form->get('dbl_rate_'.$mealPlanName), ['class' => 'error']); ?>
            </td>



             <td colspan="2">
                <?php echo $this->FormElement($form->get('tbl_rate_'.$mealPlanName)->setValue(isset($roomRate['tbl_rate'])?$roomRate['tbl_rate']:'')); ?>
                <?php echo $this->formElementErrors($form->get('tbl_rate_'.$mealPlanName), ['class' => 'error']); ?>
            </td>


            <td  colspan="2">
                <?php echo $this->FormElement($form->get('child_rate_'.$mealPlanName)->setValue(isset($roomRate['child_rate'])?$roomRate['child_rate']:'')); ?>
                <?php echo $this->formElementErrors($form->get('child_rate_'.$mealPlanName), ['class' => 'error']); ?>
            </td>



            <td  colspan="2">
                <?php echo $this->FormElement($form->get('child1_rate_'.$mealPlanName)->setValue(isset($roomRate['child1_rate'])?$roomRate['child1_rate']:'')); ?>
                <?php echo $this->formElementErrors($form->get('child1_rate_'.$mealPlanName), ['class' => 'error']); ?>
            </td>



            <td  colspan="2">
                <?php echo $this->FormElement($form->get('extra_bed_rate_'.$mealPlanName)->setValue(isset($roomRate['extra_bed_rate'])?$roomRate['extra_bed_rate']:'')); ?>
                <?php echo $this->formElementErrors($form->get('extra_bed_rate_'.$mealPlanName), ['class' => 'error']); ?>
            </td>

                                                            
                                </tr>
                                
                                
                               

                                      <?php } } ?>
                                
                                
                                <tr>
                                	
                                    <th class="hotel-roomtype-col"></th>                                
                                    <td class="hotel-roomtype-col10per"></td>
                                    <td colspan="2" style="text-align: center;">Adult Breakfast</td>
                                    <td colspan="2" style="text-align: center;">Adult Lunch</td>
                                    <td colspan="2" style="text-align: center;">Adult Dinner</td>
                                    <td colspan="2" style="text-align: center;">Child Breakfast</td>
                                    <td colspan="2" style="text-align: center;">Child Lunch</td>
                                    <td colspan="2" style="text-align: center;">Child Dinner</td>                                        
                                </tr>
                                
                                <tr>
                                	
                                  
                                	<td class="hotel-roomtype-col10per"> </td>
                                	<td class="hotel-roomtype-col10per"> Extra Meal Cost </td>
                                        
                                        <td colspan="2">
            <?php echo $this->FormElement($form->get('extra_meal_adult_sgl')); ?>
            <?php echo $this->formElementErrors($form->get('extra_meal_adult_sgl'), ['class' => 'error']); ?>
            </td>
           
            <td colspan="2">
            <?php echo $this->FormElement($form->get('extra_meal_adult_dbl')); ?>
            <?php echo $this->formElementErrors($form->get('extra_meal_adult_dbl'), ['class' => 'error']); ?>
            </td>
            
            <td colspan="2">
            <?php echo $this->FormElement($form->get('extra_meal_adult_tbl')); ?>
            <?php echo $this->formElementErrors($form->get('extra_meal_adult_tbl'), ['class' => 'error']); ?>
            </td>
            
            
            <td colspan="2">
            <?php echo $this->FormElement($form->get('extra_meal_child_child')); ?>
            <?php echo $this->formElementErrors($form->get('extra_meal_child_child'), ['class' => 'error']); ?>
            </td>

            <td colspan="2">
            <?php echo $this->FormElement($form->get('extra_meal_child_child1')); ?>
            <?php echo $this->formElementErrors($form->get('extra_meal_child_child1'), ['class' => 'error']); ?>
            </td>
            

            <td colspan="2">
            <?php echo $this->FormElement($form->get('extra_meal_child_extra_bed')); ?>
            <?php echo $this->formElementErrors($form->get('extra_meal_child_extra_bed'), ['class' => 'error']); ?>
            </td>
                                   
                                  
                                </tr>
                                </tbody>
                            </table>
    
    <?php echo $this->partial('hotel-promotion-rate-edit.phtml'); ?>
</div>
 </div>