Esempio n. 1
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Region $region, TrainRoad $trainRoad, Stantion $stantion)
 {
     $regionsCount = $region->count();
     $tRoadsCount = $trainRoad->count();
     $stationsCount = $stantion->count();
     $condCount = Condition::count();
     $productsCount = Product::count();
     $servicesCount = Service::count();
     $catCount = Category::count();
     $statusesCount = Status::count();
     $serviceStatusesCount = ServiceStatus::count();
     $newOrdersCount = Order::where('is_new', 1)->count();
     $newServiceOrdersCount = ServiceOrder::where('is_new', 1)->count();
     $customers = Firm::where('accountant_fio', null)->get();
     return view('admin.adminArea', ['regionsCount' => $regionsCount, 'tRoadsCount' => $tRoadsCount, 'stationsCount' => $stationsCount, 'condCount' => $condCount, 'catCount' => $catCount, 'productsCount' => $productsCount, 'servicesCount' => $servicesCount, 'statusesCount' => $statusesCount, 'newOrdersCount' => $newOrdersCount, 'serviceStatusesCount' => $serviceStatusesCount, 'newServiceOrdersCount' => $newServiceOrdersCount, 'customers' => $customers]);
 }
 public function createServiceAgreement(Request $request)
 {
     $firm = Firm::where('id', $request->firmId)->first();
     if (!$firm) {
         abort(404);
     }
     $firm->has_service_agreement = 1;
     $firm->save();
     return redirect()->back()->with('alert-success', 'Договор на оказание услуг с фирмой ' . $firm->organisation_name . ' заключен.');
 }