Browse Source

remove comments

pull/3/head
Muhammad Sulaiman Yusuf 2 years ago
parent
commit
defda4b658
  1. 2
      app/Console/Kernel.php
  2. 1
      app/Events/ExampleEvent.php
  3. 8
      app/Http/Controllers/AbsentController.php
  4. 124
      app/Http/Controllers/ActivityController.php
  5. 7
      app/Http/Controllers/ActivityDokumenController.php
  6. 49
      app/Http/Controllers/AssignMaterialController.php
  7. 21
      app/Http/Controllers/AssignToolsController.php
  8. 6
      app/Http/Controllers/AuthController.php
  9. 1
      app/Http/Controllers/BroadcastController.php
  10. 9
      app/Http/Controllers/ChecklistK3Controller.php
  11. 9
      app/Http/Controllers/CommentActivityController.php
  12. 7
      app/Http/Controllers/ConfigAlertController.php
  13. 7
      app/Http/Controllers/ConfigAlertUserController.php
  14. 10
      app/Http/Controllers/ControlMonitoringController.php
  15. 14
      app/Http/Controllers/Controller.php
  16. 154
      app/Http/Controllers/CurrencyController.php
  17. 53
      app/Http/Controllers/DashboardController.php
  18. 9
      app/Http/Controllers/DivisiController.php
  19. 2
      app/Http/Controllers/ExampleController.php
  20. 9
      app/Http/Controllers/FolderDocumentProyekController.php
  21. 8
      app/Http/Controllers/HolidayController.php
  22. 14
      app/Http/Controllers/HumanResourceController.php
  23. 7
      app/Http/Controllers/ImageController.php
  24. 10
      app/Http/Controllers/MaterialResourceController.php
  25. 8
      app/Http/Controllers/MenuController.php
  26. 8
      app/Http/Controllers/OfficeHoursController.php
  27. 8
      app/Http/Controllers/PanicButtonController.php
  28. 108
      app/Http/Controllers/PresenceController.php
  29. 8
      app/Http/Controllers/ProjectApprovalController.php
  30. 53
      app/Http/Controllers/ProjectCharterController.php
  31. 9
      app/Http/Controllers/ProjectController.php
  32. 9
      app/Http/Controllers/ProjectDokumenController.php
  33. 8
      app/Http/Controllers/ProjectMileStoneController.php
  34. 8
      app/Http/Controllers/ProjectParticipantsController.php
  35. 8
      app/Http/Controllers/ProjectRoleController.php
  36. 9
      app/Http/Controllers/ProjectToChecklistK3Controller.php
  37. 8
      app/Http/Controllers/ProjectTypeController.php
  38. 8
      app/Http/Controllers/RateSallaryController.php
  39. 9
      app/Http/Controllers/ReportActivityController.php
  40. 52
      app/Http/Controllers/ReportActivityMaterialController.php
  41. 10
      app/Http/Controllers/ReportK3Controller.php
  42. 8
      app/Http/Controllers/ReportK3DetailController.php
  43. 34
      app/Http/Controllers/RequestMaterialController.php
  44. 8
      app/Http/Controllers/RoleController.php
  45. 7
      app/Http/Controllers/RoleMenuController.php
  46. 8
      app/Http/Controllers/SatuanController.php
  47. 9
      app/Http/Controllers/ShiftController.php
  48. 1
      app/Http/Controllers/TBroadcastController.php
  49. 9
      app/Http/Controllers/TemplateGanttController.php
  50. 31
      app/Http/Controllers/ToolsRequestController.php
  51. 8
      app/Http/Controllers/ToolsResourceController.php
  52. 11
      app/Http/Controllers/UserMonthlyShiftController.php
  53. 10
      app/Http/Controllers/UserToActivityController.php
  54. 7
      app/Http/Controllers/UserToProyekController.php
  55. 9
      app/Http/Controllers/UserToShiftController.php
  56. 9
      app/Http/Controllers/UserToVersionGanttController.php
  57. 9
      app/Http/Controllers/VersionGanttController.php
  58. 8
      app/Http/Controllers/WaypointController.php
  59. 2
      app/Jobs/ExampleJob.php
  60. 2
      app/Libs/CustomHash/CustomHasher.php
  61. 2
      app/Listeners/ExampleListener.php
  62. 1
      app/Models/DokumenProject.php
  63. 1
      app/Models/MaterialProject.php
  64. 14
      app/Models/Project.php
  65. 1
      app/Models/ProjectCharter.php
  66. 15
      app/Models/User.php
  67. 11
      app/Models/UserMonthlyShift.php
  68. 1
      app/Providers/AppServiceProvider.php
  69. 5
      app/Providers/AuthServiceProvider.php
  70. 1
      app/Providers/CatchAllOptionsRequestsProvider.php
  71. 5
      bootstrap/app.php
  72. 1
      database/seeders/DatabaseSeeder.php
  73. 0
      resources/views/.gitkeep
  74. 64
      routes/web.php

2
app/Console/Kernel.php

@ -13,7 +13,6 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
//
];
/**
@ -24,6 +23,5 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
//
}
}

1
app/Events/ExampleEvent.php

@ -11,6 +11,5 @@ class ExampleEvent extends Event
*/
public function __construct()
{
//
}
}

8
app/Http/Controllers/AbsentController.php

