public function save_age_date() { $user = User::findIdentity(Yii::$app->user->id); if ($user->age_date != $this->age_date) { $user->age_date = $this->age_date; if ($user->save()) { return Functions::get_is_age_from_date($this->age_date); } } return false; }
<?php echo Html::decode($model->email); ?> </div> <div class="row profile-info-rows profile-info-rows"> <div class="age-line"> <?php echo DatePicker::widget(['name' => 'check_issue_date', 'options' => ['placeholder' => 'Select age date ...', 'readonly' => true, 'data-date-end-date' => '0d', 'class' => 'age-date', 'id' => 'age-date'], 'type' => DatePicker::TYPE_INPUT, 'value' => $model->age_date, 'pluginOptions' => ['format' => 'dd-mm-yyyy', 'autoclose' => true, 'todayHighlight' => true]]); ?> </div> <span class="glyphicon glyphicon-refresh inline-button" title="Update for age date" alt="Update age" onclick="change_age();"></span> </div> <div class="row profile-info-rows profile-info-rows profile-info-rows"> <span id="count-age"><?php echo Functions::get_is_age_from_date($model->age_date); ?> </span> </div> <div class="row profile-info-rows profile-info-rows profile-info-rows"> <?php echo Functions::get_date_time($model->created_at); ?> </div> <div class="row profile-info-rows profile-info-rows profile-info-rows profile-info-rows"> <?php echo Functions::get_date_time($model->updated_at); ?> </div> <div class="row profile-info-rows profile-info-rows profile-info-rows profile-info-rows profile-info-rows"> <?php