|
|
|
@ -215,6 +215,20 @@ class ProjectController extends Controller
|
|
|
|
|
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getManpower($proyek_id){ |
|
|
|
|
$manPower = UserToProyek::where('proyek_id', $proyek_id)->get(); |
|
|
|
|
$manCount = $manPower->count(); |
|
|
|
|
return response()->json(['data'=>$manPower, 'totalRecord'=>$manCount]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getAssignedHR($gantt_id){ |
|
|
|
|
$results = UserToActivity::select('assign_hr_to_activity.proyek_id', 'assign_hr_to_activity.user_id', 'm_activity.id', 'm_activity.name', 'm_activity.start_date', 'm_activity.end_date') |
|
|
|
|
->join('m_activity', 'm_activity.id', '=', 'assign_hr_to_activity.activity_id') |
|
|
|
|
->where('assign_hr_to_activity.version_gantt_id', $gantt_id) |
|
|
|
|
->get(); |
|
|
|
|
return response()->json(['data'=>$results]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function list() |
|
|
|
|
{ |
|
|
|
|
$data = Project::orderBy('id', 'desc')->get(); |
|
|
|
@ -389,7 +403,7 @@ class ProjectController extends Controller
|
|
|
|
|
|
|
|
|
|
if(!$result) |
|
|
|
|
return response()->json(['status'=>'failed','message'=> 'Project not found!','code'=> 404], 404); |
|
|
|
|
|
|
|
|
|
//TODO possible overdue bug |
|
|
|
|
if(isset($payload['till_date'])) |
|
|
|
|
$overdueActivities = Activity::where('proyek_id', $payload['id'])->whereNotNull('parent_id')->where('persentase_progress', '!=', 100)->whereDate('end_date','<=',$payload['till_date'])->orderBy('end_date', 'asc')->get(); |
|
|
|
|
else |
|
|
|
|