updates to add show judging

This commit is contained in:
Russ Long 2019-07-11 20:55:45 -04:00
parent 7cdea664e1
commit c2aced484d
34 changed files with 2341 additions and 318 deletions

View File

@ -0,0 +1,390 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\Bidders;
use App\Models\CarShowCategory;
use App\Models\CarShowWinner;
use App\Models\PeoplesChoice;
use App\Models\Vehicles;
use App\Models\VehicleScores;
use Illuminate\Support\Facades\DB;
class TabulateWinners extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'carshow:tabulatewinners';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Tabulate Show Winners, and add them to the CarShowWinner table';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
function mainWinner()
{
$mainWinnerQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->orderBy('totalscore','desc')
->first();
return $mainWinnerQuery->vehicle;
}
/*
function pcWinner()
{
$peoplesChoiceWinnerQuery = DB::table('peoples_choice')
->groupBy('peoples_choice.vehicle')
->selectRaw('*, sum(pc_count as totalscore')
->whereNotIn('vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->orderBy('totalscore','desc')
->first();
return $peoplesChoiceWinnerQuery->vehicle;
}
*/
function oughtsTo49Winner()
{
$oughtsTo49Query = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->where('vehicles.year', '>=', 1900)
->where('vehicles.year', '<=', 1949)
->orderBy('totalscore','desc')
->first();
return $oughtsTo49Query->vehicle;
}
function fiftiesWinner()
{
$fiftiesQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->where('vehicles.year', '>=', 1950)
->where('vehicles.year', '<=', 1959)
->orderBy('totalscore','desc')
->first();
return $fiftiesQuery->vehicle;
}
function sixtiesWinner()
{
$sixtiesQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->where('vehicles.year', '>=', 1960)
->where('vehicles.year', '<=', 1969)
->orderBy('totalscore','desc')
->first();
return $sixtiesQuery->vehicle;
}
function seventiesWinner()
{
$seventiesQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->where('vehicles.year', '>=', 1970)
->where('vehicles.year', '<=', 1979)
->orderBy('totalscore','desc')
->first();
return $seventiesQuery->vehicle;
}
function eightiesWinner()
{
$eightiesQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->where('vehicles.year', '>=', 1980)
->where('vehicles.year', '<=', 1989)
->orderBy('totalscore','desc')
->first();
return $eightiesQuery->vehicle;
}
function ninetiesWinner()
{
$ninetiesQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->where('vehicles.year', '>=', 1990)
->where('vehicles.year', '<=', 1999)
->orderBy('totalscore','desc')
->first();
return $ninetiesQuery->vehicle;
}
function thousandsWinner()
{
$thousandsQuery = VehicleScores::join('vehicles', 'vehicle_scores.vehicle', '=', 'vehicles.id')
->groupBy('vehicles.id')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->whereNotIn('vehicle_scores.vehicle', function($query){
$query->select('vehicle')->from('car_show_winners');
})
->where('vehicles.year', '>=', 2000)
//->where('vehicles.year', '<=', 1959)
->orderBy('totalscore','desc')
->first();
return $thousandsQuery->vehicle;
}
//categories
/* Here for reference only
$individuallyProcessedAwards = array(
'inShowFirst' =>'6',
'pcFirst' => '3'
); */
$mainAwardsToCalculate = array(
'inShowFirst' =>'6',
'pcFirst' => '3',
'bestTruckFirst' => '5',
'corvetteFirst' => '7',
'camaroFirst' => '8',
'mustangFirst' => '1',
'ratRideFirst' => '4'
);
$yearAwardsToCalculate = array(
'oughtsTo49First' => '9',
'oughtsTo49Second' => '9',
'fiftiesFirst' => '10',
'fiftiesSecond' => '10',
'sixtiesFirst' => '11',
'sixtiesSecond' => '11',
'seventiesFirst' => '12',
'seventiesSecond' => '12',
'eightiesFirst' => '13',
'eightiesSecond' => '13',
'ninetiesFirst' => '14',
'ninetiesSecond' => '14',
'thousandsFirst' => '15',
'thousandsSecond' => '15'
);
//Insert Best In Show Winner
CarShowWinner::updateOrCreate(
[
'category' => '6',
'place' => 'first'
],
[
'vehicle' => mainWinner()
]
);
//Insert People's Choice Winner
/*CarShowWinner::updateOrCreate(
[
'category' => '3',
'place' => 'first'
],
[
'vehicle' => $peoplesChoiceWinnerQuery
]
);*/
//Insert Category Award Winners
foreach($mainAwardsToCalculate as $mainaward => $category) {
$categorywinner = CarShowWinner::updateOrCreate(
[
'category' => $category,
'place' => 'first'
],
[
'vehicle' => mainWinner()
]
);
}
//Insert Year Award Winners
//1900-1949
CarShowWinner::updateOrCreate(
[
'category' => '9',
'place' => 'first'
],
[
'vehicle' => oughtsTo49Winner()
]
);
CarShowWinner::updateOrCreate(
[
'category' => '9',
'place' => 'second'
],
[
'vehicle' => oughtsTo49Winner()
]
);
//1950-1959
CarShowWinner::updateOrCreate(
[
'category' => '10',
'place' => 'first'
],
[
'vehicle' => fiftiesWinner()
]
);
CarShowWinner::updateOrCreate(
[
'category' => '10',
'place' => 'second'
],
[
'vehicle' => fiftiesWinner()
]
);
//1960-1969
CarShowWinner::updateOrCreate(
[
'category' => '11',
'place' => 'first'
],
[
'vehicle' => sixtiesWinner()
]
);
CarShowWinner::updateOrCreate(
[
'category' => '11',
'place' => 'second'
],
[
'vehicle' => sixtiesWinner()
]
);
//1970-1979
CarShowWinner::updateOrCreate(
[
'category' => '12',
'place' => 'first'
],
[
'vehicle' => seventiesWinner()
]
);
CarShowWinner::updateOrCreate(
[
'category' => '12',
'place' => 'second'
],
[
'vehicle' => seventiesWinner()
]
);
//1980-1989
CarShowWinner::updateOrCreate(
[
'category' => '13',
'place' => 'first'
],
[
'vehicle' => eightiesWinner()
]
);
CarShowWinner::updateOrCreate(
[
'category' => '13',
'place' => 'second'
],
[
'vehicle' => eightiesWinner()
]
);
//1990-1999
CarShowWinner::updateOrCreate(
[
'category' => '14',
'place' => 'first'
],
[
'vehicle' => ninetiesWinner()
]
);
CarShowWinner::updateOrCreate(
[
'category' => '14',
'place' => 'second'
],
[
'vehicle' => ninetiesWinner()
]
);
//2000-present
CarShowWinner::updateOrCreate(
[
'category' => '15',
'place' => 'first'
],
[
'vehicle' => thousandsWinner()
]
);
CarShowWinner::updateOrCreate(
[
'category' => '15',
'place' => 'second'
],
[
'vehicle' => thousandsWinner()
]
);
}
}

