<html>

<head>
    <title>Material Transfer Receipt</title>
</head>
    <body>
    
    <div class="">
        <div class="col-6">
            <br>
            <?php                         $model = MtomTransfer::model()->findByPk($id);?>
                <div class="h3" style="margin-top: 0;margin-bottom: 0;">
                    <?php echo "Material to Material Transfer Receipt"; ?>
                </div>
                <div class="input-block">
                    <b><?php echo $id;?></b>
                </div>
<!--                <b><?php echo strtoupper($modelQ1->customer->customer_name); ?></b>
                <br>-->
                <?php /* if($modelQ1->customer->customer_address != ''){ ?>
                <small><?php echo strtoupper($modelQ1->customer->customer_address); ?></small><br>
                <small><?php echo strtoupper('PO Box : '.$modelQ1->customer->customer_postal_code.', '.$modelQ1->customer->customer_location); ?></small><br>
                <small><?php echo strtoupper($modelQ1->customer->customer_city.', '.$modelQ1->customer->country->country_name); ?></small><br>
					 <?php } ?>                
                <?php if($modelQ1->customer->customer_phone_no != '') { ?>
                <small><?php echo strtoupper('Phone : '.$modelQ1->customer->customer_phone_no); ?></small><br>
                <?php } ?>
               <?php if($modelQ1->contact->person_name != '') { ?>
                <br><small>Kind Attn:</small>
                <small><b><?php echo  strtoupper($modelQ1->contact->person_name); ?></b></small><br>
                <?php }*/ ?>
        </div>
        <div class="col-5 offset-1" style="color:#101010;">
            <div class="text-right">
                <img src="<?php echo Yii::app()->baseUrl . '/images/logo/'.Yii::app()->user->pdf_company_logo; ?>" class="logo">
            </div>
            <br>
            <table class="table" style="width:100%">
                <tr>
                    <?php
         //   $modelQ = Invoice::model()->findByPk($id);
           // $model_lead=Lead::model()->find(array('condition'=>'file_id="'.$modelQ->file_id.'"'));
            ?>
                        <td class="bc-tl">Transfer No</td>
                        <td>
                            <?php echo $model->id;?>
                        </td>
                </tr>
                 <tr>
                    <td>Transfer Date</td>
                    <td>
                        <?php echo date('d/m/Y',STRTOTIME($model->transfer_date));?>
                    </td>
                </tr>
                <tr>
                    <td>Done By</td>
                    <td>
                        <?php 
                        $model_user = user::model()->findByPk($model->created_by);
                        echo $model_user->username;?>
                    </td>
                </tr>
                <!--<tr>
                    <td>From Warehouse</td>
                    <td>
                        <?php //echo $model->warehouseFrom->warehouse_name;?>
                    </td>
                </tr>
                <tr>
                    <td>To Warehouse</td>
                    <td>
                        <?php //echo $model->warehouseTo->warehouse_name;?>
                    </td>
                </tr>-->
            </table>
        </div>
    </div>
    <br />
    <div class="col-md-12">
        <table id="" class="table">
            <thead>
                <tr>
                    <th class=" bc-tl" style="width:2%">No</th>
                    <th class="" style="width:30%">From Item</th>
                    <th class="" style="width:20%">From Quantity</th>
                    <th class="" style="width:30%">To Item</th>
                    <th class="" style="width:18%">To Quantity</th>                   
                </tr>
            </thead>
            <tbody>
               
                    <?php
                $m=1;
                //$condition .= '1=1';
                //$condition .= ' AND t.mtom_table_id ="' . $id.'"';
                //$model_Items = InventoryDirectTransferItem::model()->findAll(array('condition'=>$condition));
                //foreach ( $model_Items as $i =>  $each_Item) {                   
                                      
                ?>
                 <tr>
                        <td>
                            <?php echo $m;?>
                        </td>
                        <td>
                            <?php echo $model->fromproduct->part_number;?>
                        </td>
                        <td>
                            <?php echo $model->from_qty;?>
                        </td>

                        <td class="text-right1">
                            <?php echo $model->toproduct->part_number;?>
                        </td>
                        <td class="text-right1">
                            <?php echo $model->to_qty;?>
                        </td>
                        
                        
                </tr>
                
                    <?php //$m++;
       
        
        //}
        ?>
                 

            </tbody>
        </table>
        <?php if($model->note!='')
       {
       ?>
        <div class="box">
            <h5>Note</h5>
            <div class="h5sub-details">
                <?php echo nl2br($model->note); ?>
            </div>
        </div>
        <?php } ?>
           
    </div>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <br>
    <div style="text-align:center;width:100%;font-size:10px">This report is auto generated by Bluesky ERP on
        <?php
                  date_default_timezone_set("Asia/Dubai");
                 echo date('d/m/Y')." ".date("h:i:sa"); ?>
    </div>
    
    <htmlpagefooter name="myfooter">
        <div style="border-top: 1px dotted #000000; font-size: 12px; text-align: center; padding-top: 10px; ">
            <div style="text-align:center;width:100%">
                <b><?php echo Yii::app()->user->master_company_name; ?></b>
                <br>
                <?php echo $model_Company->company_address; ?>
                <?php echo '  '.$model_Company->company_location; ?>
                <?php echo ' '.$model_Company->country->country_name; ?>
                <?php echo 'Phone : '.Yii::app()->user->company_general_phone_no; ?> ,
                <?php echo 'Email : '.Yii::app()->user->company_general_email; ?>
            </div>
            <div style="text-align:center;width:100%">Page {PAGENO} of {nb} </div>
        </div>
    </htmlpagefooter>
</body>

</html>