@extends('market.layout.master')
@section('ptitle', 'Marketing')
@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 )

<?php
Use App\Model\CompanyLaravel;
?>

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

	<div class="fluid">
		@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 dealer successful</p>
		</div>
		@endif
	</div>

	<div class="fluid">
		@foreach($company as $a)
		<form action="{{ url('/marketing/dealer/update-company') }}" class="main cussPayment" method="POST" enctype="multipart/form-data">
			<fieldset>
				<div class="widget grid2 widgetH"></div>
				<div class="widget grid8">
					<div class="whead"><h6>Edit Vendor's Detail</h6></div>

					<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
					<input type="hidden" name="company_id" value="{{$a->_id}}">;
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Company Name : </b></label></div>
						<div class="grid6"><input type="text" name="aname" id="cname" value="{{$a->name}}" required /></div>	
						<div class="grid2">&nbsp;</div>
                    </div>
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Address : </b></label></div>
                        <div class="grid6"><textarea rows="3" cols="" name="address" id="address" class="auto" style="overflow: hidden; word-wrap: break-word; resize: horizontal; height: 70px;" required>{{$a->address}}</textarea></div>
						<div class="grid2">&nbsp;</div>
                    </div>
					
                    <div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>Postcode : </b></label></div>
                        <div class="grid6"><input type="text" name="postcode" id="postcode" value="{{$a->postcode}}" required /></div>
						<div class="grid2">&nbsp;</div>
                    </div>

					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>City : </b></label></div>
                        <div class="grid6"><input type="text" name="city" id="city" value="{{$a->city}}" required /></div>
						<div class="grid2">&nbsp;</div>
                    </div>				
					
					<div class="formRow">
						<div class="grid2">&nbsp;</div>
						<div class="grid2"><label><b>State : </b></label></div>
                        <div class="grid6"><input type="text" name="state" id="state" value="{{$a->state}}" required /></div>
						<div class="grid2">&nbsp;</div>
                    </div>
					
					<div class="formRow noBorderB" id="sendForm"><input type="submit" value="Update Detail" class="buttonM bPurple formSubmit" name="submit" id="submit"></div>
				</div>
				<div class="widget grid2 widgetH"></div>
			</fieldset>
		</form>
		@endforeach
	</div>
@endsection

@section('external_js')
@endsection