@extends('layouts.rapports.layout', [ 'title' => 'Rapport Rénovation globale' ]) @section('content')
@csrf {{-- Récupération des natures de travaux des sous-rapports --}} @if($liste_rapports) @foreach($liste_rapports as $key=>$value) @php $natures = @unserialize($value['nature_travaux']) ? unserialize($value['nature_travaux']) : []; @endphp @if(!isset($natures_check)) @php $natures_check=[]; @endphp @endif @foreach($natures as $k=>$v) @if(is_array($natures)) @php $natures_check[]=$v; @endphp @endif @endforeach @endforeach @endif
@php $j=1; if(isset($natures_check)) { $count_values=array_count_values($natures_check); foreach($count_values as $p=>$m) { $count[$p]=$m; } } else {$natures_check=[]; } $a=config('rapports.rapport_164.section'); @endphp {{-- Traitement des sections du rapport principal --}} @foreach (config('rapports.rapport_164.section') as $index => $section) @if(in_array('comble_perdu',$natures_check)) @php $section['class']=str_replace('comble_perdu','comble_perdu_actif',$section['class']); @endphp @endif @if(in_array('planchers_bas',$natures_check)) @php $section['class']=str_replace('planchers_bas','planchers_bas_actif',$section['class']) @endphp @endif @if(in_array('rampant_toiture',$natures_check)) @php $section['class']=str_replace('rampant_toiture','rampant_toiture_actif',$section['class']) @endphp @endif @if(in_array('vmc',$natures_check)) @php $section['class']=str_replace('vmc','vmc_actif',$section['class']) @endphp @endif @if(in_array('solaire',$natures_check)) @php $section['class']=str_replace('solaire','solaire_actif',$section['class']) @endphp @endif @if(in_array('ite',$natures_check)) @php $section['class']=str_replace('ite','ite_actif',$section['class']) @endphp @endif @if(in_array('ballon',$natures_check)) @php $section['class']=str_replace('ballon','ballon_actif',$section['class']) @endphp @endif @if(in_array('murs_interieurs',$natures_check)) @php $section['class']=str_replace('murs_interieurs','murs_interieurs_actif',$section['class']) @endphp @endif @if(in_array('pac',$natures_check)) @php $section['class']=str_replace('pac','pac_actif',$section['class']); @endphp @endif @if(in_array('biomasse',$natures_check)) @php $section['class']=str_replace('biomasse','biomasse_actif',$section['class']); @endphp @endif @php $sections_display=['comble_perdu','planchers_bas','rampant_toiture','vmc','solaire','ite','ballon','murs_interieurs','pac', 'biomasse']; @endphp @if(isset($section['id']) && count(explode('-',$section['id']))>1) @php $section_names=explode('-',$section['id']); @endphp @if(count($section_names)>1) @php $name=end($section_names); @endphp @endif @else @php $name=''; @endphp @endif @php $name=str_replace(' ','',$name) @endphp @if( (isset($natures_check) && in_array($name,$natures_check) && $section_names[1]=='rapport') || ($section_names[1]!='rapport') )
@include('layouts.rapports.generation_rapport')
@php $j++ @endphp @endif @endforeach {{-- FIN DU TRAITEMENT DES SECTIONS DU RAPPORT PRINCIPAL --}} @php $new_index=$j-1; $main_rapport=$rapport['rapport_id']; @endphp @if(Auth::user()->user_id >0 ) @if(!empty($liste_rapports)) @foreach($liste_rapports as $key=>$value) @php $nature= @unserialize($value['nature_travaux']) ? unserialize($value['nature_travaux']) : []; @endphp @foreach (config('rapports.'.$value['type'].'.section') as $i=>$s) @php $z=config('rapports.'.$value['type'].'.section') @endphp @if( (isset($s['multiple']) && $s['multiple']=='true') ) @foreach($s['element'] as $sections) @php $display='' @endphp @if($value['type_rapport']==2 && ($value['type_operation']==1 || in_array('comble_perdu',$nature))) @php $display='isolation_des_combles' @endphp @endif @if($value['type_rapport']==2 && ($value['type_operation']==2 || in_array('rampant_toiture',$nature))) @php $display='isolation_rampant' @endphp @endif @if($value['type_rapport']==2 && ($value['type_operation']==3 || in_array('planchers_bas',$nature))) @php $display='isolation_plancher_bas' @endphp @endif @php $natures=[ 'comble_perdu'=>'Inspection des combles perdus', 'rampant_toiture'=>'Inspection des sous-rampants de toiture', 'planchers_bas'=>'Inspection des planchers bas', ] @endphp @if((isset($sections['id']) && $sections['id']===$display) || $display=='yes') @php $new_index=$new_index+2 @endphp @endif @endforeach @else @if( ($value['type_rapport']!=2 && $i>4 && $i<(count($z)-1) ) ) @php $new_index=$new_index+1 @endphp @endif @endif @endforeach @endforeach @endif @endif
@endsection @section('js') @if(auth()->user()->fonction_id === 8 || auth()->user()->user_id === 1 ) @endif @endsection