mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
3.0.7
This commit is contained in:
@@ -320,4 +320,9 @@ class ECCController extends Controller
|
||||
{
|
||||
return view('ecc.list');
|
||||
}
|
||||
|
||||
public function files()
|
||||
{
|
||||
return view('ecc.files');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -119,37 +119,41 @@ class Schedule extends Model
|
||||
{
|
||||
$schedule = Schedule::all();
|
||||
$warning = collect();
|
||||
$today = date('U');
|
||||
|
||||
foreach ($schedule as $activity) {
|
||||
|
||||
if ($activity->type == "regular") {
|
||||
|
||||
for ($niv=1; $niv < 3; $niv++) {
|
||||
for ($pe=1; $pe < 2; $pe++) {
|
||||
|
||||
/** Check name */
|
||||
if ($activity->data['n'.$niv."_p".$pe."_name"] == "") {
|
||||
$warning->push(['warning' => 'Il doit y avoir un nom pour le cours', 'niveau' => $niv, 'periode' => $pe,'date' => $activity->date]);
|
||||
}
|
||||
|
||||
/** Check OCOM */
|
||||
if ($activity->data['n'.$niv."_p".$pe."_ocom"] == "") {
|
||||
$warning->push(['warning' => "Il doit y avoir un OCOM pour le cours", 'niveau' => $niv, 'periode' => $pe,'date' => $activity->date]);
|
||||
} else {
|
||||
$regex = '/[MC]['.$niv.']\d\d.\d\d/';
|
||||
if (preg_match($regex,trim($activity->data['n'.$niv."_p".$pe."_ocom"])) == 0) {
|
||||
$warning->push(['warning' => "L'OCOM du cours de semble pas être valide", 'niveau' => $niv, 'periode' => $activity->data['n'.$niv."_p".$pe."_ocom"],'date' => $activity->date]);
|
||||
$time = date('U',strtotime($activity->date));
|
||||
if ($time >= $today) {
|
||||
for ($niv=1; $niv <= 3; $niv++) {
|
||||
for ($pe=1; $pe <= 2; $pe++) {
|
||||
|
||||
/** Check name */
|
||||
if ($activity->data['n'.$niv."_p".$pe."_name"] == "") {
|
||||
$warning->push(['warning' => 'Il doit y avoir un nom pour le cours', 'niveau' => $niv, 'periode' => $pe,'date' => $activity->date]);
|
||||
}
|
||||
|
||||
/** Check OCOM */
|
||||
if ($activity->data['n'.$niv."_p".$pe."_ocom"] == "") {
|
||||
$warning->push(['warning' => "Il doit y avoir un OCOM pour le cours", 'niveau' => $niv, 'periode' => $pe,'date' => $activity->date]);
|
||||
} else {
|
||||
$regex = '/[MC]['.$niv.']\d\d.\d\d/';
|
||||
if (preg_match($regex,trim($activity->data['n'.$niv."_p".$pe."_ocom"])) == 0 && $activity->data['n'.$niv."_p".$pe."_ocom"] != "S.O") {
|
||||
$warning->push(['warning' => "L'OCOM du cours de semble pas être valide", 'niveau' => $niv, 'periode' => $activity->data['n'.$niv."_p".$pe."_ocom"],'date' => $activity->date]);
|
||||
}
|
||||
}
|
||||
|
||||
/** Check Instructor */
|
||||
if ($activity->data['n'.$niv."_p".$pe."_instructor"] == "") {
|
||||
$warning->push(['warning' => "Il doit y avoir un instructeur pour le cours", 'niveau' => $niv, 'periode' => $pe,'date' => $activity->date]);
|
||||
}
|
||||
|
||||
/** Check local */
|
||||
if ($activity->data['n'.$niv."_p".$pe."_local"] == "") {
|
||||
$warning->push(['warning' => "Il doit y avoir un local pour le cours", 'niveau' => $niv, 'periode' => $pe,'date' => $activity->date]);
|
||||
}
|
||||
}
|
||||
|
||||
/** Check Instructor */
|
||||
if ($activity->data['n'.$niv."_p".$pe."_instructor"] == "") {
|
||||
$warning->push(['warning' => "Il doit y avoir un instructeur pour le cours", 'niveau' => $niv, 'periode' => $pe,'date' => $activity->date]);
|
||||
}
|
||||
|
||||
/** Check local */
|
||||
if ($activity->data['n'.$niv."_p".$pe."_local"] == "") {
|
||||
$warning->push(['warning' => "Il doit y avoir un local pour le cours", 'niveau' => $niv, 'periode' => $pe,'date' => $activity->date]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user