本文整理汇总了PHP中Utilities::printWD方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::printWD方法的具体用法?PHP Utilities::printWD怎么用?PHP Utilities::printWD使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities::printWD方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
} else {
$cities[$cs] = array($sa => $geom->geom_water_demand);
}
}
// Yii::log(print_r($cities, true), CLogger::LEVEL_INFO);
// Yii::log(print_r($margin, true), CLogger::LEVEL_INFO);
echo '<div>';
foreach ($cities as $k => $v) {
if (Yii::app()->user->isWRU) {
echo '<h6>' . CHtml::link(ucwords(strtolower($k)), CController::createUrl('waterRequests/index', array('municipality' => ucwords(strtolower($k)))), array('id' => 'only_this_municipality', 'title' => Yii::t('waterrequest', 'View only requests from Municipality ') . ucwords(strtolower($k)))) . ': </h6>';
} else {
echo '<h6>' . ucwords(strtolower($k)) . ': </h6>';
}
echo '<div>';
foreach ($v as $as => $wd) {
echo ucwords(strtolower($as)) . ' - ' . Yii::t('waterrequest', 'Requested') . ': ' . Utilities::printWD($wd) . ' - ' . Yii::t('waterrequest', 'Currently available') . ': ' . Utilities::printWD($margin[$as]) . '<br/>';
}
echo '</div>';
}
echo '</div>';
/*
foreach($cities as $k=>$v) {
$ret = WaterRequestGeometries::feasibilityCheck($k,$v);
$class = 'wd_ok';
if (isset($ret['margin'])) {
if ($ret['margin'] == 0)
$class = 'wd_notice';
else if ($ret['margin'] < 0)
$class = 'wd_ko';
}
echo '<div>';
示例2: foreach
<div class="tooltip <?php
echo $css_class;
?>
" style="display: none">
<div class="tooltip_content">
<?php
if (isset($scenari['maximum_water_supply'])) {
echo '<div class="' . $css_class . '">' . Yii::t('waterrequest', 'Currently available') . ': ' . Utilities::printWD($scenari['maximum_water_supply']) . ' </div>';
if (isset($scenari['scenari']) && $scenari['scenari'] != null) {
foreach ($scenari['scenari'] as $scenario) {
if (isset($scenario['maximum_water_supply'])) {
$c = 'scenario_ok';
if (isset($scenario['margin'])) {
if ($scenario['margin'] == 0) {
$c = 'scenario_notice';
} else {
if ($scenario['margin'] < 0) {
$c = 'scenario_ko';
}
}
}
echo '<div class="scenario">' . $scenario['scenario'] . ': ' . Utilities::printWD($scenario['maximum_water_supply']) . '<span class="' . $c . '"></span></div>';
}
}
}
}
?>
</div><!-- tooltip_content -->
</div> <!-- tooltip -->
示例3: array
<?php
$attributes = array('id', array('label' => $model->getAttributeLabel('phase'), 'value' => $model->phaseHR), array('label' => $model->getAttributeLabel('status'), 'value' => $model->statusIconHistory, 'type' => 'raw'), array('label' => $model->getAttributeLabel('timestamp'), 'value' => Yii::app()->dateFormatter->format('dd MMMM yyyy, HH:mm', $model->timestamp)), 'user.first_name', 'user.last_name', 'user.title', 'description', 'note', array('label' => $model->getAttributeLabel('water_demand'), 'value' => Utilities::printWD($model->total_water_demand)));
if (isset($model->parent_phase)) {
$attr = array('label' => $model->getAttributeLabel('parent_water_request'), 'type' => 'raw', 'value' => CHtml::link($model->parent_wr->project, array('waterRequests/view', 'id' => $model->parent_wr->id)));
array_push($attributes, $attr);
$attr = array('label' => $model->getAttributeLabel('parent_water_demand'), 'value' => Utilities::printWD($model->parent_wr->total_water_demand));
array_push($attributes, $attr);
$attr = array('label' => $model->getAttributeLabel('parent_water_demand_usage'), 'value' => Math::wd_percentage_round($model->total_water_demand / $model->parent_wr->total_water_demand * 100) . ' %');
array_push($attributes, $attr);
}
if ($model->phase == 2) {
$attr = array('label' => $model->getAttributeLabel('expiration_date'), 'value' => $model->expiration_date);
array_push($attributes, $attr);
}
// TODO: Perche' solo i WRU possono vedere il costo? Il costo viene assegnato da WRU quando approva una richiesta.
if (Yii::app()->user->isWRU) {
$attr = array('label' => $model->getAttributeLabel('cost'), 'value' => $model->cost . ' ' . Yii::app()->params['currency']);
array_push($attributes, $attr);
$attr = array('label' => $model->getAttributeLabel('file_link'), 'type' => 'raw', 'value' => CHtml::link($model->file_link, Yii::app()->params['transition']['upload_dir'] . '/' . $model->file_link));
array_push($attributes, $attr);
}
if (Yii::app()->user->checkAccess('updateWaterDemandInWaterRequest')) {
$attr = array('label' => $model->getAttributeLabel('effective_water_demand'), 'value' => Math::wd_round($model->effective_water_demand));
array_push($attributes, $attr);
}
$this->widget('zii.widgets.CDetailView', array('data' => $model, 'attributes' => $attributes));
?>
<script type="text/javascript">
/* <![CDATA[ */
function infoHistory(elem, wr_id) {
示例4:
<b> <?php
echo CHtml::encode($model->getAttributeLabel('pe'));
?>
:</b>
<?php
echo CHtml::encode(Math::pe_round($model->pe));
?>
<br/>
⇓
<br/>
<b> <?php
echo CHtml::encode($model->getAttributeLabel('water_demand'));
?>
:</b>
<?php
echo CHtml::encode(Utilities::printWD($model->water_demand));
?>
<?php
$info_wd = true;
break;
}
}
foreach ($model->properties as $property) {
if ($property->use4ae === true) {
continue;
} else {
if ($info_wd === true) {
echo '<br/><br/>';
echo '<b>Other info:</b><br/>';
$info_wd = false;