Beispiel #1
0
    } 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>';
Beispiel #2
0
<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 -->
Beispiel #3
0
<?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) {
Beispiel #4
0
						<b> <?php 
        echo CHtml::encode($model->getAttributeLabel('pe'));
        ?>
:</b>
						<?php 
        echo CHtml::encode(Math::pe_round($model->pe));
        ?>
						<br/>
						&#8659;
						<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;