@extends('template.app')

@section('meta')
@endsection

@section('title')
    Team Master View
@endsection

@section('styles')
@endsection

@section('content')
<div class="page-breadcrumb">
    <div class="row">
        <div class="col-7 align-self-center">
            <h4 class="page-title text-truncate text-dark font-weight-medium mb-1">Team Master</h4>
            <div class="d-flex align-items-center">
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb m-0 p-0">
                        <li class="breadcrumb-item"><a href="{{ route('dashboard') }}" class="text-muted">Dashboard</a></li>
                        <li class="breadcrumb-item"><a href="{{ route('team_master') }}" class="text-muted">Team Master</a></li>
                        <li class="breadcrumb-item text-muted active" aria-current="page">View</li>
                    </ol>
                </nav>
            </div>
        </div>
    </div>
</div>
<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <form action="{{ route('team_master.view') }}" name="form" id="form" method="post" enctype="multipart/form-data">
                        @csrf
                        @method('GET')

                        <div class="row">
                            <div class="form-group col-sm-3">
                                <label for="team_name">Team Name</label>
                                <input type="text" name="team_name" id="team_name" class="form-control" placeholder="Enter Team name" value="{{ $data->team_name ??'' }}" disabled>
                                <span class="kt-form__help error team_name"></span>
                            </div>      

                            <div class="form-group col-sm-3">
                                <label for="branch_name">Branch Name</label>
                                <select class="form-control" name="branch_name" id="branch_name" disabled>
                                    <option value="">Select Branch Name</option>
                                    @if(isset($Branch_data) && $Branch_data->isNotEmpty())
                                        @foreach($Branch_data as $branch_data)
                                            <option value="{{ $branch_data->id }}" @if($data->branch_name == $branch_data->id) selected @endif >{{ ucfirst(str_replace('_', ' ', $branch_data->name)) }}</option>
                                        @endforeach
                                    @endif
                                </select>
                                <span class="kt-form__help error branch_name"></span>
                            </div> 
                            
                            <div class="form-group col-sm-12">
                                <label for="department">Department</label>
                                <select class="form-control" name="department" id="department" disabled>
                                    <option value="">Select Branch Name</option>
                                    @if(isset($department) && $department->isNotEmpty())
                                        @foreach($department as $depart)
                                            <option value="{{ $depart->id }}" @if($data->department == $depart->id) selected @endif >{{ ucfirst(str_replace('_', ' ', $depart->name)) }}</option>
                                        @endforeach
                                    @endif
                                </select>
                                <span class="kt-form__help error department"></span>
                            </div>
                            

                        </div>

                        <div class="form-group">
                            <a href="{{ route('team_master') }}" class="btn waves-effect waves-light btn-rounded btn-outline-secondary">Back</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection

@section('scripts')
@endsection