<?php
use yii\helpers\Html;

/** @var $model app\models\MPembayaran */
?>

<div style="font-family:DejaVu Sans;font-size:12px;">

<!-- HEADER -->
<div style="border-bottom:2px solid #000;padding-bottom:10px;margin-bottom:15px;">

<table width="100%">
<tr>
<td width="60%">
    <div style="font-size:20px;font-weight:bold;">INVOICE</div>
    Kode: <?= Html::encode($model->vKode) ?>
</td>

<td width="40%" align="right">
    Status:
    <?php
        $bg = '#999';
        if ($model->eStatus == 'Lunas') $bg = '#5cb85c';
        if ($model->eStatus == 'Proses') $bg = '#f0ad4e';
        if ($model->eStatus == 'Gagal') $bg = '#d9534f';
    ?>
    <span style="background:<?= $bg ?>;color:#fff;padding:4px 10px;font-weight:bold;">
        <?= Html::encode($model->eStatus) ?>
    </span>
</td>
</tr>
</table>

</div>

<!-- INFO -->
<table width="100%" style="margin-bottom:15px;">
<tr>
<td width="50%">
    <strong>Pelanggan</strong><br>
    Perumahan : <?= Html::encode($cluster->vNama) ?><br>
    Kota / Kab. : <?= Html::encode($cluster->vKota ?? '-') ?>
</td>

<td width="50%" align="right">
    <strong>Periode</strong><br>
    Mulai: <?= date('d M Y', strtotime($model->dateStart)) ?><br>
    Selesai: <?= date('d M Y', strtotime($model->dateFinish)) ?>
</td>
</tr>
</table>

<!-- ITEM -->
<table width="100%" cellpadding="6" cellspacing="0"
       style="border-collapse:collapse;border:1px solid #000;margin-bottom:15px;">

<tr style="background:#eee;">
    <th align="left" style="border:1px solid #000;">Deskripsi</th>
    <th align="center" style="border:1px solid #000;">Durasi</th>
    <th align="right" style="border:1px solid #000;">Harga / Bulan</th>
    <th align="right" style="border:1px solid #000;">Subtotal</th>
</tr>

<tr>
    <td style="border:1px solid #000;">Langganan AKUN IPL</td>
    <td align="center" style="border:1px solid #000;">
        <?= $model->jumlah_bulan ?>
    </td>
    <td align="right" style="border:1px solid #000;">
        Rp <?= number_format(65000,0,',','.') ?>
    </td>
    <td align="right" style="border:1px solid #000;">
        Rp <?= number_format($model->vNilai,0,',','.') ?>
    </td>
</tr>

</table>

<!-- TOTAL -->
<table width="100%">
<tr>
<td width="60%">
    Catatan:<br>
    -
</td>

<td width="40%" align="right">
    <h3 style="margin:0;">
        Total: Rp <?= number_format($model->vNilai,0,',','.') ?>
    </h3>
</td>
</tr>
</table>

<hr>

<p style="text-align:center;font-size:11px;">
<!-- Invoice ini sah tanpa tanda tangan. -->
</p>

</div>
