diff --git a/app/controllers/UserController.php b/app/controllers/UserController.php index 6d6bf29..3230253 100644 --- a/app/controllers/UserController.php +++ b/app/controllers/UserController.php @@ -3,6 +3,15 @@ class UserController extends \BaseController { + + + public function index() + { + $users = User::all(); + + return View::make('users.index')->with('users', $users); + } + public function create() { return View::make('users.create'); @@ -63,8 +72,91 @@ class UserController extends \BaseController $user = User::find($user_id); - return View::make('users.profile')->with('user', $user)->with('group_id', $group_id); + return View::make('users.complete')->with('user', $user)->with('group_id', $group_id); + + } + + public function saveProfile() + { + $group_id = \Input::get('group_id'); + + $user_id = \Input::get('user_id'); + + $user = \User::find($user_id); + + $skills = array(); + + if (Input::get('java') === 'Java'){} + array_push($skills, 'Java'); + + if (Input::get('php') === 'PHP') {} + array_push($skills, 'PHP'); + + if (Input::get('python') === 'Python') {} + array_push($skills, 'Python'); + + if (Input::get('cplus') === 'Cplus') {} + array_push($skills, 'C++'); + + if (Input::get('objc') === 'Objc') {} + array_push($skills, 'Objective C'); + + if (Input::get('htmljscss') === 'Html') {} + array_push($skills, 'HTML JS CSS'); + + if (Input::get('android') === 'Android') {} + array_push($skills, 'Android'); + + if (Input::get('ux') === 'UXDesign') {} + array_push($skills, 'Java'); + + if (Input::get('webapps') === 'Webapps') {} + array_push($skills, 'Web Apps'); + + if (Input::get('ruby') === 'Ruby') {} + array_push($skills, 'Ruby on Rails'); + + if (Input::get('people') === 'People') {} + array_push($skills, 'People Skills'); + + $skills = serialize($skills); + + $user->first = \Input::get('first'); + $user->last = \Input::get('last'); + $user->email = \Input::get('email'); + $user->location = \Input::get('location'); + $user->bio = \Input::get('bio'); + $user->skills = $skills; + + if (\Input::hasFile('photo')) { + $photo = \Input::file('photo'); + $filename = uniqid('profile_').'.'.$photo->getClientOriginalExtension(); + $photo->move(public_path('images/users'), $filename); + $user->photo = 'images/users/'.$filename; + } + + $role = UserXrefRole::create(array( + 'user_id' => $user_id, + 'role_id' => $group_id + )); + + $role->save(); + + if ($user->save()) + { + return Redirect::route('users', array('user_id' => $user_id)); + }else + { + \Redirect::back('complete', array($user_id, $group_id )); + } + + } + + public function showProfile($id) + { + $user = User::find($id); + return View::make('users.profile')->with('user', $user); } } \ No newline at end of file diff --git a/app/database/migrations/2014_06_28_024032_alter_user_table_add_columns.php b/app/database/migrations/2014_06_28_024032_alter_user_table_add_columns.php new file mode 100644 index 0000000..3a6dd68 --- /dev/null +++ b/app/database/migrations/2014_06_28_024032_alter_user_table_add_columns.php @@ -0,0 +1,39 @@ +text('bio')->nullable()->after('email'); + $table->string('location', 32)->nullable()->after('bio'); + $table->string('photo', 100)->after('bio')->nullable(); + $table->text('skills')->after('photo')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function(Blueprint $table) + { + $table->dropColumn('bio'); + $table->dropColumn('location'); + $table->dropColumn('photo'); + }); + } + +} diff --git a/app/models/User.php b/app/models/User.php index fb546d5..be2e51c 100755 --- a/app/models/User.php +++ b/app/models/User.php @@ -12,7 +12,8 @@ class User extends Eloquent implements UserInterface, RemindableInterface { * @var string */ protected $table = 'users'; - protected $fillable = array('first', 'last', 'email', 'password'); + protected $fillable = array( + 'first', 'last', 'email', 'password', 'location', 'skills', 'photo', 'bio'); /** * The attributes excluded from the model's JSON form. diff --git a/app/routes.php b/app/routes.php index 215042e..233ed17 100755 --- a/app/routes.php +++ b/app/routes.php @@ -26,6 +26,9 @@ Route::get('users/create', array('as' => 'create', 'uses' => 'UserController@cre Route::post('users/store', array('uses' => 'UserController@store')); Route::get('users/group/{user_id}', array('as' => 'group', 'uses' => 'UserController@chooseGroup')); Route::get('users/group/{user_id}/{group_id}', array('as' => 'complete', 'uses' => 'UserController@completeRegistration')); +Route::post('users/group/complete', array('uses' => 'UserController@saveProfile')); +Route::get('users/{id}', array('as' => 'users', 'uses' => 'UserController@showProfile')); +Route::get('users', array('as' => 'users', 'uses' => 'UserController@index')); /** * User Password Reminder Controller routes diff --git a/app/storage/images/users/logo_53ae5f6817ca8.JPG b/app/storage/images/users/logo_53ae5f6817ca8.JPG new file mode 100644 index 0000000..0406650 Binary files /dev/null and b/app/storage/images/users/logo_53ae5f6817ca8.JPG differ diff --git a/app/storage/uploads/users/logo_53ae5867e86ab.png b/app/storage/uploads/users/logo_53ae5867e86ab.png new file mode 100755 index 0000000..d0e8914 Binary files /dev/null and b/app/storage/uploads/users/logo_53ae5867e86ab.png differ diff --git a/app/storage/uploads/users/logo_53ae59b0039f4.png b/app/storage/uploads/users/logo_53ae59b0039f4.png new file mode 100755 index 0000000..d0e8914 Binary files /dev/null and b/app/storage/uploads/users/logo_53ae59b0039f4.png differ diff --git a/app/storage/uploads/users/logo_53ae5a333aac5.JPG b/app/storage/uploads/users/logo_53ae5a333aac5.JPG new file mode 100755 index 0000000..ae3569e Binary files /dev/null and b/app/storage/uploads/users/logo_53ae5a333aac5.JPG differ diff --git a/app/views/users/choice.blade.php b/app/views/users/choice.blade.php new file mode 100644 index 0000000..63ab3b7 --- /dev/null +++ b/app/views/users/choice.blade.php @@ -0,0 +1,116 @@ + + + + + Mentconnect Inc - Profile + + {{HTML::style('css/mentconnect.css')}} + + +
+ +
+ +
+ {{ Form::open(array('url' => 'users/store', 'class' => 'form-horizontal')) }} + +
+
+

Complete Your Registration

+
+ +
+ +
+ +
+ + {{Form::text('firstname', \Input::old('firstname'), array('class' => 'form-control form-control-bordered', 'tabindex' => '1'))}} {{$errors->first('firstname')}} +
+
+ + + {{ Form::text('lastname', \Input::old('lastname'), array('class' => 'form-control form-control-bordered', 'tabindex' => '2')) }} {{$errors->first('lastname')}} +
+
+ + + {{ Form::email('email', \Input::old('email'), array('class' => 'form-control form-control-bordered', + 'tabindex' => '3')) }} {{$errors->first('email') }} +
+ +
+ + + {{ Form::text('title', \Input::old('title'), array('class' => 'form-control form-control-bordered', + 'tabindex' => '4')) }} {{$errors->first('email') }} +
+ +
+ + + {{ Form::text('location', \Input::old('location'), array('class' => 'form-control form-control-bordered', + 'tabindex' => '5')) }} {{$errors->first('location') }} +
+ +
+
+ {{Form::submit('Complete!', array('class' => 'btn btn-success btn-large submit-button'))}} +

+
+
+
+ +
+ +
+
+
+ {{ Form::close() }} +
+ +
+
+ + + + \ No newline at end of file diff --git a/app/views/users/complete.blade.php b/app/views/users/complete.blade.php index 63ab3b7..6342a62 100644 --- a/app/views/users/complete.blade.php +++ b/app/views/users/complete.blade.php @@ -2,7 +2,7 @@ - Mentconnect Inc - Profile + Mentconnect Inc {{HTML::style('css/mentconnect.css')}} @@ -31,65 +31,108 @@
- {{ Form::open(array('url' => 'users/store', 'class' => 'form-horizontal')) }} - + + {{ Form::open(array('url' => 'users/group/complete', 'files' => true, 'class' => 'form-horizontal')) }}

Complete Your Registration

- -
- -
- - {{Form::text('firstname', \Input::old('firstname'), array('class' => 'form-control form-control-bordered', 'tabindex' => '1'))}} {{$errors->first('firstname')}} +
+
+ + {{Form::text('first', $user->first, array('class' => 'form-control form-control-bordered', 'tabindex' => '1'))}} {{$errors->first('first')}}
- - {{ Form::text('lastname', \Input::old('lastname'), array('class' => 'form-control form-control-bordered', 'tabindex' => '2')) }} {{$errors->first('lastname')}} + + {{ Form::text('email', $user->email, array('class' => 'form-control form-control-bordered', 'tabindex' => '2')) }} {{$errors->first('email')}}
- - {{ Form::email('email', \Input::old('email'), array('class' => 'form-control form-control-bordered', - 'tabindex' => '3')) }} {{$errors->first('email') }} + + {{ Form::text('location', $user->location, array('class' => 'form-control form-control-bordered', + 'tabindex' => '3')) }} {{$errors->first('location') }}
+ {{Form::hidden('user_id', $user->id) }} + {{Form::hidden('group_id', $group_id) }} + +
+ + + + + + + + + + + +
+
- - - {{ Form::text('title', \Input::old('title'), array('class' => 'form-control form-control-bordered', - 'tabindex' => '4')) }} {{$errors->first('email') }} + + + {{ Form::file('photo', array('class' => 'form-control', + 'tabindex' => '3')) }} {{$errors->first('photo') }} +

Allowed Size = 200 x 200

+
+
+ +
+ + {{Form::text('last', $user->last, array('class' => 'form-control form-control-bordered', 'tabindex' => '1'))}} {{$errors->first('last')}} +
- - {{ Form::text('location', \Input::old('location'), array('class' => 'form-control form-control-bordered', - 'tabindex' => '5')) }} {{$errors->first('location') }} + + {{ Form::textarea('bio', $user->bio, array('class' => 'form-control form-control-bordered', 'tabindex' => '2')) }} {{$errors->first('bio')}}
+ -
-
- {{Form::submit('Complete!', array('class' => 'btn btn-success btn-large submit-button'))}} -

-
-
-
- -
-
+
+
+
+
+ {{Form::submit('Complete Profile!', array('class' => 'btn btn-success btn-large submit-button'))}} +

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

+ +
+
+ +
+
+ @if(!empty($user->photo)) + {{HTML::image('/'.$user->photo, 'profile', array('class' => 'pic img-circle'))}} + @endif +
Hello, {{$user->first }}
+ Change cover +
+ +


+ + +
+ + + +
+ + + +
This is the message body1
+
+ +
+ + + + +
+
+ + ... + +
+

Animation Workshop

+ 2Days animation workshop to be conducted +
+
+
+ + + +
-
-
- - -
- -
+ +
+
+
- \ No newline at end of file + diff --git a/public/css/userprofile.css b/public/css/userprofile.css new file mode 100644 index 0000000..30308e3 --- /dev/null +++ b/public/css/userprofile.css @@ -0,0 +1,50 @@ +.navbar{ + width: 100%; +} + +.container{ + width:100%; +} + +.pic +{ + margin-top:50px; + width:120px; + margin-left:50px; + margin-bottom:-60px; +} + +.panel +{ + background-image:url("http://autoimagesize.com/wp-content/uploads/2014/01/rainbow-aurora-background-wallpaper-colour-images-rainbow-background.jpg"); +} + +.name +{ + position:absolute; + padding-left:200px; + font-size:30px; +} + +.dropdown +{ + position:absolute; +} + +.change +{ + position:relative; + bottom:20px; + padding:1px; + color:white; + text-decoration:none; +} + + +.change:hover +{ + text-decoration:none; + background-color:black; + color:white; +} + diff --git a/public/images/users/profile_53ae64fd10461.JPG b/public/images/users/profile_53ae64fd10461.JPG new file mode 100644 index 0000000..52af230 Binary files /dev/null and b/public/images/users/profile_53ae64fd10461.JPG differ diff --git a/public/images/users/profile_53ae673198e13.png b/public/images/users/profile_53ae673198e13.png new file mode 100644 index 0000000..8a586a8 Binary files /dev/null and b/public/images/users/profile_53ae673198e13.png differ diff --git a/public/js/userprofile.js b/public/js/userprofile.js new file mode 100644 index 0000000..c648226 --- /dev/null +++ b/public/js/userprofile.js @@ -0,0 +1,3 @@ + $(function () { + $('#myTab a:last').tab('show'); + }); \ No newline at end of file diff --git a/vendor/autoload.php b/vendor/autoload.php index ce01ac6..5a47322 100755 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -4,4 +4,4 @@ require_once __DIR__ . '/composer' . '/autoload_real.php'; -return ComposerAutoloaderInit58ede9d7d52a7453cb838add7f15cf28::getLoader(); +return ComposerAutoloaderInit26a4f56b6ff7cf8a0ccdad2c8bd1b12a::getLoader(); diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 61f049b..d024ebe 100755 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__)); $baseDir = dirname($vendorDir); return array( + 'AlterUserTableAddColumns' => $baseDir . '/app/database/migrations/2014_06_28_024032_alter_user_table_add_columns.php', 'BaseController' => $baseDir . '/app/controllers/BaseController.php', 'Boris\\Boris' => $vendorDir . '/d11wtq/boris/lib/Boris/Boris.php', 'Boris\\CLIOptionsHandler' => $vendorDir . '/d11wtq/boris/lib/Boris/CLIOptionsHandler.php', diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 5e86d60..2ad283f 100755 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit58ede9d7d52a7453cb838add7f15cf28 +class ComposerAutoloaderInit26a4f56b6ff7cf8a0ccdad2c8bd1b12a { private static $loader; @@ -19,9 +19,9 @@ class ComposerAutoloaderInit58ede9d7d52a7453cb838add7f15cf28 return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit58ede9d7d52a7453cb838add7f15cf28', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit26a4f56b6ff7cf8a0ccdad2c8bd1b12a', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit58ede9d7d52a7453cb838add7f15cf28', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit26a4f56b6ff7cf8a0ccdad2c8bd1b12a', 'loadClassLoader')); $vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); @@ -49,14 +49,14 @@ class ComposerAutoloaderInit58ede9d7d52a7453cb838add7f15cf28 $includeFiles = require __DIR__ . '/autoload_files.php'; foreach ($includeFiles as $file) { - composerRequire58ede9d7d52a7453cb838add7f15cf28($file); + composerRequire26a4f56b6ff7cf8a0ccdad2c8bd1b12a($file); } return $loader; } } -function composerRequire58ede9d7d52a7453cb838add7f15cf28($file) +function composerRequire26a4f56b6ff7cf8a0ccdad2c8bd1b12a($file) { require $file; }