@extends('layouts.app') @section('content') @if ($errors->any())
هناك أخطاء — صحّحها ثم أعد المحاولة:
@endif @if (session('error'))
{{ session('error') }}
@endif @if (session('success'))
{{ session('success') }}
@endif
@csrf @method('PUT')

تعديل معطيات البلاغ

{{-- --}}

توقيت المكالمة

{{--
تفاصيل توقيت المكالمة
--}}

@error('date_appel')
{{ $message }}
@enderror
اليوم / الشهر / السنة
@error('heure_ecoute')
{{ $message }}
@enderror
@foreach($seances as $s)
id_seance) == $s->id ? 'checked' : '' }}>
@endforeach
@error('id_seance')
{{ $message }}
@enderror

موضوع المكالمة

{{--
تفاصيل توقيت المكالمة
--}}

@foreach($sujets as $s)
id_sujet_appel) === (string)$s->id ? 'checked' : '' }}>
@endforeach
@error('id_sujet_appel')
{{ $message }}
@enderror
@error('id_autre')
{{ $message }}
@enderror
@error('id_source_signale')
{{ $message }}
@enderror
@error('id_rapporteur')
{{ $message }}
@enderror

معلومات عن الضحية

accept_identite) === '1' ? 'checked' : '' }}>
accept_identite) === '0' ? 'checked' : '' }}>
@error('accept_identite')
{{ $message }}
@enderror
@error('nom_prenom')
{{ $message }}
@enderror
@error('identifiant')
{{ $message }}
@enderror
@error('id_cin_non_dispo')
{{ $message }}
@enderror
@error('nationalite')
{{ $message }}
@enderror
@error('num_tel')
{{ $message }}
@enderror
@error('adresse')
{{ $message }}
@enderror
@error('id_gouver')
{{ $message }}
@enderror
@error('id_municipalite')
{{ $message }}
@enderror
id_autonomie_personnel) === '1' ? 'checked' : '' }}>
id_autonomie_personnel) === '0' ? 'checked' : '' }}>
@php // $violence injected from controller; convert to array of strings $existingTypes = $violence ? $violence->types->pluck('tp_type_violence_id')->map(function($v){ return (string)$v; })->toArray() : []; // If validation failed, old('type_violence') should override; otherwise use existingTypes $selectedTypes = old('type_violence', $existingTypes); @endphp
@foreach($typeViolence as $tv)
id, $selectedTypes) ? 'checked' : '' }}>
@endforeach
@error('type_violence')
{{ $message }}
@enderror
@foreach($violenceEnf as $ve)
id_violence_enfance) === (string)$ve->id ? 'checked' : '' }}>
@endforeach

الأطفال المرافقون

@php // raw children collection from controller — may be Model objects or arrays $rawChildren = old('children') ?? ($children->isNotEmpty() ? $children->toArray() : []); // Build normalized children arrays so view and JS always use 'gender' key $initialChildren = collect($rawChildren)->map(function($c) { // if $c is model->toArray() or old() array, keys differ: // DB column is 'sex' but the form uses 'gender' as key. $sex = null; if (is_array($c)) { $sex = $c['sex'] ?? $c['gender'] ?? null; $id_age = $c['id_age_enf'] ?? $c['id_age_enf'] ?? null; $id_niv = $c['id_niveau_edu_enf'] ?? $c['id_niveau_edu_enf'] ?? null; $decroche = $c['decroche_scolaire'] ?? $c['decroche_scolaire'] ?? null; $porteur = $c['porteur_handicap'] ?? $c['porteur_handicap'] ?? null; $lien = $c['lien_parente'] ?? $c['lien_parente'] ?? null; } else { // object (Eloquent model) $sex = $c->sex ?? $c->gender ?? null; $id_age = $c->id_age_enf ?? null; $id_niv = $c->id_niveau_edu_enf ?? null; $decroche = $c->decroche_scolaire ?? null; $porteur = $c->porteur_handicap ?? null; $lien = $c->lien_parente ?? null; } return [ 'gender' => $sex, // normalized key for the view/JS 'id_age_enf' => $id_age, 'id_niveau_edu_enf' => $id_niv, 'decroche_scolaire' => $decroche, 'porteur_handicap' => $porteur, 'lien_parente' => $lien, ]; })->toArray(); $initialCount = count($initialChildren); $agesEnfForJs = $agesEnf->map(fn($a) => ['id'=>$a->id,'age_ar'=>$a->age_ar,'age_fr'=>$a->age_fr])->toArray(); $niveauxEduEnfForJs = $niveauxEduEnf->map(fn($n) => ['id'=>$n->id,'niveau_ar'=>$n->niveau_ar,'niveau_fr'=>$n->niveau_fr])->toArray(); @endphp
{{-- server-rendered rows when editing or after validation error --}} @if($initialCount > 0) @foreach($initialChildren as $idx => $c) @endforeach @endif
# الجنس العمر (فئة) المستوى التعليمي منقطع عن الدراسة حامل لإعاقة صلة القرابة / ملاحظة
{{ $idx + 1 }}
@php $checked = isset($c['decroche_scolaire']) && ($c['decroche_scolaire'] == 1 || $c['decroche_scolaire'] === true); @endphp
@php $checked2 = isset($c['porteur_handicap']) && ($c['porteur_handicap'] == 1 || $c['porteur_handicap'] === true); @endphp
أدخل عدد الأطفال ثم اضغط "تعبئة تفاصيل الأطفال" أو غير العدد لتعديل الصفوف.
{{-- expose option arrays for JS and old children data --}}
{{-- expose lookup lists to JS --}}

معلومات حول القائم بالعنف

@php // قيمة مُختارة: أولاً old من إعادة توجيه، وإلا من قاعدة البيانات ($agresseur) $selected_relation_victime = old('agresseur_id_relation_victime', optional($agresseur ?? null)->id_relation_victime); @endphp @foreach($relationsVictime as $rv)
id ? 'checked' : '' }}>
@endforeach
@error('agresseur_id_relation_victime')
{{ $message }}
@enderror
@php $selected_relation_part_intime = old('agresseur_id_relation_part_intime', optional($agresseur ?? null)->id_relation_part_intime); @endphp @error('agresseur_id_relation_part_intime')
{{ $message }}
@enderror
@php $sel_age = old('agresseur_id_age', optional($agresseur)->id_age); @endphp @error('agresseur_id_age')
{{ $message }}
@enderror
@php $sel_niv = old('agresseur_id_niveau_edu', optional($agresseur)->id_niveau_edu); @endphp @error('agresseur_id_niveau_edu')
{{ $message }}
@enderror
@php $sel_sit_pro = old('agresseur_id_sit_pro', optional($agresseur)->id_sit_pro); @endphp @error('agresseur_id_sit_pro')
{{ $message }}
@enderror
@php $sel_inactif = old('agresseur_id_sit_pro_inactif', optional($agresseur)->id_sit_pro_inactif); @endphp @error('agresseur_id_sit_pro_inactif')
{{ $message }}
@enderror
@php $sel_domaine = old('agresseur_id_domaine_pro', optional($agresseur)->id_domaine_pro); @endphp @error('agresseur_id_domaine_pro')
{{ $message }}
@enderror

تقييم المخاطر


