| @@ 70-95 (lines=26) @@ | ||
| 67 | //return view('unit_kerja.add-child',compact('unit_kerja')); |
|
| 68 | } |
|
| 69 | ||
| 70 | public function storeRoot($request = array()) |
|
| 71 | { |
|
| 72 | $check_root = LaravelOpdModel::where('id',$request->root); |
|
| 73 | ||
| 74 | if($check_root->first()->isEmpty()) |
|
| 75 | { |
|
| 76 | ||
| 77 | $unit_kerja = LaravelOpdModel::create([ |
|
| 78 | 'kunker' => $request->kunker, |
|
| 79 | 'kunker_simral' => '', |
|
| 80 | 'kunker_sinjab' => '', |
|
| 81 | 'name' => $request->name, |
|
| 82 | 'levelunker' => $request->levelunker, |
|
| 83 | 'npej' => $request->npej, |
|
| 84 | 'njab' => $request->njab |
|
| 85 | ]); |
|
| 86 | } |
|
| 87 | else |
|
| 88 | { |
|
| 89 | return redirect()->back(); |
|
| 90 | } |
|
| 91 | ||
| 92 | ||
| 93 | ||
| 94 | return redirect()->back(); |
|
| 95 | } |
|
| 96 | ||
| 97 | public function storeChild($request = array()) |
|
| 98 | { |
|
| @@ 64-87 (lines=24) @@ | ||
| 61 | return view('laravel-opd::unit_kerja.add-child',compact('unit_kerja')); |
|
| 62 | } |
|
| 63 | ||
| 64 | public function storeRoot(Request $request) |
|
| 65 | { |
|
| 66 | $check_root = LaravelOpdModel::where('id',$request->root); |
|
| 67 | ||
| 68 | if($check_root->get()->isEmpty()) |
|
| 69 | { |
|
| 70 | $unit_kerja = LaravelOpdModel::create([ |
|
| 71 | 'kunker' => $request->kunker, |
|
| 72 | 'kunker_sinjab' => '', |
|
| 73 | 'kunker_simral' => '', |
|
| 74 | 'kunker_sinjab' => '', |
|
| 75 | 'name' => $request->name, |
|
| 76 | 'levelunker' => $request->levelunker, |
|
| 77 | 'njab' => $request->njab, |
|
| 78 | 'npej' => $request->npej |
|
| 79 | ]); |
|
| 80 | } |
|
| 81 | else |
|
| 82 | { |
|
| 83 | return redirect()->back(); |
|
| 84 | } |
|
| 85 | ||
| 86 | return redirect()->back(); |
|
| 87 | } |
|
| 88 | ||
| 89 | public function storeChild(Request $request) |
|
| 90 | { |
|