Ejemplo n.º 1
0
 public function edit($id)
 {
     $request = Request::with(['equipment', 'area', 'location', 'category', 'uploads', 'approvers', 'status', 'actions' => function ($query) {
         $query->orderBy('created_at', 'desc');
     }, 'actions.submitted', 'comments.author' => function ($query) {
         $query->orderBy('created_at', 'asc');
     }])->find($id);
     if (is_null($request)) {
         return view('security.not-found');
     }
     $data['request'] = $request;
     $data['areas'] = Area::all(['id', 'name']);
     $data['organizations'] = Organization::all();
     $data['categories'] = Category::all(['id', 'name']);
     $data['locations'] = Location::all(['id', 'name']);
     $data['approvers'] = Approval::getRecent($id);
     $data['hasApproved'] = Approval::hasApproved($id)->exists();
     if ($request->Status->name == 'Approved') {
         return view('request.view', $data);
     }
     if ($request->submitted_by != Auth::User()->id && !Auth::User()->hasRole(['administrator', 'approver'])) {
         return view('security.401');
     }
     return view('request.edit', $data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $locations = Location::all()->toArray();
     /*$receptionist = Receptionist::where('role_id', '=', 3)->get();*/
     $receptionist = DB::table('users')->where('users.role_id', '=', 3)->join('locations', 'users.location_id', '=', 'locations.id')->get(['users.*', 'locations.name as location']);
     return Response::json(array('allreceptionists' => $receptionist, 'locations' => $locations));
 }
Ejemplo n.º 3
0
 public function index(Manager $fractal, LocationTransformer $locationTransformer)
 {
     // show all
     $records = Location::all();
     $collection = new Collection($records, $locationTransformer);
     $data = $fractal->createData($collection)->toArray();
     return $this->respond($data);
 }
 public function postDeleteLocation(Request $request)
 {
     $locationId = intval($request->input('location_id'));
     if ($locationId) {
         Location::find($locationId)->delete();
         return response(Location::all());
     }
     return redirect('dashboard/locations')->withErrors('No location id passed');
 }
Ejemplo n.º 5
0
 public function edit($partnerID)
 {
     if (!Auth::check() || !Auth::user()->is_admin) {
         return response(view('errors.403', ['error' => $this->errorMessages['incorrect_permissions']]), 403);
     }
     $partner = Partner::where('id', $partnerID)->firstOrFail();
     return view('partners.edit', ['partner' => $partner], ['locations' => Location::all()]);
     //return view('partners.edit')->with(['partner'=>$partner]);
 }
Ejemplo n.º 6
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $locations = Location::all()->lists('project_id');
     $project_list = Project::where('id', '>', '1');
     foreach ($locations as $location) {
         $project_list = $project_list->where('id', '!=', $location);
     }
     $project_list = $project_list->lists('name', 'id')->toArray();
     return view('pages.add-location', compact('project_list'));
 }
Ejemplo n.º 7
0
 public function edit($id)
 {
     $locations = Location::all();
     $options = array();
     foreach ($locations as $location) {
         $options[$location->name] = $location->description;
     }
     $user = FbUser::where('id', $id)->firstOrFail();
     return view('facebook.user.edit')->with('options', $options)->with('user', $user);
 }
Ejemplo n.º 8
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $this->comment(sprintf("Deleting %d products and %d locations", Product::count(), Location::count()));
     Product::all()->each(function ($doc) {
         $doc->delete();
     });
     Location::all()->each(function ($doc) {
         $doc->delete();
     });
 }
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $total = Location::all()->count();
     $used = Location::has('targets')->count();
     $free = $total - $used;
     if ($free < 5) {
         return redirect('/locations');
     }
     $location = Location::pickUnused(1);
     return view('experiments.create', compact('location', 'free'));
 }
Ejemplo n.º 10
0
 public function edit($id)
 {
     $locations = Location::all();
     $options = array();
     foreach ($locations as $location) {
         $options[$location->name] = $location->description;
     }
     $group = FbGroup::where('id', $id)->firstOrFail();
     $tags = Tag::all();
     return view('facebook.group.edit')->with('tags', $tags)->with('options', $options)->with('group', $group);
 }
Ejemplo n.º 11
0
 public function index()
 {
     $totalNumber = 5;
     // number of items to take for each section
     $data = ["events" => Event::where('end_datetime', '>', date(time()))->get()->take($totalNumber), "partners" => Partner::all()->take($totalNumber), "news" => News::all()->take($totalNumber), "media" => Media::where('processed', 0)->get()->take($totalNumber * 2)->chunk(3), "staffs" => User::where('is_staff', 1)->get(), "locations" => Location::all()->take($totalNumber)];
     $i = 0;
     foreach ($data['events'] as $event) {
         $mediaCount = count(Media::where('processed', false)->where('event_id', $event->id)->get());
         $data['events'][$i]->mediaCount = $mediaCount;
         $i++;
     }
     return View::make('admin.index')->with($data);
 }
