diff --git a/app/Http/Controllers/Client/Client.php b/app/Http/Controllers/Client/Client.php index 3b8e6fa..821dff4 100644 --- a/app/Http/Controllers/Client/Client.php +++ b/app/Http/Controllers/Client/Client.php @@ -20,8 +20,7 @@ public function __construct() { $this->middleware('auth'); } - - //Need to work on the client dashboard 123456 + //Need to work on the client dashboard 123456 public function index() { return view('client.view'); @@ -34,9 +33,8 @@ public function getData() // get data form user table $data = Datatables::of($clients) ->escapeColumns() ->addColumn('action', function ($clients) { - return 'id) . '" class="btn btn-xs btn-primary"> View + return 'id) . '" class="btn btn-xs btn-primary"> View id) . '" class="btn btn-xs btn-primary"> Edit - ';}) ->addColumn('status',function($clients){ diff --git a/app/Http/Controllers/Employee/Employee.php b/app/Http/Controllers/Employee/Employee.php index e99824b..d601548 100644 --- a/app/Http/Controllers/Employee/Employee.php +++ b/app/Http/Controllers/Employee/Employee.php @@ -150,4 +150,5 @@ public function profile($id){ 'dev_pro' => $dev_pro, ]); } + } diff --git a/app/Http/Controllers/Milestones/Milestones.php b/app/Http/Controllers/Milestones/Milestones.php index 55bf558..e9bc241 100644 --- a/app/Http/Controllers/Milestones/Milestones.php +++ b/app/Http/Controllers/Milestones/Milestones.php @@ -34,9 +34,9 @@ public function getData() // get data form user table $data = Datatables::of($milestones) ->escapeColumns() ->addColumn('action', function ($milestones) { - return 'id) . '" class="btn btn-xs btn-primary"> Edit - ';}) + return 'id) . '" class="btn btn-xs btn-primary"> + ';}) ->addColumn('mile_status',function($milestones){ if($milestones->mile_status == 1){ return 'Active'; @@ -155,4 +155,11 @@ public function milestones_pay_status(Request $request){ return response()->json($is_updated); } } + + public function destroy($id) + { + $Milestone = Milestone::findOrFail($id); + $data = $Milestone->delete(); + return response()->json($data); + } } diff --git a/app/Http/Controllers/Users/Users.php b/app/Http/Controllers/Users/Users.php index 4b27fcc..811e172 100644 --- a/app/Http/Controllers/Users/Users.php +++ b/app/Http/Controllers/Users/Users.php @@ -134,5 +134,27 @@ public function destroy($id) $data = $User->delete(); return response()->json($data); } + public function update_user_image( Request $request){ + + $id = $request->input('ids'); + + if($request->hasFile('names')) { + $file = $request->file('names'); + $name = 'logo'.'.'.$file->getClientOriginalExtension(); + $image['filePath'] = $name; + $file->move('assets/images/logo', $name); + }else{ + $name ="sdf "; + } + $name = $request->input('names'); + $data = User::find($id)->update(array('logo'=>$name)); + if($data){ + return response()->json(array("exists" =>true)); + } + else{ + return response()->json(array("exists"=>false)); + } + + } } diff --git a/app/User.php b/app/User.php index 6f8d6a6..f612729 100644 --- a/app/User.php +++ b/app/User.php @@ -16,7 +16,7 @@ class User extends Authenticatable * @var array */ protected $fillable = [ - 'email', 'name', 'first_name','last_name','city','country','zipcode','status','gender','password','active','user_type', + 'email', 'name', 'first_name','last_name','city','country','zipcode','status','gender','password','active','user_type','logo', ]; /** * The attributes that should be hidden for arrays. diff --git a/database/migrations/2017_12_12_103059_add_users_colums_to_users_table.php b/database/migrations/2017_12_12_103059_add_users_colums_to_users_table.php index b52de8b..56ebc6c 100644 --- a/database/migrations/2017_12_12_103059_add_users_colums_to_users_table.php +++ b/database/migrations/2017_12_12_103059_add_users_colums_to_users_table.php @@ -20,6 +20,7 @@ public function up() $table->string('country')->nullable(); $table->string('zipcode')->nullable(); $table->string('phone')->nullable(); + $table->string('logo')->nullable(); $table->longText('address')->nullable(); $table->string('user_type')->nullable(); $table->integer('status')->nullable(); diff --git a/resources/views/client/profile.blade.php b/resources/views/client/profile.blade.php index 346e5bd..ad94f58 100644 --- a/resources/views/client/profile.blade.php +++ b/resources/views/client/profile.blade.php @@ -9,7 +9,7 @@ Overview -
  • +
  • id ) }}"> Edit Account @@ -154,13 +154,13 @@
    @@ -344,5 +344,9 @@ ] }); }); + $(document).ready(function(){ + var tp = $('#projects > tr').size(); + $('#p_t').text(tp); + }); @stop \ No newline at end of file diff --git a/resources/views/employee/profile.blade.php b/resources/views/employee/profile.blade.php index 2d4937e..d082b7e 100644 --- a/resources/views/employee/profile.blade.php +++ b/resources/views/employee/profile.blade.php @@ -9,7 +9,7 @@ Overview
  • -
  • +
  • id ) }}"> Edit Account @@ -42,6 +42,7 @@ +