Пример #1
0
echo Yii::t('fin.grid', 'Cost');
?>
</th>
        </tr>
        <?php 
foreach ($arrModel as $model) {
    ?>
            <?php 
    $rowClass = MasterValueUtils::getColorRow($rowindex);
    $rowindex++;
    $startDateStr = '';
    $diffDays = '';
    $diffFull = '';
    if (!is_null($model->start_date)) {
        $startDate = DateTimeUtils::parse($model->start_date, DateTimeUtils::FM_DB_DATETIME);
        $startDateStr = DateTimeUtils::htmlDateTimeFormatFromDB($model->start_date, DateTimeUtils::FM_VIEW_DATE, true);
        $interval = $currentDate->diff($startDate);
        $diffDays = $interval->days;
        $diffFull = $interval->format('%Y-%M-%D %H:%I:%S');
    }
    $costAll = '';
    $costDay = '';
    if (!is_null($model->costs)) {
        $costAll = NumberUtils::format($model->costs);
        if ($diffDays > 0) {
            $costDay = NumberUtils::format($model->costs / $diffDays, 2);
        }
    }
    ?>
            <tr class="<?php 
    echo $rowClass;