
@extends('layouts.master')
@section('page-title') 
    Admin | {{ $page_title }}
@endsection
@section('page-css')
	<link rel="stylesheet" href="{{ url('public/assets/libs/select2/dist/css/select2.css') }}">
    <link rel="stylesheet" href="{{ url('public/assets/css/params.css') }}">

@endsection
@section('page-content')

@include('layouts.partials.navbar')
<div class="container my-5">
    <div class="card shadow-sm border-0">
        <div class="card-header bg-primary text-white py-3">
            <h5 class="mb-0"><i class="bi bi-shield-lock me-2"></i>LUPMIS User Group Permissions Matrix</h5>
        </div>
        <div class="card-body p-0">
            <div class="table-responsive">
                <table class="table table-hover align-middle mb-0">
                    <thead class="table-light">
                        <tr class="text-uppercase small fw-bold">
                            <th class="ps-4">User Group</th>
                            <th class="text-center">Permit Backend</th>
                            <th class="text-center">Update Permits</th>
                            <th class="text-center">Drawing Tools</th>
                            <th class="text-center">View Drawing Tools</th>
                            <th class="text-center pe-4">Admin GUI</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach($user_group_matrix as $row)
                            <?php //dump($row);  
                            $permit_tools_backend_fill = ($row->permit_tools_backend == true) ? "bi-check-circle-fill" : "bi-x-circle";
                            $update_permits_fill = ($row->update_permits == true) ? "bi-check-circle-fill" : "bi-x-circle";
                            $drawing_tools_fill = ($row->drawing_tools == true) ? "bi-check-circle-fill" : "bi-x-circle";
                            $view_drawing_tools_fill = ($row->view_drawing_tools == true) ? "bi-check-circle-fill" : "bi-x-circle";
                            $admin_gui_fill = ($row->admin_gui == true) ? "bi-check-circle-fill" : "bi-x-circle";
                            

                            ?>
                        <tr>
                            <td class="ps-4 fw-bold">{{ $row->name }}</td>
                            <td class="text-center text-<?php echo ($row->permit_tools_backend == true)? 'success':'danger'; ?>"><i class="bi {{ $permit_tools_backend_fill }}"></i></td>
                            <td class="text-center text-<?php echo ($row->update_permits == true)? 'success':'danger'; ?>"><i class="bi {{ $update_permits_fill }}"></i></td>
                            <td class="text-center text-<?php echo ($row->drawing_tools == true)? 'success':'danger'; ?>"><i class="bi {{ $drawing_tools_fill }}"></i></td>
                            <td class="text-center text-<?php echo ($row->view_drawing_tools == true)? 'success':'danger'; ?>"><i class="bi {{ $view_drawing_tools_fill }}"></i></td>
                            <td class="text-center text-<?php echo ($row->admin_gui == true)? 'success':'danger'; ?>"><i class="bi {{ $admin_gui_fill }}"></i></td>
                        </tr>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
        <div class="card-footer bg-light text-center py-3">
            <small class="text-muted">Note: Permissions are subject to District Assembly (DA) protocols.</small>
        </div>
    </div>
</div>

@endsection
@section('page-js')
	<script src="{{ url('public/assets/libs/select2/dist/js/select2.full.min.js') }}" type="text/javascript" ></script>
	<script src="{{ url('public/assets/js/params.js') }}" type="text/javascript" ></script>
@endsection
