Major updates
This commit is contained in:
40
app/Console/Kernel.php
Normal file
40
app/Console/Kernel.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* The Artisan commands provided by your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
{
|
||||
// $schedule->command('inspire')
|
||||
// ->hourly();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the Closure based commands for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function commands()
|
||||
{
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
65
app/Exceptions/Handler.php
Normal file
65
app/Exceptions/Handler.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Auth\AuthenticationException;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* A list of the exception types that should not be reported.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
\Illuminate\Auth\AuthenticationException::class,
|
||||
\Illuminate\Auth\Access\AuthorizationException::class,
|
||||
\Symfony\Component\HttpKernel\Exception\HttpException::class,
|
||||
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
|
||||
\Illuminate\Session\TokenMismatchException::class,
|
||||
\Illuminate\Validation\ValidationException::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Report or log an exception.
|
||||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $exception
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $exception)
|
||||
{
|
||||
parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $exception
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function render($request, Exception $exception)
|
||||
{
|
||||
return parent::render($request, $exception);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert an authentication exception into an unauthenticated response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Illuminate\Auth\AuthenticationException $exception
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
protected function unauthenticated($request, AuthenticationException $exception)
|
||||
{
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json(['error' => 'Unauthenticated.'], 401);
|
||||
}
|
||||
|
||||
return redirect()->guest(route('login'));
|
||||
}
|
||||
}
|
32
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
32
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
}
|
39
app/Http/Controllers/Auth/LoginController.php
Normal file
39
app/Http/Controllers/Auth/LoginController.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
}
|
||||
}
|
71
app/Http/Controllers/Auth/RegisterController.php
Normal file
71
app/Http/Controllers/Auth/RegisterController.php
Normal file
@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @param array $data
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|string|max:255',
|
||||
'email' => 'required|string|email|max:255|unique:users',
|
||||
'password' => 'required|string|min:6|confirmed',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @param array $data
|
||||
* @return User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => bcrypt($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
39
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
39
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
}
|
13
app/Http/Controllers/Controller.php
Normal file
13
app/Http/Controllers/Controller.php
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Routing\Controller as BaseController;
|
||||
use Illuminate\Foundation\Validation\ValidatesRequests;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
|
||||
class Controller extends BaseController
|
||||
{
|
||||
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
|
||||
}
|
28
app/Http/Controllers/HomeController.php
Normal file
28
app/Http/Controllers/HomeController.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
}
|
350
app/Http/Controllers/PagesController.php
Normal file
350
app/Http/Controllers/PagesController.php
Normal file
@ -0,0 +1,350 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use View;
|
||||
Use App\helpers;
|
||||
use PDF;
|
||||
//use Converter;
|
||||
|
||||
class PagesController extends Controller
|
||||
{
|
||||
public function home()
|
||||
{
|
||||
$item_count_result = DB::select("SELECT
|
||||
count(items.item_assigned_num) AS item_count
|
||||
FROM items
|
||||
");
|
||||
$bidder_count_result = DB::select("SELECT
|
||||
count(bidders.bidder_assigned_number) AS bidder_count
|
||||
FROM bidders
|
||||
");
|
||||
$winner_count_result = DB::select("SELECT
|
||||
count(winning_bids.idwinning_bids) AS winner_count
|
||||
FROM winning_bids
|
||||
");
|
||||
return view('home', ['item_count_result' => $item_count_result, 'bidder_count_result' => $bidder_count_result, 'winner_count_result' => $winner_count_result]);
|
||||
}
|
||||
|
||||
public function bidderlist()
|
||||
{
|
||||
$bidderlist_results = DB::select("SELECT
|
||||
*
|
||||
FROM bidders
|
||||
ORDER BY bidder_assigned_number ASC, bidder_fname ASC
|
||||
");
|
||||
return view('bidderlist', ['bidderlist_results' => $bidderlist_results]);
|
||||
}
|
||||
|
||||
public function bidders(Request $bidder_req)
|
||||
{
|
||||
if(!$bidder_req->bidderlname){
|
||||
return view('bidders');
|
||||
}
|
||||
$bidder_lname = $bidder_req->bidderlname;
|
||||
$bidder_fname = $bidder_req->bidderfname;
|
||||
$bidder_addr = $bidder_req->bidderaddr;
|
||||
$bidder_city = $bidder_req->biddercity;
|
||||
$bidder_state = $bidder_req->bidderstate;
|
||||
$bidder_zip = $bidder_req->bidderzip;
|
||||
$bidder_phone = $bidder_req->bidderphone;
|
||||
$bidder_email = $bidder_req->bidderemail;
|
||||
$bidder_assigned_number = $bidder_req->biddernum;
|
||||
$bidder_insert = DB::table('bidders')->insert(
|
||||
[
|
||||
'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 ,
|
||||
'bidder_assigned_number' => $bidder_assigned_number
|
||||
]);
|
||||
return redirect('bidders');
|
||||
}
|
||||
|
||||
public function checkout(Request $checkout_req)
|
||||
{
|
||||
if(!$checkout_req->checkoutbiddernum){
|
||||
return view('checkout_select_form');
|
||||
} elseif(!$checkout_req->checkout_payment_method){
|
||||
$checkout_bidder = $checkout_req->checkoutbiddernum;
|
||||
$checkout_list_results = DB::select("SELECT
|
||||
*, items.item_assigned_num
|
||||
FROM winning_bids
|
||||
INNER JOIN items AS items
|
||||
ON winning_bids.winning_item_num=items.iditems
|
||||
WHERE winning_bidder_num = $checkout_bidder
|
||||
");
|
||||
$checkout_info_results = DB::select("SELECT
|
||||
winning_bids.*,
|
||||
bidders.*,
|
||||
sum(winning_cost) AS total_cost
|
||||
FROM winning_bids
|
||||
INNER JOIN bidders AS bidders
|
||||
ON winning_bids.winning_bidder_num=bidders.idbidders
|
||||
WHERE winning_bidder_num = $checkout_bidder
|
||||
GROUP BY winning_bids.winning_bidder_num
|
||||
");
|
||||
return view('checkout', ['checkout_list_results' => $checkout_list_results, 'checkout_info_results' => $checkout_info_results]);
|
||||
} else {
|
||||
$winnertotal = $checkout_req->winnertotal;
|
||||
$bidder_num = $checkout_req->checkoutbiddernum;
|
||||
$payment_method = $checkout_req->checkout_payment_method;
|
||||
$check_number = $checkout_req->check_number;
|
||||
$cc_transaction = $checkout_req->cc_transaction;
|
||||
$cc_amount = $checkout_req->cc_amount;
|
||||
$checkout_list_results = DB::select("SELECT
|
||||
*, items.item_assigned_num, items.item_desc
|
||||
FROM winning_bids
|
||||
INNER JOIN items AS items
|
||||
ON winning_bids.winning_item_num=items.iditems
|
||||
WHERE winning_bidder_num = $bidder_num
|
||||
");
|
||||
$checkout_info_results = DB::select("SELECT
|
||||
winning_bids.*,
|
||||
bidders.*,
|
||||
sum(winning_cost) AS total_cost
|
||||
FROM winning_bids
|
||||
INNER JOIN bidders AS bidders
|
||||
ON winning_bids.winning_bidder_num=bidders.idbidders
|
||||
WHERE winning_bidder_num = $bidder_num
|
||||
GROUP BY winning_bids.winning_bidder_num
|
||||
");
|
||||
$checkout_result = DB::table('checkout')->insertGetID(
|
||||
[
|
||||
'bidder_num' => $bidder_num,
|
||||
'winnertotal' => $winnertotal,
|
||||
'payment_method' => $payment_method,
|
||||
'check_number' => $check_number,
|
||||
'cc_transaction' => $cc_transaction,
|
||||
'cc_amount' => $cc_amount,
|
||||
]
|
||||
);
|
||||
return view('checkout_complete', ['checkout_result' => $checkout_result, 'checkout_list_results' => $checkout_list_results, 'checkout_info_results' => $checkout_info_results, 'payment_method' => $payment_method, 'check_number' => $check_number, 'cc_transaction' => $cc_transaction]);
|
||||
}
|
||||
}
|
||||
|
||||
public function checkout_complete_list()
|
||||
{
|
||||
$checkout_complete_results = DB::select("SELECT
|
||||
checkout.*,
|
||||
bidders.*
|
||||
FROM checkout
|
||||
INNER JOIN bidders AS bidders
|
||||
ON checkout.bidder_num=bidders.idbidders
|
||||
GROUP BY checkout.bidder_num
|
||||
ORDER BY bidders.bidder_assigned_number ASC
|
||||
");
|
||||
return view('checkout_complete_list', ['checkout_complete_results' => $checkout_complete_results]);
|
||||
}
|
||||
|
||||
public function editwinners(Request $edit_win_req)
|
||||
{
|
||||
if(!$edit_win_req->winid){
|
||||
return view('editwinners');
|
||||
}
|
||||
$winning_bid_id = $edit_win_req->winid;
|
||||
$winner_bidder = $edit_win_req->winnerbiddernum;
|
||||
$winner_cost = $edit_win_req->winnerbid;
|
||||
$winner_insert = DB::table('winning_bids')
|
||||
->where('idwinning_bids', $winning_bid_id)
|
||||
->update(
|
||||
[
|
||||
'winning_bidder_num' => $winner_bidder,
|
||||
'winning_cost' => $winner_cost
|
||||
]
|
||||
);
|
||||
return redirect('editwinners');
|
||||
}
|
||||
|
||||
public function finaltally()
|
||||
{
|
||||
$finaltally_results = DB::select("SELECT
|
||||
winning_bids.*,
|
||||
sum(winning_bids.winning_cost) AS total_due,
|
||||
bidders.*
|
||||
FROM winning_bids
|
||||
INNER JOIN bidders as bidders
|
||||
ON winning_bids.winning_bidder_num=bidders.idbidders
|
||||
GROUP BY winning_bids.winning_bidder_num
|
||||
ORDER BY bidders.bidder_lname
|
||||
");
|
||||
return view('finaltally', ['finaltally_results' => $finaltally_results]);
|
||||
}
|
||||
|
||||
public function itemlist()
|
||||
{
|
||||
$itemlist_results = DB::select("SELECT
|
||||
*
|
||||
FROM items
|
||||
ORDER BY item_assigned_num ASC
|
||||
");
|
||||
return view('itemlist', ['itemlist_results' => $itemlist_results]);
|
||||
}
|
||||
|
||||
public function items(Request $items_req)
|
||||
{
|
||||
if(!$items_req->itemnum){
|
||||
return view('items');
|
||||
}
|
||||
$item_assigned_num = $items_req->itemnum;
|
||||
$item_desc = $items_req->itemdesc;
|
||||
$item_min_bid = $items_req->itemminbid;
|
||||
$items_est_value = $items_req->itemestvalue;
|
||||
$item_insert = DB::table('items')->insert(
|
||||
[
|
||||
'item_assigned_num' => $item_assigned_num,
|
||||
'item_desc' => $item_desc,
|
||||
'item_min_bid' => $item_min_bid,
|
||||
'item_est_value' => $items_est_value
|
||||
]);
|
||||
return redirect('items');
|
||||
}
|
||||
|
||||
public function receiptpdf(Request $receiptpdf_request)
|
||||
{
|
||||
$checkoutid = $receiptpdf_request->checkout_id;
|
||||
$checkout_final_results = DB::select("SELECT
|
||||
*
|
||||
FROM checkout
|
||||
WHERE checkout_id = $checkoutid
|
||||
");
|
||||
$bidder_num = $checkout_final_results['0']->bidder_num;
|
||||
$checkout_list_results = DB::select("SELECT
|
||||
*, items.item_assigned_num, items.item_desc
|
||||
FROM winning_bids
|
||||
INNER JOIN items AS items
|
||||
ON winning_bids.winning_item_num=items.iditems
|
||||
WHERE winning_bidder_num = $bidder_num
|
||||
");
|
||||
$checkout_info_results = DB::select("SELECT
|
||||
winning_bids.*,
|
||||
bidders.*,
|
||||
sum(winning_cost) AS total_cost
|
||||
FROM winning_bids
|
||||
INNER JOIN bidders AS bidders
|
||||
ON winning_bids.winning_bidder_num=bidders.idbidders
|
||||
WHERE winning_bidder_num = $bidder_num
|
||||
GROUP BY winning_bids.winning_bidder_num
|
||||
");
|
||||
//dd($checkout_final_results);
|
||||
$checkout_data = [
|
||||
'checkout_final_results' => $checkout_final_results,
|
||||
'checkout_list_results' => $checkout_list_results,
|
||||
'checkout_info_results' => $checkout_info_results
|
||||
];
|
||||
// dd($checkout_data);
|
||||
//$pdf = PDF::loadView('receiptpdf', $checkout_data);
|
||||
|
||||
//dd($pdf);
|
||||
// $receiptcontentview = View::make('receiptpdf', $checkout_data);
|
||||
// $receiptcontent = $receiptcontentview->render();
|
||||
// $pdf = PDF::loadHTML($receiptcontent);
|
||||
// $pdf = PDF::loadView('receiptpdf', $checkout_data);
|
||||
// return $pdf->stream('receipt.pdf');
|
||||
return view('receiptpdf', $checkout_data);
|
||||
}
|
||||
|
||||
public function reprint_receipt(Request $reprint_receipt_req)
|
||||
{
|
||||
if(!$reprint_receipt_req->reprintbiddernum){
|
||||
return view('reprint_receipt_form');
|
||||
} else {
|
||||
$bidnum=$reprint_receipt_req->reprintbiddernum;
|
||||
$checkout_id = DB::select("SELECT
|
||||
checkout_id
|
||||
FROM checkout
|
||||
WHERE bidder_num = $bidnum
|
||||
");
|
||||
return redirect()->route('receiptpdf', ['checkout_id' => $checkout_id['0']->checkout_id]);
|
||||
}
|
||||
}
|
||||
|
||||
public function winnerlist()
|
||||
{
|
||||
$winnerlist_results = DB::select("SELECT
|
||||
*, bidders.bidder_assigned_number, items.item_assigned_num
|
||||
FROM winning_bids
|
||||
INNER JOIN bidders as bidders
|
||||
ON winning_bids.winning_bidder_num=bidders.idbidders
|
||||
INNER JOIN items as items
|
||||
ON winning_bids.winning_item_num=items.iditems
|
||||
ORDER BY winning_item_num ASC
|
||||
");
|
||||
return view('winnerlist', ['winnerlist_results' => $winnerlist_results]);
|
||||
}
|
||||
|
||||
public function winners(Request $winners_req)
|
||||
{
|
||||
if(!$winners_req->winnerbid){
|
||||
return view('winners');
|
||||
}
|
||||
$winner_item = $winners_req->winneritemnum;
|
||||
$winner_bidder = $winners_req->winnerbiddernum;
|
||||
$winner_cost = $winners_req->winnerbid;
|
||||
$winner_insert = DB::table('winning_bids')->insert(
|
||||
[
|
||||
'winning_item_num' => $winner_item,
|
||||
'winning_bidder_num' => $winner_bidder,
|
||||
'winning_cost' => $winner_cost
|
||||
]
|
||||
);
|
||||
return redirect('winners');
|
||||
}
|
||||
|
||||
public function winnersbyitem()
|
||||
{
|
||||
$winnersbyitem_results = DB::select("SELECT
|
||||
*
|
||||
FROM winning_bids
|
||||
INNER JOIN items as items
|
||||
ON winning_bids.winning_item_num=items.iditems
|
||||
INNER JOIN bidders AS bidders
|
||||
ON winning_bids.winning_bidder_num=bidders.idbidders
|
||||
ORDER BY item_assigned_num ASC
|
||||
");
|
||||
return view('winnersbyitem', ['winnersbyitem_results' => $winnersbyitem_results]);
|
||||
}
|
||||
|
||||
public function winnertotal(Request $winnertotal_req)
|
||||
{
|
||||
if(!$winnertotal_req->winnerbiddernum){
|
||||
return view('winnertotalform');
|
||||
}
|
||||
$winner_total_bidder = $winnertotal_req->winnerbiddernum;
|
||||
$winnertotal_list_results = DB::select("SELECT
|
||||
*, items.item_assigned_num
|
||||
FROM winning_bids
|
||||
INNER JOIN items AS items
|
||||
ON winning_bids.winning_item_num=items.iditems
|
||||
WHERE winning_bidder_num = $winner_total_bidder
|
||||
");
|
||||
$winnertotal_info_results = DB::select("SELECT
|
||||
winning_bids.*,
|
||||
bidders.*,
|
||||
sum(winning_cost) AS total_cost
|
||||
FROM winning_bids
|
||||
INNER JOIN bidders AS bidders
|
||||
ON winning_bids.winning_bidder_num=bidders.idbidders
|
||||
WHERE winning_bidder_num = $winner_total_bidder
|
||||
GROUP BY winning_bids.winning_bidder_num
|
||||
");
|
||||
return view('winnertotal', ['winnertotal_list_results' => $winnertotal_list_results, 'winnertotal_info_results' => $winnertotal_info_results]);
|
||||
}
|
||||
|
||||
public function winningbidderlist()
|
||||
{
|
||||
$winnerlist_results = DB::select("SELECT
|
||||
winning_bidder_num
|
||||
FROM winning_bids
|
||||
GROUP BY winning_bidder_num
|
||||
ORDER BY winning_bidder_num
|
||||
");
|
||||
return view('winningbidderlist', ['winnerlist_results' => $winnerlist_results]);
|
||||
}
|
||||
}
|
61
app/Http/Kernel.php
Normal file
61
app/Http/Kernel.php
Normal file
@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middleware = [
|
||||
\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
// \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
\App\Http\Middleware\HttpsRedirect::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
'throttle:60,1',
|
||||
'bindings',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware.
|
||||
*
|
||||
* These middleware may be assigned to groups or used individually.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $routeMiddleware = [
|
||||
'auth' => \Illuminate\Auth\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
];
|
||||
}
|
17
app/Http/Middleware/EncryptCookies.php
Normal file
17
app/Http/Middleware/EncryptCookies.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as BaseEncrypter;
|
||||
|
||||
class EncryptCookies extends BaseEncrypter
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
24
app/Http/Middleware/HttpsRedirect.php
Normal file
24
app/Http/Middleware/HttpsRedirect.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
class HttpsRedirect
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
if (!$request->secure() && env('APP_ENV') === 'prod') {
|
||||
return redirect()->secure($request->getRequestUri());
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
26
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
26
app/Http/Middleware/RedirectIfAuthenticated.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @param string|null $guard
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next, $guard = null)
|
||||
{
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect('/home');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
18
app/Http/Middleware/TrimStrings.php
Normal file
18
app/Http/Middleware/TrimStrings.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as BaseTrimmer;
|
||||
|
||||
class TrimStrings extends BaseTrimmer
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
17
app/Http/Middleware/VerifyCsrfToken.php
Normal file
17
app/Http/Middleware/VerifyCsrfToken.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as BaseVerifier;
|
||||
|
||||
class VerifyCsrfToken extends BaseVerifier
|
||||
{
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
29
app/Providers/AppServiceProvider.php
Normal file
29
app/Providers/AppServiceProvider.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Schema::defaultStringLength(191);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
30
app/Providers/AuthServiceProvider.php
Normal file
30
app/Providers/AuthServiceProvider.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
'App\Model' => 'App\Policies\ModelPolicy',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->registerPolicies();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
21
app/Providers/BroadcastServiceProvider.php
Normal file
21
app/Providers/BroadcastServiceProvider.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
32
app/Providers/EventServiceProvider.php
Normal file
32
app/Providers/EventServiceProvider.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event listener mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $listen = [
|
||||
'App\Events\Event' => [
|
||||
'App\Listeners\EventListener',
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
parent::boot();
|
||||
|
||||
//
|
||||
}
|
||||
}
|
73
app/Providers/RouteServiceProvider.php
Normal file
73
app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* This namespace is applied to your controller routes.
|
||||
*
|
||||
* In addition, it is set as the URL generator's root namespace.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function map()
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
|
||||
$this->mapWebRoutes();
|
||||
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapWebRoutes()
|
||||
{
|
||||
Route::middleware('web')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function mapApiRoutes()
|
||||
{
|
||||
Route::prefix('api')
|
||||
->middleware('api')
|
||||
->namespace($this->namespace)
|
||||
->group(base_path('routes/api.php'));
|
||||
}
|
||||
}
|
29
app/User.php
Normal file
29
app/User.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'email', 'password',
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password', 'remember_token',
|
||||
];
|
||||
}
|
115
app/helpers.php
Normal file
115
app/helpers.php
Normal file
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BidderSelectList
|
||||
{
|
||||
public static function BidderShowNumbers()
|
||||
{
|
||||
$bidder_num_results = DB::select("SELECT
|
||||
*
|
||||
FROM bidders
|
||||
ORDER BY bidder_assigned_number
|
||||
");
|
||||
$bidder_num = '<option disabled selected hidden value="">choose...</option>';
|
||||
foreach($bidder_num_results as $bidder_num_result){
|
||||
$bidder_num .= '<option value="' . $bidder_num_result->idbidders . '">' . $bidder_num_result->bidder_assigned_number . ' - ' . $bidder_num_result->bidder_fname . ' ' . $bidder_num_result->bidder_lname .'</option>';
|
||||
}
|
||||
return $bidder_num;
|
||||
}
|
||||
}
|
||||
|
||||
class CheckoutBidderSelectList
|
||||
{
|
||||
public static function CheckoutBidderShowNumbers()
|
||||
{
|
||||
$checkout_bidder_num_results = DB::select("SELECT
|
||||
bidder_num, bidders.*
|
||||
FROM checkout
|
||||
INNER JOIN bidders AS bidders
|
||||
ON checkout.bidder_num=bidders.idbidders
|
||||
GROUP BY bidders.bidder_assigned_number
|
||||
ORDER BY bidders.bidder_assigned_number
|
||||
");
|
||||
$checkout_bidder_num = '<option disabled selected hidden value="">choose...</option>';
|
||||
foreach($checkout_bidder_num_results as $checkout_bidder_num_result){
|
||||
$checkout_bidder_num .= '<option value="' . $checkout_bidder_num_result->idbidders . '">' . $checkout_bidder_num_result->bidder_assigned_number . ' - ' . $checkout_bidder_num_result->bidder_fname . ' ' . $checkout_bidder_num_result->bidder_lname .'</option>';
|
||||
}
|
||||
return $checkout_bidder_num;
|
||||
}
|
||||
}
|
||||
|
||||
class ItemSelectList
|
||||
{
|
||||
public static function ItemShowNumbers()
|
||||
{
|
||||
$item_num_results = DB::select("SELECT
|
||||
*
|
||||
FROM items
|
||||
ORDER BY item_assigned_num
|
||||
");
|
||||
$item_nums = '<option disabled="disabled" selected="selected" value="0">choose...</option>';
|
||||
foreach($item_num_results as $item_num_result){
|
||||
$item_nums .= '<option value="' . $item_num_result->iditems . '">' . $item_num_result->item_assigned_num . '</option>';
|
||||
}
|
||||
return $item_nums;
|
||||
}
|
||||
}
|
||||
class PaymentMethodSelectList
|
||||
{
|
||||
public static function PaymentShowMethods()
|
||||
{
|
||||
$payment_method_results = DB::select("SELECT
|
||||
*
|
||||
FROM payment_methods
|
||||
ORDER BY pm_name
|
||||
");
|
||||
$payment_methods = '<option disabled="disabled" selected="selected" value="0">choose...</option>';
|
||||
foreach($payment_method_results as $payment_method_result){
|
||||
$payment_methods .= '<option value="' . $payment_method_result->pm_id . '">' . $payment_method_result->pm_name . '</option>';
|
||||
}
|
||||
return $payment_methods;
|
||||
}
|
||||
}
|
||||
|
||||
class WinningBidSelectList
|
||||
{
|
||||
public static function WinningBidShowNumbers()
|
||||
{
|
||||
$winning_bid_num_results = DB::select("SELECT
|
||||
*
|
||||
FROM winning_bids
|
||||
INNER JOIN items AS items
|
||||
ON winning_bids.winning_item_num = items.iditems
|
||||
ORDER BY items.item_assigned_num
|
||||
");
|
||||
$winning_bid_num = '<option disabled selected hidden value="">choose...</option>';
|
||||
foreach($winning_bid_num_results as $winning_bid_num_result){
|
||||
$winning_bid_num .= '<option value="' . $winning_bid_num_result->idwinning_bids . '">' . $winning_bid_num_result->item_assigned_num . ' - ' . $winning_bid_num_result->item_desc .'</option>';
|
||||
}
|
||||
return $winning_bid_num;
|
||||
}
|
||||
}
|
||||
|
||||
class WinningBidderSelectList
|
||||
{
|
||||
public static function WinningBidderShowNumbers()
|
||||
{
|
||||
$winning_bidder_num_results = DB::select("SELECT
|
||||
winning_bidder_num, bidders.*
|
||||
FROM winning_bids
|
||||
INNER JOIN bidders AS bidders
|
||||
ON winning_bids.winning_bidder_num=bidders.idbidders
|
||||
GROUP BY winning_bidder_num
|
||||
ORDER BY winning_bidder_num
|
||||
");
|
||||
$winning_bidder_num = '<option disabled selected hidden value="">choose...</option>';
|
||||
foreach($winning_bidder_num_results as $winning_bidder_num_result){
|
||||
$winning_bidder_num .= '<option value="' . $winning_bidder_num_result->idbidders . '">' . $winning_bidder_num_result->bidder_assigned_number . ' - ' . $winning_bidder_num_result->bidder_fname . ' ' . $winning_bidder_num_result->bidder_lname .'</option>';
|
||||
}
|
||||
return $winning_bidder_num;
|
||||
}
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user