/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); $faker = \Faker\Factory::create(); $user = User::create(['name' => 'Christian Kasperbauer', 'email' => '*****@*****.**', 'password' => bcrypt('grütze'), 'phone' => '0176-23152819', 'misc' => 'Friedrich-Ebert-Ring 4 97072 Würzburg (Ton-)Technik, KRIS, Website!', 'rights' => 'all']); $user2 = User::create(['name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt('grütze'), 'phone' => $faker->phoneNumber, 'misc' => $faker->sentence()]); for ($i = 0; $i <= 15; $i++) { User::create(['name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt('grütze'), 'phone' => $faker->phoneNumber, 'misc' => $faker->sentence()]); } Category::insert([['name' => 'Konzert', 'class' => 'light-green'], ['name' => 'Partey', 'class' => 'funky'], ['name' => 'Theater', 'class' => 'red'], ['name' => 'Kino', 'class' => 'amber'], ['name' => 'Sonstiges', 'class' => 'blue-grey'], ['name' => 'Wort', 'class' => 'light-blue']]); $user->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(4), 'category_id' => rand(1, 6), 'title' => 'Basement Blast', 'subtitle' => 'Geballer im Keller', 'description' => $faker->paragraph(10), 'admission' => 'donation', 'genre' => 'Metal', 'google_event_id' => str_random(12)])); $user2->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(9), 'category_id' => rand(1, 6), 'title' => 'Boxbeutel Boombox', 'subtitle' => 'Lecker Weinchen', 'description' => $faker->paragraph(10), 'admission' => 'free', 'genre' => 'Suff', 'google_event_id' => str_random(12)])); $user->events()->save(Event::create(['scheduled_at' => Carbon::now()->addDays(2)->addMonth(), 'category_id' => rand(1, 6), 'title' => 'Beats & Lyrics', 'subtitle' => 'Freestyle Chypher', 'description' => $faker->paragraph(10), 'admission' => 'donation', 'genre' => 'HipHop', 'google_event_id' => str_random(12)])); $user2->events()->save(Event::create(['scheduled_at' => Carbon::now()->subDays(2), 'category_id' => rand(1, 6), 'title' => 'Schon vorbei', 'subtitle' => 'Schade, du warst du spät', 'description' => $faker->paragraph(10), 'admission' => 'free', 'google_event_id' => str_random(12)])); $user->events()->save(Event::create(['scheduled_at' => Carbon::now()->subMonth(2), 'category_id' => rand(1, 6), 'title' => 'Gelöscht', 'subtitle' => 'Wird niemals stattfinden', 'description' => $faker->paragraph(10), 'admission' => 'free', 'google_event_id' => str_random(12), 'deleted_at' => Carbon::now()->subDays(7)])); $events = Event::all(); foreach ($events as $event) { $event->options()->save(EventOptions::create(['time_start' => '19:00', 'time_end' => '00:00', 'time_meal' => '18:00', 'shifts_bar' => rand(1, 2), 'shifts_tech' => rand(0, 2), 'shifts_door' => rand(0, 1), 'meal_servings' => rand(0, 15), 'misc' => 'Test test test'])); $user_id = rand(1, 2); $event->shifts()->save(Shift::create(['user_id' => $user_id, 'type' => 'tech'])); $event->shifts()->save(Shift::create(['user_id' => $user_id == 1 ? 2 : 1, 'type' => 'bar'])); } Model::reguard(); }
public function getAssigntarget() { $employee = Employee::all(); $categories = Event::all(); $userdetails = User::all(); $targets = Targetassign::all(); $deals = Deal::all(); $userData = array(); $key = 0; foreach ($targets as $target) { $achieved = 0; $userData[$key]['eventcode'] = $target->Eventcode; $userData[$key]['event'] = $target->Eventname; $userData[$key]['employee'] = $target->Employeeid; $userData[$key]['targetVal'] = $target->Targetvalue; foreach ($deals as $deal) { if ($target->Eventcode == $deal->Eventcode && $target->Employeeid == $deal->Empid) { $achieved = $achieved + $deal->Dealvalue; } } $userData[$key]['achieved'] = $achieved; $userData[$key]['variance'] = $achieved - $target->Targetvalue; $userData[$key]['cur'] = $target->Currency; $key++; } return View('approval/assigntarget')->with(array('categories' => $categories, 'employee' => $employee, 'userdata' => $userData, 'targets' => $targets, 'eventtable' => $categories)); }
/** * Display a listing of the resource. * * @return Response */ public function getIndex() { $varr = Auth::user()->empid; $empid = Targetassign::where('Employeeid', $varr)->get(); $cat = Event::all(); return View('targetmodule/eventdeal')->with(array('cat' => $cat, 'empid' => $empid)); }
/** * Display a home page. * * @return Response */ public function home() { $activeUsers = 3; $totalUsers = User::all()->count(); $eventCount = Event::all()->count(); return view('admin.home', compact('activeUsers', 'totalUsers', 'eventCount')); }
public function create() { if (!Auth::check() || !Auth::user()->is_admin) { return response(view('errors.403', ['error' => $this->errorMessages['incorrect_permissions']]), 403); } return view('partners.create', ['locations' => Location::all(), 'events' => Event::all()]); }
private function getAllEvents() { $now = Carbon::now(); $thisWeek = []; $nextWeek = []; $upcoming = []; $past = []; $events = Event::all(); foreach ($events as $event) { $event->banner; $event = $event->formatEvent(); if ($event['start'] == null) { array_push($upcoming, $event); } else { if ($event->end < $now) { array_push($past, $event); } else { if ($event->start->year == $now->year && $event->start->weekOfYear == $now->weekOfYear) { array_push($thisWeek, $event); } else { if ($event->start->weekOfYear == $now->weekOfYear + 1) { array_push($nextWeek, $event); } } } } } $allEvents = []; array_push($allEvents, $thisWeek, $nextWeek, $upcoming, $past); return $allEvents; }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $events = Event::all(); if ($events === null) { $events = null; } return \View::make('admin.manage_slide')->withSlides($events); }
public function getData() { $users = User::all(); $events = Event::all(); $committees = Committee::all(); $heads = Head::all(); return view('admin/data', compact('users', 'events', 'committees', 'heads')); }
public function getIndex() { $categories = Event::all(); $employee = Employee::all(); $invoice = Invoice::all(); $invnull = Invoice::where('Status', '=', 'Null')->get(); return View('home2')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull)); }
/** * Display a listing of the resource. * * @return Response */ public function getIndex() { // $events = Event::all(); $upcoming = Event::where('event_date', '>', Carbon::now())->get(); $past = Event::where('event_date', '<', Carbon::now())->get(); return view('event.index', compact('upcoming', 'past')); }
public function home() { $title = "Event Company TN"; $events = Event::all(); $services = Service::all(); $about = DB::select('select * from about'); $video = DB::select('select iframe from video'); return view('index', ['title' => $title, 'about' => $about, 'services' => $services, 'events' => $events, 'video' => $video]); }
/** * Bootstrap any application services. * * @return void */ public function boot() { view()->composer('partials.search', function ($view) { $view->with('terms', Event::all()); }); view()->composer(['partials.nav', 'profile.show', 'dashboard.*', 'events.*', 'posts.*', 'comments.*'], function ($view) { $view->with('auth', Auth::user()); }); }
public function __construct() { if (!Cache::has('accountList')) { Cache::put('accountList', DB::select('select full_id, name from full_id where cast(concat(parent_id,id) as UNSIGNED) not in (select parent_id from account)'), 60); } if (!Cache::has('events')) { Cache::put('events', Event::all(), 60); } }
/** * Run the migrations. * * @return void */ public function up() { Schema::table('events', function (Blueprint $table) { $table->string('slug')->after('creator_id'); }); // Set any missing slugs foreach (\App\Event::all() as $event) { $event->sluggify(); $event->save(); } }
public function getHome() { $varr = Auth::user()->empid; $evarr = User::where('empid', $varr)->get(); $edetails = Employee::where('emp_ide_id', $varr)->get(); $categories = Event::all(); $employee = Employee::all(); $invoice = Invoice::all(); $invnull = Invoice::where('Status', '=', 'Null')->get(); return View('reviewer/home')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull, 'edetails' => $edetails)); }
public function run() { DB::table('event_registrations')->delete(); $event_ids = Event::all()->lists('id')->toArray(); $user_ids = User::all()->lists('id')->toArray(); for ($counter = 0; $counter < 50; $counter++) { $rand_event_id = $event_ids[array_rand($event_ids)]; $rand_user_id = $user_ids[array_rand($user_ids)]; if (EventRegistration::where('user_id', '=', $rand_user_id)->where('event_id', '=', $rand_event_id)->exists()) { continue; } EventRegistration::create(array('user_id' => $rand_user_id, 'event_id' => $rand_event_id)); } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function calendar() { $events = []; $getevents = Event::all(); foreach ($getevents as $event) { $events[] = \Calendar::event($event->titl, false, new \DateTime($event->start), new \DateTime($event->end), $event->event_id); } $events[] = \Calendar::event('Event One', false, '2015-11-11T0800', '2015-11-12T0800', 0); $events[] = \Calendar::event("Valentine's Day", true, new \DateTime('2015-11-14'), new \DateTime('2015-11-14'), 'stringEventId'); $eloquentEvent = Event::first(); //Event implements MaddHatter\LaravelFullcalendar\Event $calendar = \Calendar::addEvents($events); return view('calendar', compact('calendar')); }
public function view_event() { $data = Event::where('society_id', Auth::user()->id)->get(); if (Auth::user()->privilege > 6) { $data = Event::all(); foreach ($data as $d) { $d->soc = Society::where('id', Event::where('id', $d->id)->first()->society_id)->first()->username; } } $t = $data->toArray(); if (empty($t)) { $data = ""; } return View::make('view_events', ['data' => $data]); }
function getTask() { $user = \Auth::user(); $events = Event::all(); $event = Event::latest('id')->first(); $tasks = Task::all(); $categories = array('Pending', 'In-progress', 'Delayed', 'Finished'); //Array of head->id of user $heads_comm = Head::where('event_id', $event->id)->where('user_id', $user->id)->get(array('comm_id'))->toArray(); //members of committee $mem = Member::whereIn('comm_id', $heads_comm)->get(array('user_id'))->toArray(); $members = User::whereIn('id', $mem)->get(); //committees where user is head $committees = Committee::whereIn('id', $heads_comm)->get(); return view('pages/task', compact('user', 'members', 'events', 'event', 'committees', 'tasks', 'categories')); }
public function postUpdateinvoice(Request $request) { $evnid = Input::get('view_invoice'); $inv_status = Input::get('invoice_status'); if ($inv_status == 'Attended with Modification') { $invoice_data = Invoice::where('Id', $evnid)->get(); $cate = Event::all(); $employee = Employee::all(); return view('executor/invoice_edit')->with(array('invoice_data' => $invoice_data, 'cate' => $cate, 'employee' => $employee)); } if ($inv_status == 'Attended without modification') { // $post = Input::get(); $i = Invoice::where('Id', $evnid)->update(array('Invoice_status' => $inv_status)); if ($i > 0) { $request->session()->flash('alert-success', 'Updated Success!'); return redirect('executor/home'); } } if ($inv_status == 'Not Attended') { // $post = Input::get(); $i = Invoice::where('Id', $evnid)->update(array('Invoice_status' => $inv_status)); if ($i > 0) { $request->session()->flash('alert-success', 'Updated Success!'); return redirect('executor/home'); } } if ($inv_status == 'Entitlement') { } if ($inv_status == 'Deal Cancel') { $dealstatus = 'Request Cancel'; $invoice_data = Invoice::where('Id', $evnid)->get(); foreach ($invoice_data as $data) { $dealid = $data->dealid; } $dealdata = Deal::where('Id', $dealid)->get(); foreach ($dealdata as $ddeal) { $dealempid = $ddeal->Id; } // dd($dealempid); $i = Invoice::where('Id', $evnid)->update(array('Status' => $dealstatus)); $i = Deal::where('Id', $dealempid)->update(array('Status' => $dealstatus)); if ($i > 0) { $request->session()->flash('alert-success', 'Updated Success!'); return redirect('executor/home'); } } }
private function composeTotal() { view()->composer('partials.admin_sidebar', function ($view) { $view->with('totalusers', User::all()->count()); //total admin $view->with('totalparticipants', Participant::all()->count()); //total participant $view->with('totalevents', Event::all()->count()); //total event $view->with('totalposts', Post::all()->count()); //total post $view->with('totaltags', Tag::all()->count()); //total tag $view->with('totalimages', Image::all()->count()); //total image }); }
public function run() { $faker = Faker::create(); DB::table('cerfs')->delete(); // Gets array of event IDs. $event_ids = Event::all()->lists('id')->toArray(); shuffle($event_ids); $user_ids = User::all()->lists('id')->toArray(); shuffle($user_ids); // TODO Events have many CERFs, so make sure to update seeder accordingly. // Each CERF should only have one event. Some events do not have an associated CERF. for ($counter = 0; $counter < 10; $counter++) { $event_id = $event_ids[$counter]; $user_id = $user_ids[$counter]; Cerf::create(array('event_id' => $event_id, 'reporter_id' => $user_id, 'amount_raised' => $faker->randomFloat(2, 0, 1000), 'amount_spent' => $faker->randomFloat(2, 0, 1000), 'net_profit' => $faker->randomFloat(2, 0, 1000), 'funds_purpose' => $faker->text, 'summary' => $faker->text, 'strengths' => $faker->text, 'weaknesses' => $faker->text, 'reflection' => $faker->text, 'approved' => false)); } }
public function getAutocomplete(SearchJsonRequest $request) { $term = $request->get('term'); $tours = Event::all(); $posts = Post::all(); $tags = Tag::all(); $results = []; foreach ($tours as $tour) { $results[] = ['id' => $tour->id, 'value' => $tour->title, 'model' => 'events']; } foreach ($posts as $post) { $results[] = ['id' => $post->id, 'value' => $post->title, 'model' => 'posts']; } foreach ($tags as $tag) { $results[] = ['id' => $tag->id, 'value' => $tag->name]; } return Response::json($results); }
/** * Run the database seeds. * * @return void */ public function run() { $faker = Faker\Factory::create(); /*$groups = Group::all(); $events = Event::all()->toArray(); foreach ($groups as $group) { foreach($faker->randomElements($events,$faker->randomDigit) as $event){ $group->events()->attach($event['id']); } }*/ $groups = Group::all()->toArray(); $events = Event::all(); foreach ($events as $event) { foreach ($faker->randomElements($groups, $faker - randomDigit) as $group) { $event->group = $group; } } }
/** * Run the migrations. * * @return void */ public function up() { echo 'Warning: Running this migration is not completely backwards compatible and will make changes to event \'category_id\' references and category \'id\' references. Cancel out of this migration within the next 10 seconds if you dont have a backup...'; echo "\n"; sleep(15); echo 'Continuing with migration...'; echo "\n"; Schema::table('categories', function (Blueprint $table) { $table->integer('city_id'); }); $cities = City::all(); $categories = Category::all(); foreach ($cities as $city) { Category::create(['title' => 'Talks', 'city_id' => $city->id]); Category::create(['title' => 'Gigs', 'city_id' => $city->id]); Category::create(['title' => 'Exhibitions', 'city_id' => $city->id]); Category::create(['title' => 'Hackdays & Workshops', 'city_id' => $city->id]); Category::create(['title' => 'Films', 'city_id' => $city->id]); Category::create(['title' => 'Food & Drink', 'city_id' => $city->id]); $city_events = Event::all(); foreach ($city_events as $event) { if ($event->city_id == $city->id) { // get the current category_id. // get the category by that id. $old_category = Category::where('id', $event->category_id)->first(); // get the name of the category. // find the new category for this city with that name. $new_category = Category::where('slug', $old_category->slug)->where('city_id', $city->id)->first(); // set the event to new category. $event->category_id = $new_category->id; $event->save(); } } } $categories = Category::all(); foreach ($categories as $category) { if ($category->city_id == 0) { $category->delete(); } } }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { return view('admin.event.index', ['active' => 'events', 'events' => Event::all()]); }
public function getEvents() { $events = Event::all(); return Response::json($events, 200); }
/** * Display a listing of the resource. * * @return \Symfony\Component\HttpFoundation\Response */ public function index() { $events = Event::all(); return View::make('events.index', compact('events')); }
/** * Display a listing of the resource. * * @return \Illuminate\Http\Response */ public function index() { $events = \App\Event::all(); return view('admin.events.index', ['events' => $events]); }
public function showAccount() { //make a parent_id array to push to view $parentIdArray = DB::select('select cast(concat(parent_id,id) as UNSIGNED) as parentable_id,name from account where length(cast(concat(parent_id,id) as UNSIGNED)) < 5 and id != 0'); return view('account.main')->with(['accountList' => Account::all(), 'parentList' => $parentIdArray, 'eventList' => Event::all()]); }