Can now retrieve data from database
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class BillController extends Controller
|
||||
{
|
||||
public function create(Request $stuff)
|
||||
{
|
||||
return view('createbill', ['username' => $stuff->input('username'), 'message' => '']);
|
||||
}
|
||||
public function createbill(Request $stuff)
|
||||
{
|
||||
$billname = $stuff->input('billname');
|
||||
$emptbillname = isset($billname);
|
||||
if (!$emptbillname)
|
||||
{
|
||||
return view('createbill', ['username' => $stuff->input('username'), 'message' => 'Enter something in the bills...']);
|
||||
}
|
||||
|
||||
DB::table('bills')->insert([
|
||||
'billname' => $billname, 'username' => $stuff->input('username')
|
||||
]);
|
||||
return view('createbill', ['username' => $stuff->input('username'), 'message' => 'Bill created']);
|
||||
}
|
||||
public function manage(Request $stuff)
|
||||
{
|
||||
return view('manage', ['username' => $stuff->input('username')]);
|
||||
}
|
||||
public function view(Request $stuff)
|
||||
{
|
||||
//DB::table('users')->where('username', $username)->first();
|
||||
//$bills[] = dDB::table('bills')->where('')
|
||||
$billrecord = DB::table('bills')->get();
|
||||
$bills;
|
||||
foreach ($billrecord as $bill) {
|
||||
echo $bill->billname;
|
||||
echo "<br>";
|
||||
$bills[] = $bill->billname;
|
||||
}
|
||||
foreach ($bills as $w) {
|
||||
echo $w;
|
||||
echo "<br>";
|
||||
}
|
||||
return view('view', ['username' => $stuff->input('username')])->with('billrecord', $billrecord);
|
||||
//return view('view', ['username' => $stuff->input('username')])->with('bills', $bills);
|
||||
}
|
||||
}
|
||||
@@ -72,4 +72,8 @@ class HomeController extends Controller
|
||||
return view('userhome', ['username' => $username]);
|
||||
}
|
||||
}
|
||||
public function home(Request $stuff)
|
||||
{
|
||||
return view('userhome', ['username' => $stuff->input('username')]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>HomeIsWhereTheMoneyIs</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
|
||||
<!-- Optional theme -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
|
||||
</head>
|
||||
<body style="background-color:#eee">
|
||||
<div class="jumbotron text-center">
|
||||
<h1>Alright {{ $username }}, here is where you can create bills</h1>
|
||||
{!! Form::open(array('action' => 'HomeController@home')) !!}
|
||||
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
{{ Form::button('user Home', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
|
||||
{!! Form::open(array('action' => 'BillController@createbill')) !!}
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
{{ Form::label('lbl', 'bill name', array('style' => 'font-size:400%')) }}
|
||||
{{ Form::text('billname', '', array('style' => 'font-size:400%')) }}
|
||||
</p>
|
||||
<p>
|
||||
{{ Form::button('Create Bill', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
<h1>{{$message}}</h1>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,37 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>HomeIsWhereTheMoneyIs</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
|
||||
<!-- Optional theme -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
|
||||
</head>
|
||||
<body style="background-color:#eee">
|
||||
<div class="jumbotron text-center">
|
||||
<h1>Alright {{ $username }}, here is where you can manage the bills you own bills</h1>
|
||||
{!! Form::open(array('action' => 'HomeController@home')) !!}
|
||||
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
{{ Form::button('user Home', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
|
||||
{!! Form::open(array('action' => 'BillController@createbill')) !!}
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
{{ Form::label('lbl', 'bill name', array('style' => 'font-size:400%')) }}
|
||||
{{ Form::text('billname', '', array('style' => 'font-size:400%')) }}
|
||||
</p>
|
||||
<p>
|
||||
{{ Form::button('Create Bill', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,15 +9,43 @@
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
|
||||
<style type="text/css">
|
||||
.test
|
||||
{
|
||||
height: 30%;
|
||||
}
|
||||
.test2 {
|
||||
height:50%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body style="background-color:#eee">
|
||||
<div class="jumbotron text-center">
|
||||
<h1>What's good {{$username}}? it's your home page</h1>
|
||||
<br>
|
||||
<a href=""><button style="height:30%;width:70%"><h1>Create Bill</h1></button><br></a>
|
||||
<a href=""><button style="height:30%;width:70%"><h1>Manage Bills</h1></button><br></a>
|
||||
<a href=""><button style="height:30%;width:70%"><h1>View Bills</h1></button><br></a>
|
||||
|
||||
{!! Form::open(array('action' => 'BillController@create')) !!}
|
||||
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
{{ Form::button('create', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
|
||||
{!! Form::open(array('action' => 'BillController@manage')) !!}
|
||||
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
{{ Form::button('mange', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
{!! Form::open(array('action' => 'BillController@view')) !!}
|
||||
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
{{ Form::button('view', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
|
||||
<html>
|
||||
<head>
|
||||
<title>HomeIsWhereTheMoneyIs</title>
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
|
||||
<!-- Optional theme -->
|
||||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
|
||||
|
||||
<!-- Latest compiled and minified JavaScript -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
|
||||
|
||||
</head>
|
||||
<body style="background-color:#eee">
|
||||
<div class="jumbotron text-center">
|
||||
<h1>Alright {{ $username }}, here is where you can view bills that you need to pay...</h1>
|
||||
{!! Form::open(array('action' => 'HomeController@home')) !!}
|
||||
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
{{ Form::button('user Home', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
|
||||
{!! Form::open(array('action' => 'BillController@createbill')) !!}
|
||||
{{ Form::hidden('username', $username) }}
|
||||
<p>
|
||||
</p>
|
||||
<ul>
|
||||
@foreach ($billrecord as $bill)
|
||||
<li>{{{ $bill->billname }}}<li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<p>
|
||||
{{ Form::text('billname', '', array('style' => 'height:40%;width:70%')) }}
|
||||
</p>
|
||||
<p>
|
||||
{{ Form::button('Create Bill', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }}
|
||||
</p>
|
||||
{!! Form::close() !!}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+5
-10
@@ -15,6 +15,11 @@ Route::get('login', 'HomeController@login');
|
||||
Route::get('register', 'HomeController@register');
|
||||
Route::post('register/post', 'HomeController@registerUser');
|
||||
Route::post('login/post', 'HomeController@loginUser');
|
||||
Route::post('userhome/maxipad', 'HomeController@home');
|
||||
Route::post('userhome/maxipad/create', 'BillController@create');
|
||||
Route::post('userhome/maxipad/create/done', 'BillController@createbill');
|
||||
Route::post('userhome/maxiad/manage', 'BillController@manage');
|
||||
Route::post('userhome/maxipad/view', 'BillController@view');
|
||||
Route::get('laravel', function () {
|
||||
return view('welcome');
|
||||
});
|
||||
@@ -22,15 +27,5 @@ Route::get('hotboy', function () {
|
||||
return 'I\'m iced up, ugly corner where we\'re from we don\'t really like ya';
|
||||
});
|
||||
Route::get('stunt', function () {
|
||||
/**
|
||||
$user = new User;
|
||||
|
||||
user->firstname = "John";
|
||||
user->lastname = "Doe";
|
||||
user->username = "Bigboy69420";
|
||||
user->password = "Swish";
|
||||
|
||||
user->save();
|
||||
*/
|
||||
return "Check the database, I think someone was created";
|
||||
});
|
||||
|
||||
+3
-2
@@ -12,10 +12,9 @@ return array(
|
||||
'App\\Http\\Controllers\\Auth\\LoginController' => $baseDir . '/app/Http/Controllers/Auth/LoginController.php',
|
||||
'App\\Http\\Controllers\\Auth\\RegisterController' => $baseDir . '/app/Http/Controllers/Auth/RegisterController.php',
|
||||
'App\\Http\\Controllers\\Auth\\ResetPasswordController' => $baseDir . '/app/Http/Controllers/Auth/ResetPasswordController.php',
|
||||
'App\\Http\\Controllers\\BillController' => $baseDir . '/app/Http/Controllers/BillController.php',
|
||||
'App\\Http\\Controllers\\Controller' => $baseDir . '/app/Http/Controllers/Controller.php',
|
||||
'App\\Http\\Controllers\\HomeController' => $baseDir . '/app/Http/Controllers/HomeController.php',
|
||||
'App\\Http\\Controllers\\Register' => $baseDir . '/app/Http/Controllers/Register.php',
|
||||
'App\\Http\\Controllers\\RegisterController' => $baseDir . '/app/Http/Controllers/RegisterController.php',
|
||||
'App\\Http\\Controllers\\UserController' => $baseDir . '/app/Http/Controllers/UserController.php',
|
||||
'App\\Http\\Kernel' => $baseDir . '/app/Http/Kernel.php',
|
||||
'App\\Http\\Middleware\\EncryptCookies' => $baseDir . '/app/Http/Middleware/EncryptCookies.php',
|
||||
@@ -38,6 +37,8 @@ return array(
|
||||
'Collective\\Html\\HtmlBuilder' => $vendorDir . '/laravelcollective/html/src/HtmlBuilder.php',
|
||||
'Collective\\Html\\HtmlFacade' => $vendorDir . '/laravelcollective/html/src/HtmlFacade.php',
|
||||
'Collective\\Html\\HtmlServiceProvider' => $vendorDir . '/laravelcollective/html/src/HtmlServiceProvider.php',
|
||||
'CreateBillsTable' => $baseDir . '/database/migrations/2017_05_25_192210_create_bills_table.php',
|
||||
'CreateGroupBillsTable' => $baseDir . '/database/migrations/2017_05_25_192127_create_group_bills_table.php',
|
||||
'CreatePasswordResetsTable' => $baseDir . '/database/migrations/2014_10_12_100000_create_password_resets_table.php',
|
||||
'CreateUsersTable' => $baseDir . '/database/migrations/2014_10_12_000000_create_users_table.php',
|
||||
'Cron\\AbstractField' => $vendorDir . '/mtdowling/cron-expression/src/Cron/AbstractField.php',
|
||||
|
||||
Vendored
+3
-2
@@ -284,10 +284,9 @@ class ComposerStaticInit896b157f9f67590e9a4ed44e524415bf
|
||||
'App\\Http\\Controllers\\Auth\\LoginController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/LoginController.php',
|
||||
'App\\Http\\Controllers\\Auth\\RegisterController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/RegisterController.php',
|
||||
'App\\Http\\Controllers\\Auth\\ResetPasswordController' => __DIR__ . '/../..' . '/app/Http/Controllers/Auth/ResetPasswordController.php',
|
||||
'App\\Http\\Controllers\\BillController' => __DIR__ . '/../..' . '/app/Http/Controllers/BillController.php',
|
||||
'App\\Http\\Controllers\\Controller' => __DIR__ . '/../..' . '/app/Http/Controllers/Controller.php',
|
||||
'App\\Http\\Controllers\\HomeController' => __DIR__ . '/../..' . '/app/Http/Controllers/HomeController.php',
|
||||
'App\\Http\\Controllers\\Register' => __DIR__ . '/../..' . '/app/Http/Controllers/Register.php',
|
||||
'App\\Http\\Controllers\\RegisterController' => __DIR__ . '/../..' . '/app/Http/Controllers/RegisterController.php',
|
||||
'App\\Http\\Controllers\\UserController' => __DIR__ . '/../..' . '/app/Http/Controllers/UserController.php',
|
||||
'App\\Http\\Kernel' => __DIR__ . '/../..' . '/app/Http/Kernel.php',
|
||||
'App\\Http\\Middleware\\EncryptCookies' => __DIR__ . '/../..' . '/app/Http/Middleware/EncryptCookies.php',
|
||||
@@ -310,6 +309,8 @@ class ComposerStaticInit896b157f9f67590e9a4ed44e524415bf
|
||||
'Collective\\Html\\HtmlBuilder' => __DIR__ . '/..' . '/laravelcollective/html/src/HtmlBuilder.php',
|
||||
'Collective\\Html\\HtmlFacade' => __DIR__ . '/..' . '/laravelcollective/html/src/HtmlFacade.php',
|
||||
'Collective\\Html\\HtmlServiceProvider' => __DIR__ . '/..' . '/laravelcollective/html/src/HtmlServiceProvider.php',
|
||||
'CreateBillsTable' => __DIR__ . '/../..' . '/database/migrations/2017_05_25_192210_create_bills_table.php',
|
||||
'CreateGroupBillsTable' => __DIR__ . '/../..' . '/database/migrations/2017_05_25_192127_create_group_bills_table.php',
|
||||
'CreatePasswordResetsTable' => __DIR__ . '/../..' . '/database/migrations/2014_10_12_100000_create_password_resets_table.php',
|
||||
'CreateUsersTable' => __DIR__ . '/../..' . '/database/migrations/2014_10_12_000000_create_users_table.php',
|
||||
'Cron\\AbstractField' => __DIR__ . '/..' . '/mtdowling/cron-expression/src/Cron/AbstractField.php',
|
||||
|
||||
Reference in New Issue
Block a user