| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -209,49 +209,59 @@ class ServiceSectionController extends Controller | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $point_descriptions = $request->point_descriptions ?? []; | 
					 | 
					 | 
					 | 
					            $point_descriptions = $request->point_descriptions ?? []; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            $icons = $request->icons ?? []; | 
					 | 
					 | 
					 | 
					            $icons = $request->icons ?? []; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					             | 
					 | 
					 | 
					 | 
					             | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					             | 
					 | 
					 | 
					 | 
					            if((!empty($points)) && ($points[0] != null)){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            if($points != null && $point_ids != null){ | 
					 | 
					 | 
					 | 
					                $service_section_point = $service_section->service_section_point(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					               foreach($request['point_ids'] as $key => $pid){ | 
					 | 
					 | 
					 | 
					                $service_section_point->delete(); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                foreach($points as $point){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    $service_section_point = new ServiceSectionPoint(); | 
					 | 
					 | 
					 | 
					                    $service_section_point = new ServiceSectionPoint(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                $service_section_point = $service_section_point->findorfail($pid); | 
					 | 
					 | 
					 | 
					                    $service_section_point->service_section_id = $service_section->id; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                // $service_section_point =  ServiceSectionPoint::find($id); | 
					 | 
					 | 
					 | 
					                    $service_section_point->point = $point; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					                    $service_section_point->save(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if(array_key_exists($key,$point_descriptions)){ | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                         $service_section_point->point_description = $point_descriptions[$key]; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if(array_key_exists($key,$icons)){ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        $extension = $icons[$key]->getClientOriginalExtension(); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        $image_folder_type = array_search('service',config('custom.image_folders')); //for image saved in folder | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					             | 
					 | 
					 | 
					 | 
					             | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        $count = rand(100,999); | 
					 | 
					 | 
					 | 
					            // if($points != null && $point_ids != null){ | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //    foreach($request['point_ids'] as $key => $pid){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //     $service_section_point = new ServiceSectionPoint(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //     $service_section_point = $service_section_point->findorfail($pid); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //     // $service_section_point =  ServiceSectionPoint::find($id); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        $out_put_path = User::save_image($icons[$key],$extension,$count,$image_folder_type); | 
					 | 
					 | 
					 | 
					            //         if(array_key_exists($key,$point_descriptions)){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        is_array($out_put_path) ? $service_section_point->icon = $out_put_path[0] : $service_section_point->icon = $out_put_path; | 
					 | 
					 | 
					 | 
					            //              $service_section_point->point_description = $point_descriptions[$key]; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                         // $service_section_point->icon = $points_descriptions[$key]; | 
					 | 
					 | 
					 | 
					            //         } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    } | 
					 | 
					 | 
					 | 
					            //         if(array_key_exists($key,$icons)){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                   $service_section_point->point = $points[$key]; | 
					 | 
					 | 
					 | 
					            //             $extension = $icons[$key]->getClientOriginalExtension(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                   $service_section_point->update(); | 
					 | 
					 | 
					 | 
					            //             $image_folder_type = array_search('service',config('custom.image_folders')); //for image saved in folder | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                     | 
					 | 
					 | 
					 | 
					                     | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
					            //             $count = rand(100,999); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            }     | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            else{ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                foreach($points as $key => $point){ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    $service_section_point = new ServiceSectionPoint(); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    $service_section_point->service_section_id = $service_section->id; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    $service_section_point->point = $point; | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    if(array_key_exists($key,$icons)){ | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        $extension = $icons[$key]->getClientOriginalExtension(); | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        $image_folder_type = array_search('service',config('custom.image_folders')); //for image saved in folder | 
					 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                     | 
					 | 
					 | 
					 | 
					                     | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        $count = rand(100,999); | 
					 | 
					 | 
					 | 
					            //             $out_put_path = User::save_image($icons[$key],$extension,$count,$image_folder_type); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //             is_array($out_put_path) ? $service_section_point->icon = $out_put_path[0] : $service_section_point->icon = $out_put_path; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //              // $service_section_point->icon = $points_descriptions[$key]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //         } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //        $service_section_point->point = $points[$key]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //        $service_section_point->update(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        $out_put_path = User::save_image($icons[$key],$extension,$count,$image_folder_type); | 
					 | 
					 | 
					 | 
					            //     } | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        is_array($out_put_path) ? $service_section_point->icon = $out_put_path[0] : $service_section_point->icon = $out_put_path; | 
					 | 
					 | 
					 | 
					            // }     | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                        // $service_section_point->icon = $points_descriptions[$key]; | 
					 | 
					 | 
					 | 
					            // else{ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                       } | 
					 | 
					 | 
					 | 
					            //     foreach($points as $key => $point){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                    $service_section_point->save(); | 
					 | 
					 | 
					 | 
					            //         $service_section_point = new ServiceSectionPoint(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                } | 
					 | 
					 | 
					 | 
					            //         $service_section_point->service_section_id = $service_section->id; | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            } | 
					 | 
					 | 
					 | 
					            //         $service_section_point->point = $point; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //         if(array_key_exists($key,$icons)){ | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //             $extension = $icons[$key]->getClientOriginalExtension(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //             $image_folder_type = array_search('service',config('custom.image_folders')); //for image saved in folder | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                     | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //             $count = rand(100,999); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					                     | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //             $out_put_path = User::save_image($icons[$key],$extension,$count,$image_folder_type); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //             is_array($out_put_path) ? $service_section_point->icon = $out_put_path[0] : $service_section_point->icon = $out_put_path; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //             // $service_section_point->icon = $points_descriptions[$key]; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //            } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //         $service_section_point->save(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            //     } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					            // } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                // $service_point = $service_section->service_section_point(); | 
					 | 
					 | 
					 | 
					                // $service_point = $service_section->service_section_point(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					                // $service_point->delete(); | 
					 | 
					 | 
					 | 
					                // $service_point->delete(); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					            // foreach($points as $key => $point){ | 
					 | 
					 | 
					 | 
					            // foreach($points as $key => $point){ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |