@php

    $stent_stent[] = 'NB';
    $stent_stent[] = 'Plastic (Christmas)';
    $stent_stent[] = 'Plastic (Double Pigtail)';
    $stent_stent[] = 'Plastic (Duodenal Bend)';
    $stent_stent[] = 'Plastic (Single Pigtail)';
    $stent_stent[] = 'PTBD';
    $stent_stent[] = 'SEMS (Bilateral Partial-Cover)';
    $stent_stent[] = 'SEMS (Fully Cover)';
    $stent_stent[] = 'SEMS (Non-Cover)';
    $stent_stent[] = 'SEMS (Single Partial-Cover)';
    $stent_stent[] = 'Soehendra Dilator';

    $stent_size1[] = '3 fr';
    $stent_size1[] = '4 fr';
    $stent_size1[] = '5 fr';
    $stent_size1[] = '7 fr';
    $stent_size1[] = '8 fr (2.67 mm)';
    $stent_size1[] = '8.5 fr';
    $stent_size1[] = '10 fr (3.33 mm)';
    $stent_size1[] = '12 fr (4 mm)';
    $stent_size1[] = '14 fr (4.67 mm)';
    $stent_size1[] = '16 fr (5.33 mm)';
    $stent_size1[] = '18 fr (6 mm)';
    $stent_size1[] = '20 fr (6.67 mm)';
    $stent_size1[] = '22 fr (7.33 mm)';
    $stent_size1[] = '24 fr (8 mm)';
    $stent_size1[] = '26 fr (8.67 mm)';
    $stent_size1[] = '6 mm';
    $stent_size1[] = '8 mm';
    $stent_size1[] = '10 mm';
    $stent_size1[] = '15 mm';
    $stent_size1[] = '16 mm';
    $stent_size1[] = '20 mm';
    $stent_size1[] = '30 mm';



    $stent_sizea[] = '3 fr';
    $stent_sizea[] = '4 fr';
    $stent_sizea[] = '5 fr';
    $stent_sizea[] = '7 fr';
    $stent_sizea[] = '8 fr (2.67 mm)';
    $stent_sizea[] = '8.5 fr';
    $stent_sizea[] = '10 fr (3.33 mm)';
    $stent_sizea[] = '12 fr (4 mm)';
    $stent_sizea[] = '14 fr (4.67 mm)';
    $stent_sizea[] = '16 fr (5.33 mm)';
    $stent_sizea[] = '18 fr (6 mm)';
    $stent_sizea[] = '20 fr (6.67 mm)';
    $stent_sizea[] = '22 fr (7.33 mm)';
    $stent_sizea[] = '24 fr (8 mm)';
    $stent_sizea[] = '26 fr (8.67 mm)';
    $stent_sizea[] = '6 mm';
    $stent_sizea[] = '8 mm';
    $stent_sizea[] = '10 mm';
    $stent_sizea[] = '15 mm';
    $stent_sizea[] = '16 mm';
    $stent_sizea[] = '20 mm';
    $stent_sizea[] = '30 mm';

    $stent_length[] = '1 cm';
    $stent_length[] = '1.5 cm';
    $stent_length[] = '2 cm';
    $stent_length[] = '4 cm';
    $stent_length[] = '5 cm';
    $stent_length[] = '6 cm';
    $stent_length[] = '7 cm';
    $stent_length[] = '8 cm';
    $stent_length[] = '9 cm';
    $stent_length[] = '10 cm';
    $stent_length[] = '12 cm';
    $stent_length[] = '15 cm';
    $stent_length[] = '20 cm';
    $stent_length[] = 'NB';
    $stent_length[] = 'PTBD';

    $stent_position[] = 'None';
    $stent_position[] = 'Ampulla';
    $stent_position[] = 'Bt. IHD Duct';
    $stent_position[] = 'CBD/CHD';
    $stent_position[] = 'Cystic Duct';
    $stent_position[] = 'Distal CBD';
    $stent_position[] = 'Gallbladder';
    $stent_position[] = 'Hilar';
    $stent_position[] = 'Lt. Main';
    $stent_position[] = 'Passing Stone';
    $stent_position[] = 'Rt. Main';
    $stent_position[] = 'Seq. I';
    $stent_position[] = 'Seq. II';
    $stent_position[] = 'Seq. III';
    $stent_position[] = 'Seq. IVa';
    $stent_position[] = 'Seq. IVb';
    $stent_position[] = 'Seq. V';
    $stent_position[] = 'Seq. VI';
    $stent_position[] = 'Seq. VII';
    $stent_position[] = 'Seq. VIII';
    $stent_position[] = 'Skin Tract';

    $stent_compli[] = 'None';
    $stent_compli[] = 'Bleeding (Massive)';
    $stent_compli[] = 'Bleeding (Minimal)';
    $stent_compli[] = 'Perforation (Scope)';
    $stent_compli[] = 'Perforation (Guidewire)';
    $stent_compli[] = 'Bleeding (Delay)';

    $stent_commanage[] = 'None';
    $stent_commanage[] = 'Observation';
    $stent_commanage[] = 'Adrenalin Injection';
    $stent_commanage[] = 'APC';
    $stent_commanage[] = 'Balloon Temponade';
    $stent_commanage[] = 'Emergency Rescue Lithotriptor';
    $stent_commanage[] = 'Endoloop';
    $stent_commanage[] = 'Endoscopic Necrosectomy/Debridement';
    $stent_commanage[] = 'Glue Injection';
    $stent_commanage[] = 'Gold Probe';
    $stent_commanage[] = 'Hemospray';
    $stent_commanage[] = 'Metalic Stent';
    $stent_commanage[] = 'NG';
    $stent_commanage[] = 'OVESCO';
    $stent_commanage[] = 'Plastic Stent';
    $stent_commanage[] = 'Re-Stenting';
    $stent_commanage[] = 'Remove Foreign Body';
    $stent_commanage[] = 'Rubber Band';
    $stent_commanage[] = 'Sclerosing Injection';
    $stent_commanage[] = 'Snare tip';

    $stent = [];
    if (isset($case->fidingtemp['stent'])) {
        $stent = $case->fidingtemp['stent'];

    }

