} ?> </div> </div> <?php $i++; } } ?> </tr> </table> </td> <td> <?php if (isset($_GET['form']) && $_GET['form'] == 16) { $cartridges = Filedetails::model()->findAllByAttributes(array('fid' => $model->ID)); echo "<table class='table table-bordered'>"; if (count($cartridges) != 0) { echo "<tr style='background:#F5A9A9;'><th colspan='4' style='text-align:center'>File Details</th></tr>"; echo "<tr><th>Content</th><th>Updated By</th><th>Updated On</th></tr>"; foreach ($cartridges as $c) { $cartridgeName4 = $c['id']; $cartridgeName = $c['content']; $cartridgeName2 = $c['updatedby']; $cartridgeName3 = $c['updatedon']; $user = User::model()->findByAttributes(array('id' => $c['updatedby'])); $temp = $user['name']; $i = 1; echo "<tr style='background:#F6E3CE'><td>{$cartridgeName}</td><td>{$temp}</td><td>{$cartridgeName3}</td></tr>"; echo "<tr>"; }
public function actionGeneratePdf() { $this->layout = 'pdf'; $model = new Filedetails('search'); if (isset($_GET['Filedetails'])) { $model->attributes = $_GET['Filedetails']; } // 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(); }