Exemplo n.º 1
0
            <div class="row">
                <div class="col-md-3 col-sm-6">
                    <div class="span2"><?php 
echo $form->labelEx($model, 'name', array('class' => 'inline-labels'));
?>
</div>
                    <div class="span3"><?php 
echo $form->textField($model, 'name', array('span' => 3, 'maxlength' => 50, 'placeHolder' => 'Supplier Name'));
?>
</div>
                    <div class="span2"><?php 
echo $form->labelEx($model, 'suppliertype_id', array('class' => 'inline-labels'));
?>
</div>
                    <div class="span3"><?php 
echo $form->dropDownList($model, 'suppliertype_id', CHtml::listData(Suppliertype::model()->findAll(), 'id', 'name'), array('span' => 2, 'prompt' => '-------'));
?>
                    <?php 
echo CHtml::ajaxLink(Yii::t('suppliertype', TbHtml::button('+', array('color' => TbHtml::BUTTON_COLOR_SUCCESS, 'size' => TbHtml::BUTTON_SIZE_DEFAULT))), $this->createUrl('suppliertype/addnew'), array('onclick' => '$("#divDialog7").dialog("open"); return false;', 'update' => '#divDialog7'), array('id' => uniqid()));
?>
                            <div id="divDialog7"></div>
                </div>
            </div>
        </tr>
        <tr>
            <div class="row">
                <div class="col-md-3 col-sm-6">
                    <div class="span2"><?php 
echo $form->labelEx($model, 'add1', array('class' => 'inline-labels'));
?>
</div>
 public function actionGeneratePdf()
 {
     $this->layout = 'pdf';
     $model = new Suppliertype('search');
     if (isset($_GET['Suppliertype'])) {
         $model->attributes = $_GET['Suppliertype'];
     }
     // to execute the filters (if is the case)
     $dataProvider = $model->search();
     $dataProvider->pagination = false;
     $mPDF1 = Yii::app()->ePdf->mpdf();
     # You can easily override default constructor's params
     $mPDF1 = Yii::app()->ePdf->mpdf('', 'A5');
     # renderPartial (only 'view' of current controller)
     $mPDF1->WriteHTML($this->renderPartial('admin', array('model' => $model), true));
     # Outputs ready PDF
     $mPDF1->Output();
 }