/**
  *This function is used to load the hall modal contents.This function response to
  *a ajax call.
  *
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function hallViewLoad(Request $request)
 {
     $inputs = $request::all();
     $hall_id = $inputs['hall_id'];
     $himage1 = HALL_IMAGE::where('hall_id', '=', $hall_id)->select('path')->first();
     $himages = HALL_IMAGE::where('hall_id', '=', $hall_id)->where('path', '!=', $himage1->path)->select('path')->get();
     $advance = DB::table('HALL_RATES')->where('hall_id', '=', $hall_id)->select('advance_payment')->first();
     $refundable = DB::table('HALL_RATES')->where('hall_id', '=', $hall_id)->select('refundable_amount')->first();
     $services = Hall_Services::where('rate', '=', 0)->select('name', 'rate')->get();
     $aservices = Hall_Services::where('rate', '>', 0)->select('name', 'rate')->get();
     return response()->json(['himage1' => $himage1->path, 'himages' => $himages, 'advance' => $advance->advance_payment, 'refundable' => $refundable->refundable_amount, 'services' => $services, 'aservices' => $aservices]);
 }
예제 #2
0
 /**
  * Delete hall image via AJAX
  *
  * @param Request $request
  * @return \Illuminate\Http\JsonResponse
  */
 public function admin_hall_image_del(Request $request)
 {
     $hi = HALL_IMAGE::find(Input::get('id'));
     $path = $hi->path;
     File::delete($path);
     $hi->delete();
     $images = HALL_IMAGE::where('hall_id', $request->input('type_id'))->get();
     return response()->json(['images' => $images]);
 }