@php use App\Http\Controllers\Mod\ModNegotiation;use App\Http\Controllers\ModCronos;use App\Models\Profile;use Illuminate\Support\Facades\Crypt; use Carbon\Carbon; $profile=Profile::user(); if($record->idUserResponsible !==null){ //PERIODO $month = Carbon::now()->format('m'); $year = Carbon::now()->format('Y'); $date_start = '1/' . $month . '/' . $year . " 00:00"; $date_end = date("d/m/Y H:i", strtotime(Carbon::now())); $date_range = $date_start . ' - ' . $date_end; $record_negotiation_relationship = ModNegotiation::informationAll([ //'dateRange' => $date_range, 'dateRangeName' => 'updated_at', 'idClientProvider' => $record->idClientProvider, 'orderBy' => 'orderByDesc', 'orderByName' => 'updated_at', ]); } @endphp @include('system-layouts.layout-head') @include('mod-clientprovider.title')
@php //-------------------------------------------------------------------------------------------------------------- //ACESSO AO CLIENTE $perm = 0; //ACESSO: NEGADO if($record->idUserResponsible === $profile->idUser){ //---| 01 - ACESSO: PERMITIDO | VENDEDOR RESPONSÁVEL $perm = 1; //ACESSO: PERIMITIR @endphp @php // ACCESS - Elem-ID: 59 | Elem: Administrar cad. cliente/fornecedor | Caminho: ger\vendas\clienteforne\adminstrar }elseif(Profile::permElem('59')==1){ //---| 02 - ACESSO: PERMITIDO | USUARIO ADMINISTRATIVO $perm = 1; //ACESSO: PERIMITIR if($record->idUserResponsible==null){ $profile_responsible = Profile::userNull(); $profile_responsible->userName = "Não tem vendedor"; }else{ $profile_responsible = Profile::user($record->idUserResponsible); } @endphp
  Vendedor responsável: {{$profile_responsible->userName}}    |  Acesso: Administrador
@php }elseif($record->idUserResponsible === null){ //---| 03 - ACESSO: PERMITIDO | NÃO VENDEDOR RESPONSÁVEL $perm = 1; //ACESSO: PERIMIITIR $profile_responsible = Profile::user($record->idUserResponsible); $profile_responsible->idUser= null; $profile_responsible->searchString = null; $profile_responsible->userName = "Não tem vendedor"; $profile_responsible->userEmail = null; $profile_responsible->idUserRole = null; @endphp
Vendedor responsável | Aberto
@php }elseif($record->idUserResponsible !== $profile->idUser){ //---| 04 - ACESSO: NEGADO | NÃO É O VENDEDOR RESPONSAVEL E NÃO TEM REQUISITOS ACIMA $perm = 0; //ACESSO: NEGADO $profile_responsible = Profile::user($record->idUserResponsible); @endphp
  Vendedor responsável: {{$profile_responsible->userName}}    |  Acesso: Somente Leitura
@php } @endphp

Editar

Este é um número ? phoneNet) checked @endif >

ie}}" maxlength="20" @if($perm==0) disabled @endif @php if($record->idIe==1){echo "disabled";} @endphp>
Não idIe==1){echo "checked";} @endphp @if($perm==0) disabled @endif class="js-switch" data-color="#3d3b3b"/> Sim
@if(isset($record_address)) @php $address_required='NotRequired'; @endphp @include('system-dev-zip.formedit-address') @else @include('mod-clientprovider.formadd-01-02-address') @endif
@php $id_user_card = $record->idUserResponsible; @endphp @include('system-user-profile.incluid_user_card')
{{-- /ACCESS - Elem-ID: 34 | Elem: Vendedor responsável | Caminho: ger\vendas\clientprovider\ alterar vendedor--}} @if (Profile::permElem('34') == 1) @elseif($record->idUserResponsible==$profile->idUser) @else @endif
{{-- @php--}} {{-- $role = Profile::userRole(['idUserRole'=>['1','2','3']])--}} {{-- @endphp--}} {{--
--}} {{-- --}} {{-- --}} {{--
--}}

@php //ACCESS - Elem-ID: 44 | Elem: Lista de alteração dos resposáveis pelo cliente | Caminho: ger\vendas\clientprovider\eventos resposaveis if (Profile::permElem('44') == 1){ @endphp
@php } @endphp

Relacionamento
@php $salesorder_date_last = isset($record_negotiation_relationship->salesOrderDateLast)?$record_negotiation_relationship->salesOrderDateLast:null; @endphp
@php $relationship_days = isset($record_negotiation_relationship->relationshipDays)?$record_negotiation_relationship->relationshipDays:0; @endphp

Existe campo(s) obrigatório(s) para ser(em) preenchido(s)
@if($perm==1) @endif
@php $id_clientprovider=Crypt::encrypt($record->idClientProvider); @endphp @if($perm==1) @include('mod-clientprovider.views-contact.formcommon-add') @include('mod-clientprovider.views-contact.formcommon-search') @endif
@include('mod-clientprovider.views-contact.index-load')
@if($perm==1)
@include('mod-clientprovider.formedit-negotiation')
@endif @php //ACCESS - Elem-ID: 44 | Elem: Lista de alteração dos resposáveis pelo cliente | Caminho: ger\vendas\clientprovider\eventos resposaveis if (Profile::permElem('44') == 1){ @endphp
@include('mod-clientprovider.formedit-event')
@include('mod-clientprovider.formedit-origin-negotiation')
@php } @endphp
@include('system-layouts/layout-footer') @include('mod-clientprovider.script') @include('mod-clientprovider.views-contact.formcommon-add-script') @include('mod-clientprovider.views-contact.formcommon-search-script') @include('mod-clientprovider.views-contact.index-load-script') @include('mod-clientprovider.common-script') {{----}}