コード例 #1
0
ファイル: _form.php プロジェクト: CDIO3/biosafe
/* @var $form yii\widgets\ActiveForm */
?>

<div class="nos-form">

    <?php 
$form = ActiveForm::begin(['id' => 'dynamic-form']);
?>
     
      <?php 
echo $form->field($model, 'naytteenottopvm')->widget(DatePicker::className(), ['name' => 'deadline', 'type' => DatePicker::TYPE_COMPONENT_APPEND, 'removeButton' => ['title' => 'Tyhjennä'], 'pickerButton' => ['title' => 'Valitse päivä'], 'value' => date('yyyy-mm-dd'), 'options' => ['placeholder' => 'Valitse'], 'language' => 'fi', 'pluginOptions' => ['format' => 'yyyy-mm-dd', 'todayHighlight' => true, 'startDate' => 'today', 'todayBtn' => true, 'multidate' => true]]);
?>
  
     
    <?php 
echo $form->field($model, 'tuote_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Tuote::find()->all(), 'id', 'nimi'), 'language' => 'fi', 'options' => ['placeholder' => 'Valitse'], 'pluginOptions' => ['allowClear' => true]]);
?>

    



    <div class="row" style="width:80% display:table" >

     <div class="panel panel-default">
        <div class="panel-heading" style="width:80%" ><h4><i class="glyphicon glyphicon-option-vertical"></i> Analysoitavat bakteerit</h4></div>
        <div class="panel-body">
             <?php 
DynamicFormWidget::begin(['widgetContainer' => 'dynamicform_wrapper', 'widgetBody' => '.container-items', 'widgetItem' => '.item', 'limit' => 4, 'min' => 1, 'insertButton' => '.add-item', 'deleteButton' => '.remove-item', 'model' => $modelsBakteeri[0], 'formId' => 'dynamic-form', 'formFields' => ['nimi', 'm_oletusarvo1', 'M_oletusarvo2', 'Osanaytteita_n', 'Osanaytteidenmaara_c']]);
?>
コード例 #2
0
ファイル: TuoteController.php プロジェクト: CDIO3/biosafe
 /**
  * Finds the Tuote model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Tuote the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Tuote::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #3
0
ファイル: Yritys.php プロジェクト: CDIO3/biosafe
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTuotes()
 {
     return $this->hasMany(Tuote::className(), ['yritys_id' => 'id']);
 }
コード例 #4
0
ファイル: Nos.php プロジェクト: CDIO3/biosafe
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getTuote()
 {
     return $this->hasOne(Tuote::className(), ['id' => 'tuote_id']);
 }