[194a359] | 1 | @extends('layouts.app')
|
---|
| 2 |
|
---|
[4b7e2d3] | 3 | @section("title", "SaveSpace - Dashboard")
|
---|
[194a359] | 4 |
|
---|
[4b7e2d3] | 5 | @section('head')
|
---|
[c6b84df] | 6 |
|
---|
| 7 | <!-- DataTable -->
|
---|
| 8 | <link rel="stylesheet" href="{{ url('vendors/dataTable/datatables.min.css') }}" type="text/css">
|
---|
| 9 | @endsection
|
---|
[194a359] | 10 |
|
---|
| 11 | @section('content')
|
---|
| 12 |
|
---|
[c6b84df] | 13 | <div class="page-header">
|
---|
| 14 | <nav aria-label="breadcrumb">
|
---|
| 15 | <ol class="breadcrumb">
|
---|
| 16 | <li class="breadcrumb-item">
|
---|
| 17 | <a href="{{ url('/') }}">Dashboard</a>
|
---|
| 18 | </li>
|
---|
| 19 | </ol>
|
---|
| 20 | </nav>
|
---|
| 21 | </div>
|
---|
[194a359] | 22 |
|
---|
| 23 | <div class="row">
|
---|
| 24 | <div class="col-md-12">
|
---|
| 25 |
|
---|
| 26 | <div class="row">
|
---|
[c6b84df] | 27 | <div class="col-lg-4 col-md-12">
|
---|
[194a359] | 28 | <div class="card">
|
---|
| 29 | <div class="card-body">
|
---|
[c6b84df] | 30 | <div class="d-flex justify-content-between mb-3">
|
---|
[194a359] | 31 | <div>
|
---|
[c6b84df] | 32 | <p class="text-muted">Total Departments</p>
|
---|
| 33 | <h2 class="font-weight-bold">{{ $departments->count() }}</h2>
|
---|
| 34 | </div>
|
---|
| 35 | <div>
|
---|
| 36 | <figure class="avatar">
|
---|
| 37 | <span class="avatar-title bg-success-bright text-success rounded-circle">
|
---|
| 38 | <i class="ti-layout-grid2"></i>
|
---|
[194a359] | 39 | </span>
|
---|
[c6b84df] | 40 | </figure>
|
---|
[194a359] | 41 | </div>
|
---|
| 42 | </div>
|
---|
[c6b84df] | 43 | <div class="d-inline-flex align-items-center">
|
---|
| 44 | <a href="{{ route("dashboard.departments.index") }}" class="text-linkedin"><i class="fa fa-arrow-right text-linkedin pr-1" aria-hidden="true"></i> Show departments</a>
|
---|
| 45 | </div>
|
---|
[194a359] | 46 | </div>
|
---|
| 47 | </div>
|
---|
| 48 | </div>
|
---|
| 49 | <div class="col-lg-4 col-md-12">
|
---|
[c6b84df] | 50 | <div class="card">
|
---|
[194a359] | 51 | <div class="card-body">
|
---|
[c6b84df] | 52 | <div class="d-flex justify-content-between mb-3">
|
---|
[194a359] | 53 | <div>
|
---|
[4b7e2d3] | 54 | <p class="text-muted">Number of folders</p>
|
---|
[c6b84df] | 55 | <h2 class="font-weight-bold">{{ $folders->count() }}</h2>
|
---|
| 56 | </div>
|
---|
| 57 | <div>
|
---|
| 58 | <figure class="avatar">
|
---|
| 59 | <span class="avatar-title bg-info-bright text-info rounded-circle">
|
---|
| 60 | <i class="ti-folder"></i>
|
---|
[194a359] | 61 | </span>
|
---|
[c6b84df] | 62 | </figure>
|
---|
[194a359] | 63 | </div>
|
---|
| 64 | </div>
|
---|
[c6b84df] | 65 | <div class="d-inline-flex align-items-center">
|
---|
| 66 | <a href="{{ route("dashboard.folders.index") }}" class="text-linkedin"><i class="fa fa-arrow-right text-linkedin pr-1" aria-hidden="true"></i> Show folders</a>
|
---|
[194a359] | 67 | </div>
|
---|
[c6b84df] | 68 | </div>
|
---|
| 69 | </div>
|
---|
| 70 | </div>
|
---|
| 71 | <div class="col-lg-4 col-md-12">
|
---|
| 72 | <div class="card">
|
---|
| 73 | <div class="card-body">
|
---|
| 74 | <div class="d-flex justify-content-between mb-3">
|
---|
| 75 | <div>
|
---|
| 76 | <p class="text-muted">Total Files</p>
|
---|
| 77 | <h2 class="font-weight-bold">{{ $files->count() }}</h2>
|
---|
[194a359] | 78 | </div>
|
---|
[c6b84df] | 79 | <div>
|
---|
| 80 | <figure class="avatar">
|
---|
| 81 | <span class="avatar-title bg-warning-bright text-warning rounded-circle">
|
---|
| 82 | <i class="ti-files"></i>
|
---|
| 83 | </span>
|
---|
| 84 | </figure>
|
---|
[194a359] | 85 | </div>
|
---|
| 86 | </div>
|
---|
[c6b84df] | 87 | <div class="d-inline-flex align-items-center">
|
---|
| 88 | <a href="{{ route("dashboard.files.index") }}" class="text-linkedin"><i class="fa fa-arrow-right text-linkedin pr-1" aria-hidden="true"></i> Show files</a>
|
---|
[194a359] | 89 | </div>
|
---|
| 90 | </div>
|
---|
| 91 | </div>
|
---|
| 92 | </div>
|
---|
[c6b84df] | 93 |
|
---|
[194a359] | 94 | </div>
|
---|
| 95 |
|
---|
[c6b84df] | 96 | </div>
|
---|
| 97 | </div>
|
---|
| 98 |
|
---|
[194a359] | 99 |
|
---|
[c6b84df] | 100 | <div class="card">
|
---|
| 101 | <div class="card-body">
|
---|
| 102 | <div class="d-flex justify-content-between">
|
---|
[4b7e2d3] | 103 | <h6 class="card-title">Recent Files</h6>
|
---|
[c6b84df] | 104 | <div>
|
---|
[4b7e2d3] | 105 | <a href="{{route("dashboard.index")}}" class="btn btn-outline-light btn-sm mr-2">
|
---|
[c6b84df] | 106 | <i class="fa fa-refresh"></i>
|
---|
| 107 | </a>
|
---|
| 108 | </div>
|
---|
| 109 | </div>
|
---|
[194a359] | 110 | <div class="row">
|
---|
[c6b84df] | 111 | <div class="col-md-12">
|
---|
| 112 | <div class="table-responsive">
|
---|
| 113 | <table id="recent-orders" class="table table-lg">
|
---|
| 114 | <thead>
|
---|
| 115 | <tr>
|
---|
[4b7e2d3] | 116 | <th>
|
---|
| 117 | </th>
|
---|
[c2e9bd9] | 118 | <th>Icon</th>
|
---|
[4b7e2d3] | 119 | <th>Name</th>
|
---|
| 120 | <th>Created at</th>
|
---|
| 121 | <th>Updated at</th>
|
---|
| 122 | <th>Folder name</th>
|
---|
| 123 | <th>Folder archive ID</th>
|
---|
| 124 | <th>Directory</th>
|
---|
| 125 | <th>Actions</th>
|
---|
[c6b84df] | 126 | </tr>
|
---|
| 127 | </thead>
|
---|
| 128 | <tbody>
|
---|
[4b7e2d3] | 129 | @foreach($recentFiles as $file)
|
---|
| 130 | <tr>
|
---|
| 131 | <td></td>
|
---|
| 132 | <td>
|
---|
| 133 | @if(in_array(explode('.', $file->name)[1], $excelExt))
|
---|
| 134 | <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
|
---|
| 135 | <i class="fa fa-file-excel-o text-success fa-2x"></i>
|
---|
| 136 | </div>
|
---|
| 137 | @else @if(in_array(explode('.', $file->name)[1], $textExt))
|
---|
| 138 | <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
|
---|
| 139 | <i class="fa fa-file-word-o text-info fa-2x"></i>
|
---|
| 140 | </div>
|
---|
| 141 | @else @if(explode('.', $file->name)[1] == 'pdf')
|
---|
| 142 | <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
|
---|
| 143 | <i class="fa fa-file-pdf-o text-danger fa-2x"></i>
|
---|
| 144 | </div>
|
---|
| 145 | @else @if(in_array(explode('.', $file->name)[1], $imageExt))
|
---|
[ff5b46e] | 146 | {{-- <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">--}}
|
---|
| 147 | {{-- <a href="{{ url('/storage/' . $file->location) }}" class="image-popup-gallery-item">--}}
|
---|
| 148 | {{-- <div class="image-hover">--}}
|
---|
| 149 | {{-- <img src="{{ url('/storage/' . $file->location) }}" class="rounded" width="30" alt="image">--}}
|
---|
| 150 | {{-- </div>--}}
|
---|
| 151 | {{-- </a>--}}
|
---|
| 152 | {{-- </div>--}}
|
---|
[4521f25] | 153 | <i class="fa fa-file-image-o text-danger"></i>
|
---|
[4b7e2d3] | 154 | @else
|
---|
[4521f25] | 155 | <i class="fa fa-file-text-o text-warning"></i>
|
---|
[4b7e2d3] | 156 | @endif
|
---|
| 157 | @endif
|
---|
| 158 | @endif
|
---|
| 159 | @endif
|
---|
| 160 | </td>
|
---|
| 161 | <td>{{ $file->name }}</td>
|
---|
| 162 | <td>{{ date('d.m.Y - H:i', strtotime($file->created_at)) }}</td>
|
---|
| 163 | @if($file->updated_at==NULL)
|
---|
| 164 | <td>/</td>
|
---|
| 165 | @else
|
---|
| 166 | <td>{{ date('d.m.Y - H:i', strtotime($file->updated_at)) }}</td>
|
---|
| 167 | @endif
|
---|
| 168 | <td><a href="{{ route('dashboard.folders.files', ['id' => $file->folder_id]) }}" class="text-linkedin">{{ \App\Models\Folder::find($file->folder_id)->name }}</a></td>
|
---|
| 169 | <td>{{ \App\Models\Folder::find($file->folder_id)->arch_id }}</td>
|
---|
| 170 | <!-- Trigger -->
|
---|
| 171 | <td><button data-clipboard-text="{{$file->location}}" class="btn btn-sm btn-primary text-white" data-toggle="tooltip" data-placement="right" title="{{$file->location}}"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-clipboard" viewBox="0 0 16 16">
|
---|
| 172 | <path d="M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"/>
|
---|
| 173 | <path d="M9.5 1a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5v-1a.5.5 0 0 1 .5-.5h3zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"/>
|
---|
| 174 | </svg></button>
|
---|
| 175 | </td>
|
---|
[0df7a93] | 176 | @if(auth()->user()->hasPermission('manage_all_files'))
|
---|
[4b7e2d3] | 177 | <td>
|
---|
| 178 | <a href="javascript:void(0)" class="text-secondary" data-toggle="modal" data-target="#editModal_{{$file->id}}" title="Edit">
|
---|
| 179 | <i class="ti-pencil"></i>
|
---|
| 180 | </a>
|
---|
| 181 | <a href="{{ route("dashboard.files.downloadFile", ['id' => $file->id]) }}" class="text-danger ml-2"title="Download">
|
---|
| 182 | <i class="ti-download"></i>
|
---|
| 183 | </a>
|
---|
| 184 | <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$file->id}}" title="Delete">
|
---|
| 185 | <i class="ti-trash"></i>
|
---|
| 186 | </a>
|
---|
| 187 | </td>
|
---|
[0df7a93] | 188 | @else
|
---|
| 189 | <td></td>
|
---|
| 190 | @endif
|
---|
[4b7e2d3] | 191 | </tr>
|
---|
| 192 | <div class="modal fade" id="deleteModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
|
---|
| 193 | <div class="modal-dialog modal-dialog-centered" role="document">
|
---|
| 194 | <div class="modal-content">
|
---|
| 195 | <div class="modal-header">
|
---|
| 196 | <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
|
---|
| 197 | <button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
---|
| 198 | <i class="ti-close"></i>
|
---|
| 199 | </button>
|
---|
| 200 | </div>
|
---|
| 201 | <div class="modal-body">
|
---|
| 202 | <form action="{{ route("dashboard.files.deleteFile", $file->id) }}" method="POST">
|
---|
| 203 | @csrf
|
---|
| 204 | @method('DELETE')
|
---|
| 205 | <p>Are you sure you want to delete file {{$file->name}}?</p>
|
---|
| 206 | <p>Location: <span class="pr-1">{{$file->location}}</span></p>
|
---|
| 207 | <div class="modal-footer">
|
---|
| 208 | <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
|
---|
| 209 | </button>
|
---|
| 210 | <button type="submit" class="btn btn-primary">Save changes</button>
|
---|
| 211 | </div>
|
---|
| 212 | </form>
|
---|
| 213 | </div>
|
---|
| 214 |
|
---|
| 215 | </div>
|
---|
| 216 | </div>
|
---|
| 217 | </div>
|
---|
| 218 | @endforeach
|
---|
[c6b84df] | 219 | </tbody>
|
---|
| 220 | </table>
|
---|
| 221 | </div>
|
---|
[194a359] | 222 | </div>
|
---|
[c6b84df] | 223 | </div>
|
---|
| 224 | </div>
|
---|
| 225 | </div>
|
---|
[194a359] | 226 |
|
---|
[c6b84df] | 227 | <div class="row">
|
---|
| 228 | <div class="col-lg-8 col-md-12">
|
---|
| 229 | <div class="card">
|
---|
| 230 | <div class="card-body">
|
---|
| 231 | <div class="d-md-flex mb-2 mb-sm-0 justify-content-between">
|
---|
[4b7e2d3] | 232 | <canvas id="canvas"></canvas>
|
---|
[c6b84df] | 233 | </div>
|
---|
| 234 | </div>
|
---|
| 235 | </div>
|
---|
| 236 | </div>
|
---|
| 237 | <div class="col-lg-4 col-md-12">
|
---|
| 238 | <div class="card">
|
---|
| 239 | <div class="card-body pb-0">
|
---|
| 240 | <div class="d-flex justify-content-between align-items-start mb-3">
|
---|
[4b7e2d3] | 241 | <h6 class="card-title mb-0">Largest departments</h6>
|
---|
| 242 | <a href="{{route("dashboard.departments.index")}}" class="small text-linkedin">View</a>
|
---|
[c6b84df] | 243 | </div>
|
---|
| 244 | </div>
|
---|
| 245 | <div class="table-responsive">
|
---|
| 246 | <table class="table table-striped mb-0">
|
---|
| 247 | <thead>
|
---|
| 248 | <tr>
|
---|
[4b7e2d3] | 249 | <th>Department</th>
|
---|
| 250 | <th>Number of folders</th>
|
---|
[c6b84df] | 251 | </tr>
|
---|
| 252 | </thead>
|
---|
| 253 | <tbody>
|
---|
[4b7e2d3] | 254 | @foreach($largestDepartments as $department)
|
---|
[c6b84df] | 255 | <tr>
|
---|
[4b7e2d3] | 256 |
|
---|
[c6b84df] | 257 | <td>
|
---|
[9a13901] | 258 | <a href="{{ route("dashboard.folders.index", ['id' => $department->id]) }}">{{$department->name}}</a>
|
---|
[c6b84df] | 259 | </td>
|
---|
| 260 | <td>
|
---|
[9a13901] | 261 | {{$department->no_of_folders}}
|
---|
[c6b84df] | 262 | </td>
|
---|
| 263 | </tr>
|
---|
[4b7e2d3] | 264 | @endforeach
|
---|
[c6b84df] | 265 | </tbody>
|
---|
| 266 | </table>
|
---|
[194a359] | 267 | </div>
|
---|
| 268 | </div>
|
---|
[c6b84df] | 269 | </div>
|
---|
| 270 | </div>
|
---|
[194a359] | 271 | @endsection
|
---|
| 272 |
|
---|
| 273 | @section('script')
|
---|
| 274 |
|
---|
| 275 | <!-- Apex chart -->
|
---|
[c6b84df] | 276 | <script src="https://apexcharts.com/samples/assets/irregular-data-series.js"></script>
|
---|
[194a359] | 277 | <script src="{{ url('/vendors/charts/apex/apexcharts.min.js') }}"></script>
|
---|
| 278 |
|
---|
[c6b84df] | 279 | <!-- Daterangepicker -->
|
---|
| 280 | <script src="{{ url('vendors/datepicker/daterangepicker.js') }}"></script>
|
---|
| 281 |
|
---|
| 282 | <!-- DataTable -->
|
---|
| 283 | <script src="{{ url('vendors/dataTable/datatables.min.js') }}"></script>
|
---|
[194a359] | 284 |
|
---|
| 285 | <!-- Dashboard scripts -->
|
---|
| 286 | <script src="{{ url('/assets/js/examples/dashboard.js') }}"></script>
|
---|
| 287 |
|
---|
[c6b84df] | 288 | <!-- Vamp -->
|
---|
| 289 | <script src="{{ url('vendors/vmap/jquery.vmap.min.js') }}"></script>
|
---|
| 290 | <script src="{{ url('vendors/vmap/maps/jquery.vmap.usa.js') }}"></script>
|
---|
| 291 | <script src="{{ url('assets/js/examples/vmap.js') }}"></script>
|
---|
| 292 |
|
---|
[194a359] | 293 | <!-- To use theme colors with Javascript -->
|
---|
| 294 | <div class="colors">
|
---|
| 295 | <div class="bg-primary"></div>
|
---|
| 296 | <div class="bg-primary-bright"></div>
|
---|
| 297 | <div class="bg-secondary"></div>
|
---|
| 298 | <div class="bg-secondary-bright"></div>
|
---|
| 299 | <div class="bg-info"></div>
|
---|
| 300 | <div class="bg-info-bright"></div>
|
---|
| 301 | <div class="bg-success"></div>
|
---|
| 302 | <div class="bg-success-bright"></div>
|
---|
| 303 | <div class="bg-danger"></div>
|
---|
| 304 | <div class="bg-danger-bright"></div>
|
---|
| 305 | <div class="bg-warning"></div>
|
---|
| 306 | <div class="bg-warning-bright"></div>
|
---|
| 307 | </div>
|
---|
| 308 |
|
---|
[c6b84df] | 309 | <script src="{{ url('assets/js/examples/pages/ecommerce-dashboard.js') }}"></script>
|
---|
[4b7e2d3] | 310 | <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>
|
---|
| 311 | <script>
|
---|
| 312 | var year = <?php echo $year; ?>;
|
---|
| 313 | var file = <?php echo $file; ?>;
|
---|
| 314 | var barChartData = {
|
---|
| 315 | labels: year,
|
---|
| 316 | datasets: [{
|
---|
| 317 | label: 'File',
|
---|
| 318 | backgroundColor: "red",
|
---|
| 319 | data: file
|
---|
| 320 | }]
|
---|
| 321 | };
|
---|
[194a359] | 322 |
|
---|
[4b7e2d3] | 323 | window.onload = function() {
|
---|
| 324 | var ctx = document.getElementById("canvas").getContext("2d");
|
---|
| 325 | window.myBar = new Chart(ctx, {
|
---|
| 326 | type: 'bar',
|
---|
| 327 | data: barChartData,
|
---|
| 328 | options: {
|
---|
| 329 | elements: {
|
---|
| 330 | rectangle: {
|
---|
| 331 | borderWidth: 2,
|
---|
| 332 | borderColor: '#c1c1c1',
|
---|
| 333 | borderSkipped: 'bottom'
|
---|
| 334 | }
|
---|
| 335 | },
|
---|
| 336 | responsive: true,
|
---|
| 337 | title: {
|
---|
| 338 | display: true,
|
---|
| 339 | text: 'Yearly uploaded files'
|
---|
| 340 | }
|
---|
| 341 | }
|
---|
| 342 | });
|
---|
| 343 | };
|
---|
| 344 | </script>
|
---|
[194a359] | 345 | @endsection
|
---|