- Add @push('styles') with @mapstyles to map views
- Fix markers parameter format (pass as 'markers' array, not string)
- Add null checks for location data
- Add @stack('styles') to layout for conditional style loading
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
68 lines
2.2 KiB
PHP
Executable File
68 lines
2.2 KiB
PHP
Executable File
@extends('layouts.app')
|
|
|
|
@push('styles')
|
|
@mapstyles
|
|
@endpush
|
|
|
|
@section('content')
|
|
@if (Auth::user()->role_id >= 5)
|
|
<div class="container-fluid" style="height:100%">
|
|
@include('sidebar')
|
|
<div style="width:90%; float: left; margin:1em 0 0 1em">
|
|
@else
|
|
<div class="container" style="margin:0 1em">
|
|
@endif
|
|
|
|
<div class="row">
|
|
<div class="col-sm-7">
|
|
<h3>Contratos Finalizados</h3>
|
|
</div>
|
|
<div class="col-sm-5">
|
|
<div class="pull-right">
|
|
{!! Form::open(['method'=>'GET','url'=>'finishedcontracts','class'=>'navbar-form navbar-left','role'=>'search']) !!}
|
|
<div class="input-group">
|
|
<input class="form-control" id="search"
|
|
value="{{ request()->session()->get('search') }}"
|
|
placeholder="Buscar" name="search"
|
|
type="text" id="search"/>
|
|
<div class="input-group-btn">
|
|
<button type="submit" class="btn btn-primary">
|
|
<i class="fa fa-search" aria-hidden="true"></i>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{!! Form::close() !!}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@php
|
|
$mapMarkers = [];
|
|
foreach ($finishedcontracts as $finishedcontract) {
|
|
if ($finishedcontract->location) {
|
|
$mapMarkers[] = [
|
|
'title' => $finishedcontract->id,
|
|
'lat' => $finishedcontract->location->getLat(),
|
|
'lng' => $finishedcontract->location->getLng(),
|
|
'popup' => '<h3>' . $finishedcontract->id . '</h3><p>' . $finishedcontract->address .
|
|
'<br>' . ($finishedcontract->suppliers->company_name ?? '') . '<br>' . ucfirst($finishedcontract->categories->name ?? '') .
|
|
'<br>' . $finishedcontract->appointment . '<br>$' . $finishedcontract->amount . '<br>' . ucfirst($finishedcontract->status->name ?? '') .
|
|
'<br>' . $finishedcontract->score . ' de 5</p>',
|
|
];
|
|
}
|
|
}
|
|
@endphp
|
|
|
|
@map([
|
|
'lat' => 20.659698,
|
|
'lng' => -103.349609,
|
|
'zoom' => 12,
|
|
'markers' => $mapMarkers
|
|
])
|
|
|
|
<ul class="pagination">
|
|
{{ $finishedcontracts->links() }}
|
|
</ul>
|
|
</div>
|
|
@endsection
|