contact.php 1.33 KB
Newer Older
Qiang Xue committed
1 2
<?php
use yii\helpers\Html;
3
use yii\widgets\ActiveForm;
Qiang Xue committed
4
use yii\captcha\Captcha;
5

Qiang Xue committed
6
/**
Alexander Makarov committed
7
 * @var yii\web\View $this
Qiang Xue committed
8 9 10 11
 * @var yii\widgets\ActiveForm $form
 * @var app\models\ContactForm $model
 */
$this->title = 'Contact';
12
$this->params['breadcrumbs'][] = $this->title;
Qiang Xue committed
13
?>
Qiang Xue committed
14
<div class="site-contact">
Alexander Makarov committed
15
	<h1><?= Html::encode($this->title) ?></h1>
16

Qiang Xue committed
17 18 19 20 21
	<?php if (Yii::$app->session->hasFlash('contactFormSubmitted')): ?>

	<div class="alert alert-success">
		Thank you for contacting us. We will respond to you as soon as possible.
	</div>
Qiang Xue committed
22

Qiang Xue committed
23
	<?php else: ?>
24

Qiang Xue committed
25 26 27 28 29 30
	<p>
		If you have business inquiries or other questions, please fill out the following form to contact us. Thank you.
	</p>

	<div class="row">
		<div class="col-lg-5">
31
			<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
Alexander Makarov committed
32 33 34 35
				<?= $form->field($model, 'name') ?>
				<?= $form->field($model, 'email') ?>
				<?= $form->field($model, 'subject') ?>
				<?= $form->field($model, 'body')->textArea(['rows' => 6]) ?>
36
				<?= $form->field($model, 'verifyCode')->widget(Captcha::className(), [
Qiang Xue committed
37
					'template' => '<div class="row"><div class="col-lg-3">{image}</div><div class="col-lg-6">{input}</div></div>',
38
				]) ?>
Qiang Xue committed
39
				<div class="form-group">
Alexander Makarov committed
40
					<?= Html::submitButton('Submit', ['class' => 'btn btn-primary']) ?>
Qiang Xue committed
41 42 43
				</div>
			<?php ActiveForm::end(); ?>
		</div>
44
	</div>
Qiang Xue committed
45 46

	<?php endif; ?>
47
</div>