public function showHomePage(Request $r) { $var = $this->getVars(); $content = array(); $content["services"] = Content::where('type', '=', 'services')->get(); $content["fields"] = Content::where('type', '=', 'fields')->get(); $events = Event::get(); $content["blogs"] = Content::where('type', '=', 'blogs')->orderBy("date_created", "desc")->take(3)->get(); $content["members"] = Member::orderBy('position', 'desc')->get(); $content["didactics"] = Content::where('type', '=', 'didactics')->orderBy("date_created", "desc")->take(3)->get(); $content["resources"] = Content::where('type', '=', 'resources')->orderBy("date_created", "desc")->take(3)->get(); $content["galleries"] = Content::where('type', '=', 'galleries')->orderBy("date_created", "desc")->take(3)->get(); $content["companies"] = Content::where('type', '=', 'companies')->orderBy("date_created", "desc")->get(); $content["researchesours"] = Content::where('type', '=', 'researches')->whereHas('research', function ($query) { $query->where('external', 0); })->orderBy("date_created", "desc")->take(2)->get(); $content["researchesexternal"] = Content::where('type', '=', 'researches')->whereHas('research', function ($query) { $query->where('external', 1); })->orderBy("date_created", "desc")->take(2)->get(); $services = Content::where('type', '=', 'services')->get(); // dd($content); $lang = $r->session()->get("lang", "fa"); // if($lang == "en") // return view("testhome",["content" => $content, "var" => $var, "lang" => $lang]); return view('home', ["content" => $content, "var" => $var, "lang" => $lang]); }
public function index() { $events = \App\Event::get(); $sliders = \App\Slider::get(); $services = \App\Service::get(); $site = \App\Site::where('active', '1')->firstOrFail(); return view('pages.index', ['events' => $events, 'sliders' => $sliders, 'services' => $services, 'site' => $site]); }
/** * Reverse the migrations. * * @return void */ public function down() { $events = Event::get(); // Get all the current events and attribute them to manchester (MCR). foreach ($events as $event) { $event->city_id = null; $event->save(); } }
public function editForm() { $eventNames = \App\Event::get()->pluck('name', 'id')->toArray(); $mediaNames = \App\Media::get()->pluck('name', 'id')->toArray(); $eventIDs = \App\Event::get()->pluck('id')->toArray(); $mediaIDs = \App\Media::get()->pluck('id')->toArray(); $mediaToEvents = array(); $eventToMedia = array(); foreach ($eventIDs as $eventID) { $eventToMedia[$eventID] = \App\Media::join('event_media', 'media.id', '=', 'event_media.mediaID')->where('event_media.eventID', $eventID)->get()->pluck('name', 'id')->toArray(); } foreach ($mediaIDs as $mediaID) { $mediaToEvents[$mediaID] = \App\Event::join('event_media', 'events.id', '=', 'event_media.eventID')->where('event_media.mediaID', $mediaID)->get()->pluck('name', 'id')->toArray(); } return view('forms/editRelationships')->with(['eventNames' => $eventNames, 'mediaNames' => $mediaNames, 'eventToMedia' => $eventToMedia, 'mediaToEvents' => $mediaToEvents]); }
public function edit($id, Requests\EditEventRequest $request) { $event = \App\Event::get()->where('id', intval($id))->toArray(); if (empty($event)) { App: abort(404); } $data = $request->all(); $tags = $data['tags']; if ($data['summary'] == '') { $data['summary'] = NULL; } unset($data['_token']); unset($data['tags']); \App\EventTag::where('eventID', intval($id))->delete(); foreach ($tags as $tag) { \App\EventTag::create(['eventID' => intval($id), 'tag' => $tag]); } \App\Event::where('id', $id)->update($data); return redirect('/'); }
public function dept() { if (Auth::user()->position->id == 1) { $this->data['items'] = Score::where('userid', Auth::id())->get(); return view('pages.viewmark.staff', $this->data); } else { if (Request::isMethod('get')) { $this->data['events'] = Event::get(); $this->data['staffs'] = null; return view('pages.viewmark.yes', $this->data); } else { // dd(Input::all()); $this->data['events'] = Event::get(); $user = Score::where('eventid', Input::get('event'))->get(); foreach ($user as $key => $value) { if ($value->user->deptid != Auth::user()->deptid) { unset($user[$key]); } } $this->data['staffs'] = $user; return view('pages.viewmark.yes', $this->data); } } }
public function index() { /* Get data for timeline */ $eventDates = \App\Event::select('timelineDate')->distinct()->get()->pluck('timelineDate')->toArray(); $mediaDates = \App\Media::select('timelineDate')->distinct()->get()->pluck('timelineDate')->toArray(); $dates = array_unique(array_merge($eventDates, $mediaDates), SORT_REGULAR); usort($dates, array('\\App\\Http\\Controllers\\TimelineController', 'dateCompare')); $media = array(); $events = array(); foreach ($dates as $date) { $eventsForThisDate = \App\Event::get()->where('timelineDate', $date)->toArray(); $mediaForThisDate = \App\Media::get()->where('timelineDate', $date)->toArray(); usort($eventsForThisDate, array('\\App\\Http\\Controllers\\TimelineController', 'itemCompare')); usort($mediaForThisDate, array('\\App\\Http\\Controllers\\TimelineController', 'itemCompare')); $media[$date] = $mediaForThisDate; $events[$date] = $eventsForThisDate; } /* Get data for filters */ $mediums = \App\Media::select('medium')->distinct()->get()->pluck('medium')->toArray(); $tags = \App\EventTag::select('tag')->distinct()->get()->pluck('tag')->toArray(); $series = \App\Series::get()->pluck('seriesAbbreviation'); sort($mediums); sort($tags); $eventIDToTags = array(); $eventIDs = \App\Event::get()->pluck('id'); foreach ($eventIDs as $eventID) { $eventIDToTags[$eventID] = \App\EventTag::select('tag')->where('eventID', $eventID)->get()->pluck('tag')->toArray(); } $seriesToCollections = array(); foreach ($series as $thisSeries) { $seriesToCollections[$thisSeries] = \App\Media::select('collection')->where('series', $thisSeries)->distinct()->get()->pluck('collection')->toArray(); } /* Get event-media relationships */ $eventMediaPairs = \App\EventMedia::get(array('eventID', 'mediaID'))->toArray(); return view('timeline')->with(['seriesToCollections' => $seriesToCollections, 'eventMediaPairs' => $eventMediaPairs, 'eventIDToTags' => $eventIDToTags, 'mediums' => $mediums, 'events' => $events, 'dates' => $dates, 'media' => $media, 'tags' => $tags]); }
/** * Our index page listing all users * * @author David Varney */ public function index() { $events = Event::get(); return view('admin.events.index', array('title' => 'Admin: Events', 'events' => $events)); }
public function event() { $this->data = array(); $this->data['event'] = Event::get(); return view('list_event', $this->data); }
/** * Display a listing of the resource. * * @return Response */ public function index() { $this->data['event'] = Event::get(); return view('admin.event.manage', $this->data); }