Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions app/Http/Controllers/Client/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -34,9 +33,8 @@ public function getData() // get data form user table
$data = Datatables::of($clients)
->escapeColumns()
->addColumn('action', function ($clients) {
return '<a href="' . route("client.profile", $clients->id) . '" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-open-eye"></i> View </a>
return '<a href="' . route("client.profile", $clients->id) . '" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-eye-open"></i> View </a>
<a href="' . route("clients.edit", $clients->id) . '" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i> Edit</a>

<button class="delete-modal btn btn-xs btn-danger" data-id="'.$clients->id.'" data-title="'.$clients->name.'" data-content="'.$clients->email.'">
<span class="glyphicon glyphicon-trash"></span> Delete</button>';})
->addColumn('status',function($clients){
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Employee/Employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ public function profile($id){
'dev_pro' => $dev_pro,
]);
}

}
13 changes: 10 additions & 3 deletions app/Http/Controllers/Milestones/Milestones.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function getData() // get data form user table
$data = Datatables::of($milestones)
->escapeColumns()
->addColumn('action', function ($milestones) {
return '<a href="' . route("milestones.edit", $milestones->id) . '" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i> Edit</a>
<button class="delete-modal btn btn-xs btn-danger" data-id="'.$milestones->id.'" data-title="'.$milestones->pro_name.'" data-content="">
<span class="glyphicon glyphicon-trash"></span> Delete</button>';})
return '<a href="' . route("milestones.edit", $milestones->id) . '" class="btn btn-xs btn-primary"><i class="glyphicon glyphicon-edit"></i></a>
<button class="delete-modal btn btn-xs btn-danger" data-id="'.$milestones->id.'" data-title="'.$milestones->title.'" data-content="">
<span class="glyphicon glyphicon-trash"></span></button>';})
->addColumn('mile_status',function($milestones){
if($milestones->mile_status == 1){
return '<span class="mile_status btn btn-xs btn-light-azure" data-id="'.$milestones->id.'" data-title="'.$milestones->pro_name.'" data-status="'.$milestones->mile_status.'">Active</span>';
Expand Down Expand Up @@ -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);
}
}
22 changes: 22 additions & 0 deletions app/Http/Controllers/Users/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}

}
}

2 changes: 1 addition & 1 deletion app/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 7 additions & 3 deletions resources/views/client/profile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Overview
</a>
</li>
<li>
<li class="hide">
<a href="{{ route("clients.edit", $user->id ) }}">
Edit Account
</a>
Expand Down Expand Up @@ -154,13 +154,13 @@
<div class="col-sm-3">
<button class="btn btn-icon margin-bottom-5 margin-bottom-5 btn-block">
<i class="ti-layers-alt block text-primary text-extra-large margin-bottom-10"></i>
Projects <span class="badge badge-success"> 23 </span>
Projects <span class="badge badge-success" id="p_t" > </span>
</button>
</div>
<div class="col-sm-3">
<button class="btn btn-icon margin-bottom-5 btn-block">
<i class="ti-comments block text-primary text-extra-large margin-bottom-10"></i>
Tasks <span class="badge badge-success"> 23 </span>
Tasks <span class="badge badge-success" > 23 </span>
</button>
</div>
<div class="col-sm-3 hide">
Expand Down Expand Up @@ -344,5 +344,9 @@
]
});
});
$(document).ready(function(){
var tp = $('#projects > tr').size();
$('#p_t').text(tp);
});
</script>
@stop
49 changes: 28 additions & 21 deletions resources/views/employee/profile.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Overview
</a>
</li>
<li>
<li class="hide">
<a href="{{ route("employee.edit", $user->id ) }}">
Edit Account
</a>
Expand Down Expand Up @@ -42,6 +42,7 @@
</div>
</div>
</div>

