Example #1
0
 /**
  * Create a new Event /
  */
 public function newEvent($timeline_id, Request $request)
 {
     $timeline = \App\Timeline::where('id', '=', $timeline_id)->first();
     if ($request->input('showForm') == 'true') {
         $characters = \App\Character::where('timeline_id', '=', $timeline_id)->orderBy('name')->get();
         $locations = \App\Location::where('timeline_id', '=', $timeline_id)->orderBy('name')->get();
         return view('events.newEvent')->with('showForm', 'true')->with('characters', $characters)->with('locations', $locations)->with('timeline', $timeline);
     } else {
         if (\Auth::check()) {
             // Validate the request data
             $this->validate($request, ['name' => 'required', 'start_date' => 'required|date_format:Y#m#d', 'end_date' => 'required|date_format:Y#m#d']);
             $user = \Auth::user();
             $event = new \App\Event();
             $event->name = $request->input('name');
             $event->start_date = $request->input('start_date');
             $event->end_date = $request->input('end_date');
             $event->description = $request->input('description');
             $event->timeline_id = $timeline_id;
             $event->created_by = $user->id;
             $event->last_modified_by = $user->id;
             $event->save();
             # Attach Characters to the event
             for ($i = 1; $i < 5; $i++) {
                 $character_input = $request->input('character' . $i);
                 if ($character_input != 'Choose a Character') {
                     $character = \App\Character::where('name', 'LIKE', $character_input)->first();
                     $event->characters()->save($character);
                 }
             }
             # Attach Locations to the event
             for ($i = 1; $i < 3; $i++) {
                 $location_input = $request->input('location' . $i);
                 if ($location_input != 'Choose a Location') {
                     $location = \App\Location::where('name', 'LIKE', $location_input)->first();
                     $event->locations()->save($location);
                 }
             }
             return view('events.newEvent')->with('showForm', 'false')->with('event', $event)->with('timeline', $timeline);
         } else {
             return 'Access Denied';
         }
     }
 }
