Exemple #1
0
 public function actionBpjs()
 {
     $model = new FormRekap();
     if (isset($_POST['FormRekap'])) {
         $model->attributes = $_POST['FormRekap'];
         $datestart = date('Y-m-d', strtotime($model->TAHUN . '-' . $model->BULAN . '-01'));
         $dateend = date('Y-m-t', strtotime($model->TAHUN . '-' . $model->BULAN . '-01'));
         $criteria = new CDbCriteria();
         $criteria->addBetweenCondition('TANGGAL_ORDER', $datestart, $dateend);
         $criteria->condition = 'ID_LAYANAN=5';
         $order = Order::model()->findAll($criteria);
         // var_dump($order); die();
         if ($order != null) {
             $filename = 'REKAP BPJS_' . strtoupper(MyFormatter::formatBulan($model->BULAN)) . '_' . $model->TAHUN;
             header("Cache-Control: no-cache, no-store, must-revalidate");
             header("Content-Type: application/vnd.ms-excel");
             header("Content-Disposition: attachment; filename=" . $filename . ".xls");
             $this->renderPartial('bpjs/_rekap_bpjs', array('order' => $order, 'model' => $model));
             exit;
         } else {
             Yii::app()->user->setFlash('info', MyFormatter::alertError('Rekap belum tersedia untuk bulan tersebut.'));
         }
     }
     $this->render('bpjs/index', array('model' => $model));
 }
Exemple #2
0
<table border="1">
    <tr>
    <th colspan="5">KLINIK AR-RAHMAH | Rekap Obat Bebas Bulan <?php 
echo MyFormatter::formatBulan($model->BULAN) . '-' . $model->TAHUN;
?>
</th>
    </tr>
    <tr>
        <th>NO NOTA</th>
        <th>TANGGAL ORDER</th>
        <th>NAMA PASIEN</th>
        <th>APOTEK</th>
        <th>TOTAL</th>
    </tr>
    <?php 
$grandtotal = 0;
?>
    <?php 
foreach ($order as $data) {
    ?>
        <tr>
            <td><?php 
    echo '#' . $data->KODE_ORDER;
    ?>
</td>
            <td><?php 
    echo MyFormatter::formatTanggal($data->TANGGAL_ORDER);
    ?>
</td>
            <td><?php 
    echo $data->pasien->NAMA_PASIEN;
<table border="1">
    <tr>
    <th colspan="7">LAPORAN STOK PENJUALAN LENSA BULAN <?php 
echo MyFormatter::formatBulan($bulan);
?>
</th>
    </tr>
    <tr>
        <th>#</th>
        <th>KODE BARANG</th>
        <th>NAMA BARANG</th>
        <th>HARGA</th>
        <th>STOK</th>
        <th>STOK TERJUAL</th>
        <th>STOK AKHIR</th>
    </tr>
    <?php 
$grandtotal = 0;
?>
    <?php 
foreach ($item as $i => $data) {
    ?>
        <?php 
    $jumlah_stok = Item::getTotalStok($data->ID_ITEM);
    $jumlah_penjualan = Item::getTotalItemDijual($data->ID_ITEM);
    $total = $jumlah_stok + $jumlah_penjualan;
    ?>
        <tr>
            <td><?php 
    echo $i + 1;
    ?>