View File

@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
* @var array * @var array
*/ */
protected $commands = [ protected $commands = [
// Commands\TabulateWinners::class,
]; ];
/** /**

View File

@ -0,0 +1,24 @@
<?php
namespace App\Helpers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\Judges;
class JudgesSelectList
{
public static function judgesShowNumbers()
{
$judge_results = Judges::orderBy('judge_number')
->get();
$judges = '<option disabled="disabled" selected="selected" value="0">choose...</option>';
foreach ($judge_results as $judge_result) {
$judges .= '<option value="' .
$judge_result->id .
'">' .
$judge_result->judge_number .
'</option>';
}
return $judges;
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace App\Helpers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\Bidders;
use App\Models\Vehicles;
class VehicleSelectList
{
public static function vehicleShowNumbers()
{
$bidder_num_results = Bidders::has('vehicles')
->join('vehicles', 'vehicles.owner', '=', 'bidders.bidder_assigned_number')
->orderBy('bidder_assigned_number')
->get();
//dd($bidder_num_results);
$bidder_num = '<option disabled selected hidden value="">choose...</option>';
foreach ($bidder_num_results as $bidder_num_result) {
$bidder_num .= '<option value="' .
$bidder_num_result->id .
'">' .
$bidder_num_result->bidder_assigned_number .
' - ' .
$bidder_num_result->year .
' ' .
$bidder_num_result->make .
'</option>';
}
return $bidder_num;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Helpers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\CarShowCategory;
class VehicleTypeSelectList
{
public static function vehicleTypeShowTypes()
{
$vehicle_type_results = CarShowCategory::orderBy('category_name')
->where('vehicle_type', '=', 1)
->get();
$vehicle_types = '<option disabled="disabled" selected="selected" value="0">choose...</option>';
foreach ($vehicle_type_results as $vehicle_type_result) {
$vehicle_types .= '<option value="' .
$vehicle_type_result->id .
'">' .
$vehicle_type_result->category_name .
'</option>';
}
return $vehicle_types;
}
}

View File

@ -12,6 +12,13 @@ use App\Models\Items;
use App\Models\Checkout; use App\Models\Checkout;
use App\Models\PaymentMethods; use App\Models\PaymentMethods;
use App\Models\WinningBids; use App\Models\WinningBids;
use App\Models\PeoplesChoice;
use App\Models\Judges;
use App\Models\CarShowWinner;
use App\Models\CarShowCategory;
use App\Models\Types;
use App\Models\Vehicles;
use App\Models\VehicleScores;
class PagesController extends Controller class PagesController extends Controller
{ {
@ -331,4 +338,164 @@ class PagesController extends Controller
->get(); ->get();
return view('winningbidderlist', ['winnerlist_results' => $winnerlist_results]); return view('winningbidderlist', ['winnerlist_results' => $winnerlist_results]);
} }
public function judgingentry(Request $judgingentry_req)
{
if (!$judgingentry_req->vehnum) {
return view('judgingentry');
}
$vehicle = $judgingentry_req->vehnum;
$judge = $judgingentry_req->judgenum;
$score = $judgingentry_req->vehscore;
$bidder_insert = VehicleScores::updateOrCreate(
[
'vehicle' => $vehicle,
'judge' => $judge
],
[
'overall_score' => $score
]
);
return redirect('judgingentry');
}
public function showcars(Request $showcar_req)
{
if (!$showcar_req->bidderlname) {
return view('showcars');
}
$bidder_lname = $showcar_req->bidderlname;
$bidder_fname = $showcar_req->bidderfname;
$bidder_addr = $showcar_req->bidderaddr;
$bidder_city = $showcar_req->biddercity;
$bidder_state = $showcar_req->bidderstate;
$bidder_zip = $showcar_req->bidderzip;
$bidder_phone = $showcar_req->bidderphone;
$bidder_email = $showcar_req->bidderemail;
$bidder_assigned_number = $showcar_req->biddernum;
$year = $showcar_req->vehyear;
$make = $showcar_req->vehmake;
$model = $showcar_req->vehmodel;
$type = $showcar_req->vehtype;
if ($showcar_req->has('vehdonotjudge')) {
$doNotJudge = 1;
} else {
$doNotJudge = 0;
}
$bidder_insert = Bidders::updateOrCreate(
[
'bidder_assigned_number' => $bidder_assigned_number,
],
[
'bidder_lname' => $bidder_lname ,
'bidder_fname' => $bidder_fname ,
'bidder_addr' => $bidder_addr ,
'bidder_city' => $bidder_city ,
'bidder_state' => $bidder_state ,
'bidder_zip' => $bidder_zip ,
'bidder_phone' => $bidder_phone ,
'bidder_email' => $bidder_email
]
);
//$owner = $bidder_insert->idbidders;
//dd($bidder_insert);
$vehicle_insert = Vehicles::updateOrCreate(
[
'owner' => $bidder_insert->id,
],
[
'year' => $year,
'make' => $make,
'model' => $model,
'type' => $type,
'doNotJudge' => $doNotJudge
]
);
return redirect('showcars');
}
public function pcentry(Request $pcentry_req)
{
if (!$pcentry_req->vehnum) {
return view('pcentry');
}
$vehicle=$pcentry_req->vehnum;
$pc_count=$pcentry_req->pc_count;
$pc_insert = PeoplesChoice::updateOrCreate(
[
'vehicle' => $vehicle,
],
[
'pc_count' => $pc_count
]
);
return redirect('pcentry');
}
public function judges(Request $judge_req)
{
if (!$judge_req->judgenum) {
return view('judges');
}
$judgenum = $judge_req->judgenum;
$judge_insert = Judges::updateOrCreate(
[
'judge_number' => $judgenum,
]
);
return redirect('judges');
}
public function awardcategories(Request $category_req)
{
if (!$category_req->category) {
return view('awardcategories');
}
$category = $category_req->category;
if ($category_req->has('vehtype')) {
$vehicleType = 1;
} else {
$vehicleType = 0;
}
$category_insert = CarShowCategory::updateOrCreate(
[
'category_name' => $category,
],
[
'vehicle_type' => $vehicleType
]
);
return redirect('awardcategories');
}
public function showwinners()
{
$carshowwinner_results = CarShowWinner::with(['awardCategory', 'awardVehicle', 'awardVehicle.vehicleOwner'])->get();
return view('carshowwinners', ['carshowwinner_results' => $carshowwinner_results]);
}
public function showscores()
{
$carshowscore_results = VehicleScores::with(['scoredVehicle'])
->groupBy('vehicle')
->selectRaw('*, sum(vehicle_scores.overall_score) as totalscore')
->orderBy('totalscore', 'desc')
->get();
return view('carshowscores', ['carshowscore_results' => $carshowscore_results]);
}
public function showcarlist()
{
$showcarlist_results = Bidders::has('vehicles')
->join('vehicles', 'vehicles.owner', '=', 'bidders.bidder_assigned_number')
//->join('car_show_categories', 'vehicles.type', '=', 'car_show_categories.category_name')
->orderBy('bidder_assigned_number')
->get();
//dd($showcarlist_results);
return view('showcarlist', ['showcarlist_results' => $showcarlist_results]);
}
} }

View File

@ -35,4 +35,9 @@ class Bidders extends Model
{ {
return $this->hasMany('App\Models\WinningBids', 'winning_bidder_num', 'idbidders'); return $this->hasMany('App\Models\WinningBids', 'winning_bidder_num', 'idbidders');
} }
public function vehicles()
{
return $this->hasMany('App\Models\Vehicles', 'owner', 'bidder_assigned_number');
}
} }

View File

@ -0,0 +1,28 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class CarShowCategory extends Model
{
protected $table = 'car_show_categories';
protected $fillable = [
'category_name',
'vehicle_type'
];
protected $dates = [
'created_at',
'updated_at'
];
public function vehicle()
{
return $this->hasMany('App\Models\Vehicles', 'id', 'type');
}
public function showWinner()
{
return $this->hasMany('App\Models\CarShowWinner', 'id', 'category');
}
}

View File

@ -0,0 +1,30 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class CarShowWinner extends Model
{
protected $table = 'car_show_winners';
protected $fillable = [
'vehicle',
'category',
'place'
];
protected $dates = [
'created_at',
'updated_at'
];
public function awardVehicle()
{
return $this->hasMany('App\Models\Vehicles', 'id', 'vehicle');
}
public function awardCategory()
{
return $this->hasMany('App\Models\CarShowCategory', 'id', 'category');
}
}

25
app/Models/Judges.php Normal file
View File

@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Judges extends Model
{
protected $table = 'judges';
protected $fillable = [
'judge_number',
'created_at',
'updated_at'
];
protected $dates = [
'created_at',
'updated_at'
];
public function vehicleScores()
{
return $this->hasMany('App\Models\VehicleScores', 'judge', 'id');
}
}

View File

@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class PeoplesChoice extends Model
{
protected $table = 'peoples_choice';
protected $fillable = [
'vehicle',
'pc_count',
'created_at',
'updated_at'
];
protected $dates = [
'created_at',
'updated_at'
];
public function vehicles()
{
return $this->belongsTo('App\Models\Vehicles', 'vehicle', 'id');
}
}

View File

@ -1,18 +0,0 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Types extends Model
{
protected $table = 'types';
protected $fillable = [
'type_name'
];
protected $dates = [
'created_at',
'updated_at'
];
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class VehicleScores extends Model
{
protected $table = 'vehicle_scores';
protected $fillable = [
'judge',
'overall_score',
'vehicle',
'created_at',
'updated_at'
];
protected $dates = [
'created_at',
'updated_at'
];
public function judge()
{
return $this->belongsTo('App\Models\Judges', 'judge', 'id');
}
public function scoredVehicle()
{
return $this->hasMany('App\Models\Vehicles', 'id', 'vehicle');
}
}

View File

@ -6,7 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class vehicles extends Model class vehicles extends Model
{ {
protected $table = 'items'; protected $table = 'vehicles';
protected $fillable = [ protected $fillable = [
'year', 'year',
'make', 'make',
@ -20,4 +20,24 @@ class vehicles extends Model
'created_at', 'created_at',
'updated_at' 'updated_at'
]; ];
public function vehicleType()
{
return $this->belongsTo('App\Models\CarShowCategory', 'type', 'id');
}
public function vehicleOwner()
{
return $this->belongsTo('App\Models\Bidders', 'owner', 'bidder_assigned_number');
}
public function vehicleScores()
{
return $this->hasMany('App\Models\VechicleScores', 'id', 'vehicle');
}
public function CarShowWinner()
{
return $this->belongsTo('App\Models\CarShowWinner', 'id', 'vehicle');
}
} }

1006
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -22,3 +22,15 @@ $factory->define(App\User::class, function (Faker\Generator $faker) {
'remember_token' => str_random(10), 'remember_token' => str_random(10),
]; ];
}); });
//Bidder
$factory->define(App\Models\Bidder::class, function (Faker\Generator $faker) {
static $password;
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'password' => $password ?: $password = bcrypt('secret'),
'remember_token' => str_random(10),
];
});

View File

@ -20,7 +20,7 @@ class CreateVehiclesTable extends Migration
$table->string('model'); $table->string('model');
$table->string('type'); $table->string('type');
$table->boolean('doNotJudge'); $table->boolean('doNotJudge');
$table->integer('owner'); $table->string('owner');
$table->timestamps(); $table->timestamps();
}); });
} }

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateVehicleScoresTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vehicle_scores', function (Blueprint $table) {
$table->increments('id');
$table->string('judge');
$table->string('overall_score');
$table->string('vehicle');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('vehicle_scores');
}
}

View File

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class CreateTypesTable extends Migration class CreateJudgesTable extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
@ -13,9 +13,9 @@ class CreateTypesTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('types', function (Blueprint $table) { Schema::create('judges', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->string('type_name'); $table->string('judge_number');
$table->timestamps(); $table->timestamps();
}); });
} }
@ -27,6 +27,6 @@ class CreateTypesTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('types'); Schema::dropIfExists('judges');
} }
} }

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePeoplesChoicesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('peoples_choice', function (Blueprint $table) {
$table->increments('id');
$table->string('vehicle');
$table->string('pc_count');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('peoples_choice');
}
}

View File

@ -0,0 +1,34 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCarShowWinnersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('car_show_winners', function (Blueprint $table) {
$table->increments('id');
$table->string('category');
$table->string('vehicle');
$table->string('place');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('car_show_winners');
}
}

View File

@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateCarShowCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('car_show_categories', function (Blueprint $table) {
$table->increments('id');
$table->string('category_name');
$table->boolean('vehicle_type');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('car_show_categories');
}
}

View File

@ -0,0 +1,40 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">Award Category Entry</div>
<div class="panel-body">
<form id="winner_form" required method="post" action="/awardcategories" enctype="multipart/form-data" class=form-horizontal>
{{ csrf_field() }}
<div class=form-group>
<label for=category class="col-sm-3 col-sm-offset-1 control-label">
Award Category:
</label>
<div class=col-sm-4>
<input type="text" name="category" id="category" class=form-control />
</div>
</div>
<div class=form-group>
<label for=vehtype class="col-sm-3 col-sm-offset-1 control-label">
Vehicle Type?
</label>
<div class=col-sm-1>
<input class="form-check-input" type="checkbox" value="" id="vehtype" name="vehtype">
</div>
</div>
<div class=form-group>
<div class="col-sm-offset-5 col-sm-10">
<button type="submit" value="Submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,75 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">
<h3>
Car Show Scores
</h3>
</div>
<div class="panel-body">
@if($carshowscore_results)
<table align='center' class='table table-striped table-condensed table-hover table-bordered'>
<tr>
<th>
Vehicle Number:
</th>
<th>
Total Score:
</th>
<th>
Year:
</th>
<th>
Make:
</th>
<th>
Model:
</th>
<th>
Category:
</th>
<th>
Owner:
</th>
</tr>
@foreach($carshowscore_results as $carshowscore_result)
<tr>
<td>
{{ $carshowscore_result->scoredVehicle[0]->owner }}
</td>
<td>
{{ $carshowscore_result->totalscore }}
</td>
<td>
{{ $carshowscore_result->scoredVehicle[0]->year }}
</td>
<td>
{{ $carshowscore_result->scoredVehicle[0]->make }}
</td>
<td>
{{ $carshowscore_result->scoredVehicle[0]->model }}
</td>
<td>
{{ $carshowscore_result->scoredVehicle[0]->vehicleType->category_name }}
</td>
<td>
{{ $carshowscore_result->scoredVehicle[0]->vehicleOwner->bidder_fname }} {{ $carshowscore_result->scoredVehicle[0]->vehicleOwner->bidder_lname }}
</td>
</tr>
@endforeach
</table>
@else
<h3>
No Car Show Scores!
</h3>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,76 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">
<h3>
Car Show Winners
</h3>
</div>
<div class="panel-body">
@if($carshowwinner_results)
<table align='center' class='table table-striped table-condensed table-hover table-bordered'>
<tr>
<th>
Award Category:
</th>
<th>
Place:
</th>
<th>
Vehicle Number:
</th>
<th>
Year:
</th>
<th>
Make:
</th>
<th>
Model:
</th>
<th>
Owner:
</th>
</tr>
@foreach($carshowwinner_results as $carshowwinner_result)
<tr>
<td>
{{ $carshowwinner_result->awardCategory[0]->category_name }}
</td>
<td>
{{ $carshowwinner_result->place }}
</td>
<td>
{{ $carshowwinner_result->awardVehicle[0]->owner }}
</td>
<td>
{{ $carshowwinner_result->awardVehicle[0]->year }}
</td>
<td>
{{ $carshowwinner_result->awardVehicle[0]->make }}
</td>
<td>
{{ $carshowwinner_result->awardVehicle[0]->model }}
</td>
<td>
{{ $carshowwinner_result->awardVehicle[0]->vehicleOwner->bidder_fname }} {{ $carshowwinner_result->awardVehicle[0]->vehicleOwner->bidder_lname }}
</td>
</tr>
@endforeach
</table>
@else
<h3>
No Car Show Winners!
</h3>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,32 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">Car Show Judge Creation</div>
<div class="panel-body">
<form id="winner_form" required method="post" action="/judges" enctype="multipart/form-data" class=form-horizontal>
{{ csrf_field() }}
<div class=form-group>
<label for=judgenum class="col-sm-2 col-sm-offset-3 control-label">
Judge Number:
</label>
<div class=col-sm-2>
<input type="text" name="judgenum" id="judgenum" class=form-control />
</div>
</div>
<div class=form-group>
<div class="col-sm-offset-5 col-sm-10">
<button type="submit" value="Submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,52 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">Car Show Judging Entry</div>
<div class="panel-body">
<form id="winner_form" required method="post" action="/judgingentry" enctype="multipart/form-data" class=form-horizontal>
{{ csrf_field() }}
<div class=form-group>
<label for=vehnum class="col-sm-2 col-sm-offset-3 control-label">
Vehicle Number:
</label>
<div class=col-sm-2>
<select name="vehnum" id="vehnum" required class=form-control>
<?php echo App\Helpers\VehicleSelectList::vehicleShowNumbers(); ?>
</select>
</div>
</div>
<div class=form-group>
<label for=judgenum class="col-sm-2 col-sm-offset-3 control-label">
Judge Number:
</label>
<div class=col-sm-2>
<select name="judgenum" id="judgenum" required class=form-control>
<?php echo App\Helpers\JudgesSelectList::judgesShowNumbers(); ?>
</select>
</div>
</div>
<div class=form-group>
<label for=vehscore class="col-sm-2 col-sm-offset-3 control-label">
Overall Score:
</label>
<div class=col-sm-2>
<input type="text" name="vehscore" id="vehscore" class=form-control />
</div>
</div>
<div class=form-group>
<div class="col-sm-offset-5 col-sm-10">
<button type="submit" value="Submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -104,6 +104,50 @@
</li> </li>
</ul> </ul>
</li> </li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
CarShow
<span class="caret">
</span>
</a>
<ul class="dropdown-menu">
<li>
<a href="/showcars">
Add Car
</a>
</li>
<li>
<a href="/showcarlist">
List Show Cars
</a>
</li>
<li>
<a href="/judgingentry">
Judging Entry
</a>
</li>
<li>
<a href="/pcentry">
People's Choice Entry
</a>
</li>
<li>
<a href="/judges">
Add Judge
</a>
</li>
<li>
<a href="/awardcategories">
Add Award Category
</a>
</li>
<li>
<a href="/showwinners">
Car Show Winners
</a>
</li>
</ul>
</li>
<li class="dropdown"> <li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
Reports Reports

View File

@ -0,0 +1,42 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">Car Show People's Choice Entry</div>
<div class="panel-body">
<form id="winner_form" required method="post" action="/pcentry" enctype="multipart/form-data" class=form-horizontal>
{{ csrf_field() }}
<div class=form-group>
<label for=vehnum class="col-sm-2 col-sm-offset-3 control-label">
Vehicle Number:
</label>
<div class=col-sm-2>
<select name="vehnum" id="vehnum" required class=form-control>
<?php echo App\Helpers\VehicleSelectList::vehicleShowNumbers(); ?>
</select>
</div>
</div>
<div class=form-group>
<label for=pc_count class="col-sm-2 col-sm-offset-3 control-label">
P.C. Ballot Count:
</label>
<div class=col-sm-2>
<input type="text" name="pc_count" id="pc_count" class=form-control />
</div>
</div>
<div class=form-group>
<div class="col-sm-offset-5 col-sm-10">
<button type="submit" value="Submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,111 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
<h3>
Show Car List
</h3>
</div>
<div class="panel-body">
@if($showcarlist_results)
<table align='center' class='table table-striped table-condensed table-hover table-bordered'>
<tr>
<th>
#:
</th>
<th>
Last Name:
</th>
<th>
First Name:
</th>
<th>
Address:
</th>
<th>
City:
</th>
<th>
State:
</th>
<th>
Zip:
</th>
<th>
Phone:
</th>
<th>
Email:
</th>
<th>
Year:
</th>
<th>
Make:
</th>
<th>
Model:
</th>
<th>
Type:
</th>
</tr>
@foreach($showcarlist_results as $showcarlist_result)
<tr>
<td>
{{ $showcarlist_result->bidder_assigned_number }}
</td>
<td>
{{ $showcarlist_result->bidder_lname }}
</td>
<td>
{{ $showcarlist_result->bidder_fname }}
</td>
<td>
{{ $showcarlist_result->bidder_addr }}
</td>
<td>
{{ $showcarlist_result->bidder_city }}
</td>
<td>
{{ $showcarlist_result->bidder_state }}
</td>
<td>
{{ $showcarlist_result->bidder_zip }}
</td>
<td>
{{ $showcarlist_result->bidder_phone }}
</td>
<td>
{{ $showcarlist_result->bidder_email }}
</td>
<td>
{{ $showcarlist_result->year }}
</td>
<td>
{{ $showcarlist_result->make }}
</td>
<td>
{{ $showcarlist_result->model }}
</td>
<td>
{{ $showcarlist_result->vehicles[0]->vehicleType->category_name }}
</td>
</tr>
@endforeach
</table>
@else
<h3>
No Bidders
</h3>
@endif
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,138 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">Show Car Entry</div>
<div class="panel-body">
<form id="bidder_form" required method="post" action="/showcars" enctype="multipart/form-data" class=form-horizontal>
{{ csrf_field() }}
<div class=form-group>
<label for=biddernum class="col-sm-3 col-sm-offset-1 control-label">
Car / Bidder Number:
</label>
<div class=col-sm-2>
<input type="text" name="biddernum" id="biddernum" required class=form-control />
</div>
</div>
<div class=form-group>
<label for=bidderfname class="col-sm-3 col-sm-offset-1 control-label">
First Name:
</label>
<div class=col-sm-4>
<input type="text" name="bidderfname" id="bidderfname" required class=form-control />
</div>
</div>
<div class=form-group>
<label for=bidderlname class="col-sm-3 col-sm-offset-1 control-label">
Last Name:
</label>
<div class=col-sm-4>
<input type="text" name="bidderlname" id="bidderlname" required class=form-control />
</div>
</div>
<div class=form-group>
<label for=bidderaddr class="col-sm-3 col-sm-offset-1 control-label">
Address:
</label>
<div class=col-sm-4>
<input type="text" name="bidderaddr" id="bidderaddr" required class=form-control />
</div>
</div>
<div class=form-group>
<label for=biddercity class="col-sm-3 col-sm-offset-1 control-label">
City:
</label>
<div class=col-sm-4>
<input type="text" name="biddercity" id="biddercity" required class=form-control />
</div>
</div>
<div class=form-group>
<label for=bidderstate class="col-sm-3 col-sm-offset-1 control-label">
State:
</label>
<div class=col-sm-2>
<input type="text" name="bidderstate" id="bidderstate" required class=form-control />
</div>
</div>
<div class=form-group>
<label for=bidderzip class="col-sm-3 col-sm-offset-1 control-label">
Zip:
</label>
<div class=col-sm-2>
<input type="text" name="bidderzip" id="bidderzip" required class=form-control />
</div>
</div>
<div class=form-group>
<label for=bidderphone class="col-sm-3 col-sm-offset-1 control-label">
Phone Number:
</label>
<div class=col-sm-4>
<input type="text" name="bidderphone" id="bidderphone" required class=form-control />
</div>
</div>
<div class=form-group>
<label for=bidderemail class="col-sm-3 col-sm-offset-1 control-label">
Email:
</label>
<div class=col-sm-4>
<input type="text" name="bidderemail" id="bidderemail" class=form-control />
</div>
</div>
<div class=form-group>
<label for=vehyear class="col-sm-3 col-sm-offset-1 control-label">
Vechicle Year:
</label>
<div class=col-sm-4>
<input type="text" name="vehyear" id="vehyear" class=form-control />
</div>
</div>
<div class=form-group>
<label for=vehmake class="col-sm-3 col-sm-offset-1 control-label">
Vehicle Make:
</label>
<div class=col-sm-4>
<input type="text" name="vehmake" id="vehmake" class=form-control />
</div>
</div>
<div class=form-group>
<label for=vehmodel class="col-sm-3 col-sm-offset-1 control-label">
Vehicle Model:
</label>
<div class=col-sm-4>
<input type="text" name="vehmodel" id="vehmodel" class=form-control />
</div>
</div>
<div class=form-group>
<label for=vehtype class="col-sm-3 col-sm-offset-1 control-label">
Vehicle Type:
</label>
<div class=col-sm-2>
<select name="vehtype" id="vehtype" required class=form-control>
<?php echo App\Helpers\VehicleTypeSelectList::vehicleTypeShowTypes(); ?>
</select>
</div>
</div>
<div class=form-group>
<label for=vehdonotjudge class="col-sm-3 col-sm-offset-1 control-label">
DO NOT JUDGE:
</label>
<div class=col-sm-1>
<input class="form-check-input" type="checkbox" value="" id="vehdonotjudge">
</div>
</div>
<div class=form-group>
<div class="col-sm-offset-5 col-sm-10">
<button type="submit" value="Submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -0,0 +1,40 @@
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">Vehicle Type Entry</div>
<div class="panel-body">
<form id="winner_form" required method="post" action="/vehicletypes" enctype="multipart/form-data" class=form-horizontal>
{{ csrf_field() }}
<div class=form-group>
<label for=vehtype class="col-sm-3 col-sm-offset-1 control-label">
Vehicle Type:
</label>
<div class=col-sm-4>
<input type="text" name="vehtype" id="vehtype" class=form-control />
</div>
</div>
<div class=form-group>
<div class="col-sm-offset-5 col-sm-10">
<button type="submit" value="Submit" class="btn btn-primary">Submit</button>
</div>
</div>
<div class=form-group>
<label for=vehdonotjudge class="col-sm-3 col-sm-offset-1 control-label">
Vehicle Type?:
</label>
<div class=col-sm-1>
<input class="form-check-input" type="checkbox" value="" id="vehtype">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
@endsection

View File

@ -17,6 +17,9 @@ Auth::routes();
Route::get('/', [ 'uses' => 'PagesController@home']); Route::get('/', [ 'uses' => 'PagesController@home']);
Route::get('home', [ 'uses' => 'PagesController@home']); Route::get('home', [ 'uses' => 'PagesController@home']);
Route::get('winningbidderlist', [ 'uses' => 'PagesController@winningbidderlist']); Route::get('winningbidderlist', [ 'uses' => 'PagesController@winningbidderlist']);
Route::get('showwinners', [ 'uses' => 'PagesController@showwinners']);
Route::get('showscores', [ 'uses' => 'PagesController@showscores']);
Route::group(['middleware' => 'auth'], function() { Route::group(['middleware' => 'auth'], function() {
Route::get('bidders', [ 'uses' => 'PagesController@bidders']); Route::get('bidders', [ 'uses' => 'PagesController@bidders']);
Route::post('bidders', [ 'uses' => 'PagesController@bidders']); Route::post('bidders', [ 'uses' => 'PagesController@bidders']);
@ -42,4 +45,17 @@ Route::group(['middleware' => 'auth'], function() {
Route::get('winnersbyitem', [ 'uses' => 'PagesController@winnersbyitem']); Route::get('winnersbyitem', [ 'uses' => 'PagesController@winnersbyitem']);
Route::get('winnertotal', [ 'uses' => 'PagesController@winnertotal']); Route::get('winnertotal', [ 'uses' => 'PagesController@winnertotal']);
Route::post('winnertotal', [ 'uses' => 'PagesController@winnertotal']); Route::post('winnertotal', [ 'uses' => 'PagesController@winnertotal']);
Route::get('showcars', [ 'uses' => 'PagesController@showcars']);
Route::get('judgingentry', [ 'uses' => 'PagesController@judgingentry']);
Route::get('pcentry', [ 'uses' => 'PagesController@pcentry']);
Route::get('judges', [ 'uses' => 'PagesController@judges']);
Route::get('vehicletypes', [ 'uses' => 'PagesController@vehicletypes']);
Route::get('awardcategories', [ 'uses' => 'PagesController@awardcategories']);
Route::post('showcars', [ 'uses' => 'PagesController@showcars']);
Route::post('judgingentry', [ 'uses' => 'PagesController@judgingentry']);
Route::post('pcentry', [ 'uses' => 'PagesController@pcentry']);
Route::post('judges', [ 'uses' => 'PagesController@judges']);
Route::post('vehicletypes', [ 'uses' => 'PagesController@vehicletypes']);
Route::post('awardcategories', [ 'uses' => 'PagesController@awardcategories']);
Route::get('showcarlist', [ 'uses' => 'PagesController@showcarlist']);
}); });

2
storage/debugbar/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore