本文整理汇总了PHP中Output::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Output::model方法的具体用法?PHP Output::model怎么用?PHP Output::model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Output
的用法示例。
在下文中一共展示了Output::model方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionExport
/**
* Export Data to Excel
*/
public function actionExport()
{
/** Get model */
$models = Output::model()->findAll();
/** Error reporting */
$this->excelErrorReport();
/** PHPExcel_IOFactory */
$objReader = new PHPExcel();
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
$path = Yii::app()->basePath . '/../export/output.xlsx';
$pathExport = Yii::app()->basePath . '/../files/Master Output.xlsx';
$objPHPExcel = $objReader->load($path);
$objPHPExcel->setActiveSheetIndex(0);
/* " Add new data to template" */
$this->exportExcel($objPHPExcel, $models);
/** Export to excel* */
$this->excel($objPHPExcel, $pathExport);
readfile($pathExport);
unlink($pathExport);
exit;
}
示例2: actionPpkSuboutputChart
public function actionPpkSuboutputChart($id, $ppkId)
{
$output = Output::model()->findByPk($id);
$ppk = Ppk::model()->findByPk($ppkId);
$packageAccounts = PackageAccount::model()->findAllByAttributes(array('output_code' => "{$output->code}", 'ppk_code' => "{$ppk->code}"));
$suboutputLists = array();
if ($packageAccounts) {
foreach ($packageAccounts as $packageAccount) {
$suboutput = $packageAccount->suboutput->name;
if (!in_array($suboutput, $suboutputLists, true)) {
array_push($suboutputLists, $suboutput);
}
}
}
$suboutputIdLists = array();
if ($packageAccounts) {
foreach ($packageAccounts as $packageAccount) {
$suboutputId = $packageAccount->suboutput->id;
if (!in_array($suboutputId, $suboutputIdLists, true)) {
array_push($suboutputIdLists, $suboutputId);
}
}
}
$suboutputCodes = array();
if ($packageAccounts) {
foreach ($packageAccounts as $packageAccount) {
$code = $packageAccount->suboutput_code;
if (!in_array($code, $suboutputCodes, true)) {
array_push($suboutputCodes, $code);
}
}
}
$limits = array();
for ($i = 0; $i < count($suboutputLists); $i++) {
$accounts = PackageAccount::model()->findAllByAttributes(array('suboutput_code' => $suboutputCodes[$i], 'ppk_code' => $ppk->code));
$limit = 0;
if ($accounts) {
foreach ($accounts as $account) {
$limit += $account->limit;
}
array_push($limits, $limit);
}
}
$realizations = array();
for ($i = 0; $i < count($suboutputLists); $i++) {
$accounts = PackageAccount::model()->findAllByAttributes(array('suboutput_code' => $suboutputCodes[$i], 'ppk_code' => $ppk->code));
$realization = 0;
if ($accounts) {
foreach ($accounts as $account) {
$realization += $account->getTotal($account->code)['realization'];
}
array_push($realizations, $realization);
}
}
$rests = array();
for ($i = 0; $i < count($suboutputLists); $i++) {
$accounts = PackageAccount::model()->findAllByAttributes(array('suboutput_code' => $suboutputCodes[$i], 'ppk_code' => $ppk->code));
$rest = 0;
if ($accounts) {
foreach ($accounts as $account) {
$rest += $account->getTotal($account->code)['restMoney'];
}
array_push($rests, $rest);
}
}
$rates = array();
for ($i = 0; $i < count($suboutputLists); $i++) {
$accounts = PackageAccount::model()->findAllByAttributes(array('suboutput_code' => $suboutputCodes[$i], 'ppk_code' => $ppk->code));
$realization = 0;
$limit = 0;
if ($accounts) {
foreach ($accounts as $account) {
$realization += $account->getTotal($account->code)['realization'];
$limit += $account->limit;
}
$rate = $realization / $limit;
array_push($rates, $rate);
} else {
array_push($rates, 0);
}
}
$this->render('ppkSuboutputChart', array('ppk' => $ppk, 'suboutputLists' => $suboutputLists, 'id' => $suboutputIdLists, 'limits' => $limits, 'realizations' => $realizations, 'rests' => $rests, 'rates' => $rates));
}
示例3: getOutputOptions
public function getOutputOptions()
{
$models = Output::model()->findAll();
$options = array();
foreach ($models as $model) {
$options[$model->code] = "[{$model->code}] | {$model->name}";
}
return $options;
}
示例4: array
<?php
echo $form->fileFieldRow($model, 'file', array('class' => 'span5', 'maxlength' => 256, 'labelOptions' => array('label' => false)));
?>
<p>File excel yang digunakan adalah file d_kmpnen yang sudah difilter jumlah barisnya</p>
<div class="form-actions">
<?php
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'label' => 'Import'));
?>
</div>
<?php
$this->endWidget();
?>
</div>
<div class="panel-header">
<a href="<?php
echo yii::app()->baseUrl;
?>
/component/exportError" class="btn btn-primary"><i class="fa fa fa-download"></i> Export Error</a>
</div>
<div class="panel-body">
<h2>Daftar Error Import Karena Sudah Terealisasi</h2>
<?php
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'component-error-grid', 'dataProvider' => $componentError->search(), 'filter' => $componentError, 'columns' => array(array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)'), array('name' => 'satker_code', 'value' => 'isset($data->satker->name)?$data->satker->name:"Not set"', 'filter' => Satker::model()->getSatkerOptions()), array('name' => 'activity_code', 'value' => 'isset($data->activity->name)?$data->activity->name:"Not set"', 'filter' => Activity::model()->getActivityOptions()), array('name' => 'output_code', 'value' => 'isset($data->outputCode->name)?$data->outputCode->name:$data->output_code', 'filter' => Output::model()->getOutputOptions()), array('name' => 'suboutput_code', 'value' => 'isset($data->suboutputCode->name)?$data->suboutputCode->name:$data->suboutput_code', 'filter' => Suboutput::model()->getSuboutputOptions()), 'code', 'name', array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{view}'))));
?>
</div>
</div>
示例5: array
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'suboutput-form', 'enableAjaxValidation' => true, 'htmlOptions' => array('enctype' => 'multipart/form-data')));
?>
<?php
echo $form->errorSummary($model);
?>
<?php
echo $form->textFieldRow($model, 'code', array('class' => 'span5', 'maxlength' => 256));
?>
<?php
echo $form->dropDownListRow($model, "output_code", Output::model()->getOutputOptions(), array("prompt" => "Please Select"));
?>
<?php
echo $form->textFieldRow($model, 'name', array('class' => 'span5', 'maxlength' => 256));
?>
<?php
/*
<?php echo $form->textFieldRow($model,'created_at',array('class'=>'span5')); ?>
<?php echo $form->textFieldRow($model,'created_by',array('class'=>'span5')); ?>
<?php echo $form->textFieldRow($model,'updated_at',array('class'=>'span5')); ?>
示例6: checkMaster
/**
* Check completeness data of master
* @return boolean
*/
public function checkMaster()
{
$complete = false;
$ppk = Ppk::model()->exists();
$satker = Satker::model()->exists();
$activity = Activity::model()->exists();
$output = Output::model()->exists();
$suboutput = Suboutput::model()->exists();
$component = Component::model()->exists();
$subcomponent = Subcomponent::model()->exists();
$account = Account::model()->exists();
$province = Province::model()->exists();
$city = City::model()->exists();
if ($ppk && $satker && $activity && $output && $suboutput & $component && $subcomponent && $account && $province && $city) {
$complete = TRUE;
}
return $complete;
}
示例7: array
<?php
$this->breadcrumbs = array('Budgets' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List Budget', 'url' => array('index')), array('label' => 'Create Budget', 'url' => array('create')));
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('budget-grid', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>
<?php
$this->widget('bootstrap.widgets.TbGridView', array('id' => 'budget-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array(array('header' => 'No', 'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)'), array('name' => 'dipa_id', 'value' => '$data->dipa->dipa_number', 'filter' => Dipa::model()->getDipaOptions()), array('name' => 'output_code', 'value' => 'isset($data->outputCode->name)?$data->outputCode->name:$data->output_code', 'filter' => Output::model()->getOutputOptions()), array('name' => 'suboutput_code', 'value' => 'isset($data->suboutputCode->name)?$data->suboutputCode->name:$data->suboutput_code', 'filter' => Suboutput::model()->getSuboutputOptions()), array('name' => 'component_code', 'value' => 'isset($data->componentCode->name)?$data->componentCode->name:$data->component_code', 'filter' => Component::model()->getComponentOptions()), array('name' => 'subcomponent_code', 'value' => 'isset($data->subcomponentCode->name)?$data->subcomponentCode->name:$data->subcomponent_code', 'filter' => Subcomponent::model()->getSubcomponentOptions()), 'subcomponent_code', array('name' => 'account_code', 'value' => 'isset($data->accountCode->name)?$data->accountCode->name:$data->account_code', 'filter' => Account::model()->getAccountOptions()), array("name" => "total_budget_limit", "value" => 'Yii::app()->format->number($data->total_budget_limit)', 'htmlOptions' => array('style' => 'text-align: right;')), array('class' => 'bootstrap.widgets.TbButtonColumn'))));