<hr>
<div class="social-icons block">
<ul>
Expand Down Expand Up @@ -169,7 +170,7 @@
<div class="col-sm-3">
<button class="btn btn-icon margin-bottom-5 margin-bottom-5 btn-block">
<i class="ti-layers-alt block text-primary text-extra-large margin-bottom-10"></i>
Projects <span class="badge badge-success"> 23 </span>
Projects <span class="badge badge-success" id="p_t"> </span>
</button>
</div>
<div class="col-sm-3">
Expand Down Expand Up @@ -357,26 +358,32 @@
{ data: 'project_status', name: 'project_status' },
{ data: 'payment_status', name: 'payment_status' },
]

});
//var rowCount = $('#projects').length;
// var rowCount = $('table#projects tr').length;
// console.log(rowCount);
});
$(document).ready(function(){
var tp = $('#projects > tr').size();
$('#p_t').text(tp);
});

// function CountRows() {
// var totalRowCount = 0;
// var rowCount = 0;
// var table = document.getElementById("#projects");
// var rows = table.getElementsByTagName("tr")
// for (var i = 0; i < rows.length; i++) {
// totalRowCount++;
// if (rows[i].getElementsByTagName("td").length > 0) {
// rowCount++;
// }
// }
// var message = "Total Row Count: " + totalRowCount;
// message += "\nRow Count: " + rowCount;
// alert(message);
// }
});
$(document).on('click','#update',function(){


var id ='{!! $u_id !!}';
var names = $('#logo')[0].files[0];
$.ajax({
url: '{!! route('users.update_user_image') !!}',
data: {
'ids':id,
'names':names,
'_token': $('input[name=_token]').val()},
contentType: false,
processData: false,
type: 'POST',
success:function(response) {
alert(response);
}
});
})
</script>
@stop
8 changes: 4 additions & 4 deletions resources/views/milestone/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@parent
<div class="row">
<div class="col-md-8">
<h2>Projects Listings</h2>
<h2>Milestones Listings</h2>
</div>
<div class="col-md-4">
<a href="{{ url('milestones/add') }}" >
Expand Down Expand Up @@ -205,7 +205,7 @@
});
$(document).on('click', '.delete-modal', function() {
$('.modal-title').text('Delete');
$('.heading_text').text('Are you sure you want to Delete the following Project?');
$('.heading_text').text('Are you sure you want to Delete the following Milestone?');
$('.custom-button').text('Delete');
$('.custom-button').addClass('delete');
$('#id_delete').val($(this).data('id'));
Expand All @@ -218,13 +218,13 @@
$('.modal-footer').on('click', '.delete', function() {
$.ajax({
type: 'DELETE',
url: 'projects_delete/'+id,
url: 'milestones_delete/'+id,
data: {
'_token': $('input[name=_token]').val(),
},
success: function(data) {
if(data === true )
toastr.success('Successfully deleted Project!', 'Success Alert', {timeOut: 3000});
toastr.success('Successfully deleted Milestone!', 'Success Alert', {timeOut: 3000});
$('.custom-button').removeClass('delete');
oTable.draw();
}
Expand Down
6 changes: 4 additions & 2 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
Route::delete('/users_delete/{id}', ['as'=>'users_delete','uses'=>'Users\Users@destroy']);
// Change user Status
Route::post('/change_user_status/', ['as'=>'change_user_status','uses'=>'Users\Users@change_status']);
// update profile image
Route::post('/update_user_image', ['as'=>'users.update_user_image','uses'=>'Users\Users@update_user_image']);

// **************** Users *****************************

Expand Down Expand Up @@ -167,8 +169,8 @@
Route::get('/milestones', 'Milestones\Milestones@index');
Route::get('/get-data-milestones', ['as'=>'get.milestones_data','uses'=>'Milestones\Milestones@getData']);
//get data for single employee and client
Route::get('/get-data-getData_me/{id}', ['as'=>'get.milestones_data_me','uses'=>'Milestones\Milestones@getData_me']);
Route::get('/get-data-getData_for_cl/{id}', ['as'=>'get.getData_for_cl','uses'=>'Milestones\Milestones@getData_for_cl']);
//Route::get('/get-data-getData_me/{id}', ['as'=>'get.milestones_data_me','uses'=>'Milestones\Milestones@getData_me']);
//Route::get('/get-data-getData_for_cl/{id}', ['as'=>'get.getData_for_cl','uses'=>'Milestones\Milestones@getData_for_cl']);
// delete
Route::delete('/milestones_delete/{id}', ['as'=>'milestones_delete','uses'=>'Milestones\Milestones@destroy']);
// Change Status
Expand Down