Skip to content

Commit

Permalink
change color to light blue when control is partly made
Browse files Browse the repository at this point in the history
  • Loading branch information
dbarzin committed Oct 31, 2024
1 parent cc43d3f commit 0ae0ebf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/ControlController.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ public function history()

// Get all controls
$controls = DB::table('controls')
->select('id', 'score', 'realisation_date', 'plan_date')
->select('id', 'score', 'observations', 'realisation_date', 'plan_date')
->get();

// Fetch measures for all controls in one query
Expand Down
4 changes: 4 additions & 0 deletions public/css/all.css
Original file line number Diff line number Diff line change
Expand Up @@ -50770,6 +50770,10 @@ input[type="text"] {
background-color: #C9CBCF;
cursor: pointer;
}
.MyCalendar .days .day_num .event.lblue {
background-color: #baccf0;
cursor: pointer;
}
.MyCalendar .days .day_num:nth-child(7n+1) {
border-left: 1px solid #e6e9ea;
}
Expand Down
4 changes: 4 additions & 0 deletions resources/css/calendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
background-color: #C9CBCF;
cursor: pointer;
}
.MyCalendar .days .day_num .event.lblue {
background-color: #baccf0;
cursor: pointer;
}
.MyCalendar .days .day_num:nth-child(7n+1) {
border-left: 1px solid #e6e9ea;
}
Expand Down
11 changes: 7 additions & 4 deletions resources/views/controls/history.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,19 @@
$calendar = new \App\Calendar(\Carbon\Carbon::now()->format('m/Y'));
foreach ($controls as $control) {
if (($control->score==null) && ($control->plan_date!=null)) {
if (($control->score===null) && ($control->plan_date!==null)) {
if ($control->observations===null)
$calendar->addEvent($control->measures->implode(', '), $control->plan_date, 1, 'grey', $control->id);
else
$calendar->addEvent($control->measures->implode(', '), $control->plan_date, 1, 'lblue', $control->id);
}
else if (($control->score==1) && ($control->realisation_date!=null)) {
else if (($control->score===1) && ($control->realisation_date!==null)) {
$calendar->addEvent($control->measures->implode(', '), $control->realisation_date, 1, 'red', $control->id);
}
else if (($control->score==2) && ($control->realisation_date!=null)) {
else if (($control->score===2) && ($control->realisation_date!==null)) {
$calendar->addEvent($control->measures->implode(', '), $control->realisation_date, 1, 'orange', $control->id);
}
else if (($control->score==3) && ($control->realisation_date!=null)) {
else if (($control->score===3) && ($control->realisation_date!==null)) {
$calendar->addEvent($control->measures->implode(', '), $control->realisation_date, 1, 'green', $control->id);
}
}
Expand Down

0 comments on commit 0ae0ebf

Please sign in to comment.