@extends('customer-service.layout.master')
@section('ptitle','Customer Service')
@section('page_title', 'Customers & Subscribers')
@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>
		<div class="grid8" id="updateS">
		@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>{{ session()->get('error_msg') }}/p>
		</div>
		@elseif(Session::get('success_msg'))
		<div class="nNote nSuccess">
			<p>{{ session()->get('success_msg') }}</p>
		</div>
		@endif
		</div>
		<div class="widget grid2 widgetH"></div>
	</div>
	
	<!-- Work Order Details -->
	<div class="fluid">
			
		<!-- Customer Details -->
		@if($form->Form->type_application == 'R')
			<form action="{{ url('/customer-service/update-customer-detail') }}" class="main cussPayment" method="POST" enctype="multipart/form-data" id="updateFormR" name="updateFormR">
				<input type="hidden" name="subscriber_id" id="subscriber_id" value="{{ $form->subscriber_id }}" required/>
				<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>Customer's Details</h6></div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid2"><label><b>Type Application : </b></label></div>
							<div class="grid6"><input type="text" name="app" id="app" value="{{ $form->Form->type_service }}" readonly required /></div>
							<div class="grid2">&nbsp;</div>
						</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="name" id="name" value="{{ $form->name }}" 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">
								@if($form->ic == "<b>Package Development</b>")
									<input type="text" name="ic" id="ic"  value="{{ $form->ic }}" readonly />
								@else
									<input type="text" name="ic" id="ic"  value="{{ $form->ic }}" required />
								@endif
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid3">&nbsp;</div>
							<div class="grid2">
								<label><b>Citizen : </b></label>
								<input type="text" name="citizen" id="citizen"  value="{{ $form->citizen }}" readonly required />
							</div>
							<div class="grid2">
								<label><b>Gender : </b></label>
								<input type="text" name="gender" id="gender"  value="{{ $form->gender }}" readonly required />
							</div>
							<div class="grid2">
								<label><b>Race : </b></label>
								<input type="text" name="race" id="race"  value="{{ $form->race }}" readonly required />
							</div>
							<div class="grid3">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid2"><label><b>Email : </b></label></div>
							<div class="grid6">
								@if($form->email == "<b>Package Development</b>")
									<input type="text" name="email" id="email" value="{{ $form->email }}" readonly />
								@else
									<input type="email" name="email" id="email" value="{{ $form->email }}" required />
								@endif
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid4">
								<label><b>Primary Number : </b></label>
								<input type="text" name="phone1" id="phone1" value="{{ $form->phone1 }}" required />
							</div>
							<div class="grid4">
								<label><b>Secondary Number: </b></label>
								<input type="text" name="phone2" id="phone2"  value="{{ $form->phone2 }}"/>
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid2"><label><b>Building : </b></label></div>
							<div class="grid6">
								<select class="styled" name="building" id="building" required>
									@foreach($coverage as $c)
										@if($c->building_name == $form->building_name)
											<option value='{{ $c->building_name }}' selected>{{ $c->building_name }}</option>
										@else
											<option value='{{ $c->building_name }}'>{{ $c->building_name }}</option>
										@endif
									@endforeach
								</select>
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid4">
								<label><b>Unit No : </b></label>
								<input type="text" name="unit_no" id="unit_no" value="{{ $form->unit_no }}" required />
							</div>
							<div class="grid4">
								<label><b>Street : </b></label>
								<input type="text" name="street" id="street" value="{{ $form->street }}" />
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid8">
								<span class="grid4">
									<label><b>City : </b></label>
									<input type="text" name="city" id="city" value="{{ $form->city }}" readonly required />
								</span>
								<span class="grid4">
									<label><b>Postcode : </b></label>
									<input type="text" name="postcode" id="postcode" value="{{ $form->postcode }}" readonly required />
								</span>
								<span class="grid4">
									<label><b>State : </b></label>
									<input type="text" name="state" id="state" value="{{ $form->state }}" readonly required />
								</span>
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow noBorderB">
							<div class="grid12">
								<input type="submit" name="updateFR" id="updateFR" class="buttonM bBlue formSubmit" value="Update Customer's Details">
							</div>
						</div>
					
					</div>
					<div class="widget grid2 widgetH"></div>
				</fieldset>
			</form>
		@elseif($form->Form->type_application == 'B')
			<form action="{{ url('/customer-service/update-customer-detail') }}" class="main cussPayment" method="POST" enctype="multipart/form-data" id="updateFormB" name="updateFormB">
				<input type="hidden" name="subscriber_id" id="subscriber_id" value="{{ $form->subscriber_id }}" required/>
				<input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">

				<!-- Company Details-->
				<fieldset>
					<div class="widget grid2 widgetH"></div>
					<div class="widget grid8">
						<div class="whead"><h6>Company's Details</h6></div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid2"><label><b>Type Application : </b></label></div>
							<div class="grid6"><input type="text" name="app" id="app" value="{{ $form->Form->type_service }}" readonly required /></div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid8">
								<span class="grid4">
									<label><b>Company Reg. No. : </b></label>
									<input type="text" name="company_reg" id="company_reg" value="{{ $form->company_reg }}" required />
								</span>
								<span class="grid4">
									<label><b>Company Contact No. : </b></label>
									<input type="text" name="company_num" id="company_num" value="{{ $form->company_num }}" required />
								</span>
								<span class="grid4">
									<label><b>Company Fax No.: </b></label>
									<input type="text" name="company_fax" id="company_fax" value="{{ $form->company_fax }}" />
								</span>
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<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="company_name" id="company_name" value="{{ $form->company_name }}" required /></div>
							<div class="grid2">&nbsp;</div>
						</div>

						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid2"><label><b>Unit No : </b></label></div>
							<div class="grid6">
								<input type="text" name="unit_no" id="unit_no" value="{{ $form->unit_no }}" 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>{{ $form->street }}</textarea></div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid8">
								<span class="grid4">
									<label><b>City : </b></label>
									<input type="text" name="city" id="city" value="{{ $form->city }}" required />
								</span>
								<span class="grid4">
									<label><b>Postcode : </b></label>
									<input type="text" name="postcode" id="postcode" value="{{ $form->postcode }}" required />
								</span>
								<span class="grid4">
									<label><b>State : </b></label>
									<input type="text" name="state" id="state" value="{{ $form->state }}" required />
								</span>
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
					</div>
					<div class="widget grid2 widgetH"></div>
				</fieldset>
				
				<!-- Customer Details-->
				<fieldset>
					<div class="widget grid2 widgetH"></div>
					<div class="widget grid8">
						<div class="whead"><h6>Technical Contact Person</h6></div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid2"><label><b>Name : </b></label></div>
							<div class="grid6"><input type="text" name="name" id="name"  value="{{ $form->name }}" 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="{{ $form->ic }}" required /></div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid2"><label><b>Designation : </b></label></div>
							<div class="grid6"><input type="text" name="designation" id="designation" value="{{ $form->designation }}" 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="{{ $form->email }}" required /></div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow">
							<div class="grid2">&nbsp;</div>
							<div class="grid4">
								<label><b>Primary Number : </b></label>
								<input type="text" name="phone1" id="phone1" value="{{ $form->phone1 }}" required />
							</div>
							<div class="grid4">
								<label><b>Secondary Number: </b></label>
								<input type="text" name="phone2" id="phone2"  value="{{ $form->phone2 }}"/>
							</div>
							<div class="grid2">&nbsp;</div>
						</div>
						
						<div class="formRow noBorderB">
							<div class="grid12">
								<input type="submit" name="updateFB" id="updateFB" class="buttonM bBlue formSubmit" value="Update Customer's Details">
							</div>
						</div>
					
					</div>
					<div class="widget grid2 widgetH"></div>
				</fieldset>
			</form>
		@endif
	</div>
@endsection

@section('external_js')
@endsection