Browse Source

Merge pull request 'staging' (#6) from staging into master

Reviewed-on: #6
master
ibnu 5 months ago
parent
commit
dac9bcb70c
  1. 1
      .gitignore
  2. 920
      app/Helpers/MasterFunctionsHelper.php
  3. 1693
      app/Helpers/MasterFunctionsHelperOld.php
  4. 16
      app/Http/Controllers/ActivityController.php
  5. 50
      app/Http/Controllers/ActivityDokumenController.php
  6. 12
      app/Http/Controllers/Controller.php
  7. 125
      app/Http/Controllers/DashboardBoDController.php
  8. 4
      app/Http/Controllers/DivisiController.php
  9. 7
      app/Http/Controllers/FolderDocumentProyekController.php
  10. 69
      app/Http/Controllers/HumanResourceController.php
  11. 31
      app/Http/Controllers/ImageController.php
  12. 1
      app/Http/Controllers/ProductTransactionController.php
  13. 5
      app/Http/Controllers/ProjectCarausellController.php
  14. 59
      app/Http/Controllers/ProjectController.php
  15. 42
      app/Http/Controllers/ProjectDokumenController.php
  16. 1
      app/Http/Controllers/ProjectExpenditureController.php
  17. 1
      app/Http/Controllers/ProjectFinancialHealthController.php
  18. 1
      app/Http/Controllers/ProjectInvoiceController.php
  19. 2
      app/Http/Controllers/ProjectRoleController.php
  20. 1
      app/Http/Controllers/ProjectScheduleHealthController.php
  21. 7
      app/Http/Controllers/ReportActivityMaterialController.php
  22. 4
      app/Http/Controllers/RoleController.php
  23. 11
      app/Http/Controllers/UserToProyekController.php
  24. 8163
      composer.lock
  25. 50
      routes/web.php

1
.gitignore vendored

@ -12,3 +12,4 @@ bootstrap/backup
.config-prod.json .config-prod.json
activity_log.txt activity_log.txt
.swp .swp
composer.lock

920
app/Helpers/MasterFunctionsHelper.php

File diff suppressed because it is too large Load Diff

1693
app/Helpers/MasterFunctionsHelperOld.php

File diff suppressed because it is too large Load Diff

16
app/Http/Controllers/ActivityController.php

@ -635,41 +635,37 @@ class ActivityController extends Controller
$activity_id = (int)$id; $activity_id = (int)$id;
$data = Activity::query() $data = Activity::query()
->from('m_activity as ma') ->from('m_activity as ma')
->select('mp.company_id') ->select('ma.id')
->join('m_proyek as mp', 'ma.proyek_id', 'mp.id') ->join('m_proyek as mp', 'ma.proyek_id', 'mp.id')
->where('ma.id', $activity_id); ->where('ma.id', $activity_id);
$cloneQuery = clone $data;
if (!$data->exists()) { if (!$data->exists()) {
DB::rollBack(); DB::rollBack();
return response()->json(['status' => 'failed', 'action' => 'error', 'message' => 'Data not found!', 'code' => 404], 404); return response()->json(['status' => 'failed', 'action' => 'error', 'message' => 'Data not found!', 'code' => 404], 404);
} }
$this->deleteRelative($activity_id, $cloneQuery->first()->company_id); $this->deleteRelative($activity_id);
if (!$data->delete()) { if (!$data->delete()) {
DB::rollBack(); DB::rollBack();
return response()->json(['status' => 'failed', 'action' => 'error', 'message' => 'Data activity failed deleted!', 'code' => 500], 500); return response()->json(['status' => 'failed', 'action' => 'error', 'message' => 'Data activity failed deleted!', 'code' => 500], 500);
} }
DB::commit(); DB::rollBack();
return response()->json(['status' => 'success', "action" => "deleted", 'message' => 'Data activity successfully deleted!', 'code' => 200], 200); return response()->json(['status' => 'success', "action" => "deleted", 'message' => 'Data activity successfully deleted!', 'code' => 200], 200);
} }
private function deleteRelative($activity_id, $company_id) private function deleteRelative($activity_id)
{ {
DB::transaction(function() use($activity_id, $company_id) { DB::transaction(function () use ($activity_id) {
UserToActivity::where('activity_id', $activity_id)->delete(); UserToActivity::where('activity_id', $activity_id)->delete();
AssignMaterial::where('activity_id', $activity_id)->delete(); AssignMaterial::where('activity_id', $activity_id)->delete();
$dataAd = ActivityDokumen::where("activity_id", $activity_id)->get(); $dataAd = ActivityDokumen::where("activity_id", $activity_id)->get();
$company = Company::find($company_id); $destinationPath = $this->setCustomeDirectoryUpload();
if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach ($dataAd as $ad) { foreach ($dataAd as $ad) {
if (file_exists($destinationPath['pathActivityDocument'] . $ad->file)) { if (file_exists($destinationPath['pathActivityDocument'] . $ad->file)) {
unlink($destinationPath['pathActivityDocument'] . $ad->file); unlink($destinationPath['pathActivityDocument'] . $ad->file);
} }
} }
ActivityDokumen::where("activity_id", $activity_id)->delete(); ActivityDokumen::where("activity_id", $activity_id)->delete();
}
}); });
} }

50
app/Http/Controllers/ActivityDokumenController.php

