Example #1
0
              
              <?php 
    $model_t->genre = unserialize($model_t->genre);
    ?>
              <div class="default-input__container" id="genre_show" style="display: <?php 
    echo $model_t->genre == '' ? 'none' : 'block';
    ?>
;">
                <div class="col-181">
                    <?php 
    echo $form->labelEx($model_t, 'genre', array('class' => 'default-input__label'));
    ?>
                </div>
                <div class="col-674">
                    <?php 
    echo $form->checkBoxList($model_t, 'genre', CHtml::listData(Genre::model()->findAll('occ_id=:occ_id', array(':occ_id' => (int) $model_t->occupation)), 'id', 'name'));
    ?>
                    <?php 
    echo $form->error($model_t, 'genre');
    ?>
                </div>
              </div>
              <div class="default-input__container">
                <div class="col-181">
                    <?php 
    echo $form->labelEx($model_t, 'date_end', array('class' => 'default-input__label pt4'));
    ?>
                </div>
                <div class="col-674">
                    <?php 
    echo $form->textField($model_t, 'date_end', array('id' => 'datepicker', 'class' => 'default__input tender__datepicker', 'placeholder' => '25 апреля 2014'));
?>
      </div>
    </div-->
    <div class="default-input__container">
      <div class="col-275">
        <?php 
echo $form->labelEx($model, 'genre_id', array('class' => 'default-input__label'));
?>
      </div>
      <div class="col-384">
        <?php 
//echo $form->textField($model,'url',array('class'=>'default__input','placeholder'=>'http://www.site.com'));
$model->genre_id = unserialize($model->genre_id);
?>
        <?php 
echo $form->checkBoxList($model, 'genre_id', CHtml::listData(Genre::model()->findAll('occ_id=:occ_id', array(':occ_id' => (int) $model->occupation_id)), 'id', 'name'), array('class' => 'default-input__radio'));
?>
        <?php 
echo $form->error($model, 'genre_id', array('style' => 'margin-top: 5px;'));
?>
      </div>
    </div>
    <!--div class="default-input__container">
      <div class="col-275">
        <?php 
echo $form->labelEx($model, 'price_h', array('class' => 'default-input__label'));
?>
      </div>
      <div class="col-384">
        <?php 
echo $form->textField($model, 'price_h', array('class' => 'default__input', 'placeholder' => 'укажите стоимость аренды'));
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Genre the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Genre::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public function actionGenresublist()
 {
     $data_genre = Genre::model()->findAll('occ_id=:occ_id', array(':occ_id' => (int) $_POST['Users']['occupation_id']));
     $data_genre = CHtml::listData($data_genre, 'id', 'name');
     foreach ($data_genre as $value => $name) {
         $data_genre[$value] = iconv('utf-8', 'windows-1251', CHtml::encode($name));
     }
     echo CHtml::checkBoxList('genre_id', '', $data_genre);
     /*foreach($data_genre as $value=>$name)
       {
           echo CHtml::tag('checkbox', array('value'=>$value),iconv('utf-8','windows-1251',CHtml::encode($name)),true);
       }*/
 }
 public function actionGenreddlist()
 {
     $data_genre = Genre::model()->findAll('occ_id=:occ_id', array(':occ_id' => (int) $_POST['Tenders']['occupation']));
     if (!empty($data_genre)) {
         $data_genre = CHtml::listData($data_genre, 'id', 'name');
         echo CHtml::dropDownList('Tenders[genre]', '', $data_genre, array('class' => 'default__input'));
     } else {
         echo '';
     }
 }
Example #6
0
if (isset(Yii::app()->request->cookies['city'])) {
    $active = Yii::app()->request->cookies['city']->value;
} else {
    $active = '';
}
echo CHtml::dropDownList('city', $active, CHtml::listData(City::model()->findAll(), 'id', 'name'), array('id' => 'city', 'empty' => 'Укажите город'));
?>
          </div>
          <div class="search__hidden__float-container search__hidden__float-container--w236">
            <label for="name" class="search__hidden__input-label">Имя или название организации</label>
            <input type="text" name="name" class="search__hidden__input" placeholder="Альфа-компани" />
          </div>
          <div class="search__hidden__float-container search__hidden__float-container--w210">
            <label for="city" class="search__hidden__input-label">Жанр</label>
            <?php 
echo CHtml::dropDownList('genre', '', CHtml::listData(Genre::model()->findAllByAttributes(array('occ_id' => Yii::app()->getRequest()->getParam('id'))), 'id', 'name'), array('id' => 'genre', 'empty' => 'Жанр'));
?>
          </div>
          <div class="search__hidden__float-container search__hidden__float-container--w210">
            <label for="city" class="search__hidden__input-label">Статус участника</label>
            <?php 
echo CHtml::dropDownList('m_type', '', array('basic' => 'basic', 'plus' => 'plus', 'pro' => 'pro'), array('id' => 'm_type', 'empty' => 'Статус учасника'));
?>
          </div>
          <div class="search__hidden__float-container search__hidden__float-container--w210" style="width:150px;">
            <label for="calend" class="search__hidden__input-label">Дата</label>
            <?php 
echo CHtml::textField('calend', '', array('id' => 'search_date', 'placeholder' => 'Выберите дату', 'class' => 'search__hidden__input'));
?>
          </div>
          <div class="clfx"></div>
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Genre the loaded model
  * @throws CHttpException
  */
 public function loadModel($id, $ml = false)
 {
     if ($ml) {
         $model = Genre::model()->multilang()->findByPk((int) $id);
     } else {
         $model = Genre::model()->findByPk((int) $id);
     }
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Example #8
0
 public function getName($id)
 {
     return Genre::model()->findByPk($id)->name;
 }
 public function actionGenresublist()
 {
     $data_genre = Genre::model()->findAll('occ_id=:occ_id', array(':occ_id' => (int) $_POST['Tenders']['occupation']));
     if (!empty($data_genre)) {
         $data_genre = CHtml::listData($data_genre, 'id', 'name');
         echo CHtml::checkBoxList('Tenders[genre]', '', $data_genre);
     } else {
         echo '';
     }
 }