samedi 14 septembre 2019

Check the dates before planning

I planned a training date on 10/09/2019

enter image description here

My problem is that when I planned a revision for example on 09/09/2019 to 11/09/2019. I can add one recording , I would like to make one blocking... Is it possible?

enter image description here

 $conflictRevision = Revision::where('fk_motorbike', $fk_motorbike)
        ->whereDate('date_revision_start', "<=" , $date_start)
        ->whereDate('date_revision_end', ">=", $date_start)
        ->where('hour_start', "<=" , $request->get('hour_start'))  
        ->where('hour_end', ">=" , $request->get('hour_end'))
        ->first();


if(isset($conflictRevision)){
            return redirect()->route('trainings.index')
            ->with('error', 'The motorbike is in revision! ');
        }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire