Skip to content

Commit

Permalink
points transaction module completed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-G-D committed May 24, 2021
1 parent 67db636 commit 7b31699
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 deletions.
25 changes: 14 additions & 11 deletions app/Http/Controllers/Dashboard/Admin/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,21 @@ public function admin_user_update(Request $request, $id)
$user->save();

//POINTS TABLE
$points = new Points;
$points->user_id = $user->id;
$points->author = Auth::user()->name;
$points->points = $user->points;
$points->assigned_points = $request->points;
if($request->input('description')){
$points->comment = $request->input('description');
if($request->points != 0){
$points = new Points;
$points->user_id = $user->id;
$points->author = Auth::user()->name;
$points->points = $user->points;
$points->assigned_points = $request->points;
if($request->input('description') && $request->input('description') != "<p>Please Enter your reason for the points assigned to User</p>"){
$points->comment = $request->input('description');
}
else{
$points->comment = 'Contact your Senior';
}
$points->save();
}
else{
$points->comment = 'Contact your Senior';
}
$points->save();




Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Dashboard/Volunteers.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function test() {
}

public function points(){
$user = Points::where('user_id', Auth::user()->id)->get();
$user = Points::orderBy('created_at', 'DESC')->where('user_id', Auth::user()->id)->get();
return view('dashboard.home.points.index')->with('users', $user);
}
}
2 changes: 1 addition & 1 deletion resources/views/dashboard/admin/users/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ function toggleVisibilityforGeolocation() {
<div class="form-group hidden" id="desc">
<div class="row">
<div class="col-md-5">
<textarea name="description" id="description">Please Enter your reason for the points assigned to {{ $user->name }} </textarea>
<textarea name="description" id="description">Please Enter your reason for the points assigned to User</textarea>
</div>
</div>
</div>
Expand Down

0 comments on commit 7b31699

Please sign in to comment.