@endphp





<div class="card" style="margin: 4px;">
    <div class="col-12  ps-4 p-3">
        <b>Stenting</b>
        <div class="row ">
            <div class="col-12">
                <div class="ms-2 pt-2">
                    <input class="form-check-input" type="checkbox" id="stent_cbd" name="stent_cbd" value="CBD Stent"
                    @checked(isset($stent['cbd']))>
                    <label class="form-check-label" for="stent_cbd">
                        CBD Stent
                    </label>
                </div>
            </div>
            <div class="row px-2 py-3 mt-3" >
                <div class="custom_cardbox px-0">
                    <div class="bg-greenfade w-100 p-2">
                        <div class="row">
                            <div class="col-lg-8 ">
                                <div class="row">
                                    <div class="col-3"> &ensp; Stent Shape</div>
                                    <div class="col-2">&nbsp; Size</div>
                                    <div class="col-2">Length
                                    </div>
                                    <div class="col-2">
                                        Position
                                    </div>
                                    <div class="col-2">Complication
                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 ">
                                <div class="row">
                                    <div class="col-8">Complication Management</div>
                                    <div class="col-4">
                                        Pieces
                                    </div>

                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="stent mt-2">
                        @forelse ($stent['g1'] ?? [] as $data)
                        <div class="row  px-3 advance">
                            
                                <div class="col-lg-8 ">
                                    <div class="row">
                                        <div class="col-3">
                                            {!! selectadvanced('stent_stent_g1', $stent_stent, $data['stent'] ?? '') !!}


                                        </div>
                                        <div class="col-2">
                                            {{-- @dd($data['size1']) --}}
                                            {!! selectadvanced('stent_size1_g1', $stent_size1, $data['size1'] ?? '') !!}


                                        </div>
                                        <div class="col-2">
                                            {!! selectadvanced('stent_length_g1', $stent_length, $data['length'] ?? '') !!}


                                        </div>
                                        <div class="col-2">
                                            {!! selectadvanced('stent_position_g1', $stent_position, $data['position'] ?? '') !!}


                                        </div>
                                        <div class="col-3">
                                            {!! selectadvanced('stent_compli_g1', $stent_compli, $data['compli'] ?? '') !!}

                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4 ">
                                    <div class="row">
                                        <div class="col-8">
                                            {!! selectadvanced('stent_commanage_g1', $stent_commanage, $data['commanage'] ?? '') !!}

                                        </div>
                                        <div class="col-3">
                                            <input name="stent_txtpieces_g1[]" type="text" class="form-control" value="{{@$data['txtpieces']}}">
                                        </div>
                                        <div class="col-1 align-self-center">
                                            <a type="button"
                                            class="btn-transparent btn-danger btn-cancel remove"><i
                                                class="ri-indeterminate-circle-fill ri-lg"></i></a>
                                        </div>
                                    </div>
                                </div>

                        </div>
                        @empty
                        <div class="row  px-3 advance">
                            <div class="row p-2">
                                <div class="col-lg-8 ">
                                    <div class="row">
                                        <div class="col-3">
                                            {!! selectadvanced('stent_stent_g1', $stent_stent, $save ?? '') !!}


                                        </div>
                                        <div class="col-2">

                                            {!! selectadvanced('stent_size1_g1', $stent_size1, $save ?? '') !!}


                                        </div>
                                        <div class="col-2">
                                            {!! selectadvanced('stent_length_g1', $stent_length, $save ?? '') !!}


                                        </div>
                                        <div class="col-2">
                                            {!! selectadvanced('stent_position_g1', $stent_position, $save ?? '') !!}


                                        </div>
                                        <div class="col-3">
                                            {!! selectadvanced('stent_compli_g1', $stent_compli, $save ?? '') !!}

                                        </div>
                                    </div>
                                </div>
                                <div class="col-lg-4 ">
                                    <div class="row">
                                        <div class="col-8">
                                            {!! selectadvanced('stent_commanage_g1', $stent_commanage, $save ?? '') !!}

                                        </div>
                                        <div class="col-3">
                                            <input name="stent_txtpieces_g1[]" type="text" class="form-control">
                                        </div>
                                        <div class="col-1 align-self-center">
                                            <a type="button"
                                            class="btn-transparent btn-danger btn-cancel remove"><i
                                                class="ri-indeterminate-circle-fill ri-lg"></i></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                        @endforelse

                    </div>
                    <div class="col-12 p-2 text-end ">
                        <a class="btn btn-soft-secondary w-lg btn_addlesson7">+ Add</a>
                    </div>
                </div>
                {{-- <div class="col-12 pt-3 my-2 text-center ">
                    <button class="btn btn-primary ">Select Photo</button>
                </div> --}}
            </div>
            <div class="col-12">
                <div class="ms-2 pt-2">
                    <input class="form-check-input" type="checkbox" id="stent_pd" name="stent_pd" value="PD Stent"
                    @checked(isset($stent['pd']))>
                    <label class="form-check-label" for="stent_pd">
                        PD Stent
                    </label>
                </div>
            </div>
        </div>
        <div class="row px-2 py-3 mt-3" >
            <div class="custom_cardbox px-0">
                <div class="bg-greenfade w-100 p-2">
                    <div class="row">
                        <div class="col-lg-8 ">
                            <div class="row">
                                <div class="col-3"> &ensp; Stent Shape</div>
                                <div class="col-2">&nbsp; Size</div>
                                <div class="col-2">Length
                                </div>
                                <div class="col-2">
                                    Position
                                </div>
                                <div class="col-2">Complication
                                </div>
                            </div>
                        </div>
                        <div class="col-lg-4 ">
                            <div class="row">
                                <div class="col-8">Complication Management</div>
                                <div class="col-4">
                                    Pieces
                                </div>

                            </div>
                        </div>
                    </div>
                </div>
                <div class="stent02 mt-2">
                    @forelse ($stent['g2'] ?? [] as $data2)
                    <div class="row  px-3 advance">
                        <div class="row p-2">
                            <div class="col-lg-8 ">
                                <div class="row">
                                    <div class="col-3">
                                        {!! selectadvanced('stent_stent_g2', $stent_stent, $data2['stent'] ?? '') !!}


                                    </div>
                                    <div class="col-2">

                                        {!! selectadvanced('stent_sizea_g2', $stent_sizea, $data2['sizea'] ?? '') !!}


                                    </div>
                                    <div class="col-2">
                                        {!! selectadvanced('stent_length_g2', $stent_length, $data2['length'] ?? '') !!}


                                    </div>
                                    <div class="col-2">
                                        {!! selectadvanced('stent_position_g2', $stent_position, $data2['position'] ?? '') !!}


                                    </div>
                                    <div class="col-3">
                                        {!! selectadvanced('stent_compli_g2', $stent_compli, $data2['compli'] ?? '') !!}

                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 ">
                                <div class="row">
                                    <div class="col-8">
                                        {!! selectadvanced('stent_commanage_g2', $stent_commanage, $data2['commanage'] ?? '') !!}

                                    </div>
                                    <div class="col-3">
                                        <input name="stent_txtpieces_g2[]" type="text" class="form-control" value="{{@$data2['txtpieces']}}">
                                    </div>
                                    <div class="col-1 align-self-center">
                                        <a type="button"
                                        class="btn-transparent btn-danger btn-cancel remove"><i
                                            class="ri-indeterminate-circle-fill ri-lg"></i></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    @empty
                    <div class="row  px-3 advance">
                        <div class="row p-2">
                            <div class="col-lg-8 ">
                                <div class="row">
                                    <div class="col-3">
                                        {!! selectadvanced('stent_stent_g2', $stent_stent, $save ?? '') !!}


                                    </div>
                                    <div class="col-2">

                                        {!! selectadvanced('stent_sizea_g2', $stent_sizea, $save ?? '') !!}


                                    </div>
                                    <div class="col-2">
                                        {!! selectadvanced('stent_length_g2', $stent_length, $save ?? '') !!}


                                    </div>
                                    <div class="col-2">
                                        {!! selectadvanced('stent_position_g2', $stent_position, $save ?? '') !!}


                                    </div>
                                    <div class="col-3">
                                        {!! selectadvanced('stent_compli_g2', $stent_compli, $save ?? '') !!}

                                    </div>
                                </div>
                            </div>
                            <div class="col-lg-4 ">
                                <div class="row">
                                    <div class="col-8">
                                        {!! selectadvanced('stent_commanage_g2', $stent_commanage, $save ?? '') !!}

                                    </div>
                                    <div class="col-3">
                                        <input name="stent_txtpieces_g2[]" type="text" class="form-control">
                                    </div>
                                    <div class="col-1 align-self-center">
                                        <a type="button"
                                        class="btn-transparent btn-danger btn-cancel remove"><i
                                            class="ri-indeterminate-circle-fill ri-lg"></i></a>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    @endforelse

                </div>
                <div class="col-12 p-2 text-end ">
                    <a class="btn btn-soft-secondary w-lg btn_addlesson8">+ Add</a>
                </div>
            </div>
            {{-- <div class="col-12 pt-3 my-2 text-center ">
                <button class="btn btn-primary ">Select Photo</button>
            </div> --}}
        </div>

    </div>

</div>