Ejemplo n.º 12
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $user = Session::get('user');
     $allowed_departments = Session::get('allowed_departments');
     $match_departments = Session::get('match_departments');
     $playlists = Playlist::whereIn('department_id', $match_departments)->get();
     // Return all locations or only the ones th user is assigned to
     if ($user->is_super_user) {
         $locations = Location::all();
     } else {
         $locations = Location::whereIn('department_id', $match_departments)->get();
     }
     $data = array('locations' => $locations, 'allowed_departments' => $allowed_departments, 'user' => $user, 'playlists' => $playlists);
     return view('pages/locations', $data);
 }
Ejemplo n.º 13
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request)
 {
     $location = Location::all();
     $i = 1;
     foreach ($location as $key => $value) {
         $location1 = 'location1_' . $i;
         $location2 = 'location2_' . $i;
         $getid = 'id_' . $i;
         $id = Input::get($getid);
         $location = Location::find($id);
         $location->location1 = Input::get($location1);
         $location->location2 = Input::get($location2);
         $location->update();
         $i++;
     }
     return redirect('location/management/')->with('message', 'You have done successfully');
 }
Ejemplo n.º 14
0
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create(Request $request)
 {
     $locations = null;
     $tags = null;
     if ($request->session()->get('tags') == null) {
         $tags = Tag::all();
         $request->session()->put('tags', $tags);
     } else {
         $tags = $request->session()->get('tags');
     }
     if ($request->session()->get('locations') == null) {
         $locations = Location::all();
         $request->session()->put('locations', $locations);
     } else {
         $locations = $request->session()->get('locations');
     }
     return view('facebook.campaign.create')->with('locations', $locations)->with('tags', $tags);
 }
Ejemplo n.º 15
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $groups = FbGroup::where('tags', 'Undefined')->get();
     $total = count($groups);
     $group = $groups[0];
     $tags = null;
     if ($request->session()->get('tags') == null) {
         $tags = Tag::all();
         $request->session()->put('tags', $tags);
     } else {
         $tags = $request->session()->get('tags');
     }
     $locations = Location::all();
     $options = array();
     foreach ($locations as $location) {
         $options[$location->name] = $location->description;
     }
     return view('facebook.group.index2')->with('options', $options)->with('total', $total)->with('group', $group)->with('tags', $tags);
 }
Ejemplo n.º 16
0
 public static function boot()
 {
     parent::boot();
     static::creating(function ($model) {
         if ($model->stock_min == null) {
             $model->stock_min = 0;
         }
     });
     static::created(function ($model) {
         $model->mix_no = 100000 + $model->getKey();
         $model->save();
         foreach (Location::all() as $location) {
             $stock = new Stock(['location_id' => $location->id, 'qty' => 0]);
             $model->stock()->save($stock);
         }
     });
     static::deleting(function ($model) {
         $model->removePic();
     });
 }
 public function create()
 {
     $locations = Location::all();
     return view('story.create', ['locations' => $locations]);
 }
 public function index()
 {
     $location = Location::all();
     return view('locations', ['locations' => $location]);
 }
Ejemplo n.º 19
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $locations = Location::all();
     return view('general.location.index')->with('locations', $locations);
 }
Ejemplo n.º 20
0
 public function locationReport()
 {
     return view('cm_reports', array('title' => 'Location Report', 'reports' => $this->reports, 'locations' => \App\Location::all()));
 }
Ejemplo n.º 21
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $locations = Location::all();
     return view('travel.travel', compact('locations'));
 }
Ejemplo n.º 22
0
 public function index()
 {
     $locations = \App\Location::all();
     return $this->respond(['data' => $this->locationTransformer->TransformCollection($locations->all())]);
 }
Ejemplo n.º 23
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     return response()->json(Location::all());
 }
Ejemplo n.º 24
0
 public function index()
 {
     $locations = Location::all();
     return $this->output($locations);
 }
Ejemplo n.º 25
0
 public function all()
 {
     return Location::all();
 }
Ejemplo n.º 26
0
 public function cm()
 {
     //return the pm view
     return view('cmDashboard', array('title' => 'CM | Welcome', 'reports' => \App\CmReport::all(), 'locations' => \App\Location::all()));
 }
 /**
  * Show list of employee locations
  *
  * @return mixed
  */
 public function manageLocations()
 {
     $locs = Location::all();
     return view('admin.locations', compact('locs'));
 }
Ejemplo n.º 28
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return view('locations.index')->with('locations', Location::all());
 }
Ejemplo n.º 29
0
 private function composeNavigation()
 {
     view()->composer('partials.nav', function ($view) {
         $view->with('locations', Location::all());
     });
 }
Ejemplo n.º 30
0
 public function postLocationsNamesListPartial()
 {
     return View::make('layouts.partials._user_menu')->with('locations', Location::all());
 }