ViewBilldetail.php 2.74 KB
<?php 
$data = $model->getData();
$member=$provider->getData();

echo CHtml::beginForm();
?>
<p></p>
<fieldset>
    <h2> สรุปรายการทั้งหมด:</h2>
	<div style="border:1px solid;background:lightblue;padding:10px;">รายละเอียดผู้ซื้อ</div>
        <table class="table table-striped" style="border:1px solid;background:#eee;">
		<tr>
			<td width="100">รหัสบิล</td>
			<td><?php echo $data[0]->bill->code; ?></td>
		</tr>
		<tr>
			<td width="100">ชื่อ</td>
			<td><?php echo $member[0]->member->m_name ?></td>
		</tr>
		<tr>
			<td width="100">email</td>
			<td><?php echo $member[0]->member->m_email ?></td>
		</tr>
		<tr>
			<td width="100">เบอร์โทร</td>
			<td><?php echo $member[0]->member->m_tel; ?></td>
		</tr>
                <tr>
			<td width="100">ที่อยู่</td>
			<td><?php echo $member[0]->member->m_address; ?></td>
		</tr>
                <tr>
                    <td width="100">การจ่ายเงิน</td>
			<td>
                            <?php $selectBnk=$data[0]->bill->detail;
                        if($selectBnk != null){
                        echo $data[0]->bill->bankfood->nameBnk; ?>
                            <img src="images/bank/<?php echo $data[0]->bill->bankfood->imgBnk;?>"
                                 width="150"/>
                        <?php }else{
                                echo "<b>ยังไม่เลือกวิธีการชำระเงิน</b>";
                            }
                        
                        ?>
                        </td>
                </tr>
		
	</table>
</fieldset>

<?php $this->widget('zii.widgets.grid.CGridView',array(
	'dataProvider' => $model,
    'columns'=>array(
        array(
		'name' => 'ชื่ออาหาร',
        'value' => '$data->food->name'
    ), array(
        'name' => 'จำนวน',
        'value' => 'number_format($data->qty)'
    ),
    array(
        'name' => 'ราคา',
        'value' => 'number_format($data->food->price)'
    ),
        array(
            'name'=>'ราคารวม',
            'value'=>'number_format($data->food->price * $data->qty)'
        ),
       
        )
));
$sum="";
foreach ($data as $index){
   $sum=$sum+$index->qty*$index->food->price;
}
?>
<div align="right">
<h2>ราคารวมทั้งหมด<span class="label label-warning"><?php echo $sum;?></span></h2>

        <?php
echo CHtml::button("เสร็จสิ้น",array(
    
    'class'=>'btn btn-success',
    'submit'=>array('site/DialogBank','id'=>$data[0]->bill->id),
    'style' => 'width: 120px;height:80px; border-radius: 10px;font-size:25px;'
));
echo CHtml::endForm();
?>
<br>

</div>