@extends('layouts.app')
@section('title','View Case Details | ')
@section('content')

<!-- Content Header (Page header) -->
<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-sm-6">
                <h4 class="m-0">View Case Details</h4>
            </div><!-- /.col -->
            <div class="col-sm-6">
                <ol class="breadcrumb float-sm-right">
                    <li class="breadcrumb-item"><a href="#">Home</a></li>
                    <li class="breadcrumb-item active">Case Management</li>
                </ol>
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.container-fluid -->
</div>
<!-- /.content-header -->
<!-- Main content -->
<section class="content">
    <div class="container-fluid">

        <div class="card card-dark" id="claim_details">
            <div class="card-header hide_in_print">
                <div class="card-title">
                    <h4 class="card-title">Case Details</h4>
                </div>
                <button type="button" class="btn btn-sm btn-light float-right print_btn">Print</button>
            </div>
            <div class="card-body">
                @if(session('success'))
                <div class="alert alert-success alert-dismissible fade show" role="alert">
                    <strong>{{ session('success') }}</strong>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                @endif
                @if(session('error'))
                <div class="alert alert-danger alert-dismissible fade show" role="alert">
                    <strong>{{ session('error') }}</strong>
                    <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                @endif
                <div class="row">

                    @if(!empty($cases))
                    <div class="col-md-12 border p-1">
                        <h5 class="font-weight-bolder text-info border-bottom border-secondary p-2 mb-2">Case Details
                        </h5>
                        <div class="row">
                            @if($cases->case_opened == 1)
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Employee Name:
                                    <strong>{{ $cases->emp_name }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Employee ID:
                                    <strong>{{ $cases->emp_id }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Claim Category:
                                    <strong>{{ $cases->claim_category }}</strong>
                                </p>
                            </div>
                            @endif
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Case Number:
                                    <strong>{{ $cases->case_number }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Case Status:
                                    <strong>
                                        @if($cases->case_status == 1)
                                        {{ __('Pending')  }}
                                        @elseif($cases->case_status == 2)
                                        {{ __('Processing')  }}
                                        @elseif($cases->case_status == 3)
                                        {{ __('Closed')  }}
                                        @endif
                                    </strong>
                                </p>
                            </div>

                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Subject:
                                    <strong>{{ $cases->subject }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Plaintiff:
                                    <strong>{{ $cases->plaintiff }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Defendant:
                                    <strong>{{ $cases->defendant }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Case Reported Date:
                                    <strong>{{ formatDate($cases->case_reported_date) }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Case File Date:
                                    <strong>{{ formatDate($cases->case_file_date) }}</strong>
                                </p>
                            </div>
                            
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Lawyer Name:
                                    <strong>{{ $cases->lawyer_name }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Lawyer Mobile:
                                    <strong>{{ $cases->lawyer_mobile }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Hearing Date:
                                    <strong>{{ formatDate($cases->hearing_date) }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Previous Hearing Date:
                                @if(!empty($cases->previous_hearing_date))
                                    <strong>{{ formatDate($cases->previous_hearing_date) }}</strong>
                                    @else
                                    <strong>-</strong>
                                    @endif
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Next Hearing Date:
                                @if(!empty($cases->next_hearing_date))
                                <strong>{{ formatDate($cases->next_hearing_date) }}</strong>
                                    @else
                                    <strong>-</strong>
                                    @endif
                                    
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Court Name:
                                @if(is_numeric($cases->court_name)) 
                                <strong>{{ $cases->name_c }}</strong>
                                        @else 
                                            <strong>{{ $cases->court_name }}</strong>
                                        @endif
                                    
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Court Address:
                                    <strong>{{ $cases->court_address }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Court District:
                                    <strong>{{ $cases->district_name }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Court Number:
                                    <strong>{{ $cases->court_number }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Case File Year:
                                    <strong>{{ $cases->case_file_year }}</strong>
                                </p>
                            </div>
                            <div class="col-md-6 col-lg-6 col-sm-12 mb-2">
                                <p class="p-0 m-0 text-secondary  border-muted">Act Details:
                                    <strong>{{ $cases->act_details }}</strong>
                                </p>
                            </div>
                        </div>
                    </div>
                    @if(!empty($cases->case_hearings))
                    @foreach($cases->case_hearings as $hearings)
                    <div class="col-md-12 mt-1 border p-1">
                        <p class="p-0 m-0 text-dark"><strong>Hearing Date:</strong> {{ formatDate($hearings->next_hearing_date) }}</p>
                        <p class="p-0 m-0 text-dark"><strong>Current Case Remark: </strong>{{ $hearings->current_remark }}</p>
                        @if(!empty($hearings->current_file_copy))
                        <p class="p-0 m-0 text-dark"><strong>Case Document: </strong>
                        <a href='{{ url("public/assets/cases/$hearings->current_file_copy ") }}' class="btn btn-xs btn-primary pl-3 pr-3" download>Download</a></p>
                        @endif
                    </div>
                    @endforeach
                    @endif
                    @else
                    <div class="col-md-12 col-lg-12 col-sm-12 mb-2">
                        <p class="p-0 m-0 text-secondary border-muted">
                            <strong>No Record Found</strong>
                        </p>
                    </div>
                    @endif
                    <a href="javascript:history.go(-1)" class="btn btn-secondary m-1" title="Return to previous page">Back</a>
                    <!-- <a class="btn btn-secondary m-1" href="{{ route('list.all.cases') }}">Back</a> -->

                </div>
            </div>
        </div>
    </div>
    <!-- /.container-fluid -->
</section>
<!-- /.content -->
@endsection
