<style>

    #new_case .modal-body{
        background: #222529;
    }
    @media (min-width: 992px){
    .modal-lg{
        width: unset !important;
        max-width: unset !important;
        width: 1400px !important;
        height: 600px !important;
    }
}
    #new_case .modal-dialog .modal-content{
        min-width: unset !important;
        max-width: unset !important;
        width: 1400px !important;
        height: 600px !important;
        /* box-shadow: 0 0 15px #8a8888; */
    }
    #new_case .modal-content{
        border: none;
    }
    .box-data{
        background: #222529;
        padding: 1em;
    }
    #new_case .form-control{
        border: none;
        background: black;
        color: #fff;
    }
    #new_case .btn-sm{
        padding: 0.2em;
    }
    #new_case .border-right{border-right: 1px solid #fff;}
    /* .list-cases{
        border-bottom: 1px solid #5b5959;
        padding: 0.5em;
    } */
    .menu-list-scroll{
        width: 100%;
        height: 600px;
        overflow-y: auto;
    }
    .text-dark-camera{
        color: #BBBBBB;
    }
/* .list-this-cases tr{border-bottom: 1px solid #fff !important;background: red} */

</style>
<div class="modal fade" id="modal_new_case" tabindex="-1" role="dialog" aria-labelledby="New_case_Label" aria-hidden="true" style="z-index: 9999999">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-body p-0 " style="    background: #222529;">
                    <h5 class=" text-dark-camera mt-4 ms-4 bold">Case List</h5>
                    <div class="mb-2" style="border: 1px solid #353535"></div>
                <div class="row m-0 ">
                    <span class="ms-3 mt-2 h5 text-dark-camera bold">Current Patient</span>

                    <div class="col-4 border-right" style="max-height: 100px; ">

                        <div class="box-data row m-0">
                            @php
                                // $json = jsonDecode(@$case->case_json);
                                $hn   = isset($case->hn) ? $case->hn : $case->case_hn;
                            @endphp
                            <div class="row p-0 m-0" style="max-height:20px">
                                <div class="col-5 light">HN :</div>
                                <div class="col-7 light text-end">{{@$hn}}</div>
                            </div>
                            <div class="col-5 light ">Name :</div>
                            <div class="col-7 light text-end">{{@$case->patientname}}</div>
                            <div class="col-5 light ">Current :</div>
                            <div class="col-7 light text-end text-danger">{{@$case->procedurename}}</div>
                            <div class="col-5 light">Physician :</div>
                            <div class="col-7 light text-end">{{@$case->doctorname}}</div>
                        </div>
                        <div class="row mt-3">
                            <div class="col-8">
                                <select name="" id="" class="form-control select-pcd">
                                    <option value="0">Select</option>
                                    @foreach ($procedure as $pcd)
                                    @php
                                        $pcd = (object) $pcd;
                                    @endphp
                                        <option value="{{$pcd->code}}" text_pcd="{{$pcd->name}}">{{$pcd->name}}</option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="col-4">
                                <button id="submit_newprocedure" class="btn btn-sm btn-load btn-primary w-100 ">Add Procedure</button></div>
                        </div>


                        <div class="row mt-3">

                            <div class="col-12">

                                <table class="table table-borderless w-100 list-this-cases">
                                    <tr>
                                        <td><u >Procedure</u></td>
                                        <td><u >Physician</u></td>
                                        <td></td>
                                    </tr>

                                    @forelse($case_today as $data2)
                                        @php
                                            $data2 = (object) $data2;
                                            if($data2->hn != $case->case_hn){
                                                continue;
                                            }
                                        @endphp
                                        <tr>
                                            <td>{{$data2->procedurename}}</td>
                                            <td >{{$data2->patientname}}</td>
                                            <td >
                                                <a href="{{url("capture/loadpic2servercapture/$case->_id?newcase=$data2->_id")}}" class="btn btn-success btn-loadicon checkend_time">
                                                    <i style="font-size: 20px" class="las la-camera"></i>
                                                </a>
                                            </td>
                                        </tr>
                                    @empty
                                        <tr>
                                            <td colspan="3" class="text-light text-center">- No case!! -</td>
                                        </tr>
                                    @endforelse


                                </table>
                            </div>
                        </div>
                    </div>
                    <div class="col-8">
                        <div class="row m-0">
                            <div class="col-6"></div>
                            <div class="col-6">

                                <div class="form-group">
                                    <div class="input-icon">
                                        <input type="text" class="form-control" placeholder="Search..." id="search_case"/>
                                        <span><i class="flaticon2-search-1 icon-md"></i></span>
                                    </div>
                                </div>





                            </div>
                            <div class="menu-list-scroll mt-2">
                                <div class="row m-0 p-3 " style="background: #121212;">
                                    <div class="col-2">HN</div>
                                    <div class="col-2">Name</div>
                                    <div class="col-3">Physician</div>
                                    <div class="col-3">Procedure</div>
                                    <div class="col-2 text-end">Action</div>

                                </div>
                                @foreach($case_today as $data)
                                @php
                                    $data = (object) $data;
                                @endphp
                                    <div class="row m-0 cn py-3">
                                            <div class="col-2">{{$data->hn}}  </div>
                                            <div class="col-2">{{$data->patientname}}</div>
                                            <div class="col-3">{{$data->doctorname}}</div>
                                            <div class="col-3">{{$data->procedurename}}</div>
                                            <div class="col-2 text-end pr-1">
                                                <a href="{{url("camera/$case->_id?newcase=$data->_id")}}" class="btn btn-loadicon btn-danger checkend_time">
                                                    <i style="font-size: 16px" class="ri-camera-fill"></i>
                                                </a>
                                            </div>
                                    </div>
                                @endforeach
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>




<script>
    $(".add_endtime").click(function(){
        alert(1);
    })
</script>
