<?php
return [
'adminEmail' => 'unitedaiminfo@mail.ru',
'supportEmail' => 'support@example.com',
'user.passwordResetTokenExpire' => 3600,
];
public function actionContact()
{
$model = new ContactForm();
if ($model->load(Yii::$app->request->post()) && $model->validate()) {
if ($model->save()) {
$model->sendEmail(Yii::$app->params['adminEmail']);
Yii::$app->session->setFlash('success', 'Спасибо, мы получили ваше сообщение.');
} else {
Yii::$app->session->setFlash('error', 'Ошибка... Попробуйте позже.');
}
return $this->refresh();
} else {
return $this->render('contact', [
'model' => $model,
]);
}
}
return $priority ?? 3;
<?php
return [
'adminEmail' => 'admin@example.com',
'supportEmail' => 'support@example.com',
'user.passwordResetTokenExpire' => 3600,
];
'mailer' => [
'class' => 'yii\swiftmailer\Mailer',
'viewPath' => '@common/mail',
// send all mails to a file by default. You have to set
// 'useFileTransport' to false and configure a transport
// for the mailer to send real emails.
'useFileTransport' => false,
'transport' => [
'class' => 'Swift_SmtpTransport',
'host' => 'smtp.mail.ru',
'username' => 'unitedaiminfo@mail.ru',
'password' => '********',
'port' => '465',
'encryption' => 'ssl',
],
],
public function actionCreate()
{
$model = new Clients();
if ($model->load(Yii::$app->request->post())) {
if ($model->save()) {
$model->passport = UploadedFile::getInstance($model, 'passport');
if ($model->passport) {
$model->passport = Yii::getAlias('@web') . 'img/store/' . $model->id_cart . "/" . $model->passport->baseName . '.' . $model->passport->extension;
$model->save();
$model->upload();
return true;
}
Yii::$app->session->setFlash('success', 'Спасибо, мы получили вашу анкету. В скором времени мы с вами свяжемся.');
} else {
Yii::$app->session->setFlash('error', 'Ошибка... Попробуйте еще раз...');
}
return $this->refresh();
}
return $this->render('create', [
'model' => $model,
]);
}
public function upload()
{
if ($this->validate()) {
$path = 'img/store/' . $this->id_cart;
FileHelper::createDirectory($path);
$this->passport->saveAs();
return true;
} else {
return false;
}
}
Array
(
[_csrf-frontend] => 5OskZrmjY_nYww1ydNtOi0wMGgOC0UcgKfYtiMK_WoSAtF0r_9AxlZ-2WTMVg2PKCThwdMGrIRZ4uFrQ-vob0w==
[Clients] => Array
(
[country] => 0
[name] => фывфвыа
[surname] => пропро
[middle_name] => аывапвып
[address] => паорпо
[residence] => фпывап
[family] => 2
[children] => 5
[education] => 2
[place_of_study] => ывафыа
[graduation] => 2019-04-17
[place_of_work] => фыафыа
[profession] => впвп
[skills] => фыааы
[last_place_of_work] => впывф
[creminal_record] => фывафыа
[eng] => 2
[rus] => 0
[uzb] => 0
[kr] => 0
[nem] => 0
[jap] => 0
[ch] => 0
[toj] => 0
[kirg] => 0
[phone] => 5549684865
[email] => assaf@mail.ru
[passport] =>
[id_cart] => 7221328889
)
)
<form action="clients/index" method="get">
<div class="heading h2 left m-b-little">
<h2 class="heading_title">
Проверить статус вашей анкеты
<br>
</h2>
</div>
<div class="row input-group-row">
<div class="col-lg-5 col-md-6 col-sm-12 col-12">
<label>
ID вашей анкеты:
</label></div>
<div class="col-lg-7 col-md-6 col-sm-12 col-12">
<div class="input-wrap">
<span class="wpcf7-form-control-wrap speciality">
<!-- --><?//= $form->field($model, 'id_cart') ?>
<input type="text" name="id_cart">
</span>
</div>
<p></p></div>
</div>
</form>