source: resources/views/dashboard/index.blade.php@ ff5b46e

develop
Last change on this file since ff5b46e was ff5b46e, checked in by beratkjufliju <kufliju@…>, 3 years ago

bug fixes

  • Property mode set to 100644
File size: 20.5 KB
Line 
1@extends('layouts.app')
2
3@section("title", "SaveSpace - Dashboard")
4
5@section('head')
6
7 <!-- DataTable -->
8 <link rel="stylesheet" href="{{ url('vendors/dataTable/datatables.min.css') }}" type="text/css">
9@endsection
10
11@section('content')
12
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>
22
23 <div class="row">
24 <div class="col-md-12">
25
26 <div class="row">
27 <div class="col-lg-4 col-md-12">
28 <div class="card">
29 <div class="card-body">
30 <div class="d-flex justify-content-between mb-3">
31 <div>
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>
39 </span>
40 </figure>
41 </div>
42 </div>
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>
46 </div>
47 </div>
48 </div>
49 <div class="col-lg-4 col-md-12">
50 <div class="card">
51 <div class="card-body">
52 <div class="d-flex justify-content-between mb-3">
53 <div>
54 <p class="text-muted">Number of folders</p>
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>
61 </span>
62 </figure>
63 </div>
64 </div>
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>
67 </div>
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>
78 </div>
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>
85 </div>
86 </div>
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>
89 </div>
90 </div>
91 </div>
92 </div>
93
94 </div>
95
96 </div>
97 </div>
98
99
100 <div class="card">
101 <div class="card-body">
102 <div class="d-flex justify-content-between">
103 <h6 class="card-title">Recent Files</h6>
104 <div>
105 <a href="{{route("dashboard.index")}}" class="btn btn-outline-light btn-sm mr-2">
106 <i class="fa fa-refresh"></i>
107 </a>
108 </div>
109 </div>
110 <div class="row">
111 <div class="col-md-12">
112 <div class="table-responsive">
113 <table id="recent-orders" class="table table-lg">
114 <thead>
115 <tr>
116 <th>
117 </th>
118 <th>Image</th>
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>
126 </tr>
127 </thead>
128 <tbody>
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))
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>--}}
153 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
154 <i class="fa fa-file-image-o text-danger fa-2x"></i>
155 </div>
156 @else
157 <div class="col-xl-1 col-lg-1 col-md-1 col-sm-2">
158 <i class="fa fa-file-text-o text-warning fa-2x"></i>
159 </div>
160 @endif
161 @endif
162 @endif
163 @endif
164 </td>
165 <td>{{ $file->name }}</td>
166 <td>{{ date('d.m.Y - H:i', strtotime($file->created_at)) }}</td>
167 @if($file->updated_at==NULL)
168 <td>/</td>
169 @else
170 <td>{{ date('d.m.Y - H:i', strtotime($file->updated_at)) }}</td>
171 @endif
172 <td><a href="{{ route('dashboard.folders.files', ['id' => $file->folder_id]) }}" class="text-linkedin">{{ \App\Models\Folder::find($file->folder_id)->name }}</a></td>
173 <td>{{ \App\Models\Folder::find($file->folder_id)->arch_id }}</td>
174 <!-- Trigger -->
175 <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">
176 <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"/>
177 <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"/>
178 </svg></button>
179 </td>
180 @if(auth()->user()->hasPermission('manage_all_files'))
181 <td>
182 <a href="javascript:void(0)" class="text-secondary" data-toggle="modal" data-target="#editModal_{{$file->id}}" title="Edit">
183 <i class="ti-pencil"></i>
184 </a>
185 <a href="{{ route("dashboard.files.downloadFile", ['id' => $file->id]) }}" class="text-danger ml-2"title="Download">
186 <i class="ti-download"></i>
187 </a>
188 <a href="javascript:void(0)" class="text-danger ml-2" data-toggle="modal" data-target="#deleteModal_{{$file->id}}" title="Delete">
189 <i class="ti-trash"></i>
190 </a>
191 </td>
192 @else
193 <td></td>
194 @endif
195 </tr>
196 <div class="modal fade" id="deleteModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
197 <div class="modal-dialog modal-dialog-centered" role="document">
198 <div class="modal-content">
199 <div class="modal-header">
200 <h5 class="modal-title" id="exampleModalCenterTitle">Delete confirmation</h5>
201 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
202 <i class="ti-close"></i>
203 </button>
204 </div>
205 <div class="modal-body">
206 <form action="{{ route("dashboard.files.deleteFile", $file->id) }}" method="POST">
207 @csrf
208 @method('DELETE')
209 <p>Are you sure you want to delete file {{$file->name}}?</p>
210 <p>Location: <span class="pr-1">{{$file->location}}</span></p>
211 <div class="modal-footer">
212 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
213 </button>
214 <button type="submit" class="btn btn-primary">Save changes</button>
215 </div>
216 </form>
217 </div>
218
219 </div>
220 </div>
221 </div>
222
223 <div class="modal fade" id="editModal_{{$file->id}}" tabindex="-1" role="dialog" aria-hidden="true">
224 <div class="modal-dialog modal-dialog-centered" role="document">
225 <div class="modal-content">
226 <div class="modal-header">
227 <h5 class="modal-title" id="exampleModalCenterTitle">Rename file</h5>
228 <button type="button" class="close" data-dismiss="modal" aria-label="Close">
229 <i class="ti-close"></i>
230 </button>
231 </div>
232 <div class="modal-body">
233 <form action="{{ route("dashboard.files.renameFile", ["id" =>$file->id]) }}" method="post" accept-charset="utf-8">
234 @method("patch")
235 @csrf
236 <div class="row">
237 <div class="col-md-12">
238 <div class="form-group">
239 <label class="form-label">Current name: {{$file->name}}</label>
240 <input type="text" name="name" value="{{ explode('.', $file->name)[0] }}" maxlength="255" title="Don't include: '\/.|'" pattern="^[^.\/|]+$" class="form-control" required>
241 </div>
242 </div>
243 </div>
244 <br/>
245 <div class="modal-footer">
246 <button type="button" class="btn btn-secondary" data-dismiss="modal">Close
247 </button>
248 <button type="submit" class="btn btn-primary">Save changes</button>
249 </div>
250 </form>
251 </div>
252
253 </div>
254 </div>
255 </div>
256 @endforeach
257 </tbody>
258 </table>
259 </div>
260 </div>
261 </div>
262 </div>
263 </div>
264
265 <div class="row">
266 <div class="col-lg-8 col-md-12">
267 <div class="card">
268 <div class="card-body">
269 <div class="d-md-flex mb-2 mb-sm-0 justify-content-between">
270 <canvas id="canvas"></canvas>
271 </div>
272 </div>
273 </div>
274 </div>
275 <div class="col-lg-4 col-md-12">
276 <div class="card">
277 <div class="card-body pb-0">
278 <div class="d-flex justify-content-between align-items-start mb-3">
279 <h6 class="card-title mb-0">Largest departments</h6>
280 <a href="{{route("dashboard.departments.index")}}" class="small text-linkedin">View</a>
281 </div>
282 </div>
283 <div class="table-responsive">
284 <table class="table table-striped mb-0">
285 <thead>
286 <tr>
287 <th>Department</th>
288 <th>Number of folders</th>
289 </tr>
290 </thead>
291 <tbody>
292 @foreach($largestDepartments as $department)
293 <tr>
294
295 <td>
296 <a href="#">{{$department->name}}</a>
297 </td>
298 <td>
299 <a href="#">{{$department->no_of_folders}}</a>
300 </td>
301 </tr>
302 @endforeach
303 </tbody>
304 </table>
305 </div>
306 </div>
307 </div>
308 </div>
309@endsection
310
311@section('script')
312
313 <!-- Apex chart -->
314 <script src="https://apexcharts.com/samples/assets/irregular-data-series.js"></script>
315 <script src="{{ url('/vendors/charts/apex/apexcharts.min.js') }}"></script>
316
317 <!-- Daterangepicker -->
318 <script src="{{ url('vendors/datepicker/daterangepicker.js') }}"></script>
319
320 <!-- DataTable -->
321 <script src="{{ url('vendors/dataTable/datatables.min.js') }}"></script>
322
323 <!-- Dashboard scripts -->
324 <script src="{{ url('/assets/js/examples/dashboard.js') }}"></script>
325
326 <!-- Vamp -->
327 <script src="{{ url('vendors/vmap/jquery.vmap.min.js') }}"></script>
328 <script src="{{ url('vendors/vmap/maps/jquery.vmap.usa.js') }}"></script>
329 <script src="{{ url('assets/js/examples/vmap.js') }}"></script>
330
331 <!-- To use theme colors with Javascript -->
332 <div class="colors">
333 <div class="bg-primary"></div>
334 <div class="bg-primary-bright"></div>
335 <div class="bg-secondary"></div>
336 <div class="bg-secondary-bright"></div>
337 <div class="bg-info"></div>
338 <div class="bg-info-bright"></div>
339 <div class="bg-success"></div>
340 <div class="bg-success-bright"></div>
341 <div class="bg-danger"></div>
342 <div class="bg-danger-bright"></div>
343 <div class="bg-warning"></div>
344 <div class="bg-warning-bright"></div>
345 </div>
346
347 <script src="{{ url('assets/js/examples/pages/ecommerce-dashboard.js') }}"></script>
348 <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.min.js"></script>
349 <script>
350 var year = <?php echo $year; ?>;
351 var file = <?php echo $file; ?>;
352 var barChartData = {
353 labels: year,
354 datasets: [{
355 label: 'File',
356 backgroundColor: "red",
357 data: file
358 }]
359 };
360
361 window.onload = function() {
362 var ctx = document.getElementById("canvas").getContext("2d");
363 window.myBar = new Chart(ctx, {
364 type: 'bar',
365 data: barChartData,
366 options: {
367 elements: {
368 rectangle: {
369 borderWidth: 2,
370 borderColor: '#c1c1c1',
371 borderSkipped: 'bottom'
372 }
373 },
374 responsive: true,
375 title: {
376 display: true,
377 text: 'Yearly uploaded files'
378 }
379 }
380 });
381 };
382 </script>
383@endsection
Note: See TracBrowser for help on using the repository browser.