public function labelRakPdf($layout)
 {
     /*
      * Persiapan render PDF
      */
     set_time_limit(0);
     $tanggalCetak = date('dmY His');
     $filterKategori = null;
     if (Yii::app()->user->hasState('labelKategoriId')) {
         $filterKategori = Yii::app()->user->getState('labelKategoriId');
     }
     $barang = is_null($filterKategori) ? LabelRakCetak::model()->findAll() : LabelRakCetak::model()->with('barang', 'barang.kategori')->findAll('barang.kategori_id=' . $filterKategori);
     $listNamaKertas = CetakLabelRakLayoutForm::listNamaKertas();
     $mPDF1 = Yii::app()->ePdf->mpdf('utf-8', $listNamaKertas[$layout['kertasId']], 0, '', 7, 7, 7, 7, 9, 9);
     $mPDF1->WriteHTML($this->renderPartial('_label_rak_pdf', array('barang' => $barang, 'namaToko' => $this->namaToko(), 'tanggalCetak' => $tanggalCetak), true));
     $mPDF1->SetDisplayMode('fullpage');
     $mPDF1->margin_top = 5;
     $mPDF1->pagenumPrefix = 'Hal ';
     $mPDF1->pagenumSuffix = ' / ';
     // Render PDF
     $mPDF1->Output("label rak {$tanggalCetak}.pdf", 'I');
 }
示例#2
0
    'htmlOptions' => array('target' => '_blank'),
    'method' => 'GET'
        ));
?>
<?php echo $form->errorSummary($model, 'Error: Perbaiki input', null, array('class' => 'panel callout')); ?>
<div class="row">
    <div class="small-12 large-6 columns">
        <?php echo $form->label($model, 'layoutId'); ?>
        <?php
        echo $form->dropDownList($model, 'layoutId', CetakLabelRakLayoutForm::listLayout());
        ?>
    </div>
    <div class="small-12 large-6 columns">
        <?php echo $form->label($model, 'kertasId'); ?>
        <?php
        echo $form->dropDownList($model, 'kertasId', CetakLabelRakLayoutForm::listKertas());
        ?>
    </div>
</div>

<div class="row">
    <div class="small-12 columns">
        <?php echo CHtml::submitButton('Cetak', array('id' => 'tombol-cetak', 'class' => 'tiny bigfont button right')); ?>
    </div>
</div>

<?php
$this->endWidget();
?>

<?php