@extends('sales.layout.master')
@section('page_title', 'Subscription Form List')
@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="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>{{ session('error_msg') }}</p>
		</div>
	</div>
	@elseif(Session::get('success_msg'))
	<div class="grid8">
		<div class="nNote nSuccess">
			<p>{{ session('success_msg') }}</p>
		</div>
	</div>
	@endif
	<div class="widget grid2 widgetH"></div>
</div>

<div class="fluid">
	<fieldset>
		<div class="widget grid2 widgetH"></div>
		<div class="widget grid8">
			<div class="whead"><h6>Update Your Profile</h6></div>

			<div class="formRow" style="text-align: center !important">
				<form action="{{url('/sales/update-profile-picture')}}" class="main cussPayment" method="POST" enctype="multipart/form-data">
					<div class="grid12">
						<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
						<input type="hidden" name="id" value="{{ $user->_id }}">
						<img src="{{ url($user->StaffDetail->user_pic) }}" style="width:128px; height:128px"><br>
						<input type="file" name="prof_img" id="prof_img" required />
						<input type="submit" value="Update Profile Picture" class="buttonM bPurple" name="submit" id="submit"><br>
						<small style="color:red">** Your image picture must be size 128x128 **</small>
					</div>
				</form>
			</div>

			<div class="formRow">
				<form action="{{url('/sales/update-fullname')}}" class="main cussPayment" method="POST" enctype="multipart/form-data">
					<div class="grid2">&nbsp;</div>
					<div class="grid2"><label><b>Full Name : </b></label></div>
					<div class="grid6">
						<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
						<input type="hidden" name="id" value="{{ $user->_id }}">
						<input type="text" name="name" id="name" value="{{$user->StaffDetail->name}}" required />
					</div>
					<div class="grid2"><input type="submit" value="Update Name" class="buttonM bPurple formSubmit" name="submit" id="submit"></div>
				</form>
			</div>

			<div class="formRow">
				<form action="{{url('/sales/update-ic')}}" class="main cussPayment" method="POST" enctype="multipart/form-data">
					<div class="grid2">&nbsp;</div>
					<div class="grid2"><label><b>Identity/NRIC : </b></label></div>
					<div class="grid6">
						<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
						<input type="hidden" name="id" value="{{ $user->_id }}">
						<input type="text" name="ic" id="ic" value="{{$user->StaffDetail->ic}}" required />
					</div>
					<div class="grid2"><input type="submit" value="Update Identity" class="buttonM bPurple formSubmit" name="submit" id="submit"></div>
				</form>
			</div>

			<div class="formRow">
				<form class="main cussPayment">
					<div class="grid2">&nbsp;</div>
					<div class="grid2"><label><b>Email : </b></label></div>
					<div class="grid6">
						<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
						<input type="hidden" name="id" value="{{ $user->_id }}">
						<input type="email" name="email" id="email" value="{{$user->StaffDetail->email}}" disabled />
					</div>
					<div class="grid2">&nbsp;</div>
				</form>
			</div>

			<div class="formRow">
				<form action="{{url('/sales/update-phone')}}" class="main cussPayment" method="POST" enctype="multipart/form-data">
					<div class="grid2">&nbsp;</div>
					<div class="grid2"><label><b>Phone Number : </b></label></div>
					<div class="grid6">
						<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
						<input type="hidden" name="id" value="{{ $user->_id }}">
						<input type="text" name="phone" id="phone" value="{{$user->StaffDetail->phone}}" required />
					</div>
					<div class="grid2"><input type="submit" value="Update Phone" class="buttonM bPurple formSubmit" name="submit" id="submit"></div>
				</form>
			</div>

			<div class="formRow">
				<form action="{{url('/sales/update-password')}}" class="main cussPayment" method="POST" enctype="multipart/form-data">
					<div class="grid2">&nbsp;</div>
					<div class="grid2"><label><b>Password : </b></label></div>
					<div class="grid6">
						<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
						<input type="hidden" name="id" value="{{ $user->_id }}">
						<input type="text" name="password" id="password" value="" required /><br>
						<small style="color:red">** Your new password must at least 8 characters **</small>
					</div>
					<div class="grid2"><input type="submit" value="Create Password" class="buttonM bPurple formSubmit" name="submit" id="submit"></div>
				</form>
			</div>
		</div>
		<div class="widget grid2 widgetH"></div>
	</fieldset>
</div>
@endsection
@section('external_js')
@endsection