@ -8,7 +8,6 @@ use App\Models\Absent;
class AbsentController extends Controller
{
public function add(Request $request){
//validasi
$this->validate($request, [
'user_id' => 'required',
'description' => 'required'
@ -80,19 +79,12 @@ class AbsentController extends Controller
public function search(Request $request)
{
// payload same like in golang API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 't_absensi');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

124
app/Http/Controllers/ActivityController.php

@ -60,7 +60,6 @@ class ActivityController extends Controller
}
$startDate = date_create($objRow->start_date);
$endDate = date_create($objRow->end_date);
// $objRow->jobs_done = $this->sumVolumeActuall($objRow->id);
$objRow->jobs_done = $this->sumVolumeActualMaterial($objRow->id);
$objRow->assign_hr = $this->getUserActivity($objRow->id);
$objRow->assign_tools = $this->getToolsActivity($objRow->id);
@ -118,7 +117,6 @@ class ActivityController extends Controller
foreach($data as $objRow){
$objRow->parent = $parent_id;
$objRow->text = $objRow->name;
// $objRow->jobs_done = $this->sumVolumeActuall($objRow->id);
$objRow->jobs_done = $this->sumVolumeActualMaterial($objRow->id);
$objRow->assign_hr = $this->getUserActivity($objRow->id);
$objRow->assign_tools = $this->getToolsActivity($objRow->id);
@ -154,13 +152,10 @@ class ActivityController extends Controller
{
$dataPlan = AssignMaterial::where('activity_id', $id)->get();
$tmpPercentage1 = [];
// for the case of each material assign
if(!$dataPlan->isEmpty()){
foreach ($dataPlan as $value) {
// $price = $value->material_id;
$qty_plan = $value->qty_planning;
$status_activity = $value->status_activity;
// get volume actual
$getDataVolActual = ReportActivityMaterial::where('assign_material_id', '=', $value->id)->sum("qty");
$percentage1 = ($getDataVolActual * 100) / $qty_plan;
if($status_activity == 'done'){
@ -174,27 +169,7 @@ class ActivityController extends Controller
$totalPercentage = array_sum($tmpPercentage1) > 0 ? array_sum($tmpPercentage1) / count($tmpPercentage1) : 0;
}else{
// if(!$dataPlan->isEmpty()){
// foreach ($dataPlan as $value) {
// $price = $value->material_id;
// $qty_plan = $value->qty_planning;
// $status_activity = $value->status_activity;
// // get volume actual
// $getDataVolActual = ReportActivityMaterial::where('assign_material_id', '=', $value->id)->sum("qty");
// $percentage1 = ($getDataVolActual * 100) / $qty_plan;
// if($status_activity == 'done'){
// $tmpPercentage1[] = 100;
// }
// // else if($status_activity == 'on-progress'){
// // $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1;
// // }
// else{
// $tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1;
// }
// }
// $totalPercentage = array_sum($tmpPercentage1) / count($tmpPercentage1);
// }else{
$totalPercentage = 0;
}
return $totalPercentage;
@ -212,7 +187,6 @@ class ActivityController extends Controller
private function getMaterialActivity($id)
{
// $data = AssignMaterial::select("m.name as name")->join("m_material_resource as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id)->get();
$data = AssignMaterial::select("m.description as name")->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id)->get();
$nameCollection = [];
foreach($data as $value){
@ -421,7 +395,6 @@ class ActivityController extends Controller
$totalCost = Activity::select(DB::raw('sum(cast(rencana_biaya as double precision))'))->where("proyek_id", $proyek)->where("version_gantt_id", $gantt)->whereNull("parent_id")->first();
}
$totalCost = $totalCost->sum;
// var_dump($totalCost);
if($totalCost > 0){
$activitys = Activity::where("proyek_id", $proyek)->where("version_gantt_id", $gantt)->get();
foreach ($activitys as $activity) {
@ -476,7 +449,6 @@ class ActivityController extends Controller
$data = Activity::find($id);
if($data){
$data->progress = (int)$data->persentase_progress/100;
// $data->jobs_done = $this->sumVolumeActuall($data->id);
$data->jobs_done = $this->sumVolumeActualMaterial($data->id);
$data->assign_hr = $this->getUserActivity($data->id);
$data->assign_tools = $this->getToolsActivity($data->id);
@ -508,22 +480,14 @@ class ActivityController extends Controller
{
$sumBobot = Activity::where("parent_id", $id)->sum("bobot_planning");
$dataActivity = Activity::find($id);
// 30 - 20
$restBobot = $dataActivity->bobot_planning - $sumBobot;
return $restBobot;
// if($dataActivity){
// $parent = $dataActivity->parent_id;
// if($parent && (int)$parent > 0){
// $this->updateBobotProgress($parent);
// }
// }
}
private function updatePersentaseProgress($id)
{
$sumProgress = Activity::where("parent_id", $id)->sum("persentase_progress");
$totalChild = Activity::where("parent_id", $id)->count();
// $sumProgress = $sumProgress/$totalChild;
$dataActivity = Activity::find($id);
$calculateProgressActual = $sumProgress/$totalChild;
$dataUpdate = array(
@ -548,7 +512,6 @@ class ActivityController extends Controller
"biaya_actual" => $biayaActual,
"updated_by" => $this->currentName
);
// Activity::where("id", $id)->update($dataUpdate);
$dataActivity->update($dataUpdate);
if($dataActivity){
$parent = $dataActivity->parent_id;
@ -560,24 +523,15 @@ class ActivityController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_activity');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
// not used move to Controller.php
public function calculateAllCost($activity_id, $proyek_id)
{
$humanCostPlanning = $this->calculateHuman($activity_id, $proyek_id);
@ -599,11 +553,6 @@ class ActivityController extends Controller
foreach ($dataHuman as $human) {
$uom = $human->uom_standart_rate;
$totalCost += $this->calculateHumanCost($human, $activity_id);
// if(strtolower($uom)=="day"){
// $totalCost += $this->calculateHumanDay($human, $activity_id);
// }else{
// $totalCost += $this->calculateHumanHours($human, $activity_id, $proyek_id);
// }
}
return $totalCost;
@ -613,7 +562,6 @@ class ActivityController extends Controller
{
$activity = Activity::find($activity_id);
$duration = $activity->duration;
// $costPerUsed = $human->cost_per_used;
$standarRate = $human->standart_rate;
$maxUsed = $human->max_used/100;
$totalCost = ($standarRate*$duration)*$maxUsed;
@ -624,7 +572,6 @@ class ActivityController extends Controller
{
$activity = Activity::find($activity_id);
$duration = $activity->duration;
// $costPerUsed = $human->cost_per_used;
$standarRate = $human->standart_rate;
$maxUsed = $human->max_used/100;
$totalCost = ($standarRate*$duration)*$maxUsed;
@ -664,7 +611,6 @@ class ActivityController extends Controller
$standarRate = $human->standart_rate;
$maxUsed = $human->max_used/100;
$totalCost += ($standarRate*$totalHours)*$maxUsed;
// $costPerUsed = $human->cost_per_used;
}
}
return $totalCost;
@ -727,7 +673,6 @@ class ActivityController extends Controller
$startH = new \DateTime($holiday->date);
$endH = clone $startH;
$endH->modify('+'.$holiday->duration.' day');
// $end = $startH->modify( '+1 day' );
$intervalH = \DateInterval::createFromDateString('1 day');
$periodH = new \DatePeriod($startH, $intervalH, $endH);
foreach ($periodH as $dt) {
@ -745,7 +690,6 @@ class ActivityController extends Controller
}else{
$dayOff = [];
}
// $dataActivity = Activity::whereNull('parent_id')->where("proyek_id", $val->proyek_id)->where("version_gantt_id", $val->last_gantt_id)->get();
$checkHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->count();
if($checkHeader > 0){
$dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first();
@ -770,7 +714,6 @@ class ActivityController extends Controller
}
$totalRencanaBudget = $totalRencanaBudget->sum;
// $dataPercentage = [];
$currentPercentage = 0;
$dataDate = [];
$dataPercen = [];
@ -793,20 +736,11 @@ class ActivityController extends Controller
if($totalRencanaBudget > 0 && $duration > 0){
$totalPercentage = $totalPercentage + ((($activity->rencana_biaya/$totalRencanaBudget)*100)/$duration);
}
// $totalPercentage += ($activity->rencana_biaya/$totalRencanaBudget)/100;
}
$currentPercentage = $currentPercentage + $totalPercentage;
// $dataPercentage[] = array(
// "date" => $currentDate,
// "percentage"=> $currentPercentage
// );
$dataDate[] = $currentDate;
$dataPercen[] = $currentPercentage;
}else{
// $dataPercentage[] = array(
// "date" => $currentDate,
// "percentage"=> "dateOff"
// );
$dataDate[] = $currentDate;
$dataPercen[] = "dateOff";
}
@ -845,14 +779,11 @@ class ActivityController extends Controller
$dataProject = Project::find($keyGantt['proyek_id']);
$dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->first();
// $dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first();
if($dataHeader){
$totalRencanaBudget = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->sum("rencana_biaya");
// $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as bigint))'))->where('parent_id', $dataHeader->id)->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->first();
}else{
$totalRencanaBudget = Activity::whereNull('parent_id')->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->sum("rencana_biaya");
// $totalRencanaBudget = Activity::select(DB::raw('sum(cast(rencana_biaya as bigint))'))->whereNull('parent_id')->where("proyek_id", $keyGantt['proyek_id'])->where("version_gantt_id", $keyGantt['last_gantt_id'])->first();
}
$minDate = DB::table('assign_material_to_activity as ama')
@ -870,17 +801,13 @@ class ActivityController extends Controller
$begin = new \DateTime($minDate);
$end = new \DateTime($maxDate);
$end2 = new \DateTime($maxDate);
// $end2 = $end2->modify( '-1 day' );
$interval = \DateInterval::createFromDateString('1 day');
$period = new \DatePeriod($begin, $interval, $end);
// week 1 == monday
$arr_ActualM = [];
$tempDate = [];
$tempPercentage = [];
$tempTtlPercentPlan=0;
$tempTtlPercentActual=0;
// $date_week =
// $lastKey = array_key_last($period);
$currentACWP = 0;
$budgetControlACWP = 0;
@ -962,7 +889,6 @@ class ActivityController extends Controller
'plan'=>$dataTempPlan,
'actual'=>$dataTempReport,
);
// week, every monday (code 1)
if(isset($dataPayload['period']) && $dataPayload['period'] == 'week'){
if($dt->format("w")==1){
if($totalACWP > 0 ){
@ -978,10 +904,7 @@ class ActivityController extends Controller
$currentBCWP += $totalBCWP;
$tempPercentage[] = array(round($tempTtlPercentPlan,2), round($tempTtlPercentActual,2));
// $tempDate[] = array($dt->format("Y-m-d"), round($currentACWP,2), round($currentBCWP,2));
$tempDate[] = array($dt->format("Y-m-d"), 0, 0);
// $tempTtlPercentPlan = 0;
// $tempTtlPercentActual = 0;
}else if($dt->format("Y-m-d") == $end2->format("Y-m-d")) {
$tempTtlPercentPlan+= $sumPercentagePlan;
$tempTtlPercentActual+= $sumPercentageActual;
@ -989,16 +912,13 @@ class ActivityController extends Controller
$currentBCWP += $totalBCWP;
$tempPercentage[] = array(round($tempTtlPercentPlan,2), round($tempTtlPercentActual,2));
// $tempDate[] = array($dt->format("Y-m-d"), round($currentACWP,2), round($currentBCWP,2));
$tempDate[] = array($dt->format("Y-m-d"), 0, 0);
$tempTtlPercentPlan = 0;
$tempTtlPercentActual = 0;
}
// else everyday
}else{
$tempPercentage[] = array(round($sumPercentagePlan,2), round($sumPercentageActual,2));
$tempDate[] = array($dt->format("Y-m-d"), 0, 0);
// $tempDate[] = array($dt->format("w"), 0, 0);
}
}
@ -1022,15 +942,6 @@ class ActivityController extends Controller
"cost_deviation" => $costDeviation,
"potential" => $costDeviation > 0 ? "SAVING" : $costDeviation == 0 ? "ON BUDGET" : "OVERRUN"
)
// "budget_control" =>array("current_budget"=> $totalRencanaBudget,
// "acwp" => round($budgetControlACWP,0),
// "bcwp" => round($budgetControlBCWP,0),
// "rem_to_complete" => ($totalRencanaBudget - round($budgetControlACWP,0)),
// "add_cost_to_complete" => 0,
// "estimated_at_completion" => $estimatedCost,
// "cost_deviation" => $costDeviation,
// "potential" => $costDeviation > 0 ? "SAVING" : $costDeviation == 0 ? "ON BUDGET" : "OVERRUN"
// )
);
$dataFinal[] = array(
@ -1061,7 +972,6 @@ class ActivityController extends Controller
$startH = new \DateTime($holiday->date);
$endH = clone $startH;
$endH->modify('+'.$holiday->duration.' day');
// $end = $startH->modify( '+1 day' );
$intervalH = \DateInterval::createFromDateString('1 day');
$periodH = new \DatePeriod($startH, $intervalH, $endH);
foreach ($periodH as $dt) {
@ -1079,7 +989,6 @@ class ActivityController extends Controller
}else{
$dayOff = [];
}
// $dataActivity = Activity::whereNull('parent_id')->where("proyek_id", $val->proyek_id)->where("version_gantt_id", $val->last_gantt_id)->get();
$checkHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->count();
if($checkHeader > 0){
$dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first();
@ -1105,7 +1014,6 @@ class ActivityController extends Controller
$totalRencanaBudget = $totalRencanaBudget->sum;
// $dataPercentage = [];
$currentPercentage = 0;
$currentACWP = 0;
$budgetControlACWP = 0;
@ -1119,7 +1027,6 @@ class ActivityController extends Controller
foreach ($period as $dt) {
$weekDay = $dt->format("w");
$currentDate = $dt->format("Y-m-d");
// $testdata1 = [];
$testdata[] = array('weekday' => $weekDay, 'date' =>$currentDate, 'dayof' => $dayOff);
$totalPercentage = isset($totalPercentage) ? $totalPercentage : 0;
@ -1141,10 +1048,7 @@ class ActivityController extends Controller
$totalBCWP += (((($activity->persentase_progress*$activity->bobot_planning)/100)/$duration)* $totalRencanaBudget)/100;
}
}
// $totalPercentage += ($activity->rencana_biaya/$totalRencanaBudget)/100;
}
// $dateMax = date_format(date_create($maxDate), "Y-m-d")
// $dateMax->modify("-1 day");
}
@ -1196,11 +1100,6 @@ class ActivityController extends Controller
$totalProgressActivity = 0;
$totalBCWP = 0;
}
// else{
// $dataDate[] = $currentDate;
// // $dataPercen[] = null;
// $dataPercen[] = array($currentPercentage,$currentProgressActivity);
// }
}
if(round($budgetControlACWP,0) > $totalRencanaBudget){
$estimatedCost = round($budgetControlACWP,0)+0;
@ -1252,7 +1151,6 @@ class ActivityController extends Controller
$startH = new \DateTime($holiday->date);
$endH = clone $startH;
$endH->modify('+'.$holiday->duration.' day');
// $end = $startH->modify( '+1 day' );
$intervalH = \DateInterval::createFromDateString('1 day');
$periodH = new \DatePeriod($startH, $intervalH, $endH);
foreach ($periodH as $dt) {
@ -1270,7 +1168,6 @@ class ActivityController extends Controller
}else{
$dayOff = [];
}
// $dataActivity = Activity::whereNull('parent_id')->where("proyek_id", $val->proyek_id)->where("version_gantt_id", $val->last_gantt_id)->get();
$dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first();
if($dataHeader){
$minDate = Activity::where('parent_id', $dataHeader->id)->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->min("start_date");
@ -1282,7 +1179,6 @@ class ActivityController extends Controller
$begin = new \DateTime($minDate);
$end = new \DateTime($maxDate);
// $end = $end->modify( '+1 day' );
$interval = \DateInterval::createFromDateString('1 day');
$period = new \DatePeriod($begin, $interval, $end);
$dataHeader = Activity::where('type_activity', 'header')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->first();
@ -1293,7 +1189,6 @@ class ActivityController extends Controller
}
$totalRencanaBudget = $totalRencanaBudget->sum;
// $dataPercentage = [];
$currentPercentage = 0;
$currentACWP = 0;
$currentProgressActivity = 0;
@ -1304,7 +1199,6 @@ class ActivityController extends Controller
foreach ($period as $dt) {
$weekDay = $dt->format("w");
$currentDate = $dt->format("Y-m-d");
// $testdata1 = [];
$testdata[] = array('weekday' => $weekDay, 'date' =>$currentDate);
if(!in_array($weekDay, $dayOff) && !in_array($currentDate, $dateHoliday))
{
@ -1312,10 +1206,7 @@ class ActivityController extends Controller
$totalACWP = 0;
$totalProgressActivity = 0;
$totalBCWP = 0;
// $dataActivitycount = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date)")->whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->count('duration');
// $dataActivity = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date) - INTERVAL '1 DAY'")->whereNull('parent_id')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->get();
$dataActivity = Activity::whereRaw("'".$currentDate."' BETWEEN DATE(m_activity.start_date) AND DATE(m_activity.end_date) - INTERVAL '1 DAY'")->where('type_activity', 'task')->where("proyek_id", $val['proyek_id'])->where("version_gantt_id", $val['last_gantt_id'])->get();
// $testdata[] = array('data'=>$dataActivity, 'date' => $currentDate);
foreach ($dataActivity as $activity) {
$duration = $activity->duration;
@ -1327,16 +1218,12 @@ class ActivityController extends Controller
$totalBCWP += (((($activity->persentase_progress*$activity->bobot_planning)/100)/$duration)* $totalRencanaBudget)/100;
}
}
// $totalPercentage += ($activity->rencana_biaya/$totalRencanaBudget)/100;
}
$currentPercentage = round(($currentPercentage + $totalPercentage), 0);
$currentACWP = $totalACWP == 0 ? null : $currentACWP + $totalACWP;
// $currentACWP = $currentACWP + $totalACWP;
$currentProgressActivity = $totalProgressActivity == 0 ? null : round(($currentProgressActivity + $totalProgressActivity),0);
// $currentProgressActivity = $currentProgressActivity + $totalProgressActivity;
$currentBCWP = $totalBCWP == 0 ? null :$currentBCWP + $totalBCWP;
// $currentBCWP = $currentBCWP + $totalBCWP;
$currentPercentage = $currentPercentage > 100 ? 100 : $currentPercentage;
$currentProgressActivity = $currentProgressActivity > 100 ? 100 : $currentProgressActivity;
@ -1345,7 +1232,6 @@ class ActivityController extends Controller
$dataPercen[] = array($currentPercentage, $currentProgressActivity);
}else{
$dataDate[] = $currentDate;
// $dataPercen[] = null;
$dataPercen[] = array($currentPercentage,$currentProgressActivity);
}
}
@ -1377,7 +1263,6 @@ class ActivityController extends Controller
public function setBaseline($gantt_id)
{
// UPDATE m_activity SET planned_start='start_date', planned_end='end_date' WHERE version_gantt_id=$gantt_id
$activities = Activity::where("version_gantt_id", $gantt_id)->get();
foreach ($activities as $activity) {
@ -1392,16 +1277,10 @@ class ActivityController extends Controller
}
return response()->json(['status'=>'success','message'=>'Set baseline success!','code'=>200], 200);
// return response()->json(['status'=>'failed','message'=>'Failed to set baseline!','code'=>400], 400);
}
public function synchronizeReport($gantt_id)
{
// Update start_date and end_date if there report_activity.
// first, get all activity id based on gantt_id
// then, loop and check table report_activity,
// if found (that must me more 1 or more than 1 report at 1 activity) so get the first and last report date
// and set to m_activity->start_data and m_activity->end_date
$activities = Activity::where("version_gantt_id", $gantt_id)->get();
$reports = [];
@ -1430,7 +1309,6 @@ class ActivityController extends Controller
}
}
// loop reports[] then update to m_activity
for ($i=0; $i < count($reports); $i++) {
$activity = Activity::find($reports[$i]['activity_id']);
$activity->start_date = $reports[$i]['min_date'];

7
app/Http/Controllers/ActivityDokumenController.php

@ -69,19 +69,12 @@ class ActivityDokumenController extends Controller
}
public function searchDocProject(Request $request){
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_document_activity');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

49
app/Http/Controllers/AssignMaterialController.php

@ -13,7 +13,6 @@ use Datatables;
class AssignMaterialController extends Controller
{
public function add_backup(Request $request){
//validasi
$this->validate($request, [
'activity_id' => 'required',
'material_id' => 'required',
@ -28,18 +27,7 @@ class AssignMaterialController extends Controller
die();
}
// $checkData = AssignMaterial::where("activity_id", $request->activity_id)->where("material_id", $request->material_id)
// ->count();
// if($checkData > 0){
// $update = $this->updateFromAdd($request->all());
// if($update){
// return response()->json(['status'=>'success','message'=>'Assign material success!','code'=>200]);
// }else{
// return response()->json(['status'=>'failed','message'=>'Assign material failed','code'=>400]);
// }
// die();
// }
$data = $request->all();
@ -62,12 +50,10 @@ class AssignMaterialController extends Controller
}
public function add(Request $request){
//validasi
$this->validate($request, [
'activity_id' => 'required',
'material_id' => 'required',
'qty_planning' => 'required'
// 'budget' => 'required'
]);
$checkStock = RequestMaterial::where("id", $request->material_id)->first();
@ -85,23 +71,13 @@ class AssignMaterialController extends Controller
$result = AssignMaterial::create($data);
if($result){
// comment untill fix flow
// $checkStock = MaterialResource::find($request->material_id);
// $newStock = (int)$checkStock->qty - (int)$request->qty_planning;
// $dataUpdate = array(
// "qty"=>$newStock,
// "updated_by"=>$this->currentName
// );
// $checkStock->update($dataUpdate);
// update cost planning
$updateActivity = Activity::find($request->activity_id);
if($updateActivity){
$costPlanOld = $updateActivity==null? 0 : (int)$updateActivity->rencana_biaya;
$costPlanNew = $costPlanOld + ($price*$request->qty_planning);
$updateActivity->rencana_biaya = $costPlanNew;
$updateActivity->save();
// $updateActivity->update(array("rencana_biaya"=>$costPlanNew));
return response()->json(['status'=>'success','message'=>'Assign material successfull created, and update cost plan success '.$costPlanNew,'code'=>200]);
}else{
return response()->json(['status'=>'success','message'=>'Assign material successfull created','code'=>200]);
@ -199,19 +175,12 @@ class AssignMaterialController extends Controller
public function search(Request $request)
{
// payload same like in golang API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'assign_material_to_activity');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
@ -229,7 +198,6 @@ class AssignMaterialController extends Controller
public function datatables(Request $request){
$id_activity = $request->query('idact');
// $data = AssignMaterial::select("assign_material_to_activity.*","m.name as material_name", "m.uom as uom")->join("m_material_resource as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id_activity)->get();
$data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom")->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id_activity)->get();
return Datatables::of($data)
->addIndexColumn()
@ -242,10 +210,6 @@ class AssignMaterialController extends Controller
public function datatablesForReportActivity(Request $request){
$id_activity = $request->query('idact');
// $data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom")
// ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
// // ->groupBy("assign_material_to_activity.activity_id")
// ->where("assign_material_to_activity.activity_id", $id_activity)->get();
$data = AssignMaterial::select(AssignMaterial::raw('SUM(qty_planning) as qty_planning'), "m.description as material_name", "assign_material_to_activity.activity_id as activity_id")
->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
->groupBy("m.description")
@ -291,7 +255,6 @@ class AssignMaterialController extends Controller
->addColumn('action', function($row){
$actionBtn = '<a href="javascript:void(0)" data-id="'.$row->id.'" data-material-name="'.$row->material_name.'" class="primary btn btn-primary btn-sm btn-lihat-plan" data-toggle="tooltip" title="Lihat Plan" data-placement="top"><i class="fa fa-align-justify"></i></a>';
$actionBtn .= '<a href="javascript:void(0)" data-id="'.$row->id.'" data-material-name="'.$row->material_name.'" class="warning btn btn-warning btn-sm btn-lihat-actual" data-toggle="tooltip" title="Input Progress" data-placement="top"><i class="fa fa-edit" aria-hidden="true"></i></a>';
// $actionBtn .= '<a href="javascript:void(0)" style="margin-left:5px;" data-id="'.$row->id.'" data-material-name="'.$row->material_name.'" class="success btn btn-success btn-sm btn-update-status" data-toggle="tooltip" title="Input Update Status" data-placement="top"><i class="fa fa-edit"></i></a>';
return $actionBtn;
})
->rawColumns(['action'])->make(true);
@ -303,20 +266,10 @@ class AssignMaterialController extends Controller
->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
->where('assign_material_to_activity.activity_id', $id_activity)->get();
foreach ($data as $key) {
// for ($i=0; $i < count($data); $i++) {
# code...
$val_qty_sum = ReportActivityMaterial::where('assign_material_id', '=', $key->id)->sum("qty");
// $data[] = ['qty' =>$val_qty_sum ? $val_qty_sum : 0];
// array_push($data[$i], ['qty' =>$val_qty_sum ? $val_qty_sum : 0]);
}
// $data = AssignMaterial::select("assign_material_to_activity.*","m.description as material_name", "m.uom as uom")
// ->join("m_req_material as m", "m.id", "=", "assign_material_to_activity.material_id")
// ->where('assign_material_to_activity.activity_id', $id_activity, function ($query) {
// $query->sum('qty')
// ->from('report_activity_material')
// ->where('report_activity_material.assign_material_id', 'assign_material_to_activity.id');
// })->get();
$countData = $data->count();
if($data){
return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200);

21
app/Http/Controllers/AssignToolsController.php

@ -9,7 +9,6 @@ use App\Models\ToolsResource;
class AssignToolsController extends Controller
{
public function add(Request $request){
//validasi
$this->validate($request, [
'activity_id' => 'required',
'tools_id' => 'required',
@ -22,18 +21,7 @@ class AssignToolsController extends Controller
return response()->json(['status'=>'failed','message'=>'Not enough stock in warehouse!','code'=>400]);
die();
}
// $checkData = AssignTools::where("activity_id", $request->activity_id)->where("tools_id", $request->tools_id)
// ->count();
// if($checkData > 0){
// $update = $this->updateFromAdd($request->all());
// if($update){
// return response()->json(['status'=>'success','message'=>'Assign tools success!','code'=>200]);
// }else{
// return response()->json(['status'=>'failed','message'=>'Assign tools failed','code'=>400]);
// }
// die();
// }
$data = $request->all();
@ -137,19 +125,12 @@ class AssignToolsController extends Controller
public function search(Request $request)
{
// payload same like in golang API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'assign_tools_to_activity');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

6
app/Http/Controllers/AuthController.php

@ -65,12 +65,6 @@ class AuthController extends Controller
$user->role = $dataRole;
}
// if($user->role_id!=1){
// $dataProject = UserProject::where('user_id', $user->id)->first();
// if($dataProject){
// $user->project = $dataProject;
// }
// }
if (! $token =Auth::login($user)) {
return response()->json(['error' => 'Unauthorized'], 401);

1
app/Http/Controllers/BroadcastController.php

@ -6,5 +6,4 @@ use Illuminate\Http\Request;
class BroadcastController extends Controller
{
//
}

9
app/Http/Controllers/ChecklistK3Controller.php

@ -7,9 +7,7 @@ use App\Models\ChecklistK3;
class ChecklistK3Controller extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'name' => 'required',
'description' => 'required'
@ -66,19 +64,12 @@ class ChecklistK3Controller extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_checklist_k3');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

9
app/Http/Controllers/CommentActivityController.php

@ -7,9 +7,7 @@ use App\Models\CommentActivity;
class CommentActivityController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'activity_id' => 'required',
'comment' => 'required'
@ -81,19 +79,12 @@ class CommentActivityController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_comment_activity');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

7
app/Http/Controllers/ConfigAlertController.php

@ -86,19 +86,12 @@ class ConfigAlertController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'config_alert');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

7
app/Http/Controllers/ConfigAlertUserController.php

@ -71,19 +71,12 @@ class ConfigAlertUserController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'config_alert_to_user');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

10
app/Http/Controllers/ControlMonitoringController.php

@ -13,17 +13,11 @@ class ControlMonitoringController extends Controller
{
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_proyek');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// get another child data
if($request->has("child_data")){
$newDataGet = [];
$child_data = $request->child_data;
@ -42,7 +36,6 @@ class ControlMonitoringController extends Controller
$act->list_report = ReportActivity::select("report_activity.*", "mu.name as user_name", "mi.image as image_url")->leftJoin("m_users as mu", "mu.id", "=", "report_activity.user_id")->leftJoin("m_image as mi", function($join){
$join->on("mi.ref_id", "=", "report_activity.id")->where("mi.category", "report_activity");
})->where("report_activity.activity_id", $act->id)->whereBetween("report_activity.report_date", [$date_start, $date_end])->get();
// $act->list_report = ReportActivity::select("report_activity.*", "mu.name as user_name")->leftJoin("m_users as mu", "mu.id", "=", "report_activity.user_id")->where("report_activity.activity_id", $act->id)->whereBetween("report_activity.report_date", [$date_start, $date_end])->get();
$listAct[] = $act;
}
$value->report_data = $listAct;
@ -50,10 +43,7 @@ class ControlMonitoringController extends Controller
}
$dataGet = $newDataGet;
}
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

14
app/Http/Controllers/Controller.php

@ -5,14 +5,8 @@ use Illuminate\Support\Facades\DB;
use Laravel\Lumen\Routing\Controller as BaseController;
// you can add function or variable in this class and can access from controller who has
// extend this class example 'class ProjectDokumenController extends Controller'
// if you make controller with command 'php artisan make:controller nameController'
// its automatically extend the controller with this class
// access like this '$this->functionName($param)' or '$this->variableName'
class Controller extends BaseController
{
// here is the global variabel
protected $pathImage = "assets/image/";
protected $pathDocument = "assets/file/project/";
protected $pathActivityDocument = "assets/file/activity/";
@ -24,19 +18,15 @@ class Controller extends BaseController
public function __construct()
{
// datetime now
$this->currentDate = date("Y-m-d H:i:s");
// current user auth
$this->currentName = auth()->user() ? auth()->user()->name : "system";
$this->currentId = auth()->user() ? auth()->user()->id : 0;
// configure assets
$this->pathImage = config('assets.image');
$this->pathDocument = config('assets.project');
$this->pathActivityDocument = config('assets.activity');
}
// every single param in this function is required
protected function setUpPayload($condition, $tableSelf)
{
$alias = "selfTable";
@ -56,7 +46,6 @@ class Controller extends BaseController
foreach($columnResult as $sColumn){
$builder = $builder->addSelect($tableName.".".$sColumn." as join_".$this->listJoinAll[$no]."_".$sColumn);
}
// need to make dinamic join option
$builder = $builder->leftJoin($tableName, $tableJoin.".".$columnJoin, '=', $tableName.'.'.$columnSelf);
$no++;
}
@ -71,7 +60,6 @@ class Controller extends BaseController
if($value && $value!="" && $value!=" "){
$column = $where['name'];
$operator = strtolower($where['logic_operator']); // like, =, <>, range
//$whereCondition = $where['operator']; // AND , OR
$value2 = isset($where['value1']) ? $where['value1'] : "";
$tableColumn = isset($where['table_name']) ? $where['table_name'] : $alias;
$query = $this->whereCondition($query, $operator, $tableColumn, $column, $value, $value2);
@ -222,7 +210,6 @@ class Controller extends BaseController
return $query;
}
// need call when update userToActivity / materialToActivity / toolsToActivity
protected function calculateAllCost($activity, $proyek_id){
$humanCostPlanning = $this->calculateAllHumanCost($activity_id, $proyek_id);
$materialCostPlanning = $this->calculateMaterialCost($activity_id, $proyek_id);
@ -252,7 +239,6 @@ class Controller extends BaseController
{
$activity = Activity::find($activity_id);
$duration = $activity->duration;
// $costPerUsed = $human->cost_per_used;
$standarRate = $human->standart_rate;
$maxUsed = $human->max_used/100;
$totalCost = ($standarRate*$duration)*$maxUsed;

154
app/Http/Controllers/CurrencyController.php

@ -9,162 +9,8 @@ class CurrencyController extends Controller
public function list() {
$CURRENCY_DATA = array(
// array("cc" => "AED", "symbol" => "\u062f.\u0625;", "name" => "UAE dirham"),
// array("cc" => "AFN", "symbol" => "Afs", "name" => "Afghan afghani"),
// array("cc" => "ALL", "symbol" => "L", "name" => "Albanian lek"),
// array("cc" => "AMD", "symbol" => "AMD", "name" => "Armenian dram"),
// array("cc" => "ANG", "symbol" => "NA\u0192", "name" => "Netherlands Antillean gulden"),
// array("cc" => "AOA", "symbol" => "Kz", "name" => "Angolan kwanza"),
// array("cc" => "ARS", "symbol" => "$", "name" => "Argentine peso"),
// array("cc" => "AUD", "symbol" => "$", "name" => "Australian dollar"),
// array("cc" => "AWG", "symbol" => "\u0192", "name" => "Aruban florin"),
// array("cc" => "AZN", "symbol" => "AZN", "name" => "Azerbaijani manat"),
// array("cc" => "BAM", "symbol" => "KM", "name" => "Bosnia and Herzegovina konvertibilna marka"),
// array("cc" => "BBD", "symbol" => "Bds$", "name" => "Barbadian dollar"),
// array("cc" => "BDT", "symbol" => "\u09f3", "name" => "Bangladeshi taka"),
// array("cc" => "BGN", "symbol" => "BGN", "name" => "Bulgarian lev"),
// array("cc" => "BHD", "symbol" => ".\u062f.\u0628", "name" => "Bahraini dinar"),
// array("cc" => "BIF", "symbol" => "FBu", "name" => "Burundi franc"),
// array("cc" => "BMD", "symbol" => "BD$", "name" => "Bermudian dollar"),
// array("cc" => "BND", "symbol" => "B$", "name" => "Brunei dollar"),
// array("cc" => "BOB", "symbol" => "Bs.", "name" => "Bolivian boliviano"),
// array("cc" => "BRL", "symbol" => "R$", "name" => "Brazilian real"),
// array("cc" => "BSD", "symbol" => "B$", "name" => "Bahamian dollar"),
// array("cc" => "BTN", "symbol" => "Nu.", "name" => "Bhutanese ngultrum"),
// array("cc" => "BWP", "symbol" => "P", "name" => "Botswana pula"),
// array("cc" => "BYR", "symbol" => "Br", "name" => "Belarusian ruble"),
// array("cc" => "BZD", "symbol" => "BZ$", "name" => "Belize dollar"),
// array("cc" => "CAD", "symbol" => "$", "name" => "Canadian dollar"),
// array("cc" => "CDF", "symbol" => "F", "name" => "Congolese franc"),
// array("cc" => "CHF", "symbol" => "Fr.", "name" => "Swiss franc"),
// array("cc" => "CLP", "symbol" => "$", "name" => "Chilean peso"),
// array("cc" => "CNY", "symbol" => "\u00a5", "name" => "Chinese/Yuan renminbi"),
// array("cc" => "COP", "symbol" => "Col$", "name" => "Colombian peso"),
// array("cc" => "CRC", "symbol" => "\u20a1", "name" => "Costa Rican colon"),
// array("cc" => "CUC", "symbol" => "$", "name" => "Cuban peso"),
// array("cc" => "CVE", "symbol" => "Esc", "name" => "Cape Verdean escudo"),
// array("cc" => "CZK", "symbol" => "K\u010d", "name" => "Czech koruna"),
// array("cc" => "DJF", "symbol" => "Fdj", "name" => "Djiboutian franc"),
// array("cc" => "DKK", "symbol" => "Kr", "name" => "Danish krone"),
// array("cc" => "DOP", "symbol" => "RD$", "name" => "Dominican peso"),
// array("cc" => "DZD", "symbol" => "\u062f.\u062c", "name" => "Algerian dinar"),
// array("cc" => "EEK", "symbol" => "KR", "name" => "Estonian kroon"),
// array("cc" => "EGP", "symbol" => "\u00a3", "name" => "Egyptian pound"),
// array("cc" => "ERN", "symbol" => "Nfa", "name" => "Eritrean nakfa"),
// array("cc" => "ETB", "symbol" => "Br", "name" => "Ethiopian birr"),
// array("cc" => "EUR", "symbol" => "\u20ac", "name" => "European Euro"),
// array("cc" => "FJD", "symbol" => "FJ$", "name" => "Fijian dollar"),
// array("cc" => "FKP", "symbol" => "\u00a3", "name" => "Falkland Islands pound"),
// array("cc" => "GBP", "symbol" => "\u00a3", "name" => "British pound"),
// array("cc" => "GEL", "symbol" => "GEL", "name" => "Georgian lari"),
// array("cc" => "GHS", "symbol" => "GH\u20b5", "name" => "Ghanaian cedi"),
// array("cc" => "GIP", "symbol" => "\u00a3", "name" => "Gibraltar pound"),
// array("cc" => "GMD", "symbol" => "D", "name" => "Gambian dalasi"),
// array("cc" => "GNF", "symbol" => "FG", "name" => "Guinean franc"),
// array("cc" => "GQE", "symbol" => "CFA", "name" => "Central African CFA franc"),
// array("cc" => "GTQ", "symbol" => "Q", "name" => "Guatemalan quetzal"),
// array("cc" => "GYD", "symbol" => "GY$", "name" => "Guyanese dollar"),
// array("cc" => "HKD", "symbol" => "HK$", "name" => "Hong Kong dollar"),
// array("cc" => "HNL", "symbol" => "L", "name" => "Honduran lempira"),
// array("cc" => "HRK", "symbol" => "kn", "name" => "Croatian kuna"),
// array("cc" => "HTG", "symbol" => "G", "name" => "Haitian gourde"),
// array("cc" => "HUF", "symbol" => "Ft", "name" => "Hungarian forint"),
array("cc" => "IDR", "symbol" => "Rp", "name" => "Indonesian rupiah"),
// array("cc" => "ILS", "symbol" => "\u20aa", "name" => "Israeli new sheqel"),
// array("cc" => "INR", "symbol" => "\u20B9", "name" => "Indian rupee"),
// array("cc" => "IQD", "symbol" => "\u062f.\u0639", "name" => "Iraqi dinar"),
// array("cc" => "IRR", "symbol" => "IRR", "name" => "Iranian rial"),
// array("cc" => "ISK", "symbol" => "kr", "name" => "Icelandic kr\u00f3na"),
// array("cc" => "JMD", "symbol" => "J$", "name" => "Jamaican dollar"),
// array("cc" => "JOD", "symbol" => "JOD", "name" => "Jordanian dinar"),
// array("cc" => "JPY", "symbol" => "\u00a5", "name" => "Japanese yen"),
// array("cc" => "KES", "symbol" => "KSh", "name" => "Kenyan shilling"),
// array("cc" => "KGS", "symbol" => "\u0441\u043e\u043c", "name" => "Kyrgyzstani som"),
// array("cc" => "KHR", "symbol" => "\u17db", "name" => "Cambodian riel"),
// array("cc" => "KMF", "symbol" => "KMF", "name" => "Comorian franc"),
// array("cc" => "KPW", "symbol" => "W", "name" => "North Korean won"),
// array("cc" => "KRW", "symbol" => "W", "name" => "South Korean won"),
// array("cc" => "KWD", "symbol" => "KWD", "name" => "Kuwaiti dinar"),
// array("cc" => "KYD", "symbol" => "KY$", "name" => "Cayman Islands dollar"),
// array("cc" => "KZT", "symbol" => "T", "name" => "Kazakhstani tenge"),
// array("cc" => "LAK", "symbol" => "KN", "name" => "Lao kip"),
// array("cc" => "LBP", "symbol" => "\u00a3", "name" => "Lebanese lira"),
// array("cc" => "LKR", "symbol" => "Rs", "name" => "Sri Lankan rupee"),
// array("cc" => "LRD", "symbol" => "L$", "name" => "Liberian dollar"),
// array("cc" => "LSL", "symbol" => "M", "name" => "Lesotho loti"),
// array("cc" => "LTL", "symbol" => "Lt", "name" => "Lithuanian litas"),
// array("cc" => "LVL", "symbol" => "Ls", "name" => "Latvian lats"),
// array("cc" => "LYD", "symbol" => "LD", "name" => "Libyan dinar"),
// array("cc" => "MAD", "symbol" => "MAD", "name" => "Moroccan dirham"),
// array("cc" => "MDL", "symbol" => "MDL", "name" => "Moldovan leu"),
// array("cc" => "MGA", "symbol" => "FMG", "name" => "Malagasy ariary"),
// array("cc" => "MKD", "symbol" => "MKD", "name" => "Macedonian denar"),
// array("cc" => "MMK", "symbol" => "K", "name" => "Myanma kyat"),
// array("cc" => "MNT", "symbol" => "\u20ae", "name" => "Mongolian tugrik"),
// array("cc" => "MOP", "symbol" => "P", "name" => "Macanese pataca"),
// array("cc" => "MRO", "symbol" => "UM", "name" => "Mauritanian ouguiya"),
// array("cc" => "MUR", "symbol" => "Rs", "name" => "Mauritian rupee"),
// array("cc" => "MVR", "symbol" => "Rf", "name" => "Maldivian rufiyaa"),
// array("cc" => "MWK", "symbol" => "MK", "name" => "Malawian kwacha"),
// array("cc" => "MXN", "symbol" => "$", "name" => "Mexican peso"),
// array("cc" => "MYR", "symbol" => "RM", "name" => "Malaysian ringgit"),
// array("cc" => "MZM", "symbol" => "MTn", "name" => "Mozambican metical"),
// array("cc" => "NAD", "symbol" => "N$", "name" => "Namibian dollar"),
// array("cc" => "NGN", "symbol" => "\u20a6", "name" => "Nigerian naira"),
// array("cc" => "NIO", "symbol" => "C$", "name" => "Nicaraguan c\u00f3rdoba"),
// array("cc" => "NOK", "symbol" => "kr", "name" => "Norwegian krone"),
// array("cc" => "NPR", "symbol" => "NRs", "name" => "Nepalese rupee"),
// array("cc" => "NZD", "symbol" => "NZ$", "name" => "New Zealand dollar"),
// array("cc" => "OMR", "symbol" => "OMR", "name" => "Omani rial"),
// array("cc" => "PAB", "symbol" => "B./", "name" => "Panamanian balboa"),
// array("cc" => "PEN", "symbol" => "S/.", "name" => "Peruvian nuevo sol"),
// array("cc" => "PGK", "symbol" => "K", "name" => "Papua New Guinean kina"),
// array("cc" => "PHP", "symbol" => "\u20b1", "name" => "Philippine peso"),
// array("cc" => "PKR", "symbol" => "Rs.", "name" => "Pakistani rupee"),
// array("cc" => "PLN", "symbol" => "z\u0142", "name" => "Polish zloty"),
// array("cc" => "PYG", "symbol" => "\u20b2", "name" => "Paraguayan guarani"),
// array("cc" => "QAR", "symbol" => "QR", "name" => "Qatari riyal"),
// array("cc" => "RON", "symbol" => "L", "name" => "Romanian leu"),
// array("cc" => "RSD", "symbol" => "din.", "name" => "Serbian dinar"),
// array("cc" => "RUB", "symbol" => "R", "name" => "Russian ruble"),
// array("cc" => "SAR", "symbol" => "SR", "name" => "Saudi riyal"),
// array("cc" => "SBD", "symbol" => "SI$", "name" => "Solomon Islands dollar"),
// array("cc" => "SCR", "symbol" => "SR", "name" => "Seychellois rupee"),
// array("cc" => "SDG", "symbol" => "SDG", "name" => "Sudanese pound"),
// array("cc" => "SEK", "symbol" => "kr", "name" => "Swedish krona"),
// array("cc" => "SGD", "symbol" => "S$", "name" => "Singapore dollar"),
// array("cc" => "SHP", "symbol" => "\u00a3", "name" => "Saint Helena pound"),
// array("cc" => "SLL", "symbol" => "Le", "name" => "Sierra Leonean leone"),
// array("cc" => "SOS", "symbol" => "Sh.", "name" => "Somali shilling"),
// array("cc" => "SRD", "symbol" => "$", "name" => "Surinamese dollar"),
// array("cc" => "SYP", "symbol" => "LS", "name" => "Syrian pound"),
// array("cc" => "SZL", "symbol" => "E", "name" => "Swazi lilangeni"),
// array("cc" => "THB", "symbol" => "\u0e3f", "name" => "Thai baht"),
// array("cc" => "TJS", "symbol" => "TJS", "name" => "Tajikistani somoni"),
// array("cc" => "TMT", "symbol" => "m", "name" => "Turkmen manat"),
// array("cc" => "TND", "symbol" => "DT", "name" => "Tunisian dinar"),
// array("cc" => "TRY", "symbol" => "TRY", "name" => "Turkish new lira"),
// array("cc" => "TTD", "symbol" => "TT$", "name" => "Trinidad and Tobago dollar"),
// array("cc" => "TWD", "symbol" => "NT$", "name" => "New Taiwan dollar"),
// array("cc" => "TZS", "symbol" => "TZS", "name" => "Tanzanian shilling"),
// array("cc" => "UAH", "symbol" => "UAH", "name" => "Ukrainian hryvnia"),
// array("cc" => "UGX", "symbol" => "USh", "name" => "Ugandan shilling"),
array("cc" => "USD", "symbol" => "US$", "name" => "United States dollar"),
// array("cc" => "UYU", "symbol" => '$U', "name" => "Uruguayan peso"),
// array("cc" => "UZS", "symbol" => "UZS", "name" => "Uzbekistani som"),
// array("cc" => "VEB", "symbol" => "Bs", "name" => "Venezuelan bolivar"),
// array("cc" => "VND", "symbol" => "\u20ab", "name" => "Vietnamese dong"),
// array("cc" => "VUV", "symbol" => "VT", "name" => "Vanuatu vatu"),
// array("cc" => "WST", "symbol" => "WS$", "name" => "Samoan tala"),
// array("cc" => "XAF", "symbol" => "CFA", "name" => "Central African CFA franc"),
// array("cc" => "XCD", "symbol" => "EC$", "name" => "East Caribbean dollar"),
// array("cc" => "XDR", "symbol" => "SDR", "name" => "Special Drawing Rights"),
// array("cc" => "XOF", "symbol" => "CFA", "name" => "West African CFA franc"),
// array("cc" => "XPF", "symbol" => "F", "name" => "CFP franc"),
// array("cc" => "YER", "symbol" => "YER", "name" => "Yemeni rial"),
// array("cc" => "ZAR", "symbol" => "R", "name" => "South African rand"),
// array("cc" => "ZMK", "symbol" => "ZK", "name" => "Zambian kwacha"),
// array("cc" => "ZWR", "symbol" => "Z$", "name" => "Zimbabwean dollar")
);
return response()->json(['status'=>'success','code'=>200,'data'=>$CURRENCY_DATA, 'totalRecord'=>count($CURRENCY_DATA)], 200);

53
app/Http/Controllers/DashboardController.php

@ -44,12 +44,9 @@ class DashboardController extends Controller
foreach ($dataPayload['project_id'] as $val) {
$dataMaxVersionGantt[] = $this->getMaxVersionGantt($val);
}
// SELECT * FROM public.m_activity where proyek_id = 11 and version_gantt_id=12 and parent_id IS NULL;
$dataFinal=[];
foreach ($dataMaxVersionGantt as $val) {
$data = Activity::select('m_activity.id', 'm_activity.proyek_id', 'm_activity.name', 'm_activity.kode_sortname', 'm_activity.persentase_progress', 'm_activity.persentase_bobot', 'm_activity.bobot_planning', 'mp.nama as proyek_name')->join("m_proyek as mp", "m_activity.proyek_id", "=", "mp.id")->where('proyek_id', $val['proyek_id'])->where('version_gantt_id', $val['last_version_gantt'])->whereNull('parent_id')->orderBy('id', 'asc')->get();
// loop
// hitung persentase_progress = persentase_progress*bobot_planning/100
$dataFinal[] = array("proyek_id" => $val['proyek_id'], "proyek_name" => isset($data) && count($data) > 0 ? $data[0]['proyek_name'] : "-", "version_gantt_id" => $val['last_version_gantt'], "data" => $data);
}
@ -73,42 +70,10 @@ class DashboardController extends Controller
}
}
// // cari titik last waypoint dari user di masing-masing project terpilih dari front end
// public function searchUserPresencePoints(Request $request) {
// $dataPayload = $request->all();
// $reqActivityId = [];
// foreach ($dataPayload['project_id'] as $val) {
// $reqActivityId[] = $this->getActivityByProjectId($val);
// }
// // var_dump(count($reqActivityId));
// $activity_id = [];
// $getPoints = false;
// if (count($reqActivityId) > 0) {
// for ($i=0; $i < count($reqActivityId); $i++) {
// if (count($reqActivityId[$i]) > 0) {
// foreach($reqActivityId[$i] as $reqAct) {
// array_push($activity_id, $reqAct->id);
// }
// }
// }
// }
// if (count($activity_id) > 0) {
// // $getPoints = ReportActivity::select('report_activity.*', 'm_activity.name as activity_name', 'm_proyek.nama as proyek_name')
// // ->leftJoin('m_activity', 'm_activity.id', '=', 'report_activity.activity_id')
// // ->leftJoin('m_proyek', 'm_proyek.id', '=', 'm_activity.proyek_id')
// // ->whereIn('report_activity.activity_id', $activity_id)->get();
// // $getPoints =
// }
// if($getPoints){
// return response()->json(['status'=>'success','code'=>200,'data'=>$getPoints, 'totalRecord'=>count($getPoints)], 200);
// }else{
// return response()->json(['status'=>'failed','message'=>'failed get list points, please try again later!','code'=>400], 400);
// }
// }
public function getActivityByProjectId($projectId) {
$output = [];
@ -171,15 +136,12 @@ class DashboardController extends Controller
$progress_percentage = Activity::where('proyek_id', $reqProject[$i]['project_id'])->whereNull('parent_id')->where('version_gantt_id', $last_version_gantt)->sum("persentase_progress");
$count_progress_percentage = Activity::where('proyek_id', $reqProject[$i]['project_id'])->whereNull('parent_id')->where('version_gantt_id', $last_version_gantt)->count("persentase_progress");
// progress_actual = bobot_planning * persentase_progress
$progress_actual = Activity::select('id', 'bobot_planning', 'persentase_progress')->where('proyek_id', $reqProject[$i]['project_id'])->whereNull('parent_id')->where('version_gantt_id', $last_version_gantt)->get();
$current_progress = 0;
foreach($progress_actual as $objRow) {
// $total_current = ($objRow->bobot_planning * $objRow->persentase_progress) / 100;
$current_progress += ($objRow->bobot_planning * $objRow->persentase_progress) / 100;
}
// yang sudah difilter dengan max_version_gantt
if (count($reqProject[$i]['activity_id']) > 0) {
for ($j=0; $j < count($reqProject[$i]['activity_id']); $j++) {
$sum_job_count_report = ReportActivity::whereIn('activity_id', $reqProject[$i]['activity_id'])->sum("job_count_report");
@ -190,7 +152,6 @@ class DashboardController extends Controller
return response()->json(['status'=>'failed','message'=>'Project with id='.$reqProject[$i]['project_id'].' is not found!','code'=>400], 400);
}
// sisa hari
$now = time();
$akhir_proyek = strtotime($queryProject->akhir_proyek);
$datediff = $akhir_proyek - $now;
@ -230,15 +191,12 @@ class DashboardController extends Controller
foreach ($dataPayload['project_id'] as $val) {
$dataMaxVersionGantt[] = $this->getMaxVersionGantt($val);
}
// SELECT * FROM public.m_activity where proyek_id = 11 and version_gantt_id=12 and parent_id IS NULL;
$dataFinal=[];
foreach ($dataMaxVersionGantt as $val) {
$data = Activity::select('m_activity.id', 'm_activity.proyek_id', 'm_activity.name', 'm_activity.kode_sortname', 'm_activity.persentase_progress', 'm_activity.persentase_bobot', 'm_activity.bobot_planning', 'm_activity.biaya_actual', 'mp.nama as proyek_name')->join("m_proyek as mp", "m_activity.proyek_id", "=", "mp.id")->where('proyek_id', $val['proyek_id'])->where('version_gantt_id', $val['last_version_gantt'])->whereNull('parent_id')->orderBy('id', 'asc')->get();
$totalCostPlanning = Activity::where('proyek_id', $val['proyek_id'])->where('version_gantt_id', $val['last_version_gantt'])->whereNull('parent_id')->sum('rencana_biaya');
// loop
$dataBobotPlan =[];
for ($i=0; $i < count($data); $i++) {
// if($i)
$tmpp = 0;
$tmpa = 0;
$tmpbc = 0;
@ -250,7 +208,6 @@ class DashboardController extends Controller
$tmpac += $data[$x]['biaya_actual'];
}
// $dataBobotPlan[] = $tmp;
$data[$i]['cal_bobot_p'] = round($tmpp,2);
if($i > 0 ){
if($data[$i-1]['cal_bobot_a'] != null){
@ -267,7 +224,6 @@ class DashboardController extends Controller
}
$data[$i]['cal_budget_cost'] = round($tmpbc,2);
// $data[$i]['cal_actual_cost']=round($tmpac,2);
if($i > 0 ){
if($data[$i-1]['cal_actual_cost'] != null){
if($data[$i-1]['cal_actual_cost'] == round($tmpac,2)){
@ -282,7 +238,6 @@ class DashboardController extends Controller
$data[$i]['cal_actual_cost'] = round($tmpac,2);
}
}
// hitung persentase_progress = persentase_progress*bobot_planning/100
$dataFinal[] = array("proyek_id" => $val['proyek_id'], "proyek_name" => isset($data) && count($data) > 0 ? $data[0]['proyek_name'] : "-", "version_gantt_id" => $val['last_version_gantt'], "data" => $data);

9
app/Http/Controllers/DivisiController.php

@ -7,9 +7,7 @@ use App\Models\Divisi;
class DivisiController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'name' => 'required',
'description' => 'required'
@ -66,19 +64,12 @@ class DivisiController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_divisi');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

2
app/Http/Controllers/ExampleController.php

@ -11,8 +11,6 @@ class ExampleController extends Controller
*/
public function __construct()
{
//
}
//
}

9
app/Http/Controllers/FolderDocumentProyekController.php

@ -8,7 +8,6 @@ use App\Models\DokumenProject;
class FolderDocumentProyekController extends Controller
{
//insert data
public function add(Request $request){
$this->validate($request, [
'name_folder' => 'required',
@ -66,19 +65,12 @@ class FolderDocumentProyekController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_FolderDocumentProyek');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
@ -97,7 +89,6 @@ class FolderDocumentProyekController extends Controller
{
$data = FolderDocumentProyek::where('proyek_id', $id)->whereNull('parent_id')->orderByRaw('id ASC')->get();
$dataFile = DokumenProject::where('type_dokumen', 'project-document-out-folder')->where('ref_id', $id)->orderByRaw('id ASC')->get();
// var_dump($dataFile);
$finalData = [];
foreach($data as $objRow){
$objRow->children = $this->getChildren($id, $objRow->id);

8
app/Http/Controllers/HolidayController.php

@ -92,20 +92,12 @@ class HolidayController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_holidays');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

14
app/Http/Controllers/HumanResourceController.php

@ -9,17 +9,10 @@ use App\Models\UserToProyek;
class HumanResourceController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'role_id' => 'required',
// 'username' => 'required',
// 'password' => 'required',
'name' => 'required',
// 'phone_number' => 'required',
// 'email' => 'required',
// 'address' => 'required',
'ktp_number' => 'required',
'employee_type' => 'required'
]);
@ -103,19 +96,12 @@ class HumanResourceController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_users');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

7
app/Http/Controllers/ImageController.php

@ -69,19 +69,12 @@ class ImageController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_image');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

10
app/Http/Controllers/MaterialResourceController.php

@ -89,20 +89,12 @@ class MaterialResourceController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_material_resource');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
@ -124,10 +116,8 @@ class MaterialResourceController extends Controller
$projectId = $request->idProyek;
if($search && !empty($search)){
// $data = MaterialResource::where("name", 'ilike', '%'.$search.'%')->get();
$data = RequestMaterial::where("description", 'ilike', '%'.$search.'%')->get();
}else{
// $data = MaterialResource::all();
$data = RequestMaterial::Where("proyek_id", $projectId)->get();
}

8
app/Http/Controllers/MenuController.php

@ -89,20 +89,12 @@ class MenuController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_menu');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/OfficeHoursController.php

@ -85,20 +85,12 @@ class OfficeHoursController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_office_hours');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/PanicButtonController.php

@ -8,7 +8,6 @@ use App\Models\PanicButton;
class PanicButtonController extends Controller
{
public function add(Request $request){
//validasi
$this->validate($request, [
'user_id' => 'required',
'lat' => 'required',
@ -88,19 +87,12 @@ class PanicButtonController extends Controller
public function search(Request $request)
{
// payload same like in golang API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 't_panic_button');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

108
app/Http/Controllers/PresenceController.php

@ -12,22 +12,16 @@ use Illuminate\Support\Facades\DB;
class PresenceController extends Controller
{
//const NOMINATIM_ADDR = "https://nominatim.oslogdev.com"; // https://nominatim.oslogdev.com/reverse?lat=-6.010201&lon=106.0162715&format=json
public function add(Request $request)
{
$this->validate($request, [
'user_id' => 'required'
]);
//var_dump($request);
if($request->type=="out"){
$clock_out_loc = "-";
// if (isset($request->clock_out_lat) && isset($request->clock_out_lng)) {
// $response = Http::get(config('api.nominatim') . "/reverse?lat=".$request->clock_out_lat."&lon=".$request->clock_out_lng."&format=json");
// $clock_out_loc = $response->json()["display_name"];
// }
$dataUpdate = array(
"clock_out"=>$request->clock_time,
"clock_out_lat" => $request->clock_out_lat,
@ -40,10 +34,6 @@ class PresenceController extends Controller
if($resultUpdate && $resultUpdate > 0){
return response()->json(['status'=>'success', 'id'=>$resultUpdate,'message'=>'clock out success!','code'=>200], 200);
}
// enable multiple clock out at same day, so I commented this
// else if($resultUpdate=="has presence"){
// return response()->json(['status'=>'failed','message'=>'clock in failed, user has made presence today!','code'=>400], 400);
// }
else{
return response()->json(['status'=>'failed','message'=>'clock out failed please try again!','code'=>400], 400);
}
@ -53,18 +43,8 @@ class PresenceController extends Controller
$date = date_create($request->clock_time);
$onlyDate = date_format($date,"Y-m-d");
// enable multiple clock in at same day, so I commented this
// $cek = Presence::where('user_id',$request->user_id)->where("date_presence", $onlyDate)->count();
// if($cek > 0){
// return response()->json(['status'=>'failed','message'=>'clock in failed, user has made presence today!','code'=>400], 400);
// die();
// }
$clock_in_loc = "-";
// if (isset($request->clock_in_lat) && isset($request->clock_in_lng)) {
// $response = Http::get(config('api.nominatim') . "/reverse?lat=".$request->clock_in_lat."&lon=".$request->clock_in_lng."&format=json");
// $clock_in_loc = $response->json()["display_name"];
// }
$dataAdd = array(
'user_id'=> $request->user_id,
@ -100,50 +80,16 @@ class PresenceController extends Controller
}
}
// public function clockinout($id) {
// $client = new Client();
// $res = $client->request('GET', config('api.golang') . "/clockinout/{$id}");
// if ($res->getStatusCode() != 200) {
// return response()->json(['status'=>'failed','message'=>'failed get data clockinout, please try again later!','code'=>400], 400);
// }
// $result= $res->getBody();
// return response($result, 200)
// ->header("content-type", $res->getHeaderLine('content-type'));
// }
public function clockinout($id) {
$dateTimeNow = Carbon::now()->addHour(7);
// ambil data t_clockinout where user_id
$dataPresence = Presence::where('user_id', $id)->orderBy('id', 'DESC')->first();
// ambil data working hour shift
// $dataShift = DB::table('t_users_monthly_shift')->where('user_id', $id)->orderBy('id', 'DESC')->first();
// if($dataShift){
// // cek ke jsonb
// }else{
// $dataWorkingHour = DB::table('m_shift')->where('is_non_shift', 't')->first();
// }
// $dataWorkingHour->start_time;
// $dataWorkingHour->end_time;
// $dataWorkingHour->flex_time_minute;
// if(Carbon::now()->format('H') == ){
// $in_working_time =
// }
if($dataPresence){
// "id": 131,
// "at": "2022-04-13T02:31:44.913587582+07:00",
// "user_id": 330,
// "clock_in": null,
// "clock_out": null,
// "last_clock_in": "2022-04-11T07:44:05+07:00",
// "last_clock_out": "2022-04-11T16:05:01+07:00",
// "start_at": "2022-04-12T04:59:59+07:00",
// "end_at": "2022-04-14T00:59:01+07:00",
// "in_working_time": true
$dateNow = date("Y-m-d");
$dateA = strtotime($dataPresence->clock_in);
$dayClockin = date("Y-m-d", $dateA);
@ -154,18 +100,14 @@ class PresenceController extends Controller
$clock_in = null;
$clock_out = null;
}
// new \DateTime($minDate)
$res_data = array(
"id" => $dataPresence->id,
// "at"=> Carbon::now()->timezone('Asia/Jakarta'),
"at" => $dateTimeNow,
"user_id"=> $id,
"clock_in"=> $clock_in,
"clock_out"=> $clock_out,
"last_clock_in"=> $dataPresence->clock_in,
"last_clock_out"=> $dataPresence->clock_out,
// "start_at"=> "2022-04-12T04=>59=>59+07=>00",
// "end_at"=> "2022-04-14T00=>59=>01+07=>00",
"in_working_time"=> true
);
return response()->json(['status'=>'success','data'=>$res_data,'code'=>200], 200);
@ -178,8 +120,6 @@ class PresenceController extends Controller
"clock_out"=> null,
"last_clock_in"=> null,
"last_clock_out"=> null,
// "start_at"=> "2022-04-12T04=>59=>59+07=>00",
// "end_at"=> "2022-04-14T00=>59=>01+07=>00",
"in_working_time"=> true
);
return response()->json(['status'=>'success','data'=>$res_data,'code'=>200], 200);
@ -191,12 +131,6 @@ class PresenceController extends Controller
$onlyDate = date_format($date,"Y-m-d");
// enable multiple clock out at same day, so I commented this
// $cek = Presence::where('user_id', $id)->where("date_presence", $onlyDate)->whereNotNull('clock_out')->count();
// if($cek > 0){
// return "has presence";
// die();
// }
$dataPresence = Presence::where('user_id',$id)
->where("clock_in", "<=", $data["clock_out"])
@ -261,44 +195,15 @@ class PresenceController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 't_clock_in_out');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
$finalData = [];
// foreach ($dataGet as $objRow) {
// // each clock_in_lat, clock_in_lng request to Address API and push clock_in_location to $dataGet
// // format clock_in_loc (full address / display_name) for now
// $clock_in_lat = $objRow->clock_in_lat;
// $clock_in_lng = $objRow->clock_in_lng;
// $objRow->clock_in_loc = "";
// if (isset($clock_in_lat) && isset($clock_in_lng)) {
// $response = Http::get(self::NOMINATIM_ADDR . "/reverse?lat=".$clock_in_lat."&lon=".$clock_in_lng."&format=json");
// $objRow->clock_in_loc = $response->json()["display_name"];
// }
// // each clock_out_lat, clock_out_lng request to Address API and push clock_out_location to $dataGet
// // format clock_out_loc (full adrress / display_name) for now
// $clock_out_lat = $objRow->clock_out_lat;
// $clock_out_lng = $objRow->clock_out_lng;
// $objRow->clock_out_loc = "";
// if (isset($clock_out_lat) && isset($clock_out_lng)) {
// $response = Http::get(self::NOMINATIM_ADDR . "/reverse?lat=".$clock_out_lat."&lon=".$clock_out_lng."&format=json");
// $objRow->clock_out_loc = $response->json()["display_name"];
// }
// $finalData[] = $objRow;
// }
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
@ -321,8 +226,6 @@ class PresenceController extends Controller
foreach($data as $objRow) {
$presence = Presence::find($objRow->id);
// each clock_in_lat, clock_in_lng request to Address API and push clock_in_location to $dataGet
// format clock_in_loc (full address / display_name) for now
$clock_in_lat = $objRow->clock_in_lat;
$clock_in_lng = $objRow->clock_in_lng;
$objRow->clock_in_loc = "";
@ -331,8 +234,6 @@ class PresenceController extends Controller
$objRow->clock_in_loc = $response->json()["display_name"];
}
// each clock_out_lat, clock_out_lng request to Address API and push clock_out_location to $dataGet
// format clock_out_loc (full adrress / display_name) for now
$clock_out_lat = $objRow->clock_out_lat;
$clock_out_lng = $objRow->clock_out_lng;
$objRow->clock_out_loc = "";
@ -341,7 +242,6 @@ class PresenceController extends Controller
$objRow->clock_out_loc = $response->json()["display_name"];
}
// $finalData[] = $objRow;
$presence->clock_in_loc = $objRow->clock_in_loc;
$presence->clock_out_loc = $objRow->clock_out_loc;

8
app/Http/Controllers/ProjectApprovalController.php

@ -109,20 +109,12 @@ class ProjectApprovalController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'project_approval');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

53
app/Http/Controllers/ProjectCharterController.php

@ -9,12 +9,6 @@ class ProjectCharterController extends Controller
{
public function add(Request $request)
{
// $this->validate($request, [
// 'nama' => 'required',
// 'keterangan' => 'required',
// 'mulai_proyek' => 'required',
// 'akhir_proyek' => 'required'
// ]);
$data = $request->all();
@ -29,20 +23,8 @@ class ProjectCharterController extends Controller
}
}
// public function edit($id){
// if(!$id || (int) $id < 0 || $id==""){
// return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400);
// die();
// }
// $result = Project::find($id);
// if($result){
// return response()->json(['status'=>'success','code'=>200,'data'=>$result], 200);
// }else{
// return response()->json(['status'=>'failed','message'=>'failed get data project, please try again later!','code'=>400], 400);
// }
// }
public function update(Request $request, $id)
{
@ -67,53 +49,20 @@ class ProjectCharterController extends Controller
}
}
// public function delete($id)
// {
// $data = Project::find($id);
// if($data){
// $delete = $data->delete();
// }else{
// return response()->json(['status'=>'failed','message'=>'data project not found!','code'=>400], 400);
// die();
// }
// if($delete){
// return response()->json(['status'=>'success','message'=>'data project successfully deleted!','code'=>200], 200);
// }else{
// return response()->json(['status'=>'failed','message'=>'data project failed deleted!','code'=>400], 400);
// }
// }
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'project_charter');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
// public function list()
// {
// $data = Project::all();
// $countData = $data->count();
// if($data){
// return response()->json(['status'=>'success','code'=>200,'data'=>$data, 'totalRecord'=>$countData], 200);
// }else{
// return response()->json(['status'=>'failed','message'=>'failed get list project, please try again later!','code'=>400], 400);
// }
// }
}

9
app/Http/Controllers/ProjectController.php

@ -34,7 +34,6 @@ class ProjectController extends Controller
{
$this->validate($request, [
'nama' => 'required',
// 'keterangan' => 'required',
'mulai_proyek' => 'required',
'akhir_proyek' => 'required',
'rencana_biaya' => 'required',
@ -210,20 +209,12 @@ class ProjectController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_proyek');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

9
app/Http/Controllers/ProjectDokumenController.php

@ -38,7 +38,6 @@ class ProjectDokumenController extends Controller
public function uploadProjectDokumen(Request $request)
{
if($request->hasFile('dokumen')){
// $project_id = $request->project_id;
$dokumen = $request->file('dokumen');
$ref_id = $request->ref_id;
$extension = $dokumen->extension();
@ -47,7 +46,6 @@ class ProjectDokumenController extends Controller
$result = $dokumen->move($this->pathDocument, $name);
if($result){
$data = [
// 'ref_id' => (int)$project_id,
'ref_id' => (int)$ref_id,
'file' => $name,
'type_dokumen' => isset($request->type_dokumen) ? $request->type_dokumen : 'project-document' // project-document-in-folder / project-document-out-folder
@ -71,19 +69,12 @@ class ProjectDokumenController extends Controller
}
public function searchDocProject(Request $request){
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'document_project');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/ProjectMileStoneController.php

@ -111,20 +111,12 @@ class ProjectMileStoneController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'project_milestone');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/ProjectParticipantsController.php

@ -108,20 +108,12 @@ class ProjectParticipantsController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'project_participants');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/ProjectRoleController.php

@ -86,20 +86,12 @@ class ProjectRoleController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_role_proyek');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

9
app/Http/Controllers/ProjectToChecklistK3Controller.php

@ -7,9 +7,7 @@ use App\Models\ProjectToChecklistK3;
class ProjectToChecklistK3Controller extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'proyek_id' => 'required',
'checklist_k3_id' => 'required'
@ -119,19 +117,12 @@ class ProjectToChecklistK3Controller extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'proyek_to_checklist_k3');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/ProjectTypeController.php

@ -86,20 +86,12 @@ class ProjectTypeController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_type_proyek');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/RateSallaryController.php

@ -86,20 +86,12 @@ class RateSallaryController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'rate_cost_hr');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

9
app/Http/Controllers/ReportActivityController.php

@ -188,20 +188,12 @@ class ReportActivityController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'report_activity');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
@ -224,7 +216,6 @@ class ReportActivityController extends Controller
$reqActivityId[] = $this->getActivityByProjectId($val);
}
// var_dump(count($reqActivityId));
$activity_id = [];
$getPoints = false;

52
app/Http/Controllers/ReportActivityMaterialController.php

@ -12,12 +12,9 @@ class ReportActivityMaterialController extends Controller
{
public function add(Request $request){
//validasi
$this->validate($request, [
'activity_id' => 'required',
// 'assign_material_id' => 'required',
'qty' => 'required'
// 'budget' => 'required'
]);
$valAssignMaterialId = AssignMaterial::where('activity_id', $request->activity_id)->first();
@ -35,7 +32,6 @@ class ReportActivityMaterialController extends Controller
$costActualNew = $costActualOld + ($price*$request->qty);
$updateActivity->biaya_actual = $costActualNew;
$updateActivity->save();
// return response()->json(['status'=>'success','message'=>'Assign material successfull created, and update cost plan success '.$costPlanNew,'code'=>200]);
$result = ReportActivityMaterial::create($data);
if($result){
$this->countForProgress($request->activity_id);
@ -49,22 +45,7 @@ class ReportActivityMaterialController extends Controller
}
public function updateStatusStartFinish(Request $request){
// $updateData = AssignMaterial::find($request->assign_material_id);
// if($updateData){
// $updateData->start_activity = $request->start_activity;
// $updateData->finish_activity = $request->finish_activity;
// $updateData->status_activity = $request->status_activity;
// $updateData->save();
// if($request->status_activity == 'done'){
// $dataUpdate = array(
// "persentase_progress" => 100,
// "updated_by" => $this->currentName
// );
// Activity::where('id', $updateData->activity_id)->update($dataUpdate);
// }
// return response()->json(['status'=>'success','message'=>'Update data status successfully ', 'code'=>200]);
// }
$payloadUpdate = array(
'start_activity' => $request->start_activity,
'finish_activity' => $request->finish_activity,
@ -73,10 +54,6 @@ class ReportActivityMaterialController extends Controller
$updateData = AssignMaterial::where('activity_id',$request->activity_id)
->update($payloadUpdate);
if($updateData){
// $updateData->start_activity = $request->start_activity;
// $updateData->finish_activity = $request->finish_activity;
// $updateData->status_activity = $request->status_activity;
// $updateData->save();
if($request->status_activity == 'done'){
$dataUpdate = array(
"persentase_progress" => 100,
@ -114,7 +91,6 @@ class ReportActivityMaterialController extends Controller
private function countForProgress($id)
{
// $totalJobs = ReportActivityMaterial::where('activity_id', $id)->sum("qty");
$dataActivity = Activity::find($id);
$dataPlan = AssignMaterial::where('activity_id', $id)->get();
$tmpPercentage1 = [];
@ -126,7 +102,6 @@ class ReportActivityMaterialController extends Controller
$qty_plan = $value->qty_planning;
$status_activity = $value->status_activity;
// get volume actual
$getDataVolActual = ReportActivityMaterial::where('assign_material_id', '=', $value->id)->sum("qty");
$percentage1 = ($getDataVolActual * 100) / $qty_plan;
@ -143,15 +118,8 @@ class ReportActivityMaterialController extends Controller
$totalPercentage = 0;
}
// if ($jobsActivity < 1) {
// return false;
// }
// if ($totalJobs < 1) {
// return false;
// }
// $persentaseActual = ($totalJobs/$jobsActivity)*100;
$dataUpdate = array(
"persentase_progress" => $totalPercentage,
@ -163,23 +131,17 @@ class ReportActivityMaterialController extends Controller
public function countForProgressTest()
{
$dataPlan = AssignMaterial::where('activity_id', 807)->get();
// $jobsActivity = (int)$dataActivity->qty_planning;
$tmpPercentage1 = [];
if(!$dataPlan->isEmpty()){
foreach ($dataPlan as $value) {
# code...
// price per material
$price = $value->material_id;
$qty_plan = $value->qty_planning;
$status_activity = $value->status_activity;
// get volume actual
$getDataVolActual = ReportActivityMaterial::where('assign_material_id', '=', $value->id)->sum("qty");
$percentage1 = ($getDataVolActual * 100) / $qty_plan;
// if($qty_plan == null){
// $tmpPercentage1[] = 0
// }else{
$percentage1 = ($getDataVolActual * 100) / $qty_plan;
if($status_activity == 'done'){
$tmpPercentage1[] = $percentage1 > 100 ? 100 : $percentage1;
@ -188,7 +150,6 @@ class ReportActivityMaterialController extends Controller
}else{
$tmpPercentage1[] = $percentage1 >= 100 ? 90 : $percentage1;
}
// }
}
@ -202,19 +163,12 @@ class ReportActivityMaterialController extends Controller
public function search(Request $request)
{
// payload same like in golang API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'report_activity_material');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
@ -248,12 +202,8 @@ class ReportActivityMaterialController extends Controller
})
->rawColumns(['action'])->make(true);
}else{
// $data = AssignMaterial::select("assign_material_to_activity.*","m.name as material_name", "m.uom as uom")->join("m_material_resource as m", "m.id", "=", "assign_material_to_activity.material_id")->where('assign_material_to_activity.activity_id', $id_activity)->get();
$data = ReportActivityMaterial::select("report_activity_material.*", "u.name as human_resource")
// ->join("assign_material_to_activity as am_ta", "am_ta.id","=", "report_activity_material.assign_material_id")
// ->join("m_req_material as m", "m.id", "=", "am_ta.material_id")
->join("m_users as u", "u.id", "=", "report_activity_material.user_id")
// ->where('report_activity_material.assign_material_id', $id_assign_material_id)
->where('report_activity_material.activity_id', $id_activity)
->orderBy('report_activity_material.report_date', 'asc')
->get();

10
app/Http/Controllers/ReportK3Controller.php

@ -108,17 +108,11 @@ class ReportK3Controller extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 't_report_k3');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// get another child data
if($request->has("child_data")){
$newDataGet = [];
$dataChild = $request->child_data;
@ -128,7 +122,6 @@ class ReportK3Controller extends Controller
foreach ($dataGet as $value) {
$resultData = DB::table($dataChild['table_name'])->where($columnSelf,$value->{$columnForeign})->get();
$value->childData = $resultData;
// only for report k3
$value->k3_checked = $resultData->pluck("name_checklist_k3")->all();
$dataImage = Image::where("category", "report_k3")->where("ref_id", $value->id)->first();
if($dataImage){
@ -139,15 +132,12 @@ class ReportK3Controller extends Controller
$idsChecklist = $resultData->pluck("checklist_k3_id")->all();
$CheklistK3Ids = ProjectToChecklistK3::whereNotIn("checklist_k3_id", $idsChecklist)->where("proyek_id", $value->proyek_id)->pluck("checklist_k3_id");
$value->k3_not_checked = ChecklistK3::whereIn("id", $CheklistK3Ids)->pluck("name")->all();
// === //
$newDataGet[] = $value;
}
$dataGet = $newDataGet;
}
}
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/ReportK3DetailController.php

@ -87,20 +87,12 @@ class ReportK3DetailController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 't_report_k3_detail');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

34
app/Http/Controllers/RequestMaterialController.php

@ -48,28 +48,11 @@ class RequestMaterialController extends Controller
}
}
// public function update(Request $request, $id){
// if(!$id || (int) $id < 0 || $id==""){
// return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400);
// }
// $data = RequestMaterial::find($id);
// if($data){
// $result = $data->update($request->all());
// }else{
// return response()->json(['status'=>'failed','message'=>'data request material not found!','code'=>400], 400);
// die();
// }
// if($result){
// return response()->json(['status'=>'success','message'=>'request material successfully updated!','code'=>200], 200);
// }else{
// return response()->json(['status'=>'failed','message'=>'request material failed updated!','code'=>400], 400);
// }
// }
public function delete($id)
{
@ -92,19 +75,12 @@ class RequestMaterialController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_req_material');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
@ -130,7 +106,6 @@ class RequestMaterialController extends Controller
$data = RequestMaterial::find($id);
if($data){
if(!isset($dataForm['status'])){
// return response()->json(['status'=>'failed','message'=>'status is required!','code'=>400], 400);
$resultUpdate = $data->update($request->all());
if($resultUpdate){
return response()->json(['status'=>'success','message'=>'request material successfully updated!','code'=>200], 200);
@ -140,8 +115,6 @@ class RequestMaterialController extends Controller
die();
}
if($dataForm['status']=="receipt to warehouse"){
// $result = $data->update($request->all());
// if($result){
$dataM = MaterialResource::where('name', 'ilike', $data->description)->first();
if($dataM){
$result = $data->update($request->all());
@ -167,12 +140,8 @@ class RequestMaterialController extends Controller
}
}
// }else{
// return response()->json(['status'=>'failed','message'=>'update status receipt to warehouse request material resource failed!','code'=>400], 400);
// }
}else if($dataForm['status']=="receipt to site"){
$result = $data->update($request->all());
// if($result){
$dataM = MaterialResource::where('name', 'ilike', $data->description)->first();
if($dataM){
$result = $data->update($request->all());
@ -187,9 +156,6 @@ class RequestMaterialController extends Controller
}else{
return response()->json(['status'=>'failed','message'=>'update status receipt to site request material resource failed, because material is not exist in warehouse!','code'=>400], 400);
}
// }else{
// return response()->json(['status'=>'failed','message'=>'update status receipt to site request material resource failed!','code'=>400], 400);
// }
}else{
$resultUpdate = $data->update($request->all());
if($resultUpdate){

8
app/Http/Controllers/RoleController.php

@ -85,20 +85,12 @@ class RoleController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_roles');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

7
app/Http/Controllers/RoleMenuController.php

@ -91,19 +91,12 @@ class RoleMenuController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 't_roles_menu');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
}

8
app/Http/Controllers/SatuanController.php

@ -86,20 +86,12 @@ class SatuanController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_satuan');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

9
app/Http/Controllers/ShiftController.php

@ -7,9 +7,7 @@ use App\Models\Shift;
class ShiftController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'label' => 'required',
'flex_time_minute' => 'required',
@ -68,19 +66,12 @@ class ShiftController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_shift');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

1
app/Http/Controllers/TBroadcastController.php

@ -6,5 +6,4 @@ use Illuminate\Http\Request;
class TBroadcastController extends Controller
{
//
}

9
app/Http/Controllers/TemplateGanttController.php

@ -7,9 +7,7 @@ use App\Models\TemplateGantt;
class TemplateGanttController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'proyek_type_id' => 'required',
'name_activity' => 'required'
@ -81,19 +79,12 @@ class TemplateGanttController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_template_gantt');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

31
app/Http/Controllers/ToolsRequestController.php

@ -8,9 +8,7 @@ use App\Models\ToolsResource;
class ToolsRequestController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'asset_type' => 'required',
'asset_name' => 'required',
@ -24,7 +22,6 @@ class ToolsRequestController extends Controller
$data['created_by'] = $this->currentName;
$result = ToolsRequest::create($data);
// return response()->json($author, 201);
if($result){
return response()->json(['status'=>'success','message'=>'Tools Request Project successfull created','code'=>200]);
}else{
@ -32,25 +29,8 @@ class ToolsRequestController extends Controller
}
}
// public function update(Request $request, $id){
// if(!$id || (int) $id < 0 || $id==""){
// return response()->json(['status'=>'failed','message'=>'id is required!','code'=>400], 400);
// }
// $data = ToolsRequest::find($id);
// if($data){
// $result = $data->update($request->all());
// }else{
// return response()->json(['status'=>'failed','message'=>'data Tools Request Project not found!','code'=>400], 400);
// die();
// }
// if($result){
// return response()->json(['status'=>'success','message'=>'Tools Request Project successfully updated!','code'=>200], 200);
// }else{
// return response()->json(['status'=>'failed','message'=>'Tools Request Project failed updated!','code'=>400], 400);
// }
// }
public function update(Request $request, $id)
{
@ -141,19 +121,12 @@ class ToolsRequestController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_req_tools');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/ToolsResourceController.php

@ -88,20 +88,12 @@ class ToolsResourceController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_tools_resource');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

11
app/Http/Controllers/UserMonthlyShiftController.php

@ -8,9 +8,7 @@ use GuzzleHttp\Client;
class UserMonthlyShiftController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'user_id' => 'required',
'schedules' => 'required',
@ -92,23 +90,15 @@ class UserMonthlyShiftController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_shift');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
// List this month's shift schedule
public function list()
{
return $this->listYYYYMM(date('Ym'));
@ -116,7 +106,6 @@ class UserMonthlyShiftController extends Controller
public function listYYYYMM($yyyymm)
{
// Kadang start_time bisa jadi tanggal awal-bulan - 1 hari
/*
$data = UserMonthlyShift::where("to_char(start_at+INTERVAL '1 day', 'YYYYMM')", $yyyymm)
->all();

10
app/Http/Controllers/UserToActivityController.php

@ -12,9 +12,7 @@ use Datatables;
class UserToActivityController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'activity_id' => 'required',
'user_id' => 'required'
@ -36,7 +34,6 @@ class UserToActivityController extends Controller
$costPlanNew = $costPlanOld + $costUser;
$updateActivity->rencana_biaya = $costPlanNew;
$updateActivity->save();
// UserToProyek::where('user_id', $request->user_id)->update(['rencana_biaya' => $costPlanNew]);
return response()->json(['status'=>'success','message'=>'user to activity gantt Project successfull created, and cost plant successfull update '.$costPlanNew,'code'=>200]);
}else{
return response()->json(['status'=>'success','message'=>'user to activity gantt Project successfull created','code'=>200]);
@ -176,19 +173,12 @@ class UserToActivityController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'assign_hr_to_activity');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

7
app/Http/Controllers/UserToProyekController.php

@ -112,19 +112,12 @@ class UserToProyekController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'assign_hr_to_proyek');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

9
app/Http/Controllers/UserToShiftController.php

@ -7,9 +7,7 @@ use App\Models\UserShift;
class UserToShiftController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'user_id' => 'required',
'from_date' => 'required'
@ -67,19 +65,12 @@ class UserToShiftController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 't_users_shift');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

9
app/Http/Controllers/UserToVersionGanttController.php

@ -7,9 +7,7 @@ use App\Models\UserToVersionGantt;
class UserToVersionGanttController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'user_id' => 'required',
'version_gantt_id' => 'required'
@ -119,19 +117,12 @@ class UserToVersionGanttController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'user_to_version_gantt');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

9
app/Http/Controllers/VersionGanttController.php

@ -7,9 +7,7 @@ use App\Models\VersionGantt;
class VersionGanttController extends Controller
{
//insert data
public function add(Request $request){
//validasi
$this->validate($request, [
'name_version' => 'required',
'description' => 'required',
@ -82,19 +80,12 @@ class VersionGanttController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_version_gantt');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

8
app/Http/Controllers/WaypointController.php

@ -87,20 +87,12 @@ class WaypointController extends Controller
public function search(Request $request)
{
// payload same like in goland API oke
$payload = $request->all();
// second parameter is table name
$dataBuilder = $this->setUpPayload($payload, 'm_waypoint');
// builder for get data
$builder = $dataBuilder['builder'];
// builder for count data
$countBuilder = $dataBuilder['count'];
// execute builder
$dataGet = $builder->get();
// execute count builder
$totalRecord = $countBuilder->count();
// dd($totalRecord);
// send response about the result
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}

2
app/Jobs/ExampleJob.php

@ -11,7 +11,6 @@ class ExampleJob extends Job
*/
public function __construct()
{
//
}
/**
@ -21,6 +20,5 @@ class ExampleJob extends Job
*/
public function handle()
{
//
}
}

2
app/Libs/CustomHash/CustomHasher.php

@ -14,8 +14,6 @@ class CustomHasher implements HasherContract {
* @return string
*/
public function make($value, array $options = array()) {
//I have custom encoding / encryption here//
//Define your custom hashing logic here//
return base64_encode(base64_encode($value));
}

2
app/Listeners/ExampleListener.php

@ -15,7 +15,6 @@ class ExampleListener
*/
public function __construct()
{
//
}
/**
@ -26,6 +25,5 @@ class ExampleListener
*/
public function handle(ExampleEvent $event)
{
//
}
}

1
app/Models/DokumenProject.php

@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class DokumenProject extends Model
{
// define table
protected $table = 'document_project';
const CREATED_AT = 'created_at';

1
app/Models/MaterialProject.php

@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class MaterialProject extends Model
{
// define table
protected $table = 'material_to_proyek';
const CREATED_AT = 'created_at';

14
app/Models/Project.php

@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class Project extends Model
{
// define table
protected $table = 'm_proyek';
const CREATED_AT = 'created_at';
@ -26,23 +25,10 @@ class Project extends Model
'pm_id',
'type_proyek_id',
'persentase_progress',
// 'investor',
// 'finance',
'keterangan',
'durasi_proyek',
'progress_by_worklog',
// 'relevance',
// 'level',
'status',
// 'depens',
// 'can_write',
// 'start_is_milestone',
// 'end_is_milestone',
// 'collapsed',
// 'has_child',
// 'can_delete',
// 'can_write_on_parent',
// 'can_add',
'currency_simbol',
'currency_code',
'currency_name',

1
app/Models/ProjectCharter.php

@ -6,7 +6,6 @@ use Illuminate\Database\Eloquent\Model;
class ProjectCharter extends Model
{
// define table
protected $table = 'project_charter';
const CREATED_AT = 'created_at';

15
app/Models/User.php

@ -64,7 +64,6 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
return [];
}
/// --- belum terpakai, sementara pakai API golang ---
/**
* Get working hours for given timestamp
@ -79,17 +78,13 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
"to"=> Carbon::createFromTimeString($t, $tz)
);
// get Shift assignment
$userShift = UserShift::where('user_id', )
->orderByDesc('from_date')
->first();
// HAS SHIFT
$shift = null;
if ($userShift !== null)
{
// get date
//$ts = Carbon::parse($strTs);
$shiftId = null;
switch ($ts->shortEnglishDayOfWeek)
{
@ -116,22 +111,18 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
break;
}
// Holiday
if ($shiftId === null) {
return null;
}
$shift = Shift::where('id', $shiftId)->first();
} else {
// get default shift time (NON-SHIFT)
$shift = Shift::where('is_non_shift', true)
->orderByDesc('created_at')
->first();
}
// TODO: calendar holiday
// assign shift time
if ($shift !== null)
{
$from = Carbon::createFromTimeString($shift->start_time, $tz)
@ -149,7 +140,6 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
$workingTime['to'] = $to;
}
// return working time
return $workingTime;
}
@ -158,8 +148,6 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
*/
public function presenceStatus(Carbon $at = null, $tz = self::DEFAULT_TZ)
{
// response
// INSIDE, OUTSIDE, HOLIDAY
$ts = $at;
if ($at !== null)
@ -179,8 +167,6 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
$tsFrom = $from->secondsSinceMidnight();
$tsTo = $to->secondsSinceMidnight();
// working hours with different date
// e.g. 22:00 - 06:00 (nextday)
if ($from->greaterThan($to)) {
$tsMid = 24*60*60 - $tsFrom;
if ($tsSec >= $tsFrom || $tsSec < $tsTo) {
@ -197,7 +183,6 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
}
}
// Get clock-in/out
$clockIn = null;
$clockOut = null;
$inout = Presence::where('user_id', $this->id)

11
app/Models/UserMonthlyShift.php

@ -18,7 +18,6 @@ class UserMonthlyShift extends Model
'created_at', 'created_by', 'updated_at', 'updated_by'
];
// Custom properties
protected $appends = [
'user_name', 'user_ktp_number'
];
@ -34,7 +33,6 @@ class UserMonthlyShift extends Model
{
foreach ($users as $user) {
if ($user->id == $this->user_id) {
//Log::debug("User ID matched {$user->id}");
$this->setUserInfo($user);
break;
}
@ -53,33 +51,24 @@ class UserMonthlyShift extends Model
return $res;
}
// get monthly schedules
public static function monthlyWithUserInfo($yyyymm)
{
// fetch schedule with user name and KTP no
// get user_id that match the condition
$rawWhere = DB::raw("to_char(start_at+INTERVAL '1 day', 'YYYYMM')");
$userIds = UserMonthlyShift::where($rawWhere, $yyyymm)->select('user_id');
// Fetch users from database
$users = User::whereIn('id', $userIds)
->orderBy('id')
->select('id', 'name', 'ktp_number')
->get();
//var_dump($users);
//Log::info($users);
// Get all schedules
$schedules = UserMonthlyShift::where($rawWhere, $yyyymm)->get();
if ($schedules) {
foreach($schedules as $schedule)
{
$schedule->assignUserInfo($users);
//Log::debug($schedule);
}
}
//Log::debug($schedules);
return $schedules;
}

1
app/Providers/AppServiceProvider.php

@ -13,6 +13,5 @@ class AppServiceProvider extends ServiceProvider
*/
public function register()
{
//
}
}

5
app/Providers/AuthServiceProvider.php

@ -15,7 +15,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function register()
{
//
}
/**
@ -25,10 +24,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot()
{
// Here you may define how you wish users to be authenticated for your Lumen
// application. The callback which receives the incoming request instance
// should return either a User instance or null. You're free to obtain
// the User instance via an API token or any other method necessary.
$this->app['auth']->viaRequest('api', function ($request) {
if ($request->input('api_token')) {

1
app/Providers/CatchAllOptionsRequestsProvider.php

@ -13,7 +13,6 @@ class CatchAllOptionsRequestsProvider extends ServiceProvider
*/
public function boot()
{
//
}
/**

5
bootstrap/app.php

@ -77,9 +77,6 @@ $app->configure('assets');
|
*/
// $app->middleware([
// App\Http\Middleware\ExampleMiddleware::class
// ]);
$app->middleware([
App\Http\Middleware\CorsMiddleware::class
@ -102,9 +99,7 @@ $app->routeMiddleware([
$app->register(App\Providers\CatchAllOptionsRequestsProvider::class);
// $app->register(App\Providers\AppServiceProvider::class);
$app->register(App\Providers\AuthServiceProvider::class);
// $app->register(App\Providers\EventServiceProvider::class);
$app->register(Tymon\JWTAuth\Providers\LumenServiceProvider::class);
$app->register(Flipbox\LumenGenerator\LumenGeneratorServiceProvider::class);
class_alias('Yajra\DataTables\DataTables', 'Datatables');

1
database/seeders/DatabaseSeeder.php

@ -13,6 +13,5 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
// $this->call('UsersTableSeeder');
}
}

0
resources/views/.gitkeep

64
routes/web.php

@ -18,11 +18,8 @@ $router->get('/', function () use ($router) {
});
$router->group(['prefix'=>'api'], function () use ($router) {
// API route
// Login
$router->post('/login', 'AuthController@login');
// Role
$router->post('/role/search', 'RoleController@search');
$router->post('/role/add', 'RoleController@add');
$router->get('/role/edit/{id}', 'RoleController@edit');
@ -31,7 +28,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/role/list', 'RoleController@list');
// menu
$router->post('/menu/add', 'MenuController@add');
$router->get('/menu/edit/{id}', 'MenuController@edit');
$router->put('/menu/update/{id}', 'MenuController@update');
@ -39,34 +35,28 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->post('/menu/search', 'MenuController@search');
$router->get('/menu/management/{id}', 'MenuController@listMenu');
$router->get('/menu/list', 'MenuController@list');
// role menu
$router->post('/role-menu/add', 'RoleMenuController@add');
$router->put('/role-menu/update/{id}', 'RoleMenuController@update');
$router->delete('/role-menu/delete/{id}', 'RoleMenuController@delete');
$router->delete('/role-menu/delete-byrole/{id}', 'RoleMenuController@deleteByRole');
$router->post('/role-menu/search', 'RoleMenuController@search');
$router->get('/role-menu/get-role/{id}', 'RoleMenuController@listMenu');
// download dokumen no need token
$router->get('/document-project/download/{id}', 'ProjectDokumenController@downloadDokumen');
$router->group(['middleware' => 'auth'], function () use ($router) {
// API route need token to akses
// project dokumen
$router->post('/document-project/upload', 'ProjectDokumenController@uploadProjectDokumen');
$router->get('/document-project/get/{id}', 'ProjectDokumenController@dokumenByProyekId');
$router->delete('/document-project/delete/{id}', 'ProjectDokumenController@delete');
$router->post('/document-project/search', 'ProjectDokumenController@searchDocProject');
// activity dokumen
$router->post('/document-activity/upload', 'ActivityDokumenController@uploadProjectDokumen');
$router->get('/document-activity/get/{id}', 'ActivityDokumenController@dokumenByActivityId');
$router->delete('/document-activity/delete/{id}', 'ActivityDokumenController@delete');
$router->post('/document-activity/search', 'ActivityDokumenController@searchDocProject');
$router->get('/document-activity/download/{id}', 'ActivityDokumenController@downloadDokumen');
// project
$router->post('/project/search', 'ProjectController@search');
$router->post('/project/add', 'ProjectController@add');
$router->put('/project/update/{id}', 'ProjectController@update');
@ -74,12 +64,10 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/project/delete/{id}', 'ProjectController@delete');
$router->get('/project/list', 'ProjectController@list');
$router->get('/project/list-user/{id}', 'ProjectController@getListProjectTask');
// Project Charter
$router->post('/project-charter/search', 'ProjectCharterController@search');
$router->post('/project-charter/add', 'ProjectCharterController@add');
$router->put('/project-charter/update/{id}', 'ProjectCharterController@update');
// divisi
$router->post('/divisi/add', 'DivisiController@add');
$router->get('/divisi/edit/{id}', 'DivisiController@edit');
$router->put('/divisi/update/{id}', 'DivisiController@update');
@ -87,7 +75,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/divisi/delete/{id}', 'DivisiController@delete');
$router->get('/divisi/list', 'DivisiController@list');
// config alert
$router->post('/config-alert/search', 'ConfigAlertController@search');
$router->post('/config-alert/add', 'ConfigAlertController@add');
$router->get('/config-alert/edit/{id}', 'ConfigAlertController@edit');
@ -95,14 +82,12 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/config-alert/delete/{id}', 'ConfigAlertController@delete');
$router->get('/config-alert/list', 'ConfigAlertController@list');
// config alert user
$router->post('/config-alert-to-user/search', 'ConfigAlertUserController@search');
$router->post('/config-alert-to-user/add', 'ConfigAlertUserController@add');
$router->put('/config-alert-to-user/update/{id}', 'ConfigAlertUserController@update');
$router->delete('/config-alert-to-user/delete/{id}', 'ConfigAlertUserController@delete');
$router->get('/config-alert/get-user/{id}', 'ConfigAlertUserController@getConfigUser');
// Human Resource
$router->post('/human-resource/search', 'HumanResourceController@search');
$router->post('/human-resource/add', 'HumanResourceController@add');
$router->get('/human-resource/edit/{id}', 'HumanResourceController@edit');
@ -112,7 +97,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/human-resource/select', 'HumanResourceController@select');
$router->post('/human-resource/check-old-password/{id}', 'HumanResourceController@checkOldPassword');
// Project Role
$router->post('/project-role/search', 'ProjectRoleController@search');
$router->post('/project-role/add', 'ProjectRoleController@add');
$router->get('/project-role/edit/{id}', 'ProjectRoleController@edit');
@ -121,7 +105,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/project-role/list', 'ProjectRoleController@list');
$router->get('/project-role/select', 'ProjectRoleController@select');
// Project Type
$router->post('/project-type/search', 'ProjectTypeController@search');
$router->post('/project-type/add', 'ProjectTypeController@add');
$router->get('/project-type/edit/{id}', 'ProjectTypeController@edit');
@ -129,10 +112,8 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/project-type/delete/{id}', 'ProjectTypeController@delete');
$router->get('/project-type/list', 'ProjectTypeController@list');
// user to project
$router->post('/user-to-project/assign', 'UserProyekController@assignUserProyek');
// Request Material
$router->post('/request-material/add', 'RequestMaterialController@add');
$router->post('/request-material/search', 'RequestMaterialController@search');
$router->get('/request-material/edit/{id}', 'RequestMaterialController@edit');
@ -140,13 +121,10 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/request-material/delete/{id}', 'RequestMaterialController@delete');
$router->get('/request-material/list', 'RequestMaterialController@list');
// update receipt to warehouse / site
$router->put('/request-material/update-warehouse-site/{id}', 'RequestMaterialController@updateWarehouseSite');
// Material to project
$router->post('/material-to-project/assign', 'MaterialProjectController@assignMaterial');
// material resource
$router->post('/material-resource/add', 'MaterialResourceController@add');
$router->post('/material-resource/search', 'MaterialResourceController@search');
$router->get('/material-resource/update/{id}', 'MaterialResourceController@edit');
@ -155,11 +133,9 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/material-resource/list', 'MaterialResourceController@list');
$router->get('/material-resource/select', 'MaterialResourceController@select');
// Tools to project
$router->post('/tools-to-project/assign', 'ToolsProjectController@assignTools');
$router->get('/tools-to-project/search', 'ToolsProjectController@searchTools');
// tools resource
$router->post('/tools-resource/add', 'ToolsResourceController@add');
$router->post('/tools-resource/search', 'ToolsResourceController@search');
$router->get('/tools-resource/edit/{id}', 'ToolsResourceController@edit');
@ -168,7 +144,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/tools-resource/list', 'ToolsResourceController@list');
$router->get('/tools-resource/select', 'ToolsResourceController@select');
// Tools Request
$router->post('/req-tools/add', 'ToolsRequestController@add');
$router->get('/req-tools/edit/{id}', 'ToolsRequestController@edit');
$router->put('/req-tools/update/{id}', 'ToolsRequestController@update');
@ -176,7 +151,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/req-tools/delete/{id}', 'ToolsRequestController@delete');
$router->get('/req-tools/list', 'ToolsRequestController@list');
// Version Gantt
$router->post('/version-gantt/add', 'VersionGanttController@add');
$router->get('/version-gantt/edit/{id}', 'VersionGanttController@edit');
$router->put('/version-gantt/update/{id}', 'VersionGanttController@update');
@ -184,7 +158,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/version-gantt/delete/{id}', 'VersionGanttController@delete');
$router->get('/version-gantt/list', 'VersionGanttController@list');
// User Version Gantt
$router->post('/user-to-version-gantt/add', 'UserToVersionGanttController@add');
$router->post('/user-to-version-gantt/add-multiple', 'UserToVersionGanttController@addMultiple');
$router->get('/user-to-version-gantt/edit/{id}', 'UserToVersionGanttController@edit');
@ -194,7 +167,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/user-to-version-gantt/list', 'UserToVersionGanttController@list');
$router->get('/user-to-version-gantt/get-by-gantt/{gantt_id}', 'UserToVersionGanttController@getByUserGantt');
// User to activity
$router->post('/user-to-activity/add', 'UserToActivityController@add');
$router->post('/user-to-activity/add-multiple', 'UserToActivityController@addMultiple');
$router->get('/user-to-activity/edit/{id}', 'UserToActivityController@edit');
@ -204,7 +176,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/user-to-activity/list', 'UserToActivityController@list');
$router->get('/user-to-activity/datatables', 'UserToActivityController@datatables');
// activity
$router->get('/sumVolActualM/{id}', 'ActivityController@sumVolumeActualMaterial');
$router->get('/activity/{id}/{proyek_id}/get', 'ActivityController@getByGanttId');
$router->get('/activity/search', 'ActivityController@search');
@ -219,12 +190,10 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->post('/activity/get-curva-s', 'ActivityController@getCalculateCurvaS');
$router->get('/activity/synchronize-report/{gantt_id}', 'ActivityController@synchronizeReport');
// link
$router->post('/link', 'LinkController@add');
$router->put('/link/{id}', 'LinkController@update');
$router->delete('/link/{id}', 'LinkController@delete');
// template gantt
$router->post('/template-gantt/add', 'TemplateGanttController@add');
$router->get('/template-gantt/edit/{id}', 'TemplateGanttController@edit');
$router->put('/template-gantt/update/{id}', 'TemplateGanttController@update');
@ -233,7 +202,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/template-gantt/list', 'TemplateGanttController@list');
$router->get('/template-gantt/get-tree/{id}', 'TemplateGanttController@getTreeByTypeProject');
// comment activity
$router->post('/comment-activity/add', 'CommentActivityController@add');
$router->get('/comment-activity/edit/{id}', 'CommentActivityController@edit');
$router->put('/comment-activity/update/{id}', 'CommentActivityController@update');
@ -241,7 +209,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/comment-activity/delete/{id}', 'CommentActivityController@delete');
$router->get('/comment-activity/list', 'CommentActivityController@list');
// presence human resource
$router->post('/presence/add', 'PresenceController@add');
$router->get('/presence/edit/{id}', 'PresenceController@edit');
$router->put('/presence/update/{id}', 'PresenceController@update');
@ -251,7 +218,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/presence/clockinout/{id}', 'PresenceController@clockinout');
$router->get('/presence/bulk-update-location', 'PresenceController@bulkUpdateLocation');
// absent human resource
$router->post('/permit/add', 'AbsentController@add');
$router->get('/permit/edit/{id}', 'AbsentController@edit');
$router->put('/permit/update/{id}', 'AbsentController@update');
@ -259,7 +225,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/permit/delete/{id}', 'AbsentController@delete');
$router->get('/permit/list', 'AbsentController@list');
// assign tools
$router->post('/assign-tools/add', 'AssignToolsController@add');
$router->get('/assign-tools/edit/{id}', 'AssignToolsController@edit');
$router->put('/assign-tools/update/{id}', 'AssignToolsController@update');
@ -268,7 +233,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/assign-tools/list', 'AssignToolsController@list');
$router->get('/assign-tools/datatables', 'AssignToolsController@datatables');
// assign material
$router->post('/assign-material/add', 'AssignMaterialController@add');
$router->get('/assign-material/edit/{id}', 'AssignMaterialController@edit');
$router->put('/assign-material/update/{id}', 'AssignMaterialController@update');
@ -279,14 +243,12 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/assign-material/datatablesForReportActivity', 'AssignMaterialController@datatablesForReportActivity');
$router->post('/assign-material/ForReportActivityByMaterial', 'AssignMaterialController@ForReportActivityByMaterial');
// image
$router->post('/image/search', 'ImageController@search');
$router->delete('/image/delete/{id}', 'ImageController@delete');
$router->delete('/image/delete/{id}/{category}', 'ImageController@deleteByRef');
$router->post('/image/upload', 'ImageController@uploadImage');
$router->get('/image/{id}/{category}', 'ImageController@getByRefId');
// panic button
$router->post('/panic-button/add', 'PanicButtonController@add');
$router->get('/panic-button/edit/{id}', 'PanicButtonController@edit');
$router->put('/panic-button/update/{id}', 'PanicButtonController@update');
@ -294,7 +256,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/panic-button/delete/{id}', 'PanicButtonController@delete');
$router->get('/panic-button/list', 'PanicButtonController@list');
// rate-sallary
$router->post('/rate-sallary/add', 'RateSallaryController@add');
$router->get('/rate-sallary/edit/{id}', 'RateSallaryController@edit');
$router->put('/rate-sallary/update/{id}', 'RateSallaryController@update');
@ -302,7 +263,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/rate-sallary/delete/{id}', 'RateSallaryController@delete');
$router->get('/rate-sallary/list', 'RateSallaryController@list');
// project-participants
$router->post('/project-participants/add', 'ProjectParticipantsController@add');
$router->get('/project-participants/edit/{id}', 'ProjectParticipantsController@edit');
$router->put('/project-participants/update/{id}', 'ProjectParticipantsController@update');
@ -312,7 +272,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/project-participants/list', 'ProjectParticipantsController@list');
$router->get('/project-participants/{where}/{val}', 'ProjectParticipantsController@customWhere');
// project-approval
$router->post('/project-approval/add', 'ProjectApprovalController@add');
$router->get('/project-approval/edit/{id}', 'ProjectApprovalController@edit');
$router->put('/project-approval/update/{id}', 'ProjectApprovalController@update');
@ -322,7 +281,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/project-approval/list', 'ProjectApprovalController@list');
$router->get('/project-approval/{where}/{val}', 'ProjectApprovalController@customWhere');
// project-milestone
$router->post('/project-milestone/add', 'ProjectMileStoneController@add');
$router->get('/project-milestone/edit/{id}', 'ProjectMileStoneController@edit');
$router->put('/project-milestone/update/{id}', 'ProjectMileStoneController@update');
@ -333,14 +291,12 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/project-milestone/select', 'ProjectMileStoneController@select');
$router->get('/project-milestone/{where}/{val}', 'ProjectMileStoneController@customWhere');
// dashboard
$router->post('/dashboard/cost-planning-actual', 'DashboardController@costPlanningActual');
$router->post('/dashboard/percentage-planning-actual', 'DashboardController@percentagePlanningActual');
$router->post('/dashboard/search-user-presence', 'DashboardController@searchUserPresencePoints');
$router->post('/dashboard/status-proyek', 'DashboardController@statusProyek');
$router->post('/dashboard/curva-s', 'DashboardController@curvaS');
// report-activity
$router->post('/report-activity/add', 'ReportActivityController@add');
$router->get('/report-activity/edit/{id}', 'ReportActivityController@edit');
$router->put('/report-activity/update/{id}', 'ReportActivityController@update');
@ -350,20 +306,15 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->post('/report-activity/search-point', 'ReportActivityController@searchPoint');
$router->get('/report-activity/datatables', 'ReportActivityController@datatables');
// report-activity-material
$router->post('/report-activity-material/add', 'ReportActivityMaterialController@add');
// $router->get('/report-activity-material/edit/{id}', 'ReportActivityMaterialController@edit');
// $router->put('/report-activity-material/update/{id}', 'ReportActivityMaterialController@update');
$router->post('/report-activity-material/search', 'ReportActivityMaterialController@search');
$router->delete('/report-activity-material/delete/{id}', 'ReportActivityMaterialController@delete');
$router->get('/report-activity-material/list', 'ReportActivityMaterialController@list');
// $router->post('/report-activity-material/search-point', 'ReportActivityMaterialController@searchPoint');
$router->get('/report-activity-material/datatables', 'ReportActivityMaterialController@datatables');
$router->post('/report-activity-material/update-status', 'ReportActivityMaterialController@updateStatusStartFinish');
$router->get('/report-activity-material/test', 'ReportActivityMaterialController@countForProgressTest');
// waypoint
$router->post('/waypoint/add', 'WaypointController@add');
$router->get('/waypoint/edit/{id}', 'WaypointController@edit');
$router->put('/waypoint/update/{id}', 'WaypointController@update');
@ -371,7 +322,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/waypoint/delete/{id}', 'WaypointController@delete');
$router->get('/waypoint/list', 'WaypointController@list');
// holiday
$router->post('/holiday/add', 'HolidayController@add');
$router->get('/holiday/edit/{id}', 'HolidayController@edit');
$router->put('/holiday/update/{id}', 'HolidayController@update');
@ -380,7 +330,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/holiday/list', 'HolidayController@list');
$router->get('/holiday/datatables', 'HolidayController@datatables');
// satuan
$router->post('/satuan/add', 'SatuanController@add');
$router->get('/satuan/edit/{id}', 'SatuanController@edit');
$router->put('/satuan/update/{id}', 'SatuanController@update');
@ -388,7 +337,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/satuan/delete/{id}', 'SatuanController@delete');
$router->get('/satuan/list', 'SatuanController@list');
// checklist k3
$router->post('/checklist-k3/add', 'ChecklistK3Controller@add');
$router->get('/checklist-k3/edit/{id}', 'ChecklistK3Controller@edit');
$router->put('/checklist-k3/update/{id}', 'ChecklistK3Controller@update');
@ -396,7 +344,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/checklist-k3/delete/{id}', 'ChecklistK3Controller@delete');
$router->get('/checklist-k3/list', 'ChecklistK3Controller@list');
// report k3
$router->post('/report-k3/add', 'ReportK3Controller@add');
$router->get('/report-k3/edit/{id}', 'ReportK3Controller@edit');
$router->put('/report-k3/update/{id}', 'ReportK3Controller@update');
@ -404,7 +351,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/report-k3/delete/{id}', 'ReportK3Controller@delete');
$router->get('/report-k3/list', 'ReportK3Controller@list');
// report k3 detail
$router->post('/report-k3-detail/add', 'ReportK3DetailController@add');
$router->get('/report-k3-detail/edit/{id}', 'ReportK3DetailController@edit');
$router->put('/report-k3-detail/update/{id}', 'ReportK3DetailController@update');
@ -412,7 +358,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/report-k3-detail/delete/{id}', 'ReportK3DetailController@delete');
$router->get('/report-k3-detail/list', 'ReportK3DetailController@list');
// user to proyek
$router->post('/user-to-proyek/add', 'UserToProyekController@add');
$router->get('/user-to-proyek/edit/{id}', 'UserToProyekController@edit');
$router->put('/user-to-proyek/update/{id}', 'UserToProyekController@update');
@ -421,7 +366,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/user-to-proyek/list', 'UserToProyekController@list');
$router->get('/user-to-proyek/select', 'UserToProyekController@select');
// flder document proyek
$router->post('/folder-document-proyek/add', 'FolderDocumentProyekController@add');
$router->get('/folder-document-proyek/edit/{id}', 'FolderDocumentProyekController@edit');
$router->put('/folder-document-proyek/update/{id}', 'FolderDocumentProyekController@update');
@ -430,7 +374,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->get('/folder-document-proyek/list', 'FolderDocumentProyekController@list');
$router->get('/folder-document-proyek/get-tree/{id}', 'FolderDocumentProyekController@getTree');
// office-hours
$router->post('/office-hours/add', 'OfficeHoursController@add');
$router->get('/office-hours/edit/{id}', 'OfficeHoursController@edit');
$router->put('/office-hours/update/{id}', 'OfficeHoursController@update');
@ -438,13 +381,11 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/office-hours/delete/{id}', 'OfficeHoursController@delete');
$router->get('/office-hours/list', 'OfficeHoursController@list');
// gantt-show-hide
$router->get('/gantt-show-hide/get-by-gantt/{gantt_id}', 'ShowHideColumnController@getByUserGantt');
$router->post('/gantt-show-hide/add', 'ShowHideColumnController@add');
$router->post('/gantt-show-hide/update/{gantt_id}', 'ShowHideColumnController@update');
// master shift
$router->post('/shift/add', 'ShiftController@add');
$router->get('/shift/edit/{id}', 'ShiftController@edit');
$router->put('/shift/update/{id}', 'ShiftController@update');
@ -452,7 +393,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/shift/delete/{id}', 'ShiftController@delete');
$router->get('/shift/list', 'ShiftController@list');
// monthly shift
$router->post('/user-monthly-shift/add', 'UserMonthlyShiftController@add');
$router->put('/user-monthly-shift/update/{id}', 'UserMonthlyShiftController@update');
$router->post('/user-monthly-shift/search', 'UserMonthlyShiftController@search');
@ -462,7 +402,6 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->post('/user-monthly-shift/import', 'UserMonthlyShiftController@import');
$router->get('/user-monthly-shift/list/{yyyymm}', 'UserMonthlyShiftController@listYYYYMM');
// Shift assignment
$router->post('/user-to-shift/add', 'UserToShiftController@add');
$router->get('/user-to-shift/edit/{id}', 'UserToShiftController@edit');
$router->put('/user-to-shift/update/{id}', 'UserToShiftController@update');
@ -470,12 +409,9 @@ $router->group(['prefix'=>'api'], function () use ($router) {
$router->delete('/user-to-shift/delete/{id}', 'UserToShiftController@delete');
$router->get('/user-to-shift/list', 'UserToShiftController@list');
// control monitoring
$router->post('/control-monitoring/search', 'ControlMonitoringController@search');
// currency
$router->get('/currency/list', 'CurrencyController@list');
// project to checklist k3
$router->post('/project-to-checklist-k3/add', 'ProjectToChecklistK3Controller@add');
$router->post('/project-to-checklist-k3/add-multiple', 'ProjectToChecklistK3Controller@addMultiple');
$router->get('/project-to-checklist-k3/edit/{id}', 'ProjectToChecklistK3Controller@edit');

Loading…
Cancel
Save