質問編集履歴
1
ソースの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -33,3 +33,77 @@
|
|
33
33
|
お力貸していただけますと助かります。
|
34
34
|
|
35
35
|
よろしくお願いいたします。
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
追記
|
40
|
+
|
41
|
+
ソースを記載いたします。
|
42
|
+
|
43
|
+
Controller
|
44
|
+
|
45
|
+
```PHP
|
46
|
+
|
47
|
+
$this->loadModel('Jobs');
|
48
|
+
|
49
|
+
$jobs = $this->paginate($this->Jobs);
|
50
|
+
|
51
|
+
$this->set(compact('jobs'));
|
52
|
+
|
53
|
+
```
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
Template
|
60
|
+
|
61
|
+
```PHP
|
62
|
+
|
63
|
+
<table cellpadding="0" cellspacing="0">
|
64
|
+
|
65
|
+
<thead>
|
66
|
+
|
67
|
+
<tr>
|
68
|
+
|
69
|
+
<th scope="col"><?= $this->Paginator->sort('date',['label' => '日付']) ?></th>
|
70
|
+
|
71
|
+
<th scope="col"><?= $this->Paginator->sort('price',['label' => '時給']) ?></th>
|
72
|
+
|
73
|
+
</tr>
|
74
|
+
|
75
|
+
</thead>
|
76
|
+
|
77
|
+
<tbody>
|
78
|
+
|
79
|
+
<?php foreach ($jobs as $job) : ?>
|
80
|
+
|
81
|
+
<tr>
|
82
|
+
|
83
|
+
<td><?= date("Y年m月d日", strtotime($job->date)); ?><br>
|
84
|
+
|
85
|
+
<?= date("H:i", strtotime($job->in_time)); ?>〜<?= date("H:i", strtotime($job->to_time)); ?>
|
86
|
+
|
87
|
+
</td>
|
88
|
+
|
89
|
+
<td>
|
90
|
+
|
91
|
+
<?php
|
92
|
+
|
93
|
+
$youbi = strtolower(date("D", strtotime($job->date)));
|
94
|
+
|
95
|
+
echo number_format($job->user->{$youbi}) . '円';
|
96
|
+
|
97
|
+
?>
|
98
|
+
|
99
|
+
</td>
|
100
|
+
|
101
|
+
</tr>
|
102
|
+
|
103
|
+
<?php endforeach; ?>
|
104
|
+
|
105
|
+
</tbody>
|
106
|
+
|
107
|
+
</table>
|
108
|
+
|
109
|
+
```
|