@extends('dealer.layout.master')
@section('page_title', 'Dashboard')
@section('subpage', 'Graph & Summary Report')
@section('img_profile', asset($user->StaffDetail->user_pic))
@section('login_name', $user->StaffDetail->name )
@section('last_login', $user->last_login_at )

@section('content')
	<style type="text/css">
		.i_note {color: red;}
	</style>

	<div class="fluid">
		<div class="widget grid2 widgetH"></div>
		<div class="grid8">
		@if(count($errors) > 0)
		<div class="nNote nFailure">
			@foreach($errors->all() as $error)
			<p>{{$error}}</p>
			@endforeach
		</div>
		@endif

		@if(Session::get('error_msg'))
		<div class="nNote nFailure">
			<p>Email or Password is invalid</p>
		</div>
		@elseif(Session::get('success_msg'))
		<div class="nNote nSuccess">
			<p>Add new Agent successful</p>
		</div>
		@endif
		</div>
		<div class="widget grid2 widgetH"></div>
	</div>

	<div class="fluid">
		<form action="{{ url('/dealer/add-agent') }}" class="main cussPayment" method="POST" enctype="multipart/form-data">
			<fieldset>
				<div class="widget grid2 widgetH"></div>
				<div class="widget grid8">
					<div class="whead"><h6>Agent Details</h6></div>

					<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
					<input type="hidden" name="company_id" value="{{ $user->StaffDetail->company_id }}">
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Full Name : </b></label></div>
                        <div class="grid6"><input type="text" name="aname" id="aname" value="{{old('aname')}}" required /></div>
						<div class="grid2">&nbsp;</div>
                    </div>
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>NRIC : </b></label></div>
                        <div class="grid6"><input type="text" name="ic" id="ic"  value="{{ old('ic')}}" required /></div>
						<div class="grid2">&nbsp;</div>
                    </div>
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Email : </b></label></div>
                        <div class="grid6"><input type="email" name="email" id="email" value="{{ old('email')}}" required /></div>
						<div class="grid2">&nbsp;</div>
                    </div>
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Phone No. : </b></label></div>
                        <div class="grid6"><input type="text" name="phone" id="phone" required  value="{{ old('phone')}}"/></div>
						<div class="grid2">&nbsp;</div>
                    </div>
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Password : </b></label></div>
                        <div class="grid6">
                        	<input type="password" name="password" id="password" pattern=".{0}|.{8,}" required />
                        	<small class="i_note">** Please enter at least 8 characters **</small></div>
						<div class="grid2">&nbsp;</div>
                    </div>
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Re-Password : </b></label></div>
                        <div class="grid6">
                        	<input type="password" name="password_confirmation" id="password_confirmation" pattern=".{0}|.{8,}" required/>
                        	<small class="i_note">** Please enter at least 8 characters & match with password above **</small>
                        </div>
						<div class="grid2">&nbsp;</div>
                    </div>
					
					<div class="formRow noBorderB" id="sendForm"><input type="submit" value="Submit" class="buttonM bGreen formSubmit" name="submit" id="submit"></div>
				</div>
				<div class="widget grid2 widgetH"></div>
			</fieldset>
		</form>
	</div>
@endsection

@section('external_js')
@endsection