<div class="row"> <?php echo $form->label($model, 'district'); ?> <?php echo $form->textField($model, 'district', array('maxlength' => 20)); ?> </div> <div class="row"> <?php echo $form->label($model, 'idprovince'); ?> <?php echo $form->dropDownList($model, 'idprovince', GxHtml::listDataEx(IguProvince::model()->findAllAttributes(null, true)), array('prompt' => Yii::t('app', 'All'))); ?> </div> <div class="row buttons"> <?php echo GxHtml::submitButton(Yii::t('app', 'Search')); ?> </div> <?php $this->endWidget(); ?> </div><!-- search-form -->
<?php $this->breadcrumbs = array(IguProvince::label(2), Yii::t('app', 'Index')); $this->menu = array(array('label' => Yii::t('app', 'Manage') . ' ' . IguDistrict::label(2), 'url' => array('admin'))); $this->beginWidget('zii.widgets.CPortlet', array('htmlOptions' => array('class' => ''))); $this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'items' => array(array('label' => 'Create', 'icon' => 'icon-plus', 'url' => Yii::app()->controller->createUrl('create'), 'linkOptions' => array()), array('label' => 'List', 'icon' => 'icon-th-list', 'url' => Yii::app()->controller->createUrl('index'), 'active' => true, 'linkOptions' => array()), array('label' => 'Manage', 'icon' => 'icon-search', 'url' => Yii::app()->controller->createUrl('admin'), 'linkOptions' => array('class' => 'search-button')), array('label' => 'Export to PDF', 'icon' => 'icon-download', 'url' => Yii::app()->controller->createUrl('GeneratePdf'), 'linkOptions' => array('target' => '_blank'), 'visible' => true), array('label' => 'Export to Excel', 'icon' => 'icon-download', 'url' => Yii::app()->controller->createUrl('GenerateExcel'), 'linkOptions' => array('target' => '_blank'), 'visible' => true)))); $this->endWidget(); ?> <h1><?php echo GxHtml::encode(IguProvince::label(2)); ?> </h1> <?php $this->widget('zii.widgets.CListView', array('dataProvider' => $dataProvider, 'itemView' => '_view'));
public function actionGeneratePdf() { $session = new CHttpSession(); $session->open(); Yii::import('application.modules.admin.extensions.giiplus.bootstrap.*'); require_once 'tcpdf/tcpdf.php'; require_once 'tcpdf/config/lang/eng.php'; if (isset($session['IguProvince_records'])) { $model = $session['IguProvince_records']; } else { $model = IguProvince::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('IguProvince Report'); $pdf->SetSubject('IguProvince 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("IguProvince_002.pdf", "I"); }
echo $form->errorSummary($model); ?> <div class="row"> <?php echo $form->labelEx($model, 'district'); ?> <?php echo $form->textField($model, 'district', array('maxlength' => 20)); ?> <?php echo $form->error($model, 'district'); ?> </div><!-- row --> <div class="row"> <?php echo $form->labelEx($model, 'idprovince'); ?> <?php echo $form->dropDownList($model, 'idprovince', GxHtml::listDataEx(IguProvince::model()->findAllAttributes(null, true)), array('empty' => '--- Choose---')); ?> <?php echo $form->error($model, 'idprovince'); ?> </div><!-- row --> <?php echo GxHtml::submitButton(Yii::t('app', 'Save')); $this->endWidget(); ?> </div><!-- form -->
<?php $this->breadcrumbs = array($model->label(2) => array('index'), Yii::t('app', 'Manage')); Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$.fn.yiiGridView.update('igu-district-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n"); $this->menu = array(array('label' => Yii::t('app', 'Manage') . ' ' . IguDistrict::label(2), 'url' => array('admin'))); $this->beginWidget('zii.widgets.CPortlet', array('htmlOptions' => array('class' => ''))); $this->widget('bootstrap.widgets.TbMenu', array('type' => 'pills', 'items' => array(array('label' => 'Create', 'icon' => 'icon-plus', 'url' => Yii::app()->controller->createUrl('create'), 'linkOptions' => array()), array('label' => 'List', 'icon' => 'icon-th-list', 'url' => Yii::app()->controller->createUrl('index'), 'linkOptions' => array()), array('label' => 'Manage', 'icon' => 'icon-search', 'url' => Yii::app()->controller->createUrl('admin'), 'active' => true, 'linkOptions' => array('class' => 'search-button')), array('label' => 'Export to PDF', 'icon' => 'icon-download', 'url' => Yii::app()->controller->createUrl('GeneratePdf'), 'linkOptions' => array('target' => '_blank'), 'visible' => true), array('label' => 'Export to Excel', 'icon' => 'icon-download', 'url' => Yii::app()->controller->createUrl('GenerateExcel'), 'linkOptions' => array('target' => '_blank'), 'visible' => true)))); $this->endWidget(); ?> <h1><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?> </h1> <?php echo GxHtml::link(Yii::t('app', 'Advanced Search'), '#', array('class' => 'search-button')); ?> <div class="search-form" style="display:none;"> <?php $this->renderPartial('_search', array('model' => $model)); ?> </div><!-- search-form --> <?php $this->widget('zii.widgets.grid.CGridView', array('id' => 'igu-district-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array('id', 'district', array('name' => 'idprovince', 'value' => 'GxHtml::valueEx($data->idprovince0)', 'filter' => GxHtml::listDataEx(IguProvince::model()->findAllAttributes(null, true))), array('class' => 'CButtonColumn'))));
public function Document() { echo NJSON::encode(IguProvince::model()->findAll()); }