@extends('customer-service.layout.master')
@section('ptitle','Customer Service')
@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')
<div class="wrapper">	
	<div class="fluid">
		<div class="widget grid2 widgetH"></div>
		@if(count($errors) > 0)
		<div class="grid8">
			<div class="nNote nFailure">
				@foreach($errors->all() as $error)
				<p>{{$error}}</p>
				@endforeach
			</div>
		</div>
		@endif

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

	<div class="fluid">
		<form action="{{ url('/customer-service/team/add-contractor') }}" class="main cussPayment" method="POST" enctype="multipart/form-data">
			<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
			<fieldset>
				<div class="widget grid2 widgetH"></div>
				<div class="widget grid8">
					<div class="whead"><h6>Contractor's Detail</h6></div>

					<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="" 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="" required /></div>
						<div class="grid2">&nbsp;</div>
					</div>

					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid4">
							<label><b>Email : </b></label> 
							<input type="email" name="email" id="email" value="" required />
						</div>
						<div class="grid4">
							<label><b>Phone No. : </b></label>
							<input type="text" name="phone" id="phone" required  value=""/>
							<small style="color: red"></small>
						</div>
						<div class="grid2">&nbsp;</div>
					</div>

					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Company / Vendor : </b></label></div>
						<div class="grid6">
							<select class="styled" id="vendor" name="vendor" required>
								<option value=''>Please Select Company</option>
								@foreach($company as $c)
								<option value='{{ $c->_id }}'>{{ $c->name }}</option>
								@endforeach
							</select>
						</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="text" name="password" id="password" required /><small style="color: red"></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="text" name="password_confirmation" id="password_confirmation" required /><small style="color: red"></small></div>
						<div class="grid2">&nbsp;</div>
					</div>
						
						<div class="formRow noBorderB" id="sendForm"><input type="submit" value="Add New Contractor" class="buttonM bPurple formSubmit" name="submit" id="submit"></div>
				</div>
				<div class="widget grid2 widgetH"></div>
			</fieldset>
		</form>
	</div>
</div>
@endsection

@section('external_js')
@endsection