Example #2
0
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/
Route::group(['middleware' => ['web', 'fw-block-bl']], function () {
    /**
     * Landing Page
     */
    Route::get('/', ['as' => 'welcome', function () {
        $news = App\News::whereType(0)->latest()->first();
        $event = App\Event::latest()->first();
        $codewars = App\CodeWarQuestion::latest()->limit(3)->get();
        $questions = App\Question::wherePublic(1)->approved()->latest()->limit(3)->get();
        $aluminis = App\Alumini::where('speech', '!=', 'null')->get()->random(2);
        $users = App\User::whereBanned(0)->latest()->limit(3)->get();
        $picture = App\Photo::whereGallery(1)->get()->random();
        $technews = App\News::whereType(1)->latest()->first();
        $qotd = App\Quote::getQotd();
        $shouts = App\Shout::limit(15)->latest()->get();
        $shouts = $shouts->sortBy('created_at');
        $urls = ['http://numbersapi.com/random/', 'http://numbersapi.com/random/year/', 'http://numbersapi.com/random/date'];
        try {
            $didyouknow = file_get_contents($urls[array_rand($urls)]);
        } catch (Exception $e) {
            $didyouknow = "This website is hosted on a VPS with 1GB of RAM and is developed using PHP as backend, MySQL & Redis for database storage, and Sockets for real time events.";
        }
Example #3
0
<?php

$nd = Carbon\Carbon::today()->addMonth();
$incomingEvents = App\Event::where('private', 0)->where('active', 1)->where('date', '>=', DB::raw('NOW()'))->where('date', '<=', $nd)->orderBy('date', 'ASC')->get();
$lastNews = App\News::where('active', 1)->where('published_at', '<=', DB::raw('NOW()'))->orderBy('published_at', 'DESC')->limit(5)->get();
?>

<!DOCTYPE html>
<html>
<head>
	<title>DjMaker | @section('title') Accueil @show </title>
	<link rel="stylesheet" type="text/css" href="{{ url('vendor/css/bootstrap.css') }}" />
	{{-- <link rel="stylesheet/less" type="text/css" href="{{ url('vendor/css/style.less') }}" /> --}}
    <meta name="csrf-token" content="{{ csrf_token() }}" />
	<link rel="stylesheet" type="text/css" href="{{ url('vendor/css/less.css') }}">
	<link rel="stylesheet" type="text/css" href="{{ url('vendor/css/css.css') }}">
	<link rel="stylesheet" type="text/css" href="{{ url('vendor/css/hover.min.css') }}">
	<link rel="stylesheet" type="text/css" href="{{ url('vendor/js/jquery-ui/jquery-ui.min.css') }}">
	<link rel="stylesheet" type="text/css" href="{{ url('vendor/js/timepicker/stylesheets/wickedpicker.css') }}">
	<link href="{{ 	URL::asset('vendor/js/file-input/css/fileinput.min.css') }}" media="all" rel="stylesheet" type="text/css" />
	<script src="{{ URL::asset('vendor/js/less.js') }}"></script>
	<script src="{{ URL::asset('vendor/js/jquery.js') }}"></script>
	<script src="{{ URL::asset('vendor/js/bootstrap.min.js') }}"></script>
</head>
<body>

<header>
	<div class="banner" id="banner">
		<a href="{{ url('/') }}">
			<h1>DjMaker</h1>
		</a>
Example #4
0
			<li class="tab col s3"><a href="#dashboard" class="active">Dashboard</a></li>
			<li class="tab col s3"><a href="#upcoming">Upcoming</a></li>
			<li class="tab col s3"><a href="#past">Past Events</a></li>
			<li class="tab col s3"><a href="#searchTab">Your Subscriptions</a></li>
		</ul>
	</div>
 </div>
 <div class="container">

  <?php 
// User
$user = Auth::user();
// Suggested events
$suggestedEvents = App\Event::all();
// Upcoming events
$upcomingEvents = App\Event::upcoming()->get();
// Past events
$pastEvents = $user->attending()->past()->get();
?>

<div id="dashboard" class="col s12">
	<div class="fixed-action-btn tooltipped" data-position="top" data-delay="50" data-tooltip="Click here to Edit profile data" style="top: 205px; right: 5%;">
		<a class="btn-floating btn-large red" href="{{ route('user.edit', $user->id) }}">
			<i class="large material-icons">mode_edit</i>
		</a>
	</div>
	
	<div id="imageContaineruser">
		<div class="valign-wrapper">
			<!--data will have to be pulled here to supply a name for the h1 and fill in profile data below-->
			<h2 class="valign center-block white-text">Welcome, {{ $user->first_name }}</h2>
Example #5
0
 public function run()
 {
     /*1*/
     App\Event::create(['name' => 'Earth/Vulcan First Contact', 'timelineDate' => 2063, 'summary' => "Zefram Cochrane completes his construction of The Phoenix, the first ship on Earth with warp speed capabilities. During the ship's first flight, it is detected by the Vulcan ship T'Plana Hath. A peaceful first contact with the Vulcans is made."]);
     /*2*/
     App\Event::create(['name' => 'Kirk Demoted to Captain', 'timelineDate' => 2286, 'summary' => "When Kirk and his crew return home after saving Earth from a giant probe, they go to trial facing many charges including the theft and damage of the USS Enterprise, and disobeying orders from the Starfleet commander. Kirk's punishment is to be demoted from the rank of Admiral to Captain, and as a result he is given the duty of commanding a starship."]);
     /*3*/
     App\Event::create(['name' => 'Origin of Humanoid Life Discovered', 'timelineDate' => 2369, 'summary' => "Humans, Klingons, Cardassians, and Romulans make the discovery that all humanoid life in the galaxy originates from one single source: an ancient race that decided to send their DNA out to other worlds so that life could form throughout the galaxy."]);
     /*4*/
     App\Event::create(['name' => 'Earth/Malcor III First Contact', 'timelineDate' => 2367, 'summary' => "The Federation (accidentally) makes first contact with the Malcorians, a race that is on the verge of developing a warp engine."]);
     /*5*/
     App\Event::create(['name' => 'Sisko Promoted to Captain', 'timelineDate' => 2371, 'summary' => "Sisko is promoted to the rank of Captain."]);
     /*6*/
     App\Event::create(['name' => 'Romulans Join War Against the Dominion', 'timelineDate' => 2374, 'summary' => "After the Dominion discovers one of their senators was murdered by the Dominion, they break their non-agression pact and wage war against the Dominion, finally joining the war on the side of the Federation."]);
     /*7*/
     App\Event::create(['name' => 'Senator Vreenak Murdered', 'timelineDate' => 2374, 'summary' => "In an attempt to trick the Romulans into thinking the Dominion is plotting against them, Sisko invites Vreenak to DS9 to discuss the war. While there, a bomb is planted on the senator's ship, killing him when he leaves the station."]);
     /*8*/
     App\Event::create(['name' => 'Borg Queen Defeated', 'timelineDate' => 2373, 'summary' => "When the Borg, led by the Borg Queen, travelled back in time to prevent humans from making the first warp speed flight into space, they were stopped and the Borg Queen killed by Captain Picard."]);
     /*9*/
     App\Event::create(['name' => 'Picard is Shown the Beginning of Evolution on Earth', 'timelineDate' => 2364, 'summary' => "While the USS Enterprise was in the middle of researching a dangerous spatial anomaly, Q takes Picard back in time to show him the moment in time when life on Earth began to develop. This was done to give Picard a clue about the formation of the anomaly they were studying."]);
     /*10*/
     App\Event::create(['name' => 'Cardassia Reforms into a Democracy', 'timelineDate' => 2376, 'summary' => "During the war with the Dominion, the Cardassian government made many decisions that were unpoplar among civilians. This led to many Cardassians wanting reform once the war ended, after they had seen how easily their leaders fell to corruption."]);
     /*11*/
     App\Event::create(['name' => 'Dax Symbiont Moves from Curzon to Jadzia', 'timelineDate' => 2367, 'summary' => "After Dax's host Curzon died, the symbiont moved to Jadzia. Because of her poor performance during her training, her joining with Dax was controversial. Jadzia was the only Trill in history to be joined after being rejected from the training program."]);
     /*12*/
     App\Event::create(['name' => 'Dax Symbiont Moves from Jadzia to Ezri', 'timelineDate' => 2374, 'summary' => "When Jadzia died during the Dominion War the Dax synbiont was passed onto Ezri, who had a hard time adjusting to being joined."]);
     /*13*/
     App\Event::create(['name' => 'USS Enterprise 1701-A Commissioned', 'timelineDate' => 2286, 'summary' => "When the original Enterprise is decommissioned, Kirk and his crew are assigned to a new Enterprise ship."]);
     /*14*/
     App\Event::create(['name' => 'USS Enterprise 1701-E Commissioned', 'timelineDate' => 2374, 'summary' => "After the Enterprise-D was destroyed when it crashed to the ground, the Enterprise-E was built to replace it. Picard and his old crew were reassigned to this ship."]);
     /*15*/
     App\Event::create(['name' => 'USS Enterprise 1701-B Commissioned', 'timelineDate' => 2371, 'summary' => "The crew of the original Enterprise is present during the Enterprise-B's maiden voyage. When they are just about to get under way, they are forced to answer a distress beacon from a ship being pulled into an energy ribbon. During the rescue the ship is destroyed and needs to be repaired."]);
     /*16*/
     App\Event::create(['name' => 'USS Enterprise 1701-D Destroyed', 'timelineDate' => 2373, 'summary' => "After combat with a Klingon ship, the Enterprise is badly damaged and crash lands on the surface of Veridian III. The ship is beyond repair."]);
     /*17*/
     App\Event::create(['name' => 'A Changeling Infant is brought to DS9', 'timelineDate' => 2373, 'summary' => "A changeling infant is found on the space station and Odo takes on the responsibility of caring for it."]);
     /*18*/
     App\Event::create(['name' => 'Genesis Planet Formed', 'timelineDate' => 2285, 'summary' => "The goal of the Genesis Project was to transform previously uninhabitable planets so they may be suitable to support life."]);
     /*19*/
     App\Event::create(['name' => 'The Enterprise Crew Find Spock After his Assumed Death', 'timelineDate' => 2285, 'summary' => "Spock had died at the end of Star Trek II, but because his body was left on the Genesis planet he was able to survive. The Enterprise crew learned of this and came back to rescue him."]);
     /*20*/
     App\Event::create(['name' => 'Spock Reveals His Suspicions of Common Vulcan/Romulan Ancestry', 'timelineDate' => 2266, 'summary' => "During the Enterprise's first encounter with the Romulans, Spock learns of the common ancestry he shares with the Romulans."]);
     /*21*/
     App\Event::create(['name' => 'The Dominion Infiltrates the Defiant', 'timelineDate' => 2371, 'summary' => "A changeling is discovered abord the USS Defiant, who is able to disguise itself by taking the form of various crew members. Later, the Dominion is able to infiltrate planet Earth as well."]);
     /*22*/
     App\Event::create(['name' => 'Ancient Vulcan Weapon, Stoke of Gol, Unearthed', 'timelineDate' => 2370, 'summary' => "An ancient Vulcan weapon with special properties is discovered. The weapon is special because it can only affect those with aggressive emotions."]);
     /*23*/
     App\Event::create(['name' => 'Ezri Offered Counselor Position on DS9', 'timelineDate' => 2375, 'summary' => "Captain Sisko offers Dax's new host a permanent position on the space station, but Ezri has a hard time deciding if she should accept."]);
 }
Example #6
0
});
Route::bind('client', function ($id) {
    /** @var int $id */
    return App\Client::where('id', $id)->first();
});
Route::bind('subject', function ($name) {
    /** @var string $id */
    return new App\Http\Forum\Subject($name);
});
Route::bind('recipient', function ($id) {
    /** @var int $id */
    return App\Client::where('id', $id)->first();
});
Route::bind('event', function ($id) {
    /** @var int $id */
    return App\Event::where('id', $id)->first();
});
Route::bind('notice', function ($id) {
    /** @var int $id */
    return App\Notice::where('id', $id)->first();
});
Route::bind('group', function ($username) {
    /** @var int $id */
    return App\Group::where('username', $username)->first();
});
Route::bind('folder', function ($id) {
    /** @var int $id */
    return App\Folder::find($id);
});
Route::bind('file', function ($id) {
    /** @var int $id */
Example #7
0
function createEvents()
{
    $c = 0;
    for ($i = 1; $i < 13; $i++) {
        for ($j = 1; $j < 29; $j++) {
            $n = rand(0, 2);
            if ($n === 1) {
                App\Event::create(['name' => 'test event ' . $c++, 'user_id' => 2, 'slug' => 'test-auto-event-' . $c, 'date' => '2016-' . ($i < 10 ? '0' . $i : $i) . '-' . ($j < 10 ? '0' . $j : $j), 'start' => '19:00:00', 'end' => '5:00:00']);
            }
        }
    }
}
Example #8
0
						</div>
						<div class="card-content">
							<p>{{strip_tags(str_limit(_t($event->description),250))}}</p>
						</div>
						<div class="card-action">
							<a href="{{ URL::route('events.show', $event->id) }}" class="red-text text-lighten-2"> {{ _t('View Event') }} &rarr;</a>
						</div>
					</div>
				</div>
			@endforeach
		</div>
	</div>
</div>

<?php 
$event = App\Event::first();
?>
<div class="row" id="venues">
	<div class="parallax-container valign-wrapper">
		<div class="parallax"><img src="{{ $event->location->featured_image }}"></div>
		<div class="col s12 m10 offset-m1 valign center">
			<h2 class="white-text">{{ _t($event->location->name) }}</h2>
			<h4 class="white-text">{{ _t(date( 'g:iA, D jS F ', strtotime($event->hrStartTime()))) }} &rarr; {{ _t(date( 'g:iA, D jS F ', strtotime($event->hrEndTime()))) }}</h4>
		</div>
	</div>
</div>

<!-- News Section -->
<div class="row" id="latest">
	<div class="parallax-container">
		<div class="parallax"><img src="{{ URL::to('/') . '/images/gray-geometric-background.jpg'}}"></div>