<?php

use app\base\Common;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\select2\Select2;

/* @var $this yii\web\View */
/* @var $model app\models\Mobilenumbers */
/* @var $form yii\widgets\ActiveForm */

$PIDs = Common::getAttendancePIDs();
?>

<div class="mobilenumbers-form">
	<div class="panel panel-default">
		<div class="panel-heading">
			
		</div>
		<div class="panel-body">
			<div class="row">
				<div class="col-lg-12">
					<?php
						$form = ActiveForm::begin(['enableAjaxValidation' => true, 'options' => ['class' => 'form-horizontal']]);
						$template = [
							'labelOptions' => ['class' => 'form-label'],
							'template' => '<div class="col-sm-5">{label}{hint}</div><div class="col-sm-4">{input}{error}</div>',
						];
						$htemplate = [
							'options' => ['tag' => false],
							'template' => '{input}'
						];
					?>
					<?php // echo $form->errorSummary($model); ?>
					<?php if($model->isNewRecord): ?>
						<?= $form->field($model, 'mobile_part_id', $template)->widget(Select2::classname(), ['data' => $PIDs, 'options' => ['prompt' => $model->getAttributeLabel("mobile_part_id")]])->hint("<strong>Please Bar Code Scan the ICC Client ID</strong>"); ?>
					<?php else: ?>
						<?= $form->field($model, 'mobile_part_id', $template)->textInput(['maxlength' => true]) ?>
					<?php endif; ?>
					<?= $form->field($model, 'mobile_q1', $template)->textInput(['maxlength' => true])->hint("<strong>Kindly check with the Client If there is change in Contact Details too. If so Update the Contact Details Accordingly</strong>"); ?>
					<div class="form-group">
						<div class="col-sm-offset-5 col-sm-7">
							<?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
							<?= Html::a('Cancel', ['/'.Yii::$app->controller->id], ['class' => 'btn btn-default']) ?>
						</div>
					</div>
					<?php ActiveForm::end(); ?>
				</div>
				<!-- /.col-lg-6 (nested) -->
			</div>
			<!-- /.row (nested) -->
		</div>
		<!-- /.panel-body -->
	</div>
	<!-- /.panel -->
</div>