@include('shared._message_all')
{{ Form::label_title("General Business Info") }}
{{ Form::row_label_inline('Org', $fuse_org_data->x_org, null, 3, 9, \App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}
{{ Form::row_label_inline('Org ID', $fuse_org_data->id, null, 3, 9, \App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}
{{ Form::row_select_inline('business_package', 'Business Package', $business->business_package, \App\Models\Business_Package_Recurly_Map::business_package_select(), 3, 6,\App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}
{{-- // DISABLED PIPEDRIVE 4/20/20 --}}
{{-- {{ Form::row_text_inline('pipedrive_id', 'Pipedrive ID', $business->pipedrive_id, 3, 6,\App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}--}}
{{ Form::row_text_inline('deal_id', 'Deal ID', $business->deal_id, 3, 6,\App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}
{{ Form::row_select_inline('phase', 'Phase', $business->phase, \App\Models\Business::$business_phase_map, 3, 6, \App\Helpers\FormComponentHelper::SIZE_MEDIUM, null, 'Select') }}
{{ Form::row_text_inline('company', 'Business Name', $business->company, 3, 6,\App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}
{{ Form::row_text_inline("", 'Main Business Phone 1', $main_location->phone_1, 3, 6, \App\Helpers\FormComponentHelper::SIZE_MEDIUM, true) }}
{{ Form::row_text_inline("", 'Main Business Phone 2', $main_location->phone_2, 3, 6, \App\Helpers\FormComponentHelper::SIZE_MEDIUM, true) }}
{{ Form::row_text_inline('email', 'Business Email', $business->email, 3, 6,\App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}
{{ Form::row_text_inline('website', 'Current Website URL', $business->website, 3, 6,\App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}
{{ Form::label_title("Business Locations") }}
{{ Form::hidden('locations_count', $location_count) }}
@if($main_location->exists)
{{ Form::hidden("locations[{$main_location->business_location}][atom]", $main_location->business_location) }}
@include('super_admin._business_location', ['location'=> $main_location, 'id'=>null])
@elseif(empty(old('new_locations')))
@include('shared.forms._new_business_location', ['id' => 'new-location-data'])
@endif
@foreach($nonmain_locations as $location)
{{ Form::hidden("locations[{$location->business_location}][atom]", $location->business_location) }}
@include('super_admin._business_location', ['location'=>$location, 'id'=>null])
{{ Form::button_tiny("Delete Location",
"delete_business_location('". $location->business_location ."', '". action('BusinessLocationController@destroy', ['business' => $location->business, 'bl' => $location->business_location]) ."' );",
"delete_business_location_btn_". $location->business_location) }}
@endforeach
@if(old('new_locations'))
@if($main_location->exists) {{-- The main location is not in the invalid data --}}
@foreach(old('new_locations') as $location)
@include('shared.forms._new_invalid_business_location', ['i' => $loop->iteration, 'id' => 'new-location-data'])
@endforeach
@else{{-- There is a main location which has failed validation and does not already exist, so the "main" location is in the invalid data --}}
@foreach(old('new_locations') as $location)
@if($location['main'])
@include('shared.forms._new_business_location', ['id' => 'new-location-data'])
@else
@include('shared.forms._new_invalid_business_location', ['i' => $loop->iteration, 'id' => 'new-location-data'])
@endif
@endforeach
@endif
@endif
{{ Form::button_actual("Add Another Location", null, "add-location-btn", \App\Helpers\FormComponentHelper::SIZE_TINY ) }}
{{ Form::label_title("Team") }}
{{ Form::row_select_inline('team', 'Fulfillment Team', $business->team,$business_team_map, 3, 6,\App\Helpers\FormComponentHelper::SIZE_MEDIUM, null, 'Select One') }}
@foreach(\App\Helpers\FormDataHelper::get_fulfillment_business_roles() as $role)
{{ Form::row_select_inline('teams['.$role['role'].']', $role['name'], $selected_team[$role['role']], $teams[$role['role']], 3, 6,
\App\Helpers\FormComponentHelper::SIZE_MEDIUM, null, 'Select One') }}
@endforeach
{{ Form::row_textarea_inline('team_assignment_notes', 'Team Assignment Notes', $business->team_assignment_notes, 3, 6, \App\Helpers\FormComponentHelper::SIZE_MEDIUM) }}
@if ((sizeof(session()->getOldInput()) > 0) && (Request::old('income_stream')))
@include('shared.forms._driver_component_edit', ['selected_industry' => \App\Models\Industry::find(Request::old('industry')),
'selected_income_streams' => \App\Models\Income_Stream::whereIn('income_stream', Request::old('income_stream'))->get()
] )
@else
@include('shared.forms._driver_component_edit', ['selected_industry' => $selected_industry, 'selected_income_streams' => $selected_income_streams] )
@endif
{{ Form::button_save() }}
{{ Form::button_link("Cancel", action('SuperAdminBusinessController@profile_readonly',compact('business'))) }}