public static function getItemBarcode($valueArray) { $barcodeDetailsRow = Barcodedetail::model()->find('organisation_id=:organisation_id', array('organisation_id' => Yii::app()->user->getState("org_id"))); if (isset($valueArray['commodity_id'])) { $stockname = Stockname::model()->findByAttributes(array('commodity_id' => $valueArray['commodity_id'])); $prefix = $stockname['prefix']; } else { $prefix = ''; } $optionsArray = array('elementId' => $valueArray['itemId'] . "_bcode", 'value' => $prefix . '/' . $valueArray['barcode'], 'type' => $barcodeDetailsRow['type'], 'settings' => array('output' => $barcodeDetailsRow['format'], 'barWidth' => $barcodeDetailsRow['bar_width'], 'barHeight' => $barcodeDetailsRow['bar_height'])); self::getBarcode($optionsArray); return CHtml::tag('div', array('id' => $valueArray['itemId'] . "_bcode")); }
public function actionGeneratePdf() { $this->layout = 'pdf'; $model = new Barcodedetail('search'); if (isset($_GET['Barcodedetail'])) { $model->attributes = $_GET['Barcodedetail']; } // 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(); }