mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
Debut BD Cours
This commit is contained in:
@@ -16,6 +16,18 @@ class Course extends Model
|
|||||||
return $this->belongsTo('App\User');
|
return $this->belongsTo('App\User');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function instructor()
|
||||||
|
{
|
||||||
|
if (\App\User::find($this->user_id))
|
||||||
|
{
|
||||||
|
return \App\User::find($this->user_id)->fullname();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return $this->user_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function event()
|
public function event()
|
||||||
{
|
{
|
||||||
return $this->belongsTo('App\Event');
|
return $this->belongsTo('App\Event');
|
||||||
|
|||||||
@@ -142,6 +142,14 @@ class EventController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
$course->save();
|
$course->save();
|
||||||
|
|
||||||
|
$ocom = \App\OCOM::where('ocom','=',request('ocom_n'.$l.'_p'.$p))->first();
|
||||||
|
if ($ocom != null)
|
||||||
|
{
|
||||||
|
$foo = $ocom->courses();
|
||||||
|
$foo->push($course);
|
||||||
|
$ocom->saveCourses($foo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,11 +12,11 @@ class OCOMController extends Controller
|
|||||||
/**
|
/**
|
||||||
* Display a listing of the resource.
|
* Display a listing of the resource.
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
//
|
return view('admin.ocom.index',['ocoms' => OCOM::all()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -640,6 +640,18 @@ X20,\"Participer à des activités
|
|||||||
|
|
||||||
$newocom->ocom = $ocom[0];
|
$newocom->ocom = $ocom[0];
|
||||||
$newocom->oren = $oren[0];
|
$newocom->oren = $oren[0];
|
||||||
|
|
||||||
|
if ($newocom->ocom[0] == 'C' || $newocom->ocom[0] == 'c')
|
||||||
|
{
|
||||||
|
$newocom->complementary = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$newocom->complementary = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$newocom->course_id = '';
|
||||||
|
|
||||||
$newocom->objectif_competence = $obj_competence;
|
$newocom->objectif_competence = $obj_competence;
|
||||||
$newocom->objectif_rendement = $orens[$oren[0]];
|
$newocom->objectif_rendement = $orens[$oren[0]];
|
||||||
$newocom->save();
|
$newocom->save();
|
||||||
@@ -662,12 +674,12 @@ X20,\"Participer à des activités
|
|||||||
/**
|
/**
|
||||||
* Display the specified resource.
|
* Display the specified resource.
|
||||||
*
|
*
|
||||||
* @param \App\OCOM $oCOM
|
* @param $OCOM
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
|
||||||
*/
|
*/
|
||||||
public function show(OCOM $oCOM)
|
public function show($OCOM)
|
||||||
{
|
{
|
||||||
//
|
return view('admin.ocom.show',['ocom' => OCOM::find($OCOM)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
24
app/OCOM.php
24
app/OCOM.php
@@ -6,5 +6,27 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class OCOM extends Model
|
class OCOM extends Model
|
||||||
{
|
{
|
||||||
//
|
public function courses()
|
||||||
|
{
|
||||||
|
$courses_id = explode(',',$this->course_id);
|
||||||
|
$courses = collect();
|
||||||
|
foreach ($courses_id as $course_id)
|
||||||
|
{
|
||||||
|
$courses->push(\App\Course::find($course_id));
|
||||||
|
}
|
||||||
|
return $courses;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function saveCourses($courses)
|
||||||
|
{
|
||||||
|
$courses_id = [];
|
||||||
|
foreach ($courses as $cours)
|
||||||
|
{
|
||||||
|
if ($cours != null){
|
||||||
|
array_push($courses_id,$cours->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->course_id = implode(',',$courses_id);
|
||||||
|
$this->save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ class CreateOCOMSTable extends Migration
|
|||||||
$table->string('nbPeriode');
|
$table->string('nbPeriode');
|
||||||
$table->string('objectif_rendement');
|
$table->string('objectif_rendement');
|
||||||
$table->string('oren');
|
$table->string('oren');
|
||||||
|
$table->boolean('complementary');
|
||||||
|
$table->string('course_id');
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
9181
package-lock.json
generated
9181
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
19
package.json
19
package.json
@@ -10,16 +10,17 @@
|
|||||||
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"axios": "^0.18",
|
"axios": "^0.18.1",
|
||||||
"bootstrap": "^4.0.0",
|
"bootstrap": "^4.4.1",
|
||||||
"popper.js": "^1.12",
|
"cross-env": "^5.2.1",
|
||||||
"cross-env": "^5.1",
|
"jquery": "^3.4.1",
|
||||||
"jquery": "^3.2",
|
"laravel-mix": "^2.1.14",
|
||||||
"laravel-mix": "^2.0",
|
"lodash": "^4.17.15",
|
||||||
"lodash": "^4.17.4",
|
"popper.js": "^1.16.1",
|
||||||
"vue": "^2.5.7"
|
"vue": "^2.6.11"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"sweetalert2": "^7.26.11"
|
"ajv": "^6.12.0",
|
||||||
|
"sweetalert2": "^7.33.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
744
public/css/app.css
vendored
744
public/css/app.css
vendored
File diff suppressed because it is too large
Load Diff
49147
public/js/app.js
vendored
49147
public/js/app.js
vendored
File diff suppressed because it is too large
Load Diff
21
resources/assets/js/app.js
vendored
21
resources/assets/js/app.js
vendored
@@ -1,22 +1 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* First we will load all of this project's JavaScript dependencies which
|
|
||||||
* includes Vue and other libraries. It is a great starting point when
|
|
||||||
* building robust, powerful web applications using Vue and Laravel.
|
|
||||||
*/
|
|
||||||
|
|
||||||
require('./bootstrap');
|
|
||||||
|
|
||||||
window.Vue = require('vue');
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Next, we will create a fresh Vue application instance and attach it to
|
|
||||||
* the page. Then, you may begin adding components to this application
|
|
||||||
* or customize the JavaScript scaffolding to fit your unique needs.
|
|
||||||
*/
|
|
||||||
|
|
||||||
Vue.component('example-component', require('./components/ExampleComponent.vue'));
|
|
||||||
|
|
||||||
const app = new Vue({
|
|
||||||
el: '#app'
|
|
||||||
});
|
|
||||||
|
|||||||
75
resources/views/admin/ocom/index.blade.php
Normal file
75
resources/views/admin/ocom/index.blade.php
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
@extends('layouts.admin.main')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header card-header-primary">
|
||||||
|
<h4 class="card-title">Liste des cours</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="content">
|
||||||
|
<p>Liste des cours dans la base de données</p>
|
||||||
|
<table class="table table-striped table-no-bordered table-hover dataTable dtr-inline" id="table" style="width:100%">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th style="width: 4.5rem">Status</th>
|
||||||
|
<th style="width: 4.5rem">OREN</th>
|
||||||
|
<th style="width: 4.5rem">OCOM</th>
|
||||||
|
<th style="width: 7rem">Nb Periode</th>
|
||||||
|
<th>Objectif de rendement</th>
|
||||||
|
<th>Objectif de compétence</th>
|
||||||
|
<th style="width: 6rem"></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($ocoms as $ocom)
|
||||||
|
<tr class="cursor" onclick="navigate({{$ocom->id}})">
|
||||||
|
<td class="text-center">
|
||||||
|
@if($ocom->course_id != "")
|
||||||
|
<div data-toggle="tooltip" data-placement="right" title="Le cours a été donné">
|
||||||
|
<i class="fas fa-check-circle fa-2x text-success"></i>
|
||||||
|
</div>
|
||||||
|
@else
|
||||||
|
<div data-toggle="tooltip" data-placement="right" title="Le cours n'a jamais été donné">
|
||||||
|
<i class="fas fa-times-circle fa-2x text-warning"></i>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</td>
|
||||||
|
<td>{{$ocom->oren}}</td>
|
||||||
|
<td>{{$ocom->ocom}}</td>
|
||||||
|
<td>{{$ocom->nbPeriode}}</td>
|
||||||
|
<td>{{$ocom->objectif_rendement}}</td>
|
||||||
|
<td>{{$ocom->objectif_competence}}</td>
|
||||||
|
<td>
|
||||||
|
<button class="btn btn-primary btn-fab btn-fab-mini btn-round">
|
||||||
|
<i class="material-icons">edit</i>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-danger btn-fab btn-fab-mini btn-round">
|
||||||
|
<i class="material-icons">delete</i>
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
<a class="navbar-brand">Base de données des cours</a>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('custom_scripts')
|
||||||
|
<script>
|
||||||
|
$('.tooltip').tooltip('enable')
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#table').DataTable({
|
||||||
|
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
|
||||||
|
"ordering" : true,
|
||||||
|
});
|
||||||
|
} );
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
84
resources/views/admin/ocom/show.blade.php
Normal file
84
resources/views/admin/ocom/show.blade.php
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
@extends('layouts.admin.main')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header card-header-primary">
|
||||||
|
<h4 class="card-title">{{$ocom->ocom.' / '.$ocom->objectif_competence}}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<div class="content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label>OREN</label>
|
||||||
|
<p>{{$ocom->oren}}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<label>OCOM</label>
|
||||||
|
<p>{{$ocom->ocom}}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Objectif de compétence</label>
|
||||||
|
<p>{{$ocom->objectif_competence}}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Nombre de période</label>
|
||||||
|
<p>{{$ocom->nbPeriode}}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-4">
|
||||||
|
<label>Objectif de rendement</label>
|
||||||
|
<p>{{$ocom->objectif_rendement}}</p>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-8 text-right">
|
||||||
|
<button type="button" class="btn btn-warning">Modifier</button>
|
||||||
|
<button type="button" class="btn btn-danger">Supprimer</button>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
<label>Index des périodes</label>
|
||||||
|
@if($ocom->course_id == "")
|
||||||
|
<p class="text-center text-muted">Le cours n'est jamais donnée</p>
|
||||||
|
@else
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>ID</th>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Instructeur</th>
|
||||||
|
<th>Niveau</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($ocom->courses() as $course)
|
||||||
|
<tr>
|
||||||
|
<th>{{$course->id}}</th>
|
||||||
|
<td>{{$course->event->date_begin}}</td>
|
||||||
|
<td>{{$course->instructor()}}</td>
|
||||||
|
<td>{{$course->level}}</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('breadcrumb')
|
||||||
|
<a class="navbar-brand" href="/admin/ocom">Base de données des cours</a> / {{$ocom->ocom}}
|
||||||
|
@endsection
|
||||||
|
|
||||||
|
@section('custom_scripts')
|
||||||
|
<script>
|
||||||
|
$('.tooltip').tooltip('enable')
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#table').DataTable({
|
||||||
|
"lengthMenu": [[25, 50, -1], [25, 50, "All"]],
|
||||||
|
"ordering" : true,
|
||||||
|
});
|
||||||
|
} );
|
||||||
|
</script>
|
||||||
|
@endsection
|
||||||
@@ -13,7 +13,7 @@ foreach (Auth::user()->unreadNotifications as $notification) {
|
|||||||
<i class="material-icons design_bullet-list-67 visible-on-sidebar-mini">view_list</i>
|
<i class="material-icons design_bullet-list-67 visible-on-sidebar-mini">view_list</i>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<a class="navbar-brand">@yield('breadcrumb')</a>
|
@yield('breadcrumb')
|
||||||
</div>
|
</div>
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
|
<button class="navbar-toggler" type="button" data-toggle="collapse" aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
|
||||||
<span class="sr-only">Toggle navigation</span>
|
<span class="sr-only">Toggle navigation</span>
|
||||||
|
|||||||
@@ -43,3 +43,5 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=r82pabvd9arn3fjb1e2fsolf2xpixuv4hwfwart4cf1fb7mx"></script>
|
<script src="https://cloud.tinymce.com/stable/tinymce.min.js?apiKey=r82pabvd9arn3fjb1e2fsolf2xpixuv4hwfwart4cf1fb7mx"></script>
|
||||||
|
|
||||||
|
<script src="/js/app.js"></script>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::get('/admin/config/files' , 'ConfigController@showfilesConfig')->middleware('perm:config_edit');
|
Route::get('/admin/config/files' , 'ConfigController@showfilesConfig')->middleware('perm:config_edit');
|
||||||
Route::post('/admin/config/files' , 'ConfigController@editfilesConfig')->middleware('perm:config_edit');
|
Route::post('/admin/config/files' , 'ConfigController@editfilesConfig')->middleware('perm:config_edit');
|
||||||
|
|
||||||
/** Public page */
|
/** Public page */
|
||||||
Route::get('/admin/public/edit/{config}', 'PublicController@edit')->middleware('perm:config_edit');
|
Route::get('/admin/public/edit/{config}', 'PublicController@edit')->middleware('perm:config_edit');
|
||||||
Route::post('/admin/public/edit/{config}', 'PublicController@update')->middleware('perm:config_edit');
|
Route::post('/admin/public/edit/{config}', 'PublicController@update')->middleware('perm:config_edit');
|
||||||
|
|
||||||
@@ -166,6 +166,10 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::get('/admin/files','FilesController@index')->middleware('perm:file_see');
|
Route::get('/admin/files','FilesController@index')->middleware('perm:file_see');
|
||||||
Route::get('/admin/guide','FilesController@guide')->middleware('perm:file_see');
|
Route::get('/admin/guide','FilesController@guide')->middleware('perm:file_see');
|
||||||
Route::get('/admin/drive/{folder?}','GoogleDriveController@index')->middleware('perm:file_see');
|
Route::get('/admin/drive/{folder?}','GoogleDriveController@index')->middleware('perm:file_see');
|
||||||
|
|
||||||
|
/** OCOM */
|
||||||
|
Route::get('/admin/ocom','OCOMController@index');
|
||||||
|
Route::get('/admin/ocom/{id}','OCOMController@show');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
3
webpack.mix.js
vendored
3
webpack.mix.js
vendored
@@ -11,7 +11,6 @@ let mix = require('laravel-mix');
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
mix.js('resources/assets/js/app.js', 'public/js')
|
mix.sass('resources/assets/sass/app.scss', 'public/css')
|
||||||
.sass('resources/assets/sass/app.scss', 'public/css')
|
|
||||||
.sass('resources/theme/material-dashboard/assets/scss/material-dashboard.scss', 'public/css')
|
.sass('resources/theme/material-dashboard/assets/scss/material-dashboard.scss', 'public/css')
|
||||||
.styles('resources/custom.css','public/css/custom.css');
|
.styles('resources/custom.css','public/css/custom.css');
|
||||||
|
|||||||
Reference in New Issue
Block a user