Continue MMC
This commit is contained in:
@@ -147,26 +147,29 @@ class AUKController extends Controller
|
||||
$auks = array();
|
||||
$MMC_PATH = $project->mmc_path;
|
||||
|
||||
$mmc_dir = scandir($MMC_PATH);
|
||||
if(is_dir($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) {
|
||||
$tmp_array = array();
|
||||
$tmp_array['auk_name'] = "АУК " . $entry;
|
||||
$tmp_array['auk_path'] = $entry;
|
||||
$tmp_array['image_dir'] = "";
|
||||
$mmc_course_dir = scandir($course_path);
|
||||
foreach ($mmc_course_dir as $course_entry) {
|
||||
if (strcasecmp($course_entry, 'images') == 0) {
|
||||
$course_image_path = $course_path . '/' . $course_entry;
|
||||
if (is_dir($course_image_path)) {
|
||||
$tmp_array['image_dir'] = $course_entry;
|
||||
foreach ($mmc_dir as $entry) {
|
||||
$course_path = $MMC_PATH . '/' . $entry;
|
||||
if (is_dir($course_path)) {
|
||||
if (intval($entry) > 0 && intval($entry) < 99) {
|
||||
$tmp_array = array();
|
||||
$tmp_array['auk_name'] = "АУК " . $entry;
|
||||
$tmp_array['auk_path'] = $entry;
|
||||
$tmp_array['image_dir'] = "";
|
||||
$mmc_course_dir = scandir($course_path);
|
||||
foreach ($mmc_course_dir as $course_entry) {
|
||||
if (strcasecmp($course_entry, 'images') == 0) {
|
||||
$course_image_path = $course_path . '/' . $course_entry;
|
||||
if (is_dir($course_image_path)) {
|
||||
$tmp_array['image_dir'] = $course_entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
array_push($auks, $tmp_array);
|
||||
}
|
||||
array_push($auks, $tmp_array);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,7 +202,7 @@ class AUKController extends Controller
|
||||
'auk_name' => $auk_name,
|
||||
'auk_path' => $auk_path,
|
||||
'image_dir' => $image_dir,
|
||||
'parent_id' => null,
|
||||
'parent_id' => 0,
|
||||
]);
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Project;
|
||||
use App\Models\AUK;
|
||||
use App\Models\Document;
|
||||
|
||||
|
||||
class MMCController extends Controller
|
||||
{
|
||||
@@ -17,7 +20,12 @@ class MMCController extends Controller
|
||||
{
|
||||
$project_id = $request->session()->get('project_id');
|
||||
$project = Project::find($project_id);
|
||||
return view('mmc.list', ['project' => $project]);
|
||||
$top_auks = $project->auks()->where('parent_id', 0)->get()->sortBy('auk_name');
|
||||
if(count($top_auks))
|
||||
{
|
||||
$mmc = $top_auks[0]->mmcs;
|
||||
}
|
||||
return view('mmc.list', ['project' => $project, 'top_auks' => $top_auks]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user