diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php new file mode 100644 index 0000000..a5a68c8 --- /dev/null +++ b/app/Http/Controllers/BillController.php @@ -0,0 +1,50 @@ + $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 "
"; + $bills[] = $bill->billname; + } + foreach ($bills as $w) { + echo $w; + echo "
"; + } + return view('view', ['username' => $stuff->input('username')])->with('billrecord', $billrecord); + //return view('view', ['username' => $stuff->input('username')])->with('bills', $bills); + } +} diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index fff470f..59ef081 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -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')]); + } } diff --git a/resources/views/createbill.blade.php b/resources/views/createbill.blade.php new file mode 100644 index 0000000..032f4ab --- /dev/null +++ b/resources/views/createbill.blade.php @@ -0,0 +1,38 @@ + + + + HomeIsWhereTheMoneyIs + + + + + + + + + + +
+

Alright {{ $username }}, here is where you can create bills

+ {!! Form::open(array('action' => 'HomeController@home')) !!} + + {{ Form::hidden('username', $username) }} +

+ {{ Form::button('user Home', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!} + + {!! Form::open(array('action' => 'BillController@createbill')) !!} + {{ Form::hidden('username', $username) }} +

+ {{ Form::label('lbl', 'bill name', array('style' => 'font-size:400%')) }} + {{ Form::text('billname', '', array('style' => 'font-size:400%')) }} +

+

+ {{ Form::button('Create Bill', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!} +

{{$message}}

+
+ + diff --git a/resources/views/manage.blade.php b/resources/views/manage.blade.php new file mode 100644 index 0000000..71fe140 --- /dev/null +++ b/resources/views/manage.blade.php @@ -0,0 +1,37 @@ + + + + HomeIsWhereTheMoneyIs + + + + + + + + + + +
+

Alright {{ $username }}, here is where you can manage the bills you own bills

+ {!! Form::open(array('action' => 'HomeController@home')) !!} + + {{ Form::hidden('username', $username) }} +

+ {{ Form::button('user Home', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!} + + {!! Form::open(array('action' => 'BillController@createbill')) !!} + {{ Form::hidden('username', $username) }} +

+ {{ Form::label('lbl', 'bill name', array('style' => 'font-size:400%')) }} + {{ Form::text('billname', '', array('style' => 'font-size:400%')) }} +

+

+ {{ Form::button('Create Bill', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!} +
+ + diff --git a/resources/views/userhome.blade.php b/resources/views/userhome.blade.php index d86178d..8b2c706 100644 --- a/resources/views/userhome.blade.php +++ b/resources/views/userhome.blade.php @@ -9,15 +9,43 @@ - +

What's good {{$username}}? it's your home page


-
-
-
+ + {!! Form::open(array('action' => 'BillController@create')) !!} + + {{ Form::hidden('username', $username) }} +

+ {{ Form::button('create', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!} + + {!! Form::open(array('action' => 'BillController@manage')) !!} + + {{ Form::hidden('username', $username) }} +

+ {{ Form::button('mange', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!} + {!! Form::open(array('action' => 'BillController@view')) !!} + + {{ Form::hidden('username', $username) }} +

+ {{ Form::button('view', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!}
diff --git a/resources/views/view.blade.php b/resources/views/view.blade.php new file mode 100644 index 0000000..7aa2d42 --- /dev/null +++ b/resources/views/view.blade.php @@ -0,0 +1,43 @@ + + + + HomeIsWhereTheMoneyIs + + + + + + + + + + +
+

Alright {{ $username }}, here is where you can view bills that you need to pay...

+ {!! Form::open(array('action' => 'HomeController@home')) !!} + + {{ Form::hidden('username', $username) }} +

+ {{ Form::button('user Home', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!} + + {!! Form::open(array('action' => 'BillController@createbill')) !!} + {{ Form::hidden('username', $username) }} +

+

+ +

+ {{ Form::text('billname', '', array('style' => 'height:40%;width:70%')) }} +

+

+ {{ Form::button('Create Bill', array('style' => 'height:40%;width:70%', 'type' => 'submit')) }} +

+ {!! Form::close() !!} +
+ + diff --git a/routes/web.php b/routes/web.php index e66c81a..587fda4 100755 --- a/routes/web.php +++ b/routes/web.php @@ -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"; }); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index ebd8967..44734f2 100755 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -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', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 1341621..dcb9d3f 100755 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -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',