<!DOCTYPE html>
<html>

<head>
    <title>Price List</title>
</head>

<body>
    <div class="">
           <div class="header" style="width:100%;float: left;padding-bottom:10px;">
           <?php $this->renderPartial("//common/header");?>
    </div>
        <div class="col-6">
             <?php   $model=$model->findByPk($id); ?>
              <div class="h3" style="margin-top: 0;margin-bottom: 0;">
                    <?php echo "PRICE LIST"; ?>
                </div>
                <div class="input-block">
                    <b>Part No : <?php echo $model['part_number']; ?></b>
                </div>
            <br />
           
        </div>  
        <div class="col-5 offset-1" style="color:#101010;">
        
        </div>
        <div class="col-12">
            Description : <b><?php echo $model['description']; ?></b>
        </div>     
    </div>
    <br />
    
    <?php
    
    $model_group_name  = SalesPriceGroupName::model()->findAll(/*array('condition'=>'	lowest_pricing_group="N"')*/);
    
    
    $mo_group  = new SalesPriceGroup();
    
    $model_group  = $mo_group->findAll(array('condition'=>'product_id ="'.$id.'"'));
   // $model_group  = SalesPriceGroup::model()->find('product_id ="'.$id.'"');
    
    $count = $mo_group->count(array('condition'=>'product_id ="'.$id.'"'));
    
    ?>
    <div class="col-md-12">
        <table id="" class="table">
            <thead>
                <tr>
                    <th class="text-center">Sale Price</th>                        
                   
                    <th class="text-center">Updated Date</th> 
                </tr>
            </thead>
            <tbody>
                
                    <?php
                   if($count>0){
                    if(!empty($model_group)){
                        foreach($model_group AS $model_group){
                            ?>
                            <tr>
                                <td class="text-right"><?php echo $model_group->sales_price;?></td>
                                
                                <td class="text-center"><?php echo date('d/m/Y',strtotime($model_group->updated_date_time));?></td>
                            </tr>
                        <?php
                        }
                        
                    }
                        
                      } 
                      else{
                        ?>
                        <tr>
                            <td colspan="2">No data found</td>
                        </tr>
                        <?php
                      } 
                    
                    ?>
                    
                
               
            </tbody>
        </table>
        
    </div>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
    <br/>
     <htmlpagefooter name="myfooter">

           <div style="text-align:center;width:100%;font-size:10px"><?php echo Yii::app()->user->footer_autogenerated; ?>
        <?php
                  date_default_timezone_set("Asia/Dubai");
                 echo date('d/m/Y')." ".date("h:i:sa"); ?>
    </div>

 <img src="<?php echo  'images/logo/pdf_logo_footer.png'; ?>"/>

    </htmlpagefooter>
   

</body>

</html>
