<?php

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model \common\models\LoginForm */

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

$this->title = 'Add Consumer';
$this->params['breadcrumbs'][] = $this->title;
?>
<style>
    .help-block-error{
        color:red;
    }
</style>

<main class="content-sec">
    <div class="container-xl">
    <div class="row">
        <div class="col-12">
        <div class="lucky-wrapper">
            <div class="lucky-cover">
            <div class="login-form-cover">
                <div class="login-form-hd">
                <h1>Add Consumer</h1>
                <a href="<?=Yii::$app->urlManager->createUrl(['site/logout'])?>" class="pull-right">Logout</a>
                </div>
                <div class="login-form">
                <?php if(Yii::$app->session->getFlash('success')!=null){?>
                    <div class="alert alert-success" role="alert">
                     Application has been submitted. Reference No is - <?= Yii::$app->session->getFlash('success'); ?>
                    </div>
                   
                 <?php } ?>
                <?php $form = ActiveForm::begin(['id' => 'consumer-form',  'options' => ['enctype' => 'multipart/form-data']])?>
                <?= $form->field($model, 'consumer_name')->textInput(['placeholder' => 'Consumer Name'])->label(false) ?>
                <?= $form->field($model, 'civil_id')->textInput(['placeholder' => 'Civil ID'])->label(false) ?>
                <?= $form->field($model, 'mobile')->textInput(['placeholder' => 'Mobile'])->label(false) ?>
                <?= $form->field($model, 'email')->textInput(['placeholder' => 'Email'])->label(false) ?>
                <?= $form->field($model, 'invoice_number')->textInput(['placeholder' => 'Invoice Number'])->label(false) ?>
                <?
                $urlmanager=Yii::$app->urlManager->baseUrl;
               echo  $form->field($model, 'invoice', [
    'template' => " <div class='upload-invoice'>{input}  <span class='input-btn'><img src='".$urlmanager."/files/images/upload-icon.png' alt='upload'> Upload Invoice Image </span> {error}
                      </div>"])->fileInput(['accept'=>'image/*;capture=camera'])
                
               
                ?>
                
              
              
                <button class="btn btn-login">
                    <span class="btn-label">Submit</span>
                </button>
                <?php ActiveForm::end(); ?>

                </div>
            </div>
            </div>
        </div>
        </div>
    </div>
    </div>
</main>
