Browse Source

update progress import

pull/3/head
ibnu 2 years ago
parent
commit
3c1846cbcd
  1. 15
      app/Http/Controllers/ActivityController.php

15
app/Http/Controllers/ActivityController.php

@ -281,7 +281,8 @@ class ActivityController extends Controller
return response()->json(['status'=>'success','code'=>200,'data'=>$dataGet, 'totalRecord'=>$totalRecord], 200);
}
public function import(Request $request)
// before upload file
public function importOld(Request $request)
{
$data = $request->all();
@ -388,6 +389,18 @@ class ActivityController extends Controller
return response()->json(['stack' => $activityStack, 'status' => 'success', 'message' => 'Data imported!', 'projectId' => $projectId, 'code' => 200], 200);
}
public function import(Request $request)
{
$data = $request->all();
$data['created_by'] = $this->currentName;
Activity::where('version_gantt_id', $data['ganttId'])->delete();
$projectId = VersionGantt::where('id', $data['ganttId'])->first()->proyek_id;
// get data excel
$excel = TmpImport::lates('id')->first();
return response()->json(['stack' => $excel, 'status' => 'success', 'message' => 'Data imported!', 'projectId' => $projectId, 'code' => 200], 200);
}
public function uploadTmpImport(Request $request)
{
if($request->hasFile('dokumen')){

Loading…
Cancel
Save