diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index 8b5f017..c00f7e4 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -15,6 +15,7 @@ class AppAsset extends AssetBundle 'css/site.css', ]; public $js = [ + 'js/site.js' ]; public $depends = [ 'yii\web\YiiAsset', diff --git a/frontend/modules/access/views/access/_form.php b/frontend/modules/access/views/access/_form.php index 4b979f7..75c1128 100644 --- a/frontend/modules/access/views/access/_form.php +++ b/frontend/modules/access/views/access/_form.php @@ -16,7 +16,7 @@ use yii\widgets\ActiveForm; = $form->field($model, 'login')->textInput(['maxlength' => true]) ?> - = $form->field($model, 'password')->passwordInput(['maxlength' => true]) ?> + = $form->field($model, 'password')->textInput(['maxlength' => true]) ?> = $form->field($model, 'link')->textInput(['maxlength' => true]) ?> diff --git a/frontend/modules/card/controllers/UserCardController.php b/frontend/modules/card/controllers/UserCardController.php index 86bf120..3a81c7e 100755 --- a/frontend/modules/card/controllers/UserCardController.php +++ b/frontend/modules/card/controllers/UserCardController.php @@ -3,8 +3,10 @@ namespace frontend\modules\card\controllers; +use common\classes\Debug; use common\models\CardSkill; use common\models\FieldsValueNew; +use common\models\User; use Yii; use frontend\modules\card\models\UserCard; use yii\data\ActiveDataProvider; @@ -57,7 +59,6 @@ class UserCardController extends Controller ]); $skills = CardSkill::find()->where(['card_id' => $id])->with('skill')->all(); - return $this->render('view', [ 'model' => $this->findModel($id), 'modelFildValue' => $dataProvider, @@ -86,6 +87,28 @@ class UserCardController extends Controller ]); } + public function actionPassword($id) + { + $user_card = UserCard::findOne($id); + $model = User::findOne(['id' => $user_card->id_user]); + + return $this->render('password', [ + 'model' => $model, + ]); + } + + public function actionAjax() { + if(Yii::$app->request->isAjax) { + $id = $_POST['id']; + $password = $_POST['password']; + + $user_card = UserCard::findOne($id); + $user = User::findOne(['id' => $user_card->id_user]); + $user->password = $password; + $user->save(); + } + } + /** * Finds the Product model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. diff --git a/frontend/modules/card/views/user-card/_form.php b/frontend/modules/card/views/user-card/_form.php index eeefc53..e510d86 100755 --- a/frontend/modules/card/views/user-card/_form.php +++ b/frontend/modules/card/views/user-card/_form.php @@ -17,10 +17,6 @@ use yii\helpers\ArrayHelper; = $form->field($model, 'fio')->textInput(['maxlength' => true]) ?> - = $form->field($model, 'email')->textInput(['maxlength' => true]) ?> - - = $form->field($model, 'gender')->dropDownList($model->genders, ['prompt' => 'Выберите']) ?> - = $form->field($model, 'dob')->input( 'date', [ @@ -30,7 +26,6 @@ use yii\helpers\ArrayHelper; ] ) ?> -