1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?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>