public function actionGeneratePdf() { $session = new CHttpSession(); $session->open(); Yii::import('application.extensions.bootstrap.gii.*'); require_once 'bootstrap/tcpdf/tcpdf.php'; require_once 'bootstrap/tcpdf/config/lang/eng.php'; if (isset($session['MFlotas_records'])) { $model = $session['MFlotas_records']; } else { $model = MFlotas::model()->findAll(); } $html = $this->renderPartial('expenseGridtoReport', array('model' => $model), true); //die($html); $pdf = new TCPDF(); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor(Yii::app()->name); $pdf->SetTitle('MFlotas Report'); $pdf->SetSubject('MFlotas Report'); //$pdf->SetKeywords('example, text, report'); $pdf->SetHeaderData('', 0, "Report", ''); $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, "Example Report by " . Yii::app()->name, ""); $pdf->setHeaderFont(array('helvetica', '', 8)); $pdf->setFooterFont(array('helvetica', '', 6)); $pdf->SetMargins(15, 18, 15); $pdf->SetHeaderMargin(5); $pdf->SetFooterMargin(10); $pdf->SetAutoPageBreak(TRUE, 0); $pdf->SetFont('dejavusans', '', 7); $pdf->AddPage(); $pdf->writeHTML($html, true, false, true, false, ''); $pdf->LastPage(); $pdf->Output("MFlotas_002.pdf", "I"); }
'dayNamesMin' => array('Do','Lu','Ma','Mi','Ju','Vi','Sa'), 'numberOfMonths'=>2, 'dateFormat'=>'yy-mm-dd',//Date format 'mm/dd/yy','yy-mm-dd','d M, y','d MM, y','DD, d MM, yy' ), ) ); ?> <?php echo $form->dropDownListRow( $model, 'IdFlota', CHtml::listData(MFlotas::model()->findAll(), 'IdFlota', 'NombreFlota'), array('empty'=>'', 'class'=>'span5') ); ?> </div> </div> <div class="form-actions"> <?php $this->widget('bootstrap.widgets.TbButton', array( 'buttonType'=>'submit', 'type'=>'primary',
<?php echo $form->dropDownListRow( $model, 'IdClasificacionDia', CHtml::listData(MClasificaciondias::model()->findAll(), 'IdClasificacionDia', 'NombreClasificacionDia'), array('empty'=>'', 'class'=>'span5') ); ?> <?php echo $form->textFieldRow($model,'NumeroMensajerosProgramacion',array('class'=>'span5','maxlength'=>3, 'style'=>'text-transform:uppercase', 'onKeyUp'=>'javascript:this.value=this.value.toUpperCase();')); ?> <?php echo $form->dropDownListRow( $model, 'IdFlota', CHtml::listData(MFlotas::model()->findAll(array('order'=>'NombreFlota')), 'IdFlota', 'NombreFlota'), array('empty'=>'', 'class'=>'span5') ); ?> <?php echo $form->datepickerRow($model,'FechaInicio', array('prepend'=>'<i class="icon-calendar"></i>', 'disabled' => true, 'options'=>array( 'showAnim'=>'fadeIn', 'yearSuffix'=>'', 'monthNames' => array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre"), 'monthNamesShort' => array("Ene","Feb","Mar","Abr","May","Jun","Jul","Ago","Sep","Oct","Nov","Dic"), 'dayNames' => array('Domingo,Lunes,Martes,Miercoles,Jueves,Viernes,Sabado'),