<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model backend\models\Complaintsbe */
/* @var $form yii\widgets\ActiveForm */
$complainttype = ['driving' => 'Driving', 'behavior' => 'Behavior'];
$complaintsstatus = ['Recieved' => 'Recieved', 'Investigation Started' => 'Investigation Started', 'Awaiting Response' => 'Awaiting Respose', 'Complete' => 'Complete'];
?>

<div class="complaintsbe-form">
		<div class="card card-default">
			<div class="card-header">Create Complaint</div>
			<div class="card-body">
			<?php $form = ActiveForm::begin(); ?>
				<div class="row">
					<div class='col-12 col-lg-2'>Employee</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'employee')->dropdownlist($employees, ['prompt' => 'Please Select'])->label(false) ?></div>
					<div class='col-12 col-lg-2'>Vehicle</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'vehicle')->dropdownlist($vehicles, ['prompt' => 'Please Select'])->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-12 col-lg-2'>Date Recieved</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'datereceived')->widget(\kartik\date\DatePicker::class, ['pluginOptions' => ['showMeridian' =>true, 'convertFormat' => true, 'format' => 'dd/mm/yyyy']])->label(false) ?></div>
					<div class='col-12 col-lg-2'>Job No</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'jobno')->textInput()->label(false) ?></div>
					<div class='col-12 col-lg-2'>Complaint Type</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'type')->dropdownlist($complainttype, ['prompt' => 'Please Select'])->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-12 col-lg-2'>Complainant Name*</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'comname')->textInput()->label(false) ?></div>
					<div class='col-12 col-lg-2'>Complainant Phone*</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'comphone')->textInput()->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-12 col-lg-2'>Complainant Address*</div>
					<div class='col-12 col-lg-10'><?= $form->field($model, 'comaddress')->textArea()->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-12 col-lg-2'>Overview</div>
					<div class='col-12 col-lg-10'><?= $form->field($model, 'overview')->textArea()->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-10 col-lg-4'>Step 1: Complaint Acknowledged</div>
					<div class='col-2 col-lg-2'><?= $form->field($model, 'step1')->checkbox(['label' => False])->label(false) ?></div>
					<div class="col-12 col-lg-2">Date</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'step1date')->widget(\kartik\date\DatePicker::class, ['pluginOptions' => ['showMeridian' =>true, 'convertFormat' => true, 'format' => 'dd/mm/yyyy']])->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-10 col-lg-4'>Step 2</div>
					<div class='col-2 col-lg-2'><?= $form->field($model, 'step2')->checkbox(['label' => False])->label(false) ?></div>
					<div class="col-12 col-lg-2">Date</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'step2date')->checkbox(['label' => False])->widget(\kartik\date\DatePicker::class, ['pluginOptions' => ['showMeridian' =>true, 'convertFormat' => true, 'format' => 'dd/mm/yyyy']])->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-10 col-lg-4'>Step 3</div>
					<div class='col-2 col-lg-2'><?= $form->field($model, 'step3')->checkbox(['label' => False])->label(false) ?></div>
					<div class="col-12 col-lg-2">Date</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'step3date')->widget(\kartik\date\DatePicker::class, ['pluginOptions' => ['showMeridian' =>true, 'convertFormat' => true, 'format' => 'dd/mm/yyyy']])->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-10 col-lg-4'>Step 4</div>
					<div class='col-2 col-lg-2'><?= $form->field($model, 'step4')->checkbox(['label' => False])->label(false) ?></div>
					<div class="col-12 col-lg-2">Date</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'step4date')->widget(\kartik\date\DatePicker::class, ['pluginOptions' => ['showMeridian' =>true, 'convertFormat' => true, 'format' => 'dd/mm/yyyy']])->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-10 col-lg-4'>Step 5</div>
					<div class='col-2 col-lg-2'><?= $form->field($model, 'step5')->checkbox(['label' => False])->label(false) ?></div>
					<div class="col-12 col-lg-2">Date</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'step5date')->widget(\kartik\date\DatePicker::class, ['pluginOptions' => ['showMeridian' =>true, 'convertFormat' => true, 'format' => 'dd/mm/yyyy']])->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-10 col-lg-4'>Step 6</div>
					<div class='col-2 col-lg-2'><?= $form->field($model, 'step6')->checkbox(['label' => False])->label(false) ?></div>
					<div class="col-12 col-lg-2">Date</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'step6date')->widget(\kartik\date\DatePicker::class, ['pluginOptions' => ['showMeridian' =>true, 'convertFormat' => true, 'format' => 'dd/mm/yyyy']])->label(false) ?></div>
				</div>
				<div class="row">
					<div class='col-12 col-lg-2'>Status</div>
					<div class='col-12 col-lg-4'><?= $form->field($model, 'status')->dropdownlist($complaintsstatus, ['prompt' => 'Please Select'])->label(false) ?></div>
				</div>
				<?= $this->render('//uploads/dbupload', ['relatedid' => isset($model->id) ? $model->id : Yii::$app->session->get('comptempid'),'relatedto' => 'complaint']); ?>

				<div class="form-group mt-2">
					<?= Html::submitButton('Save', ['class' => 'btn btn-primary']) ?>
				</div>
			</div>
		</div>
	<?php ActiveForm::end(); ?>
</div>
