Last active
October 5, 2020 07:55
-
-
Save inuvalogic/a3f3d68ec5b0d2ecb1f2649efc80ef49 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.table-fitur tr td { | |
padding: 15px 20px; | |
border-top: none; | |
} | |
.table-fitur tr td.button { | |
padding: 20px 0 0 0; | |
} | |
.table-fitur tr td.namafitur { | |
font-family: 'Open Sans', sans-serif; | |
font-size: 24px; | |
font-weight: 700; | |
color: #000000; | |
width: 30%; | |
} | |
.table-fitur tr td.namapaket { | |
font-size: 18px; | |
width: 20%; | |
} | |
.bg-grey { | |
background: #f5f5f5; | |
color: #000000; | |
} | |
.bg-green { | |
background: #6dd57e; | |
color: #ffffff; | |
} | |
.bg-blue { | |
background: #25aefb; | |
color: #ffffff; | |
} | |
.text-black { | |
color: #000000; | |
} | |
.text-green { | |
color: #6dd57e; | |
} | |
.text-blue { | |
color: #25aefb; | |
} | |
.btn-fitur { | |
padding: 15px 20px; | |
display: block; | |
text-transform: uppercase; | |
border-radius: 15px; | |
} | |
.btn-grey { | |
background: #f5f5f5; | |
color: #000000; | |
border: #bbbbbb solid 1px; | |
} | |
.btn-green { | |
background: #6dd57e; | |
color: #ffffff; | |
} | |
.btn-blue { | |
background: #25aefb; | |
color: #ffffff; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Akaneapp\Controller; | |
class FiturController extends \Akane\Controller\BaseController | |
{ | |
public function indexAction() | |
{ | |
$paket = $this->paketModel->all('', '', array( | |
'tampil' => 'ya' | |
)); | |
$fitur = $this->fiturModel->all(); | |
foreach ($fitur as &$row_fitur) { | |
foreach ($paket as $row_paket) { | |
$row_fitur['paket'][$row_paket['id']] = $this->fiturModel->getFiturValue($row_paket['id'], $row_fitur['id']); | |
} | |
} | |
echo $this->layout->render('layout', array( | |
'content' => $this->layout->render('fitur', array( | |
'paket' => $paket, | |
'fitur' => $fitur, | |
)) | |
)); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Akaneapp\Model; | |
class FiturModel extends \Akane\Model\BaseModel | |
{ | |
const TABLE_NAME = 'fitur'; | |
public function getFiturValue($paket_id, $fitur_id) | |
{ | |
$sql = "SELECT `value` FROM `paket_fitur` WHERE `paket_id` = ? AND `fitur_id` = ?"; | |
$data = $this->getSingleData($sql, array($paket_id, $fitur_id)); | |
if ($data!=false){ | |
return $data['value']; | |
} else { | |
return ''; | |
} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class="table table-fitur mt-5"> | |
<tr> | |
<td class="namafitur">Fitur</td> | |
<?php | |
foreach ($paket as $p) { | |
if ($p['nama']=='Rocket'){ | |
$class_text = 'text-black'; | |
} | |
if ($p['nama']=='Missile'){ | |
$class_text = 'text-green'; | |
} | |
if ($p['nama']=='Apollo'){ | |
$class_text = 'text-blue'; | |
} | |
?> | |
<td class="text-center namapaket <?= $class_text ?>"><?= $p['nama'] ?></td> | |
<td></td> | |
<?php | |
} | |
?> | |
</tr> | |
<?php | |
foreach ($fitur as $f) { | |
?> | |
<tr> | |
<td><?= $f['nama_fitur']; ?></td> | |
<?php | |
foreach ($paket as $p) { | |
if ($p['nama']=='Rocket'){ | |
$class_bg = 'bg-grey'; | |
} | |
if ($p['nama']=='Missile'){ | |
$class_bg = 'bg-green'; | |
} | |
if ($p['nama']=='Apollo'){ | |
$class_bg = 'bg-blue'; | |
} | |
$value = $f['paket'][$p['id']]; | |
if ($value=='ya'){ | |
$value = '<i class="fa fa-check"></i>'; | |
} | |
if ($value=='tidak'){ | |
$value = '<i class="fa fa-times"></i>'; | |
} | |
?> | |
<td class="text-center <?= $class_bg ?>"><?= $value ?></td> | |
<td></td> | |
<?php | |
} | |
?> | |
</tr> | |
<?php | |
} | |
?> | |
<tr> | |
<td></td> | |
<?php | |
foreach ($paket as $p) { | |
if ($p['nama']=='Rocket'){ | |
$class_btn = 'btn-grey'; | |
} | |
if ($p['nama']=='Missile'){ | |
$class_btn = 'btn-green'; | |
} | |
if ($p['nama']=='Apollo'){ | |
$class_btn = 'btn-blue'; | |
} | |
?> | |
<td class="button"><a href="/order/<?= $p['id'] ?>" class="btn btn-fitur <?= $class_btn ?>">Daftar</a></td> | |
<td></td> | |
<?php | |
} | |
?> | |
</tr> | |
</table> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment