diff --git a/app/Http/Controllers/MMCController.php b/app/Http/Controllers/MMCController.php index cd16e6e..bdf6d8f 100644 --- a/app/Http/Controllers/MMCController.php +++ b/app/Http/Controllers/MMCController.php @@ -127,6 +127,62 @@ class MMCController extends Controller { $project_id = $request->session()->get('project_id'); $project = Project::find($project_id); - return view('mmc.scan', ['project' => $project]); + + + $MMC = array(); + $total_size = 0; + $total_count = 0; + $MMC_PATH = $project->mmc_path; + $mmc_dir = scandir($MMC_PATH); + + + foreach ($mmc_dir as $entry) { + $course_path = $MMC_PATH . '/' . $entry; + if (is_dir($course_path)) { + if (intval($entry) > 0 && intval($entry) < 99) { + // $MMC[] = $entry; + // echo ($entry . "\n"); + $mmc_course_dir = scandir($course_path); + foreach ($mmc_course_dir as $course_entry) { + // VVV Images VVV + if (strcasecmp($course_entry, 'images') == 0) { + $course_image_path = $course_path . '/' . $course_entry; + if (is_dir($course_image_path)) { + // echo ($course_image_path . "\n"); + $MMC[$entry]['image_dir'] = $course_entry; + $course_images = scandir($course_image_path); + foreach ($course_images as $image) { + $image_file_path = $course_image_path . '/' . $image; + if (is_file($image_file_path)) { + if (strncmp($entry, $image, 2) == 0) { + if ( + strcasecmp(substr($image, -3, 3), 'jpg') == 0 || + strcasecmp(substr($image, -3, 3), 'svg') == 0 || + strcasecmp(substr($image, -3, 3), 'swf') == 0 + ) { + // $MMC[$entry][] = $image; + $tmp_array = array(); + $tmp_array['file'] = $image; + $tmp_array['size'] = filesize($image_file_path); + $tmp_array['mtime'] = filemtime($image_file_path); + $tmp_array['atime'] = fileatime($image_file_path); + + $MMC[$entry]['images'][] = $tmp_array; + + $total_size += $tmp_array['size']; + $total_count++; + } + } + } + } + } + } + // ^^^ Images ^^^ + } + } + } + } + + return view('mmc.scan', ['project' => $project,'MMC' => $MMC]); } } diff --git a/public/css/app.css b/public/css/app.css index 6755c29..d3ebebb 100644 --- a/public/css/app.css +++ b/public/css/app.css @@ -827,6 +827,9 @@ select { .max-w-6xl { max-width: 72rem; } +.max-w-xl { + max-width: 36rem; +} .flex-1 { flex: 1 1 0%; } @@ -936,6 +939,9 @@ select { .border-l-4 { border-left-width: 4px; } +.border-r { + border-right-width: 1px; +} .border-gray-300 { --tw-border-opacity: 1; border-color: rgb(209 213 219 / var(--tw-border-opacity)); @@ -955,6 +961,10 @@ select { --tw-border-opacity: 1; border-color: rgb(129 140 248 / var(--tw-border-opacity)); } +.border-gray-400 { + --tw-border-opacity: 1; + border-color: rgb(156 163 175 / var(--tw-border-opacity)); +} .bg-white { --tw-bg-opacity: 1; background-color: rgb(255 255 255 / var(--tw-bg-opacity)); @@ -1110,6 +1120,9 @@ select { .tracking-widest { letter-spacing: 0.1em; } +.tracking-wider { + letter-spacing: 0.05em; +} .text-gray-500 { --tw-text-opacity: 1; color: rgb(107 114 128 / var(--tw-text-opacity)); diff --git a/resources/views/mmc/create.blade.php b/resources/views/mmc/create.blade.php index e69de29..c44e735 100644 --- a/resources/views/mmc/create.blade.php +++ b/resources/views/mmc/create.blade.php @@ -0,0 +1,19 @@ + + + + {{ $project->name }}: {{ __('Create MMC') }} + + + + + + + + + MMC create form here + + + + + + \ No newline at end of file diff --git a/resources/views/mmc/scan.blade.php b/resources/views/mmc/scan.blade.php index a19c1c5..e7e1766 100644 --- a/resources/views/mmc/scan.blade.php +++ b/resources/views/mmc/scan.blade.php @@ -1,7 +1,7 @@ - {{ __('Scan MMC') }} + {{ $project->name }}: {{ __('Scan MMC') }} @@ -10,9 +10,47 @@ + @foreach ($MMC as $key => $value) + АУК {{ $key }} + + + + {{ __('File') }} + + + {{ __('Size') }} + + + {{ __('MTime') }} + + + {{ __('ATime') }} + + + {{ __('Actions') }} + + + @forelse ($value['images'] as $image) + + {{ $image['file'] }} + {{ $image['size'] }} + {{ $image['mtime'] }} + {{ $image['atime'] }} + + + + + @empty + + No Documents! + + + @endforelse + + @endforeach - \ No newline at end of file + diff --git a/routes/web.php b/routes/web.php index de62415..4d8d200 100644 --- a/routes/web.php +++ b/routes/web.php @@ -37,7 +37,7 @@ Route::prefix('admin')->middleware(['admin'])->group(function () { Route::resource('/projects', ProjectController::class)->middleware(['auth']); Route::post('/project/{project}/select',SelectProjectController::class)->middleware(['auth'])->name('project.select'); -Route::resource('/mmc', MMCController::class)->middleware(['auth']); +Route::resource('/mmc', MMCController::class)->middleware(['auth'])->only(['index','create']); Route::get('/mmc/scan', [MMCController::class, 'scan'])->middleware(['auth'])->name('mmc.scan'); Route::resource('/documents', DocumentController::class)->except('show')->middleware(['auth']); Route::resource('/auks', AUKController::class)->except('show')->middleware(['auth']);