@php $oldRv = old('risques_victime', []); $oldRa = old('risques_agresseur', []); $oldRvv = old('risques_violence', []); @endphp
@php // الحصول على الـ violence من الـ controller (يفضل أن يكون موجوداً في view) // نريد ثلاث مصفوفات تمثل القيم المحددة: old => fallback to DB => empty array $dbRv = isset($violence) && $violence && $violence->risquesVictime ? $violence->risquesVictime->pluck('id')->map(fn($i) => (string)$i)->toArray() : []; $dbRa = isset($violence) && $violence && $violence->risquesAgresseur ? $violence->risquesAgresseur->pluck('id')->map(fn($i) => (string)$i)->toArray() : []; $dbRvv = isset($violence) && $violence && $violence->risquesViolence ? $violence->risquesViolence->pluck('id')->map(fn($i) => (string)$i)->toArray() : []; // old(...) قد يرجع null أو مصفوفة أرقام/سلاسل -- نطبعها كمصفوفة سلاسل لسهولة المقارنة $oldRvRaw = old('risques_victime', $dbRv); $oldRaRaw = old('risques_agresseur', $dbRa); $oldRvvRaw = old('risques_violence', $dbRvv); // normalize to array of strings $oldRv = is_array($oldRvRaw) ? array_map('strval', $oldRvRaw) : []; $oldRa = is_array($oldRaRaw) ? array_map('strval', $oldRaRaw) : []; $oldRvv = is_array($oldRvvRaw) ? array_map('strval', $oldRvvRaw) : []; @endphp
@php // $signalement, $parcours, $parcoursDestIds يجب أن يمرّرهما controller // Fallbacks: old() (بعد فشل التحقق) ثم DB value ثم افتراضي $parcoursObj = $parcours ?? null; // selected destinations (array of ids as strings) $selectedParcoursDest = old('parcours_destinations', $parcoursDestIds ?? []); if (!is_array($selectedParcoursDest)) { $selectedParcoursDest = $selectedParcoursDest ? (array)$selectedParcoursDest : []; } $selectedParcoursDest = array_map('strval', $selectedParcoursDest); // individual fields fallback $selDecisionPoursuite = (string) (old('id_decision_poursuite_anterieur', $parcoursObj->id_decision_poursuite_anterieur ?? '') ?? ''); $selRequisitionMed = (string) (old('requisition_medicale', isset($parcoursObj->requisition_medicale) ? ($parcoursObj->requisition_medicale ? '1' : '0') : '') ?? ''); $selTypeRequisition = (string) (old('id_type_requisition', $parcoursObj->id_type_requisition ?? '') ?? ''); $selEngagementSanitaire = (string) (old('engagement_sanitaire', isset($parcoursObj->engagement_sanitaire) ? ($parcoursObj->engagement_sanitaire ? '1' : '0') : '') ?? ''); $selTypeServiceSante = (string) (old('id_type_service_sante', $parcoursObj->id_type_service_sante ?? '') ?? ''); $selCert48 = (string) (old('cert_med_48h', isset($parcoursObj->cert_med_48h) ? ($parcoursObj->cert_med_48h ? '1' : '0') : '') ?? ''); $selCertFree = (string) (old('cert_med_gratuite', isset($parcoursObj->cert_med_gratuite) ? ($parcoursObj->cert_med_gratuite ? '1' : '0') : '') ?? ''); $selCertReq = (string) (old('cert_med_par_requisition', isset($parcoursObj->cert_med_par_requisition) ? ($parcoursObj->cert_med_par_requisition ? '1' : '0') : '') ?? ''); $selEngagementJud = (string) (old('engagement_judiciaire', isset($parcoursObj->engagement_judiciaire) ? ($parcoursObj->engagement_judiciaire ? '1' : '0') : '') ?? ''); $selTypeServiceJud = (string) (old('id_type_service_judiciare', $parcoursObj->id_type_service_judiciare ?? '') ?? ''); $selConseilJuridique = (string) (old('conseil_juridique', $signalement->conseil_juridique ?? '') ?? ''); $selServicesOrientation = (string) (old('services_orientation', $signalement->services_orientation ?? '') ?? ''); $selInstitutionOrientation = (string) (old('id_institution_orientation', $signalement->id_institution_orientation ?? '') ?? ''); // remarks: prefer old(), then signalement->remarques, then parcours autres_services_sante $remarquesParcoursValue = old('remarques_parcours', $signalement->remarques ?? $parcoursObj->autres_services_sante ?? ''); $requisition = (string) old('requisition_medicale', isset($parcours) ? (string)$parcours->requisition_medicale : ''); $id_type_requisition_old = (string) old('id_type_requisition', isset($parcours) ? (string)($parcours->id_type_requisition ?? '') : ''); $eng_san = (string) old('engagement_sanitaire', isset($parcours) ? (string)($parcours->engagement_sanitaire ?? '') : ''); $cert48 = (string) old('cert_med_48h', isset($parcours) ? (string)($parcours->cert_med_48h ?? '') : ''); $certFree = (string) old('cert_med_gratuite', isset($parcours) ? (string)($parcours->cert_med_gratuite ?? '') : ''); $certReq = (string) old('cert_med_par_requisition', isset($parcours) ? (string)($parcours->cert_med_par_requisition ?? '') : ''); $autres_services = (string) old('autres_services_sante', isset($parcours) ? (string)($parcours->autres_services_sante ?? '') : ''); $id_type_service_sante_old = (string) old('id_type_service_sante', isset($parcours) ? (string)($parcours->id_type_service_sante ?? '') : ''); $eng_jud = (string) old('engagement_judiciaire', isset($parcours) ? (string)($parcours->engagement_judiciaire ?? '') : ''); $id_type_service_judiciare_old = (string) old('id_type_service_judiciare', isset($parcours) ? (string)($parcours->id_type_service_judiciare ?? '') : ''); @endphp

مسار التعهد

اختر واحدًا أو عدة مؤسسات — سيتم حفظها كمصفوفة.

• خدمات الإرشاد والتوجيه الخاصة بالخط الأخضر 1899

{{-- Small script to update dropdown button label with selection count / labels --}}

المتابعة الميدانية

suivi_terrain) === '1' ? 'checked' : '' }}>
{{-- رجوع --}}
@push('scripts') @endpush @push('scripts') @endpush {{-- --}} @endsection