@ -8,8 +8,13 @@ use App\Models\ActivityDokumen;
class ActivityDokumenController extends Controller class ActivityDokumenController extends Controller
{ {
public $directories;
public function __construct() {
$this->directories = $this->setCustomeDirectoryUpload();
}
public function dokumenByActivityId($id){ public function dokumenByActivityId($id)
{
if (empty($id) || !is_int((int)$id)) if (empty($id) || !is_int((int)$id))
return response()->json(['status' => 'failed', 'message' => 'activity id is required!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'activity id is required!', 'code' => 400], 400);
@ -17,7 +22,7 @@ class ActivityDokumenController extends Controller
return response()->json(['status' => 'success', 'data' => $dataDokumen, 'code' => 200], 200); return response()->json(['status' => 'success', 'data' => $dataDokumen, 'code' => 200], 200);
} }
public function delete($id, $company_id) public function delete($id)
{ {
if (empty($id) || !is_int((int)$id)) if (empty($id) || !is_int((int)$id))
return response()->json(['status' => 'failed', 'message' => 'Id is required!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'Id is required!', 'code' => 400], 400);
@ -27,12 +32,9 @@ class ActivityDokumenController extends Controller
if (!$document) { if (!$document) {
return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 404], 404); return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 404], 404);
} }
$company = Company::find($company_id); $destinationPath = $this->setCustomeDirectoryUpload();
if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
if (file_exists($destinationPath['pathActivityDocument'] . $document->file)) { if (file_exists($destinationPath['pathActivityDocument'] . $document->file)) {
unlink($destinationPath['pathActivityDocument'] . $document->file); unlink($destinationPath['pathActivityDocument'] . $document->file);
}
} }
$document->delete(); $document->delete();
return response()->json(['status' => 'success', 'message' => 'Dokumen deleted successfully!', 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Dokumen deleted successfully!', 'code' => 200], 200);
@ -40,18 +42,22 @@ class ActivityDokumenController extends Controller
public function uploadProjectDokumen(Request $request) public function uploadProjectDokumen(Request $request)
{ {
if(!$request->hasFile('dokumen')) {
return response()->json(['status'=>'failed','message'=>'file is required!','code'=>400], 400);
}
$activity_id = $request->activity_id; $activity_id = $request->activity_id;
$document = $request->file('dokumen'); $document = $request->file('dokumen');
$name = $document->getClientOriginalName(); $name = $document->getClientOriginalName();
$company = Company::find($request->company_id); $fileSize = $document->getSize();
if($company) { $maximumSizeFile = $fileSize > 15 * 1024 * 1024; // 15 MB
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']); if ($maximumSizeFile) {
$result = $document->move($destinationPath['pathActivityDocument'], $name); return response()->json(['status' => 'failed', 'message' => 'This file is too large. Allowed maximum size is 15MB', 'code' => 500], 500);
}
$this->validate($request, [
'dokumen' => 'required|file|max:15360'
]);
if (!$request->hasFile('dokumen')) {
return response()->json(['status' => 'failed', 'message' => 'file is required!', 'code' => 400], 400);
} }
if(!$result || !$company) { $result = $document->move($this->directories['pathActivityDocument'], $name);
if (!$result) {
return response()->json(['status' => 'failed', 'message' => 'Upload failed!', 'code' => 500], 500); return response()->json(['status' => 'failed', 'message' => 'Upload failed!', 'code' => 500], 500);
} }
$data = [ $data = [
@ -60,14 +66,15 @@ class ActivityDokumenController extends Controller
'description' => $request->description 'description' => $request->description
]; ];
$result = ActivityDokumen::create($data); $result = ActivityDokumen::create($data);
if(!$result || !$company) { if (!$result) {
unlink($destinationPath['pathActivityDocument'].$name); unlink($this->directories['pathActivityDocument'] . $name);
return response()->json(['status' => 'failed', 'message' => 'Upload failed!', 'code' => 500], 500); return response()->json(['status' => 'failed', 'message' => 'Upload failed!', 'code' => 500], 500);
} }
return response()->json(['status' => 'success', 'message' => 'Upload success!', 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Upload success!', 'code' => 200], 200);
} }
public function searchDocProject(Request $request){ public function searchDocProject(Request $request)
{
$payload = $request->all(); $payload = $request->all();
$dataBuilder = $this->setUpPayload($payload, 'm_document_activity'); $dataBuilder = $this->setUpPayload($payload, 'm_document_activity');
@ -79,22 +86,19 @@ class ActivityDokumenController extends Controller
return response()->json(['status' => 'success', 'code' => 200, 'data' => $dataGet, 'totalRecord' => $totalRecord], 200); return response()->json(['status' => 'success', 'code' => 200, 'data' => $dataGet, 'totalRecord' => $totalRecord], 200);
} }
public function downloadDokumen($id, $company_id) public function downloadDokumen($id)
{ {
if (empty($id) || !is_int((int)$id)) { if (empty($id) || !is_int((int)$id)) {
return response()->json(['status' => 'failed', 'message' => 'Id is required!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'Id is required!', 'code' => 400], 400);
} }
$document = ActivityDokumen::find($id); $document = ActivityDokumen::find($id);
$company = Company::find($company_id); if (!$document) {
if(!$document || !$company) {
return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 400], 400);
} }
if($company) { $destinationPath = $this->setCustomeDirectoryUpload();
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
if (file_exists($destinationPath['pathActivityDocument'] . $document->file)) { if (file_exists($destinationPath['pathActivityDocument'] . $document->file)) {
$pathToFile = $destinationPath['pathActivityDocument'] . $document->file; $pathToFile = $destinationPath['pathActivityDocument'] . $document->file;
return response()->download($pathToFile); return response()->download($pathToFile);
}
} }
return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 400], 400);
} }

12
app/Http/Controllers/Controller.php

@ -44,17 +44,15 @@ class Controller extends BaseController
$this->pathActivityDocument = config('assets.activity'); $this->pathActivityDocument = config('assets.activity');
} }
protected function setCustomeDirectoryUpload($company_name) protected function setCustomeDirectoryUpload()
{ {
$current_date = date('Y-m-d'); $current_date = date('Y-m-d');
[$year, $month] = explode('-', $current_date); [$year, $month] = explode('-', $current_date);
$yearMonth = $year.'-'.$month; $yearMonth = $year.'-'.$month;
$pathImage = 'assets/image/';
$pathImage = 'assets/' . $company_name .'/'. $yearMonth . '/image/'; $pathDocument = 'assets/file/project/';
$pathDocument = 'assets/' . $company_name .'/'. $yearMonth . '/file/project/'; $pathTmpImport = 'assets/file/tmpimport/';
$pathTmpImport = 'assets/' . $company_name .'/'. $yearMonth . '/file/tmpimport/'; $pathActivityDocument = 'assets/file/activity/';
$pathActivityDocument = 'assets/' . $company_name .'/'. $yearMonth . '/file/activity/';
return [ return [
'pathImage' => $pathImage, 'pathImage' => $pathImage,
'pathDocument' => $pathDocument, 'pathDocument' => $pathDocument,

125
app/Http/Controllers/DashboardBoDController.php

@ -28,29 +28,23 @@ class DashboardBoDController extends Controller
public function getCompanyCashFlow($company_id, $all_project, $hierarchy, $role_name) public function getCompanyCashFlow($all_project, $hierarchy, $role_name)
{ {
$totalExpenditure = $totalInvoice = $totalPaidInvoice = 0; $totalExpenditure = $totalInvoice = $totalPaidInvoice = 0;
$totalBudgets = null; $totalBudgets = null;
$role = urldecode($role_name); $role = urldecode($role_name);
if ($role === "Super Admin") { if (!empty($all_project) || $role === "Super Admin") {
$totalBudgets = Project::sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)')); $totalBudgets = Project::sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
} elseif (!empty($all_project)) {
$totalBudgets = Project::where('company_id', $company_id)
->sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
} else { } else {
$totalBudgets = Project::where('created_by_id', $hierarchy) $totalBudgets = Project::where('created_by_id', $hierarchy)
->sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)')); ->sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
} }
$totalBudgets = Project::sum(DB::raw('CAST("rencana_biaya" AS DOUBLE PRECISION)'));
$projects = null; $projects = null;
if ($role === "Super Admin") { if (!empty($all_project) || $role === "Super Admin") {
$projects = Project::get(); $projects = Project::get();
} elseif (!empty($all_project)) {
$projects = Project::where('company_id', $company_id)
->get();
} else { } else {
$projects = Project::where('created_by_id', $hierarchy) $projects = Project::where('created_by_id', $hierarchy)
->get(); ->get();
@ -85,15 +79,11 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getDetailExpenditureColor($role_name, $company_id) public function getDetailExpenditureColor($role_name)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$query = null; $query = null;
if ($role === 'Super Admin') {
$query = ProjectExpenditure::get(); $query = ProjectExpenditure::get();
} else {
$query = ProjectExpenditure::where('company_id', $company_id)->get();
}
$data = []; $data = [];
foreach ($query as $value) { foreach ($query as $value) {
@ -120,16 +110,11 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getDetailFinancialHealthColor($role_name, $company_id) public function getDetailFinancialHealthColor($role_name)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$query = null; $query = null;
if ($role === 'Super Admin') {
$query = ProjectFinancialHealth::get(); $query = ProjectFinancialHealth::get();
} else {
$query = ProjectFinancialHealth::where('company_id', $company_id)->get();
}
$data = []; $data = [];
foreach ($query as $value) { foreach ($query as $value) {
@ -152,15 +137,11 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getDetailScheduleHealthColor($role_name, $company_id) public function getDetailScheduleHealthColor($role_name)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$query = null; $query = null;
if ($role === 'Super Admin') {
$query = ProjectScheduleHealth::get(); $query = ProjectScheduleHealth::get();
} else {
$query = ProjectScheduleHealth::where('company_id', $company_id)->get();
}
$data = []; $data = [];
foreach ($query as $value) { foreach ($query as $value) {
@ -183,15 +164,11 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getDetailInvoiceColor($role_name, $company_id) public function getDetailInvoiceColor($role_name)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$query = null; $query = null;
if ($role === 'Super Admin') {
$query = ProjectInvoice::get(); $query = ProjectInvoice::get();
} else {
$query = ProjectInvoice::where('company_id', $company_id)->get();
}
$data = []; $data = [];
foreach ($query as $value) { foreach ($query as $value) {
if ($value['name'] === 'Invoiced') { if ($value['name'] === 'Invoiced') {
@ -210,15 +187,12 @@ class DashboardBoDController extends Controller
} }
// integrasi // integrasi
public function getInvoiceOutstanding($role_name, $company_id, $all_project, $hierarchy) public function getInvoiceOutstanding($role_name, $all_project, $hierarchy)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$projects = null; $projects = null;
if ($role === 'Super Admin') { if (!empty($all_project) || $role === 'Super Admin') {
$projects = Project::get(); $projects = Project::get();
} elseif (!empty($all_project)) {
$projects = Project::where('company_id', $company_id)
->get();
} else { } else {
$projects = Project::where('created_by_id', $hierarchy) $projects = Project::where('created_by_id', $hierarchy)
->get(); ->get();
@ -241,7 +215,7 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getTotalProjectPerScheduleHealth($role_name, $company_id, $all_project, $hierarchy) public function getTotalProjectPerScheduleHealth($role_name, $all_project, $hierarchy)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$replaceHierarchy = preg_replace('/[\[\]]/', '', $hierarchy); $replaceHierarchy = preg_replace('/[\[\]]/', '', $hierarchy);
@ -253,11 +227,8 @@ class DashboardBoDController extends Controller
]; ];
$projects = null; $projects = null;
if ($role === 'Super Admin') { if ($all_project == 'true' || $role === 'Super Admin') {
$projects = Project::get(); $projects = Project::get();
} elseif ($all_project == 'true') {
$projects = Project::where('company_id', $company_id)
->get();
} else { } else {
$projects = Project::where('created_by_id', $replaceHierarchy) $projects = Project::where('created_by_id', $replaceHierarchy)
->get(); ->get();
@ -274,18 +245,11 @@ class DashboardBoDController extends Controller
} }
public function getTotalProjectScheduleHealthPerDivision($role_name, $company_id) public function getTotalProjectScheduleHealthPerDivision($role_name)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$divisions = null;
if ($role === 'Super Admin') {
$divisions = Divisi::whereNull('parent') $divisions = Divisi::whereNull('parent')
->get(); ->get();
} else {
$divisions = Divisi::whereNull('parent')
->where('company_id', $company_id)
->get();
}
foreach ($divisions as $index => $division) { foreach ($divisions as $index => $division) {
$behindSchedule = $warning = $onSchedule = 0; $behindSchedule = $warning = $onSchedule = 0;
@ -311,7 +275,7 @@ class DashboardBoDController extends Controller
return response()->json(['data' => $divisions], 200); return response()->json(['data' => $divisions], 200);
} }
public function getTotalProjectPerBudgetHealth($role_name, $company_id, $all_project, $hierarchy) public function getTotalProjectPerBudgetHealth($role_name, $all_project, $hierarchy)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$replaceHierarchy = preg_replace('/[\[\]]/', '', $hierarchy); $replaceHierarchy = preg_replace('/[\[\]]/', '', $hierarchy);
@ -324,7 +288,6 @@ class DashboardBoDController extends Controller
] ]
]; ];
$divisi = Divisi::query() $divisi = Divisi::query()
->where('company_id', $company_id)
->pluck('id'); ->pluck('id');
// arr overrun // arr overrun
@ -333,7 +296,7 @@ class DashboardBoDController extends Controller
->count(); ->count();
} elseif ($all_project == 'true') { } elseif ($all_project == 'true') {
$response['data']['overrun'] = Project::whereIn('divisi_id', $divisi) $response['data']['overrun'] = Project::whereIn('divisi_id', $divisi)
->where([['budget_health', 'overrun'], ['company_id', $company_id]]) ->where([['budget_health', 'overrun']])
->count(); ->count();
} else { } else {
$response['data']['overrun'] = Project::whereIn('divisi_id', $divisi) $response['data']['overrun'] = Project::whereIn('divisi_id', $divisi)
@ -346,7 +309,7 @@ class DashboardBoDController extends Controller
->count(); ->count();
} elseif ($all_project == 'true') { } elseif ($all_project == 'true') {
$response['data']['warning'] = Project::whereIn('divisi_id', $divisi) $response['data']['warning'] = Project::whereIn('divisi_id', $divisi)
->where([['budget_health', 'warning'], ['company_id', $company_id]]) ->where([['budget_health', 'warning']])
->count(); ->count();
} else { } else {
$response['data']['warning'] = Project::whereIn('divisi_id', $divisi) $response['data']['warning'] = Project::whereIn('divisi_id', $divisi)
@ -359,7 +322,7 @@ class DashboardBoDController extends Controller
->count(); ->count();
} elseif ($all_project == 'true') { } elseif ($all_project == 'true') {
$response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi) $response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi)
->where([['company_id', $company_id], ['budget_health', 'on-budget']]) ->where([['budget_health', 'on-budget']])
->count(); ->count();
} else { } else {
$response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi) $response['data']['on-budget'] = Project::whereIn('divisi_id', $divisi)
@ -376,7 +339,7 @@ class DashboardBoDController extends Controller
} }
public function getTotalProjectBudgetHealthPerDivision($role_name, $company_id) public function getTotalProjectBudgetHealthPerDivision($role_name)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$divisions = null; $divisions = null;
@ -389,7 +352,6 @@ class DashboardBoDController extends Controller
$divisions = Divisi::select('id', 'name') $divisions = Divisi::select('id', 'name')
->with('children') ->with('children')
->whereNull('parent') ->whereNull('parent')
->where('company_id', $company_id)
->get(); ->get();
} }
@ -414,25 +376,15 @@ class DashboardBoDController extends Controller
], 200); ], 200);
} }
public function getTotalProjectPerPhase($role_name, $company_id, $all_project, $hierarchy) public function getTotalProjectPerPhase($role_name, $all_project, $hierarchy)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$projectPhases = null;
if ($role === 'Super Admin') {
$projectPhases = ProjectPhase::orderBy('order')->get(); $projectPhases = ProjectPhase::orderBy('order')->get();
} else {
$projectPhases = ProjectPhase::where('company_id', $company_id)->orderBy('order')->get();
}
foreach ($projectPhases as $phase) { foreach ($projectPhases as $phase) {
if ($role === 'Super Admin') { if ($role === 'Super Admin' || $all_project) {
$phase->totalProject = Project::where('phase_id', $phase->id)
->count();
} elseif ($all_project) {
$phase->totalProject = Project::where('phase_id', $phase->id) $phase->totalProject = Project::where('phase_id', $phase->id)
->where('company_id', $company_id)
->count(); ->count();
} else { } else {
$phase->totalProject = Project::where('phase_id', $phase->id) $phase->totalProject = Project::where('phase_id', $phase->id)
@ -453,25 +405,14 @@ class DashboardBoDController extends Controller
->count(); ->count();
} }
public function getTotalProjectPerDivision($role_name, $company_id) public function getTotalProjectPerDivision($role_name)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
$divisions = null; $divisions = null;
if ($role === 'Super Admin') {
$divisions = Divisi::select('id', 'name', 'parent', 'color') $divisions = Divisi::select('id', 'name', 'parent', 'color')
->with('children') ->with('children')
->whereNull('parent') ->whereNull('parent')
->get(); ->get();
} else {
$divisions = Divisi::select('id', 'name', 'parent', 'color')
->with('children')
->whereNull('parent')
->where('company_id', $company_id)
->get();
}
// to do : count in more than 1 level child // to do : count in more than 1 level child
foreach ($divisions as $v) { foreach ($divisions as $v) {
@ -495,22 +436,13 @@ class DashboardBoDController extends Controller
->first(); ->first();
} }
public function getTotalProjectValuePerDivision($role_name, $company_id) public function getTotalProjectValuePerDivision($role_name)
{ {
$role = urldecode($role_name); $role = urldecode($role_name);
if ($role === 'Super Admin') {
$divisions = Divisi::select('id', 'name', 'color')
->with('children')
->whereNull('parent')
->get();
} else {
$divisions = Divisi::select('id', 'name', 'color') $divisions = Divisi::select('id', 'name', 'color')
->with('children') ->with('children')
->whereNull('parent') ->whereNull('parent')
->where('company_id', $company_id)
->get(); ->get();
}
foreach ($divisions as $v) { foreach ($divisions as $v) {
$v->total = $this->countTotalProjectValueInDivision($v->id); $v->total = $this->countTotalProjectValueInDivision($v->id);
@ -526,18 +458,15 @@ class DashboardBoDController extends Controller
} }
public function getDetailExpenditure($year = '%', $company_id, $all_project, $hierarchy) public function getDetailExpenditure($all_project, $hierarchy, $role_name)
{ {
$year = $this->interpolateYear($year); // $year = $this->interpolateYear($year);
$projects = null; $projects = null;
if ($all_project) { if ($all_project) {
$projects = Project::where('mulai_proyek', 'like', $year) $projects = Project::orderBy('id', 'desc')
->where('company_id', $company_id)
->orderBy('id', 'desc')
->get(); ->get();
} else { } else {
$projects = Project::where('mulai_proyek', 'like', $year) $projects = Project::where('created_by_id', $hierarchy)
->where('created_by_id', $hierarchy)
->orderBy('id', 'desc') ->orderBy('id', 'desc')
->get(); ->get();
} }
@ -562,7 +491,7 @@ class DashboardBoDController extends Controller
return response()->json([ return response()->json([
'data' => $projects, 'data' => $projects,
'total_manpowers' => User::where('company_id', $company_id)->count() 'total_manpowers' => User::count()
], 200); ], 200);
} }
} }

4
app/Http/Controllers/DivisiController.php

@ -22,7 +22,7 @@ class DivisiController extends Controller
public function add(Request $request) public function add(Request $request)
{ {
$this->validate($request, [ $this->validate($request, [
'name' => 'string|required|unique:m_divisi,name,NULL,id,company_id,' . $request->input('company_id'), 'name' => 'string|required|unique:m_divisi,name,NULL,id',
'description' => 'nullable|string', 'description' => 'nullable|string',
'parent' => 'nullable|integer', 'parent' => 'nullable|integer',
'color' => 'nullable|string|max:10' 'color' => 'nullable|string|max:10'
@ -32,7 +32,6 @@ class DivisiController extends Controller
$data['created_by'] = $this->currentName; $data['created_by'] = $this->currentName;
$result = Divisi::create($data); $result = Divisi::create($data);
if (!$result) if (!$result)
return response()->json(['status' => 'failed', 'message' => 'Failed to add data', 'code' => 500]); return response()->json(['status' => 'failed', 'message' => 'Failed to add data', 'code' => 500]);
@ -86,7 +85,6 @@ class DivisiController extends Controller
{ {
$companyId = $request->input('columns.0.value'); $companyId = $request->input('columns.0.value');
$parentDivisi = Divisi::whereNull('parent') $parentDivisi = Divisi::whereNull('parent')
->where('company_id', $companyId)
->with('children') ->with('children')
->get(); ->get();
$divisions = []; $divisions = [];

7
app/Http/Controllers/FolderDocumentProyekController.php

@ -47,13 +47,12 @@ class FolderDocumentProyekController extends Controller
} }
} }
public function delete($id, $company_id) public function delete($id)
{ {
DB::beginTransaction(); DB::beginTransaction();
$data = FolderDocumentProyek::find($id); $data = FolderDocumentProyek::find($id);
$company = Company::find($company_id); if($data) {
if($data && $company) { $destinationPath = $this->setCustomeDirectoryUpload();
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
$dir = $destinationPath['pathDocument']; $dir = $destinationPath['pathDocument'];
$dataFile = DokumenProject::where([['type_dokumen', 'project-document-in-folder'],['ref_id', $data['id']]])->orderByRaw('id ASC')->get(); $dataFile = DokumenProject::where([['type_dokumen', 'project-document-in-folder'],['ref_id', $data['id']]])->orderByRaw('id ASC')->get();
if (is_dir($dir)) { if (is_dir($dir)) {

69
app/Http/Controllers/HumanResourceController.php

@ -22,7 +22,6 @@ class HumanResourceController extends Controller
'name' => 'required|string', 'name' => 'required|string',
'ktp_number' => 'required|string|unique:m_users,ktp_number', 'ktp_number' => 'required|string|unique:m_users,ktp_number',
'employee_type' => 'required|in:employee,subcon,freelance', 'employee_type' => 'required|in:employee,subcon,freelance',
'company_id' => 'required|integer',
'username' => 'string|unique:m_users,username', 'username' => 'string|unique:m_users,username',
'email' => 'string|unique:m_users,email' 'email' => 'string|unique:m_users,email'
], $messages); ], $messages);
@ -34,32 +33,7 @@ class HumanResourceController extends Controller
$data['password'] = md5($request->password); $data['password'] = md5($request->password);
} }
$transaction = ProductTransaction::query()
->where('company_id', (int) $request->company_id);
$cloneQueryTransaction = clone $transaction;
$countCreate = false;
$projectResult = HumanResource::query()
->selectRaw('count(*) as total_hr')
->where('company_id', (int) $request->company_id)
->first();
if($transaction->where([['type_paket','Basic'],['amount','!=',null]])->exists()) {
if($projectResult['total_hr'] < 50) {
$countCreate = true;
}
} elseif ($cloneQueryTransaction->where([['type_paket','Free'],['amount',0]])->exists()) {
if($projectResult['total_hr'] < 1) {
$countCreate = true;
}
} else {
$countCreate = true;
}
if($countCreate) {
$result = HumanResource::create($data); $result = HumanResource::create($data);
} else {
return response()->json(['status' => 'failed', 'message' => 'Limited to create human resource!', 'code' => 500], 500);
}
if ($result) { if ($result) {
return response()->json(['status' => 'success', 'message' => 'Human Resource Pool successfull created', 'code' => 200]); return response()->json(['status' => 'success', 'message' => 'Human Resource Pool successfull created', 'code' => 200]);
@ -76,7 +50,6 @@ class HumanResourceController extends Controller
'name' => 'required', 'name' => 'required',
'ktp_number' => 'required|string|unique:m_users,ktp_number', 'ktp_number' => 'required|string|unique:m_users,ktp_number',
'employee_type' => 'required', 'employee_type' => 'required',
'company_id' => 'required',
'username' => 'required', 'username' => 'required',
'email' => 'required|unique:m_users,email|email' 'email' => 'required|unique:m_users,email|email'
]); ]);
@ -121,15 +94,13 @@ class HumanResourceController extends Controller
'required' => 'Data tidak boleh kosong' 'required' => 'Data tidak boleh kosong'
]; ];
$request->validate($request, [ $this->validate($request, [
'name' => 'required|string', 'name' => 'required|string',
'ktp_number' => 'required|string|unique:m_users,ktp_number,'.$id . ',id', 'ktp_number' => 'required|string|unique:m_users,ktp_number,'.$id . ',id',
'employee_type' => 'required|in:employee,subcon,freelance', 'employee_type' => 'required|in:employee,subcon,freelance',
'company_id' => 'required|integer',
'username' => 'unique:m_users,username,'.$id . ',id', 'username' => 'unique:m_users,username,'.$id . ',id',
'email' => 'string|unique:m_users,email,'.$id . ',id' 'email' => 'string|unique:m_users,email,'.$id . ',id'
], $messages); ], $messages);
!$request->is_customer ? $this->validate($request,['role_id'=>'required', 'divisi_id'=>'required'], $messages) : ''; !$request->is_customer ? $this->validate($request,['role_id'=>'required', 'divisi_id'=>'required'], $messages) : '';
$request->password ? $this->validate($request,['password'=>'required|min:8']) : ''; $request->password ? $this->validate($request,['password'=>'required|min:8']) : '';
@ -144,43 +115,12 @@ class HumanResourceController extends Controller
return response()->json(['status' => 'failed', 'message' => 'Data Human Resource not found!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'Data Human Resource not found!', 'code' => 400], 400);
} }
if($request->company_id && isset($request->password) && isset($request->username)) {
$transaction = ProductTransaction::query()
->where('company_id', $request->company_id);
$cloneQueryTransaction = clone $transaction;
$countCreate = false;
$projectResult = HumanResource::query()
->selectRaw('count(*) as total_hr')
->where([
['company_id', $request->company_id],
['username', '!=', null],
['password', '!=', null]
])
->first();
if($transaction->where([['type_paket','Basic'],['amount','!=',null]])->exists()) {
if($projectResult['total_hr'] < 10) {
$countCreate = true;
}
} elseif ($cloneQueryTransaction->where([['type_paket','Free'],['amount',0]])->exists()) {
if($projectResult['total_hr'] < 1) {
$countCreate = true;
}
} else {
$countCreate = true;
}
} else {
$countCreate = true;
}
if (isset($request->password) && $request->password != "") { if (isset($request->password) && $request->password != "") {
$data['password'] = md5($request->password); $data['password'] = md5($request->password);
} }
if ($countCreate) { // $result = $humanresource->update($data);
$result = $humanresource->update($data); $result = true;
} else {
return response()->json(['status' => 'failed', 'message' => 'Limited to create human resource!', 'code' => 500], 500);
}
if ($result) { if ($result) {
return response()->json(['status' => 'success', 'data' => $result, 'message' => 'Human Resource Pool successfully updated!', 'code' => 200], 200); return response()->json(['status' => 'success', 'data' => $result, 'message' => 'Human Resource Pool successfully updated!', 'code' => 200], 200);
@ -220,7 +160,7 @@ class HumanResourceController extends Controller
public function list() public function list()
{ {
$data = HumanResource::select('id', 'name', 'role_id','company_id')->get(); $data = HumanResource::select('id', 'name', 'role_id')->get();
$countData = $data->count(); $countData = $data->count();
if ($data) { if ($data) {
@ -352,6 +292,5 @@ class HumanResourceController extends Controller
} else { } else {
print_r(json_decode($response)); print_r(json_decode($response));
} }
} }
} }

31
app/Http/Controllers/ImageController.php

@ -124,23 +124,6 @@ class ImageController extends Controller
} }
} }
$totalSize += $sizeFile; $totalSize += $sizeFile;
$transaction = ProductTransaction::query()
->where('company_id', $company['id']);
$cloneQueryTransaction = clone $transaction;
$countCreate = false;
if($transaction->where([['type_paket','Basic'], ['amount','!=',null]])->exists()) {
$maximumSize = 500 * 1024 * 1024;
$countCreate = true;
} elseif ($cloneQueryTransaction->where([['type_paket','Free'], ['amount', 0]])->exists()) {
$maximumSize = 50 * 1024 * 1024;
$countCreate = true;
}
if($countCreate) {
if ($totalSize > $maximumSize) {
return response()->json(['status'=>'failed','message'=>'Limited storage maximum!','code'=> 500], 500);
}
}
} }
foreach ($dokumen as $file) { foreach ($dokumen as $file) {
$extension = $file->extension(); $extension = $file->extension();
@ -219,12 +202,11 @@ class ImageController extends Controller
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200); return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
} }
public function deleteByRef($id, $category, $company_id) public function deleteByRef($id, $category)
{ {
$data = Image::where("ref_id", (int)$id)->where("category", $category)->first(); $data = Image::where("ref_id", (int)$id)->where("category", $category)->first();
$company = Company::find($company_id); if($data){
if($data && $company){ $destinationPath = $this->setCustomeDirectoryUpload();
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
unlink($destinationPath['pathImage'].$data->image); unlink($destinationPath['pathImage'].$data->image);
$delete = $data->delete(); $delete = $data->delete();
}else{ }else{
@ -240,16 +222,15 @@ class ImageController extends Controller
} }
} }
public function deleteByRefMultiple($id, $category, $company_id) public function deleteByRefMultiple($id, $category)
{ {
$successCount = 0; $successCount = 0;
$data = Image::where([ $data = Image::where([
["ref_id", intval($id)], ["ref_id", intval($id)],
["category", $category] ["category", $category]
])->get(); ])->get();
$company = Company::find($company_id); if($data->isNotEmpty()) {
if($data->isNotEmpty() && $company) { $destinationPath = $this->setCustomeDirectoryUpload();
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach($data as $img) { foreach($data as $img) {
unlink($destinationPath['pathImage'].$img->image); unlink($destinationPath['pathImage'].$img->image);
$delete = $img->delete(); $delete = $img->delete();

1
app/Http/Controllers/ProductTransactionController.php

@ -10,7 +10,6 @@ class ProductTransactionController extends Controller
public function add(Request $request) public function add(Request $request)
{ {
$this->validate($request, [ $this->validate($request, [
'company_id' => 'required|integer',
'type_paket' => 'required|string', 'type_paket' => 'required|string',
'amount' => 'required', 'amount' => 'required',
'exp_ospro' => 'required' 'exp_ospro' => 'required'

5
app/Http/Controllers/ProjectCarausellController.php

@ -16,16 +16,13 @@ class ProjectCarausellController extends Controller
public function invoke(Request $request) public function invoke(Request $request)
{ {
// Master Data // Master Data
$company_id = $request->route('company_id');
$all_project = $request->route('all_project'); $all_project = $request->route('all_project');
$hierarchy = $request->route('hierarchy'); $hierarchy = $request->route('hierarchy');
$query = Project::query() $query = Project::query()
->select("id", "nama", "kode_sortname", "pm_id", "budget_health", "calculation_status", "mulai_proyek", "akhir_proyek", "rencana_biaya", "company", "scurve"); ->select("id", "nama", "kode_sortname", "pm_id", "budget_health", "calculation_status", "mulai_proyek", "akhir_proyek", "rencana_biaya", "company", "scurve");
if ($all_project) { if (!$all_project) {
$query->where('company_id', $company_id);
} else {
$query->where('created_by_id', $hierarchy); $query->where('created_by_id', $hierarchy);
} }

59
app/Http/Controllers/ProjectController.php

@ -60,7 +60,6 @@ class ProjectController extends Controller
'akhir_proyek' => 'required', 'akhir_proyek' => 'required',
'rencana_biaya' => 'required', 'rencana_biaya' => 'required',
'type_proyek_id' => 'required', 'type_proyek_id' => 'required',
'company_id' => 'required'
]); ]);
DB::beginTransaction(); DB::beginTransaction();
try { try {
@ -72,29 +71,9 @@ class ProjectController extends Controller
if (empty($data['phase_id'])) { if (empty($data['phase_id'])) {
$data['phase_id'] = 1; $data['phase_id'] = 1;
} }
$transaction = ProductTransaction::query()
->where('company_id', $request->company_id);
$cloneQueryTransaction = clone $transaction;
$countCreate = false;
$projectResult = Project::query()
->selectRaw('count(*) as total_project')
->where('company_id', $request->company_id)
->first();
if ($transaction->where([['type_paket', 'Basic'], ['amount', '!=', null]])->exists()) {
if ($projectResult['total_project'] < 10) {
$countCreate = true;
}
} elseif ($cloneQueryTransaction->where([['type_paket', 'Free'], ['amount', 0]])->exists()) {
if ($projectResult['total_project'] < 1) {
$countCreate = true;
}
} else {
$countCreate = true;
}
if ($countCreate) {
$result = Project::create($data); $result = Project::create($data);
if (!$result) { if (!$result) {
return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 500], 500); return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 500], 500);
} else { } else {
@ -103,9 +82,6 @@ class ProjectController extends Controller
DB::commit(); DB::commit();
return response()->json(['status' => 'success', 'message' => 'Data added!', 'data_result' => $dataResultInsert, 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Data added!', 'data_result' => $dataResultInsert, 'code' => 200], 200);
} }
} else {
return response()->json(['status' => 'failed', 'message' => 'Limited to create project!', 'code' => 500], 500);
}
} catch (\Throwable $th) { } catch (\Throwable $th) {
DB::rollBack(); DB::rollBack();
} }
@ -150,7 +126,6 @@ class ProjectController extends Controller
'phase_id', 'phase_id',
'calculation_status', 'calculation_status',
'md.name as divisi_name', 'md.name as divisi_name',
'm_proyek.company_id'
) )
->leftJoin('m_divisi as md', 'md.id', '=', 'm_proyek.divisi_id') ->leftJoin('m_divisi as md', 'md.id', '=', 'm_proyek.divisi_id')
->where('m_proyek.id', $id) ->where('m_proyek.id', $id)
@ -207,15 +182,13 @@ class ProjectController extends Controller
return true; return true;
} }
public function delete($id, $company_id) public function delete($id)
{ {
DB::beginTransaction(); DB::beginTransaction();
$data = Project::find($id); $data = Project::find($id);
$dateNow = Carbon::now();
if ($data) { if ($data) {
$this->deleteRelative($id, $company_id); $this->deleteRelative($id);
if ($data->delete()) { if ($data->delete()) {
// if ($data->update(['deleted_at' => $dateNow, 'deleted_by_id' => $this->currentId])) {
DB::commit(); DB::commit();
return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200);
} else { } else {
@ -228,9 +201,9 @@ class ProjectController extends Controller
} }
} }
private function deleteRelative($project_id, $company_id) private function deleteRelative($project_id)
{ {
DB::transaction(function () use ($project_id, $company_id) { DB::transaction(function () use ($project_id) {
UserToProyek::where('proyek_id', $project_id)->delete(); UserToProyek::where('proyek_id', $project_id)->delete();
UserToActivity::where('proyek_id', $project_id)->delete(); UserToActivity::where('proyek_id', $project_id)->delete();
AssignMaterial::where('proyek_id', $project_id)->delete(); AssignMaterial::where('proyek_id', $project_id)->delete();
@ -247,22 +220,20 @@ class ProjectController extends Controller
OfficeHours::where('proyek_id', $project_id)->delete(); OfficeHours::where('proyek_id', $project_id)->delete();
ReportK3::where('proyek_id', $project_id)->delete(); ReportK3::where('proyek_id', $project_id)->delete();
RequestMaterial::where('proyek_id', $project_id)->delete(); RequestMaterial::where('proyek_id', $project_id)->delete();
$this->deleteVersionGantt($project_id, $company_id); $this->deleteVersionGantt($project_id);
$this->deleteDokumenProject($project_id, $company_id); $this->deleteDokumenProject($project_id);
}, 5); }, 5);
} }
private function deleteVersionGantt($project_id, $company_id) private function deleteVersionGantt($project_id)
{ {
DB::transaction(function () use ($project_id, $company_id) { DB::transaction(function () use ($project_id) {
$dataVg = VersionGantt::where("proyek_id", $project_id)->pluck("id"); $dataVg = VersionGantt::where("proyek_id", $project_id)->pluck("id");
$vhIds = $dataVg->all(); $vhIds = $dataVg->all();
$activity = Activity::whereIn("version_gantt_id", $vhIds)->pluck('id'); $activity = Activity::whereIn("version_gantt_id", $vhIds)->pluck('id');
$activityIds = $activity->all(); $activityIds = $activity->all();
$dataRa = ReportActivity::whereIn("activity_id", $activityIds)->get(); $dataRa = ReportActivity::whereIn("activity_id", $activityIds)->get();
$company = Company::find($company_id); $destinationPath = $this->setCustomeDirectoryUpload();
if ($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach ($dataRa as $ra) { foreach ($dataRa as $ra) {
$images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get(); $images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get();
foreach ($images as $image) { foreach ($images as $image) {
@ -278,7 +249,6 @@ class ProjectController extends Controller
unlink($destinationPath['pathActivityDocument'] . $ad->file); unlink($destinationPath['pathActivityDocument'] . $ad->file);
} }
} }
}
ActivityDokumen::whereIn("activity_id", $activityIds)->delete(); ActivityDokumen::whereIn("activity_id", $activityIds)->delete();
CommentActivity::whereIn("activity_id", $activityIds)->delete(); CommentActivity::whereIn("activity_id", $activityIds)->delete();
Holiday::where("proyek_id", $project_id)->delete(); Holiday::where("proyek_id", $project_id)->delete();
@ -290,19 +260,16 @@ class ProjectController extends Controller
}, 5); }, 5);
} }
private function deleteDokumenProject($project_id, $company_id) private function deleteDokumenProject($project_id)
{ {
DB::transaction(function () use ($project_id, $company_id) { DB::transaction(function () use ($project_id) {
$dataDokumen = DokumenProject::where([['type_dokumen', 'project-document-out-folder'], ['ref_id', $project_id]])->get(); $dataDokumen = DokumenProject::where([['type_dokumen', 'project-document-out-folder'], ['ref_id', $project_id]])->get();
$company = Company::find($company_id); $destinationPath = $this->setCustomeDirectoryUpload();
if ($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach ($dataDokumen as $dokumen) { foreach ($dataDokumen as $dokumen) {
if (file_exists($destinationPath['pathDocument'] . $dokumen->file)) { if (file_exists($destinationPath['pathDocument'] . $dokumen->file)) {
unlink($destinationPath['pathDocument'] . $dokumen->file); unlink($destinationPath['pathDocument'] . $dokumen->file);
} }
} }
}
DokumenProject::where([['type_dokumen', 'project-document-out-folder'], ['ref_id', $project_id]])->delete(); DokumenProject::where([['type_dokumen', 'project-document-out-folder'], ['ref_id', $project_id]])->delete();
$dataFolder = FolderDocumentProyek::where('proyek_id', $project_id)->pluck("id"); $dataFolder = FolderDocumentProyek::where('proyek_id', $project_id)->pluck("id");
$ref_ids = $dataFolder->all(); $ref_ids = $dataFolder->all();

42
app/Http/Controllers/ProjectDokumenController.php

@ -9,7 +9,8 @@ use Illuminate\Support\Facades\DB;
class ProjectDokumenController extends Controller class ProjectDokumenController extends Controller
{ {
public function dokumenByProyekId($id){ public function dokumenByProyekId($id)
{
if (empty($id) || !is_int((int)$id)) { if (empty($id) || !is_int((int)$id)) {
return response()->json(['status' => 'failed', 'message' => 'project id is required!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'project id is required!', 'code' => 400], 400);
} }
@ -22,7 +23,7 @@ class ProjectDokumenController extends Controller
return response()->json(['status' => 'success', 'data' => $document, 'code' => 200], 200); return response()->json(['status' => 'success', 'data' => $document, 'code' => 200], 200);
} }
public function delete($id, $company_id) public function delete($id)
{ {
if (empty($id) || !is_int((int)$id)) { if (empty($id) || !is_int((int)$id)) {
return response()->json(['status' => 'failed', 'message' => 'id is required!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'id is required!', 'code' => 400], 400);
@ -32,12 +33,9 @@ class ProjectDokumenController extends Controller
if (!$document) { if (!$document) {
return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 400], 400);
} }
$company = Company::find($company_id); $destinationPath = $this->setCustomeDirectoryUpload();
if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
if (file_exists($destinationPath['pathDocument'] . $document['file'])) { if (file_exists($destinationPath['pathDocument'] . $document['file'])) {
unlink($destinationPath['pathDocument'] . $document['file']); unlink($destinationPath['pathDocument'] . $document['file']);
}
} }
$document->delete(); $document->delete();
return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Data deleted!', 'code' => 200], 200);
@ -55,17 +53,8 @@ class ProjectDokumenController extends Controller
$extension = pathinfo($originalFilename, PATHINFO_EXTENSION); $extension = pathinfo($originalFilename, PATHINFO_EXTENSION);
$filename = pathinfo($originalFilename, PATHINFO_FILENAME); $filename = pathinfo($originalFilename, PATHINFO_FILENAME);
$name = $filename . '_' . $timeNow->format('d-m-y-His') . '.' . $extension; $name = $filename . '_' . $timeNow->format('d-m-y-His') . '.' . $extension;
// Limited Storage
$company = Company::whereId($request->company_id)->first(); $destinationPath = $this->setCustomeDirectoryUpload();
if($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
$getLimitStorage = $this->setLimitsStorage($company, $document, $destinationPath['pathDocument'],$destinationPath);
}
if(isset($getLimitStorage)) {
if($getLimitStorage === false) {
DB::rollBack();
return response()->json(['status' => 'failed', 'message' => 'Limited storage maximum!', 'code' => 500], 500);
}
$data = [ $data = [
'ref_id' => (int)$ref_id, 'ref_id' => (int)$ref_id,
'file' => $name, 'file' => $name,
@ -73,7 +62,6 @@ class ProjectDokumenController extends Controller
]; ];
$result = DokumenProject::create($data); $result = DokumenProject::create($data);
if (!$document->move($destinationPath['pathDocument'], $name) && $result) { if (!$document->move($destinationPath['pathDocument'], $name) && $result) {
unlink($destinationPath['pathDocument'] . $name); unlink($destinationPath['pathDocument'] . $name);
DB::rollBack(); DB::rollBack();
@ -82,14 +70,12 @@ class ProjectDokumenController extends Controller
DB::commit(); DB::commit();
return response()->json(['status' => 'success', 'message' => 'Dokumen project berhasil diupload!', 'code' => 200], 200); return response()->json(['status' => 'success', 'message' => 'Dokumen project berhasil diupload!', 'code' => 200], 200);
} }
DB::rollBack();
return response()->json(['status'=>'failed','message'=>'Dokumen project gagal diupload!','code'=> 500], 500);
}
DB::rollBack(); DB::rollBack();
return response()->json(['status' => 'failed', 'message' => 'File is required!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'File is required!', 'code' => 400], 400);
} }
public function searchDocProject(Request $request){ public function searchDocProject(Request $request)
{
$payload = $request->all(); $payload = $request->all();
$dataBuilder = $this->setUpPayload($payload, 'document_project'); $dataBuilder = $this->setUpPayload($payload, 'document_project');
@ -101,27 +87,25 @@ class ProjectDokumenController extends Controller
return response()->json(['status' => 'success', 'code' => 200, 'data' => $dataGet, 'totalRecord' => $totalRecord], 200); return response()->json(['status' => 'success', 'code' => 200, 'data' => $dataGet, 'totalRecord' => $totalRecord], 200);
} }
public function downloadDokumen($id, $company_id) public function downloadDokumen($id)
{ {
if (empty($id) || !is_int((int)$id)) { if (empty($id) || !is_int((int)$id)) {
return response()->json(['status' => 'failed', 'message' => 'Id is required!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'Id is required!', 'code' => 400], 400);
} }
$document = DokumenProject::find($id); $document = DokumenProject::find($id);
$company = Company::find($company_id);
if(!$document || !$company) { if (!$document) {
return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 404], 404); return response()->json(['status' => 'failed', 'message' => 'Data not found!', 'code' => 404], 404);
} }
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']); $destinationPath = $this->setCustomeDirectoryUpload();
$pathToFile = $destinationPath['pathDocument'] . $document['file']; $pathToFile = $destinationPath['pathDocument'] . $document['file'];
if (!file_exists($pathToFile)) { if (!file_exists($pathToFile)) {
return response()->json(['status' => 'failed', 'message' => 'Directory not found!', 'code' => 404], 404); return response()->json(['status' => 'failed', 'message' => 'Directory not found!', 'code' => 404], 404);
} }
if($company) {
$name = pathinfo($pathToFile, PATHINFO_FILENAME) . "." . pathinfo($pathToFile, PATHINFO_EXTENSION); $name = pathinfo($pathToFile, PATHINFO_FILENAME) . "." . pathinfo($pathToFile, PATHINFO_EXTENSION);
}
$headers = [ $headers = [
'Content-Disposition' => 'attachment; filename="' . $name . '"' 'Content-Disposition' => 'attachment; filename="' . $name . '"'
]; ];

1
app/Http/Controllers/ProjectExpenditureController.php

@ -16,7 +16,6 @@ class ProjectExpenditureController extends Controller
// Set Unique // Set Unique
$result = ProjectExpenditure::query() $result = ProjectExpenditure::query()
->where([ ->where([
['company_id',$data['company_id']],
['name', $data['name']] ['name', $data['name']]
])->first(); ])->first();
if($result) { if($result) {

1
app/Http/Controllers/ProjectFinancialHealthController.php

@ -16,7 +16,6 @@ class ProjectFinancialHealthController extends Controller
// Set Unique // Set Unique
$result = ProjectFinancialHealth::query() $result = ProjectFinancialHealth::query()
->where([ ->where([
['company_id',$data['company_id']],
['name', $data['name']] ['name', $data['name']]
])->first(); ])->first();
if($result) { if($result) {

1
app/Http/Controllers/ProjectInvoiceController.php

@ -16,7 +16,6 @@ class ProjectInvoiceController extends Controller
// Set Unique // Set Unique
$result = ProjectInvoice::query() $result = ProjectInvoice::query()
->where([ ->where([
['company_id',$data['company_id']],
['name', $data['name']] ['name', $data['name']]
])->first(); ])->first();
if($result) { if($result) {

2
app/Http/Controllers/ProjectRoleController.php

@ -12,7 +12,6 @@ class ProjectRoleController extends Controller
$this->validate($request, [ $this->validate($request, [
'name' => 'required', 'name' => 'required',
'description' => 'required', 'description' => 'required',
'company_id' => 'required'
]); ]);
$data = $request->all(); $data = $request->all();
@ -20,7 +19,6 @@ class ProjectRoleController extends Controller
$data['created_by'] = $this->currentName; $data['created_by'] = $this->currentName;
$result = ProjectRole::create($data); $result = ProjectRole::create($data);
if($result){ if($result){
return response()->json(['status'=>'success','message'=>'add data project role successfully!','code'=>200], 200); return response()->json(['status'=>'success','message'=>'add data project role successfully!','code'=>200], 200);
}else{ }else{

1
app/Http/Controllers/ProjectScheduleHealthController.php

@ -16,7 +16,6 @@ class ProjectScheduleHealthController extends Controller
// Set Unique // Set Unique
$result = ProjectScheduleHealth::query() $result = ProjectScheduleHealth::query()
->where([ ->where([
['company_id',$data['company_id']],
['name', $data['name']] ['name', $data['name']]
])->first(); ])->first();
if($result) { if($result) {

7
app/Http/Controllers/ReportActivityMaterialController.php

@ -102,14 +102,13 @@ class ReportActivityMaterialController extends Controller
} }
} }
public function delete($id, $company_id) public function delete($id)
{ {
$data = ReportActivityMaterial::findOrFail($id); $data = ReportActivityMaterial::findOrFail($id);
$company = Company::find($company_id);
$image = Image::where([['ref_id', $id],['category','report_activity']])->first(); $image = Image::where([['ref_id', $id],['category','report_activity']])->first();
if($data && $company && $image) { if($data && $image) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']); $destinationPath = $this->setCustomeDirectoryUpload();
unlink($destinationPath['pathImage'].$image['image']); unlink($destinationPath['pathImage'].$image['image']);
} }
if(!$data->delete()) { if(!$data->delete()) {

4
app/Http/Controllers/RoleController.php

@ -11,9 +11,8 @@ class RoleController extends Controller
public function add(Request $request) public function add(Request $request)
{ {
$this->validate($request, [ $this->validate($request, [
'name' => 'string|required|unique:m_roles,name,NULL,id,company_id,' . $request->input('company_id'), 'name' => 'string|required|unique:m_roles,name,NULL,id',
'description' => 'required', 'description' => 'required',
'company_id' => 'required'
]); ]);
$data = $request->all(); $data = $request->all();
@ -24,7 +23,6 @@ class RoleController extends Controller
} }
$result = Role::create($data); $result = Role::create($data);
if (!$result) if (!$result)
return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 500], 500); return response()->json(['status' => 'failed', 'message' => 'Failed to add data!', 'code' => 500], 500);

11
app/Http/Controllers/UserToProyekController.php

@ -113,7 +113,7 @@ class UserToProyekController extends Controller
} }
} }
public function delete($id, $company_id) public function delete($id)
{ {
$data = UserToProyek::find($id); $data = UserToProyek::find($id);
if ($data) { if ($data) {
@ -121,7 +121,7 @@ class UserToProyekController extends Controller
$proyekId = $data->proyek_id; $proyekId = $data->proyek_id;
$delete = $data->delete(); $delete = $data->delete();
if ($delete) { if ($delete) {
$this->deleteRelative($proyekId, $userId, $company_id); $this->deleteRelative($proyekId, $userId);
} }
} else { } else {
return response()->json(['status' => 'failed', 'message' => 'data assign hr to proyek not found!', 'code' => 400], 400); return response()->json(['status' => 'failed', 'message' => 'data assign hr to proyek not found!', 'code' => 400], 400);
@ -136,14 +136,12 @@ class UserToProyekController extends Controller
} }
} }
private function deleteRelative($proyekId, $userId, $company_id) private function deleteRelative($proyekId, $userId)
{ {
$uta = UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->get(); $uta = UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->get();
foreach ($uta as $value) { foreach ($uta as $value) {
$dataRa = ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->get(); $dataRa = ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->get();
$company = Company::find($company_id); $destinationPath = $this->setCustomeDirectoryUpload();
if ($company) {
$destinationPath = $this->setCustomeDirectoryUpload($company['company_name']);
foreach ($dataRa as $ra) { foreach ($dataRa as $ra) {
$images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get(); $images = Image::where("ref_id", $ra->id)->where("category", "report_activity")->get();
foreach ($images as $image) { foreach ($images as $image) {
@ -155,7 +153,6 @@ class UserToProyekController extends Controller
} }
ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->delete(); ReportActivity::where("activity_id", $value->activity_id)->where("user_id", $value->user_id)->delete();
} }
}
UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->delete(); UserToActivity::where("proyek_id", $proyekId)->where("user_id", $userId)->delete();
} }

8163
composer.lock generated

File diff suppressed because it is too large Load Diff

50
routes/web.php

@ -42,20 +42,20 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->group(['middleware' => ['auth', 'cors']], function () use ($router) { $router->group(['middleware' => ['auth', 'cors']], function () use ($router) {
$router->get('/dashboard/get-company-cashflow/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getCompanyCashFlow'); // project expenditure $router->get('/dashboard/get-company-cashflow/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getCompanyCashFlow'); // project expenditure
$router->get('/dashboard/get-invoice-outstanding/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getInvoiceOutstanding'); // project invoice vs cash in $router->get('/dashboard/get-invoice-outstanding/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getInvoiceOutstanding'); // project invoice vs cash in
$router->get('/dashboard/get-total-project-per-schedule-health/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerScheduleHealth'); $router->get('/dashboard/get-total-project-per-schedule-health/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerScheduleHealth');
$router->get('/dashboard/get-total-project-per-budget-health/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerBudgetHealth'); $router->get('/dashboard/get-total-project-per-budget-health/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerBudgetHealth');
$router->get('/dashboard/get-total-project-schedule-health-per-division/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectScheduleHealthPerDivision'); $router->get('/dashboard/get-total-project-schedule-health-per-division/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectScheduleHealthPerDivision');
$router->get('/dashboard/get-total-project-budget-health-per-division/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectBudgetHealthPerDivision'); $router->get('/dashboard/get-total-project-budget-health-per-division/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectBudgetHealthPerDivision');
$router->get('/dashboard/get-total-project-per-phase/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerPhase'); $router->get('/dashboard/get-total-project-per-phase/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerPhase');
$router->get('/dashboard/get-total-project-per-division/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerDivision'); $router->get('/dashboard/get-total-project-per-division/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectPerDivision');
$router->get('/dashboard/get-total-project-value-per-division/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectValuePerDivision'); $router->get('/dashboard/get-total-project-value-per-division/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getTotalProjectValuePerDivision');
$router->get('/dashboard/get-detail-expenditure/{company_id}/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getDetailExpenditure'); $router->get('/dashboard/get-detail-expenditure/{all_project}/{hierarchy}/{role_name}', 'DashboardBoDController@getDetailExpenditure');
$router->get('/dashboard/get-detail-expenditure-color/{company_id}/{role_name}', 'DashboardBoDController@getDetailExpenditureColor'); $router->get('/dashboard/get-detail-expenditure-color/{role_name}', 'DashboardBoDController@getDetailExpenditureColor');
$router->get('/dashboard/get-detail-financial-health-color/{company_id}/{role_name}', 'DashboardBoDController@getDetailFinancialHealthColor'); $router->get('/dashboard/get-detail-financial-health-color/{role_name}', 'DashboardBoDController@getDetailFinancialHealthColor');
$router->get('/dashboard/get-detail-schedule-health-color/{company_id}/{role_name}', 'DashboardBoDController@getDetailScheduleHealthColor'); $router->get('/dashboard/get-detail-schedule-health-color/{role_name}', 'DashboardBoDController@getDetailScheduleHealthColor');
$router->get('/dashboard/get-detail-invoice-color/{company_id}/{role_name}', 'DashboardBoDController@getDetailInvoiceColor'); $router->get('/dashboard/get-detail-invoice-color/{role_name}', 'DashboardBoDController@getDetailInvoiceColor');
$router->post('/role/search', 'RoleController@search'); $router->post('/role/search', 'RoleController@search');
$router->post('/role/add', 'RoleController@add'); $router->post('/role/add', 'RoleController@add');
@ -66,15 +66,15 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->post('/document-project/upload', 'ProjectDokumenController@uploadProjectDokumen'); $router->post('/document-project/upload', 'ProjectDokumenController@uploadProjectDokumen');
$router->get('/document-project/get/{id}', 'ProjectDokumenController@dokumenByProyekId'); $router->get('/document-project/get/{id}', 'ProjectDokumenController@dokumenByProyekId');
$router->delete('/document-project/delete/{id}/{company_id}', 'ProjectDokumenController@delete'); $router->delete('/document-project/delete/{id}', 'ProjectDokumenController@delete');
$router->post('/document-project/search', 'ProjectDokumenController@searchDocProject'); $router->post('/document-project/search', 'ProjectDokumenController@searchDocProject');
$router->get('/document-project/download/{id}/{company_id}', 'ProjectDokumenController@downloadDokumen'); $router->get('/document-project/download/{id}', 'ProjectDokumenController@downloadDokumen');
$router->post('/document-activity/upload', 'ActivityDokumenController@uploadProjectDokumen'); $router->post('/document-activity/upload', 'ActivityDokumenController@uploadProjectDokumen');
$router->get('/document-activity/get/{id}', 'ActivityDokumenController@dokumenByActivityId'); $router->get('/document-activity/get/{id}', 'ActivityDokumenController@dokumenByActivityId');
$router->delete('/document-activity/delete/{id}/{company_id}', 'ActivityDokumenController@delete'); $router->delete('/document-activity/delete/{id}', 'ActivityDokumenController@delete');
$router->post('/document-activity/search', 'ActivityDokumenController@searchDocProject'); $router->post('/document-activity/search', 'ActivityDokumenController@searchDocProject');
$router->get('/document-activity/download/{id}/{company_id}', 'ActivityDokumenController@downloadDokumen'); $router->get('/document-activity/download/{id}', 'ActivityDokumenController@downloadDokumen');
$router->get('/project-by-customer/{id}', 'ProjectController@getByUser'); $router->get('/project-by-customer/{id}', 'ProjectController@getByUser');
$router->post('/project/search', 'ProjectController@search'); $router->post('/project/search', 'ProjectController@search');
@ -82,7 +82,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->put('/project/update/{id}', 'ProjectController@update'); $router->put('/project/update/{id}', 'ProjectController@update');
$router->get('/project/edit/{id}', 'ProjectController@edit'); $router->get('/project/edit/{id}', 'ProjectController@edit');
$router->get('/project/detail/{id}[/{gantt_id}[/{s_curve}]]', 'ProjectController@detail'); $router->get('/project/detail/{id}[/{gantt_id}[/{s_curve}]]', 'ProjectController@detail');
$router->delete('/project/delete/{id}/{company_id}', 'ProjectController@delete'); $router->delete('/project/delete/{id}', 'ProjectController@delete');
$router->get('/project/list', 'ProjectController@list'); $router->get('/project/list', 'ProjectController@list');
$router->get('/project/set-baseline/{gantt_id}', 'ProjectController@setBaseline'); $router->get('/project/set-baseline/{gantt_id}', 'ProjectController@setBaseline');
$router->get('/project/set-baseline-activity/{activity_id}/{gantt_id}', 'ProjectController@setBaselineActivity'); $router->get('/project/set-baseline-activity/{activity_id}/{gantt_id}', 'ProjectController@setBaselineActivity');
@ -106,7 +106,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
/* $router->get('/project/get-status-health-schedule/{id}', 'ProjectController@getStatusSchedule'); */ /* $router->get('/project/get-status-health-schedule/{id}', 'ProjectController@getStatusSchedule'); */
/* $router->get('/project/get-status-health-budget/{id}', 'ProjectController@getStatusBudget'); */ /* $router->get('/project/get-status-health-budget/{id}', 'ProjectController@getStatusBudget'); */
$router->get('/project-carausell/{company_id}/{all_project}/{hierarchy}', 'ProjectCarausellController@invoke'); $router->get('/project-carausell/{all_project}/{hierarchy}', 'ProjectCarausellController@invoke');
$router->post('/project-charter/search', 'ProjectCharterController@search'); $router->post('/project-charter/search', 'ProjectCharterController@search');
$router->post('/project-charter/add', 'ProjectCharterController@add'); $router->post('/project-charter/add', 'ProjectCharterController@add');
@ -333,8 +333,8 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->post('/image/search', 'ImageController@search'); $router->post('/image/search', 'ImageController@search');
$router->delete('/image/delete/{id}', 'ImageController@delete'); $router->delete('/image/delete/{id}', 'ImageController@delete');
$router->delete('/image/delete/{id}/{category}/{company_id}', 'ImageController@deleteByRef'); $router->delete('/image/delete/{id}/{category}', 'ImageController@deleteByRef');
$router->delete('/image/multiple-delete/{id}/{category}/{company_id}', 'ImageController@deleteByRefMultiple'); $router->delete('/image/multiple-delete/{id}/{category}', 'ImageController@deleteByRefMultiple');
$router->post('/image/upload', 'ImageController@uploadImage'); $router->post('/image/upload', 'ImageController@uploadImage');
$router->post('/image/multiple-upload', 'ImageController@uploadMultipleImage'); $router->post('/image/multiple-upload', 'ImageController@uploadMultipleImage');
$router->get('/image/{id}/{category}', 'ImageController@getByRefId'); $router->get('/image/{id}/{category}', 'ImageController@getByRefId');
@ -431,7 +431,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->post('/report-activity-material/add', 'ReportActivityMaterialController@add'); $router->post('/report-activity-material/add', 'ReportActivityMaterialController@add');
$router->post('/report-activity-material/search', 'ReportActivityMaterialController@search'); $router->post('/report-activity-material/search', 'ReportActivityMaterialController@search');
$router->delete('/report-activity-material/delete/{id}/{company_id}', 'ReportActivityMaterialController@delete'); $router->delete('/report-activity-material/delete/{id}', 'ReportActivityMaterialController@delete');
$router->get('/report-activity-material/list', 'ReportActivityMaterialController@list'); $router->get('/report-activity-material/list', 'ReportActivityMaterialController@list');
$router->get('/report-activity-material/datatables', 'ReportActivityMaterialController@datatables'); $router->get('/report-activity-material/datatables', 'ReportActivityMaterialController@datatables');
$router->post('/report-activity-material/update-status', 'ReportActivityMaterialController@updateStatusStartFinish'); $router->post('/report-activity-material/update-status', 'ReportActivityMaterialController@updateStatusStartFinish');
@ -485,7 +485,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->get('/user-to-proyek/edit/{id}', 'UserToProyekController@edit'); $router->get('/user-to-proyek/edit/{id}', 'UserToProyekController@edit');
$router->put('/user-to-proyek/update/{id}', 'UserToProyekController@update'); $router->put('/user-to-proyek/update/{id}', 'UserToProyekController@update');
$router->post('/user-to-proyek/search', 'UserToProyekController@search'); $router->post('/user-to-proyek/search', 'UserToProyekController@search');
$router->delete('/user-to-proyek/delete/{id}/{company_id}', 'UserToProyekController@delete'); $router->delete('/user-to-proyek/delete/{id}', 'UserToProyekController@delete');
$router->get('/user-to-proyek/list', 'UserToProyekController@list'); $router->get('/user-to-proyek/list', 'UserToProyekController@list');
$router->get('/user-to-proyek/select', 'UserToProyekController@select'); $router->get('/user-to-proyek/select', 'UserToProyekController@select');
$router->get('/user-to-proyek/get-employee-integration', 'UserToProyekController@getEmployeeIntegration'); $router->get('/user-to-proyek/get-employee-integration', 'UserToProyekController@getEmployeeIntegration');
@ -494,7 +494,7 @@ $router->group(['prefix' => 'api', 'middleware' => 'cors'], function () use ($ro
$router->get('/folder-document-proyek/edit/{id}', 'FolderDocumentProyekController@edit'); $router->get('/folder-document-proyek/edit/{id}', 'FolderDocumentProyekController@edit');
$router->put('/folder-document-proyek/update/{id}', 'FolderDocumentProyekController@update'); $router->put('/folder-document-proyek/update/{id}', 'FolderDocumentProyekController@update');
$router->post('/folder-document-proyek/search', 'FolderDocumentProyekController@search'); $router->post('/folder-document-proyek/search', 'FolderDocumentProyekController@search');
$router->delete('/folder-document-proyek/delete/{id}/{company_id}', 'FolderDocumentProyekController@delete'); $router->delete('/folder-document-proyek/delete/{id}', 'FolderDocumentProyekController@delete');
$router->get('/folder-document-proyek/list', 'FolderDocumentProyekController@list'); $router->get('/folder-document-proyek/list', 'FolderDocumentProyekController@list');
$router->get('/folder-document-proyek/get-tree/{id}', 'FolderDocumentProyekController@getTree'); $router->get('/folder-document-proyek/get-tree/{id}', 'FolderDocumentProyekController@getTree');

Loading…
Cancel
Save