<?php $row_id = "timeslot-" . $key; ?>
<?php $typeOfDayList = CHtml::listData(TimeSlot::getTypeOfDayList(), 'value', 'label'); ?>
<?php $dayOfTheYear = $model->dayOfTheYear;; ?>
<?php $dayOfTheYearStr = ((!empty($dayOfTheYear))? ($dayOfTheYear->format(Yii::app()->params['dayoftheyearselect_format'][Yii::app()->language]['view'])): ''); ?>
<div <?php echo MtHaml\Runtime::renderAttributes(array(array('class', ('time-slot-sub-form' . ' ' . 'span9')), array('id', $row_id)), 'html5', 'UTF-8'); ?>>
  <?php echo $form->hiddenField($model, "[$key]ID");; ?>
  <?php echo $form->updateTypeField($model, $key, "updateType", array('key' => $key));; ?>
  <div class="time-slot-field">
    <?php echo $form->textFieldRow($model,"[$key]Descrizione",array('class'=>'span','maxlength'=>250)); ?>
  </div>
  <div class="time-slot-field">
    <?php echo $form->dropDownListRow($model,"[$key]WeekDay", $typeOfDayList, array('class'=>'span2','maxlength'=>250)); ?>
  </div>
  <div class="time-slot-field">
    <?php echo $form->label($model, "dayOfTheYear"); ?>
    <div class="input-append date dayofyear-picker">
      <input <?php echo MtHaml\Runtime::renderAttributes(array(array('data-initial-value', (((isset($dayOfTheYear))? ('2000-'.$dayOfTheYear->format('m-d')): '-'))), array('data-format', (Yii::app()->params['dayoftheyearselect_format'][Yii::app()->language]['view'])), array('type', 'text'), array('name', ('TimeSlot[' . $key . '][dayOfTheYear]')), array('value', $dayOfTheYearStr)), 'html5', 'UTF-8'); ?>>
        <span class="add-on">
          <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
        </span>
      </input>
    </div>
  </div>
  <div class="time-slot-field">
    <?php echo $form->label($model, "[$key]TimeStart"); ?>
    <div id="datepicker-start-time" class="input-prepend input-append time-picker" data-initial-value="00:00">
      <input <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'span1'), array('data-format', (Yii::app()->params['timeselect_format'][Yii::app()->language]['view'])), array('type', 'text'), array('name', ('TimeSlot[' . $key . '][TimeStart]')), array('data-initial-value', ('2000-01-01T' . ($model->TimeStart) . 'Z')), array('value', '00:00')), 'html5', 'UTF-8'); ?> />
      <span class="add-on">
        <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
      </span>
    </div>
  </div>
  <div class="time-slot-field">
    <?php echo $form->label($model, "[$key]TimeStop"); ?>
    <div id="datepicker-start-time" class="input-prepend input-append time-picker" data-initial-value="23:59">
      <input <?php echo MtHaml\Runtime::renderAttributes(array(array('class', 'span1'), array('data-format', (Yii::app()->params['timeselect_format'][Yii::app()->language]['view'])), array('type', 'text'), array('name', ('TimeSlot[' . $key . '][TimeStop]')), array('data-initial-value', ('2000-01-01T' . ($model->TimeStop) . 'Z')), array('value', '23:59')), 'html5', 'UTF-8'); ?> />
      <span class="add-on">
        <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i>
      </span>
    </div>
  </div>
  <div class="time-slot-button-delete">
    <?php echo $form->deleteRowButton($row_id, $key);; ?>
  </div>
</div>
