Пример #1
0
 public function tasks($id)
 {
     $line = Line::find($id);
     $tasksGroupedDate = Task::getGroupedDateByLineId($id);
     krsort($tasksGroupedDate);
     return view('line.tasks', ['line' => $line, 'tasksGroupedDate' => $tasksGroupedDate]);
 }
Пример #2
0
 public function update($id)
 {
     $area = Area::findOrFail($id);
     $AMs = Employee::where('level_id', 3)->active()->get();
     $lines = Line::all();
     $dataView = ['area' => $area, 'AMs' => $AMs, 'lines' => $lines];
     return view('admin.area.edit', $dataView);
 }
Пример #3
0
 public function doDelete($id)
 {
     $line = Line::findOrFail($id);
     try {
         $line->delete();
         return redirect()->back()->with('message', 'Line has been deleted successfully !');
     } catch (ParseException $ex) {
         echo 'Failed to delete this line , with error message: ' . $ex->getMessage();
     }
 }
Пример #4
0
 public function update($id)
 {
     $lines = Line::all();
     $levels = Level::all();
     $employee = Employee::findOrFail($id);
     $salesManagers = Employee::where('level_id', 2)->get();
     $areaManagers = Employee::where('level_id', 3)->get();
     $dataView = ['lines' => $lines, 'levels' => $levels, 'employee' => $employee, 'salesManagers' => $salesManagers, 'areaManagers' => $areaManagers];
     return view('admin.employee.edit', $dataView);
 }
Пример #5
0
 public function index()
 {
     /** @var Collection $lines */
     $lines = Line::where('visible', true)->orderBy('list_order', 'asc')->get();
     $lineIds = array_map(function ($line) {
         return $line['id'];
     }, $lines->all());
     $dateStart = new \DateTime('-4 day');
     $dateEnd = new \DateTime('+4 day');
     $tasks = Task::whereIn('line_id', $lineIds)->whereBetween('date', [$dateStart->format('Y-m-d'), $dateEnd->format('Y-m-d')])->get();
     return view('nichirei.index', ['lines' => $lines, 'tasks' => $tasks, 'dateStart' => $dateStart, 'dateEnd' => $dateEnd]);
 }
Пример #6
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function fire()
 {
     Departure::truncate();
     Line::truncate();
     Stop::truncate();
     $cities = City::all();
     foreach ($cities as $city) {
         $this->info('importing city: ' . $city->name);
         $lines = Line::import($city);
         foreach ($lines as $line) {
             $this->info('importing line: ' . $line->name);
             $stops = Stop::fullImport($line);
         }
     }
 }
Пример #7
0
 public function all()
 {
     $lines = Line::all();
     $tasksGrouped = Task::getGroupedDateAndLineId();
     return view('task.all', ['lines' => $lines, 'tasksGrouped' => $tasksGrouped]);
 }
Пример #8
0
 public function achievement()
 {
     $dataView = ['lines' => Line::all(), 'MRs' => Employee::where('level_id', 7)->get()];
     return view('admin.line.history.search', $dataView);
 }
Пример #9
0
 public function updateProductTarget($productTargetId)
 {
     $productTarget = ProductsTarget::findOrFail($productTargetId);
     $lines = Line::all();
     $dataView = ['lines' => $lines, 'productTarget' => $productTarget];
     return view('admin.product.edit_target', $dataView);
 }