public function show($id) { $register_user = userRegister::findorFail($id); if ($register_user) { MyHelper::debug($register_user->toArray(), 1); } die; }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function UpdateAction(Request $request, $id) { $this->album = Album::find($id); if ($this->album) { $url = MyHelper::clean(Input::get('title')); if ($this->__checkduplicateurl($this->album->id, $url)) { $this->album->title = $request->get('title'); $this->album->url = $url; $this->album->short_description = $request->get('short_description'); $this->album->detail_description = $request->get('detail_description'); $this->album->status = $request->get('status'); $this->album->save(); return redirect()->route('album/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The album is successfully Updated'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Duplicate Url Request'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Request'])); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function StoreAction(Blog_categoryAddFormRequest $request) { $rand = rand(12222, 222222223) . '_'; $url = MyHelper::clean($request->get('title')); if (Blog_category::where('url', $url)->count() > 0) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Duplicate url'])); } if ($request->hasFile('image')) { $file = $request->file('image'); $image = $file->getClientOriginalName(); $new_image_name = $rand . $image; if (!File::exists($this->image_path)) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'The blog_category image folder is not found'])); } $file->move($this->image_path, $new_image_name); } $this->data = Blog_category::create(['title' => $request->get('title'), 'url' => $url, 'image' => $new_image_name, 'short_description' => $request->get('short_description'), 'detail_description' => $request->get('detail_description'), 'status' => $request->get('status')])->save(); return redirect()->route('blog_category/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The blog category table is successfully added'])); }
/** * Store a newly created resource in storage. * * @param \Illuminate\Http\Request $request * @return \Illuminate\Http\Response */ public function StoreAction(Request $request) { $url = MyHelper::clean($request->get('title')); if (Blog_post::where('url', $url)->count() > 0) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Duplicate url'])); } $rand = rand(211111, 2555555) . '_'; if ($request->hasFile('image')) { $file = $request->file('image'); $image = $file->getClientOriginalName(); $new_image_name = $rand . $image; if (!File::exists($this->image_path)) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Image folder not found'])); } $file->move($this->image_path, $new_image_name); } $this->data = Blog_post::create(['title' => $request->get('title'), 'url' => $url, 'image' => $new_image_name, 'short_description' => $request->get('short_description'), 'detail_description' => $request->get('detail_description'), 'status' => $request->get('status')]); if (!empty($request->get('blog_categories'))) { $this->data->blog_category()->sync($request->get('blog_categories')); } return redirect()->route('blog_post/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The blog_post table cane be added one data at this time'])); }
/** * @param Request $request * @param $id * @return \Illuminate\Http\RedirectResponse */ public function UpdateAction(Request $request, $id) { $this->package_image = Package_image::find($id); $url = MyHelper::clean(Input::get('title')); if ($this->package_image) { if ($this->check_package_id(Input::get('package_id'))) { if ($this->check_duplicate_url($id, $url)) { if ($request->hasfile('image')) { $rand = rand(100000, 50000) . "_"; $file = $request->file('image'); $image_name = $file->getClientOriginalName(); $new_image_name = $rand . $image_name; if (File::exists($this->image_path)) { $this->new_img_path = $this->image_path . '/' . $request->get('package_id'); /* unlink old image*/ $packages_id = $this->package_image->package_id; $old_image = $this->package_image->image; @unlink($this->image_path . '/' . $packages_id . '/' . $old_image); /*replace by new image*/ @mkdir($this->new_img_path); $file->move($this->new_img_path, $new_image_name); } $this->package_image->package_id = $request->get('package_id'); $this->package_image->title = $request->get('title'); $this->package_image->image = $new_image_name; $this->package_image->url = $url; $this->package_image->short_description = $request->get('short_description'); $this->package_image->detail_description = $request->get('detail_description'); $this->package_image->status = $request->get('status'); $this->package_image->save(); return redirect()->route('package_image/list')->with('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The Package Image field is successfully added']); } $this->package_image->package_id = $request->get('package_id'); $this->package_image->title = $request->get('title'); $this->package_image->url = $url; $this->package_image->short_description = $request->get('short_description'); $this->package_image->detail_description = $request->get('detail_description'); $this->package_image->status = $request->get('status'); $this->package_image->save(); return redirect()->route('package_image/list')->with('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The Package Image field is successfully added']); } return redirect()->route('package_image/list')->with('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid package id']); } return redirect()->route('package_image/list')->with('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid package id']); } return redirect()->route('package_image/list')->with('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Package Image ID']); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function UpdateAction(Request $request, $id) { $this->country = Country::find($id); if ($this->country) { /*check for duplicate url*/ $url = MyHelper::clean(Input::get('name')); if ($this->__checkForDuplicateUul($id, $url)) { /*For Imaging processing*/ if ($request->hasfile('image')) { $rand = rand(10000, 88888) . '_'; $file = $request->file('image'); $image_name = $file->getClientOriginalName(); $new_image_name = $rand . $image_name; if (!File::exists(public_path() . '/images/country')) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'The image Directory is not found'])); } $get_old_image = $this->country->image; $file->move(public_path() . '/images/country', $new_image_name); @unlink(public_path() . '/images/country/' . $get_old_image); $this->country->name = $request->name; $this->country->url = $url; $this->country->image = $new_image_name; $this->country->short_description = $request->short_description; $this->country->detail_description = $request->detail_description; $this->country->status = $request->status; $this->country->save(); return redirect()->route('country/list')->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The country field successfully Updated'])); } else { $this->country->name = $request->name; $this->country->url = $url; $this->country->short_description = $request->short_description; $this->country->detail_description = $request->detail_description; $this->country->status = $request->status; $this->country->save(); return redirect()->route('country/list')->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The country field successfully Updated'])); } } return redirect()->back()->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Url Request'])); } return redirect()->back()->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Request'])); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function UpdateAction(Request $request, $id) { $this->category = category::find($id); if ($this->category) { $url = MyHelper::clean(Input::get('name')); $this->country = Country::find(Input::get('country_id')); if (!$this->country) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_WARNING', ['message' => 'Country ID did not match'])); } if ($this->__checkForDuplicateUrl($id, $this->country->id, $url)) { if ($request->hasfile('image')) { $file = $request->file('image'); $image_name = $file->getClientOriginalName(); $rand = rand(5000, 60000) . '_'; $new_img_name = $rand . $image_name; $get_old_image = $this->category->image; if (!File::exists($this->image_path)) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_WARNING', ['message' => 'No image Folder'])); } @unlink($this->image_path . '/' . $get_old_image); $file->move($this->image_path, $new_img_name); $this->category->country_id = $request->get('country_id'); $this->category->name = $request->get('name'); $this->category->url = $url; $this->category->image = $new_img_name; $this->category->short_description = $request->get('short_description'); $this->category->detail_description = $request->get('detail_description'); $this->category->status = $request->get('status'); $this->category->save(); return redirect()->route('category/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The category field is successfully updated'])); } $this->category->country_id = $request->get('country_id'); $this->category->name = $request->get('name'); $this->category->url = $url; $this->category->short_description = $request->get('short_description'); $this->category->detail_description = $request->get('detail_description'); $this->category->status = $request->get('status'); $this->category->save(); return redirect()->route('category/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The category has been Updated'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_WARNING', ['message' => 'Duplicate Url supply'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_WARNING', ['message' => 'Invalid request supply'])); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function UpdateAction(Request $request, $id) { $this->page = Page::find($id); if ($this->page) { $url = MyHelper::clean($request->get('title')); /*check duplicate url*/ if ($this->__checkduplicateurl($this->page->id, $url)) { $rand = rand(5000, 60000) . '_'; if ($request->hasfile('image')) { $file = $request->file('image'); $name = $file->getClientOriginalName(); $new_name = $rand . $name; $find_old_image = $this->page->image; if (!File::exists($this->image_path)) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Image folder not found'])); } $file->move($this->image_path, $new_name); @unlink($this->image_path . '/' . $find_old_image); $this->page->title = $request->get('title'); $this->page->url = $url; $this->page->parent_id = $request->get('parent_id'); $this->page->image = $new_name; $this->page->short_description = $request->get('short_description'); $this->page->detail_description = $request->get('detail_description'); $this->page->status = $request->get('status'); $this->page->section = $request->get('section'); $this->page->save(); return redirect()->route('page/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The page Field is successfully updated'])); } $this->page->title = $request->get('title'); $this->page->url = $url; $this->page->parent_id = $request->get('parent_id'); $this->page->short_description = $request->get('short_description'); $this->page->detail_description = $request->get('detail_description'); $this->page->status = $request->get('status'); $this->page->section = $request->get('section'); $this->page->save(); return redirect()->route('page/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The page Field is successfully updated'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Duplicate Url'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Request'])); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function UpdateAction(Request $request, $id) { /* MyHelper::debug(Input::all(),1);die;*/ $this->package = Package::find($id); if (!$this->package) { return redirect()->back()->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Package id'])); } $this->country = Country::find($request->get('country_id')); if (!$this->country) { return redirect()->back()->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Country id'])); } $this->category = category::find($request->get('category_id')); if (!$this->category) { return redirect()->back()->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Category id'])); } $url = MyHelper::clean($request->get('title')); $rand = rand(20000, 300000) . '_'; if ($this->__checkForDuplicate_url($id, $this->category->id, $url)) { if ($request->hasfile('image')) { $file = $request->file('image'); $image_name = $file->getClientOriginalName(); $image_new_name = $rand . $image_name; $find_old_image = $this->package->image; @unlink($this->image_path . '/' . $find_old_image); if (!File::exists($this->image_path)) { return redirect()->back()->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Image Folder not found'])); } $file->move($this->image_path, $image_new_name); $this->package->category_id = $request->get('category_id'); $this->package->title = $request->get('title'); $this->package->url = $url; $this->package->image = $image_new_name; $this->package->is_special = $request->get('is_special'); $this->package->grade = $request->get('grade'); $this->package->currency = $request->get('currency'); $this->package->price = $request->get('price'); $this->package->route = $request->get('route'); $this->package->duration = $request->get('duration'); $this->package->itinerary = $request->get('itinerary'); $this->package->const_description = $request->get('const_description'); $this->package->short_description = $request->get('short_description'); $this->package->detail_description = $request->get('detail_description'); $this->package->status = $request->get('status'); $this->package->save(); } $this->package->category_id = $request->get('category_id'); $this->package->title = $request->get('title'); $this->package->url = $url; $this->package->is_special = $request->get('is_special'); $this->package->grade = $request->get('grade'); $this->package->currency = $request->get('currency'); $this->package->price = $request->get('price'); $this->package->route = $request->get('route'); $this->package->duration = $request->get('duration'); $this->package->itinerary = $request->get('itinerary'); $this->package->const_description = $request->get('const_description'); $this->package->short_description = $request->get('short_description'); $this->package->detail_description = $request->get('detail_description'); $this->package->status = $request->get('status'); $this->package->save(); return redirect()->route('package/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The package hasbeen successfully updated'])); } return redirect()->back()->withInput()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Duplicate url'])); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function UpdateAction(Request $request, $id) { $this->gallery = Gallery::find($id); $url = MyHelper::clean(Input::get('title')); if ($this->__checkAlbumId(Input::get('albums_id'))) { if ($this->__checkDuplicateUrl($this->gallery->id, Input::get('album_id'), $url)) { $rand = rand(10000, 50000) . '_i'; if ($request->hasfile('image')) { $file = $request->file('image'); $image_name = $file->getClientOriginalName(); $new_image_name = $rand . $image_name; if (!File::exists($this->image_path)) { return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Image folder not found'])); } $old_image = $this->gallery->image; @unlink($this->image_path . '/' . $old_image); $file->move($this->image_path, $new_image_name); $this->gallery->albums_id = $request->get('albums_id'); $this->gallery->title = $request->get('title'); $this->gallery->url = $url; $this->gallery->image = $new_image_name; $this->gallery->short_description = $request->get('short_description'); $this->gallery->detail_description = $request->get('detail_description'); $this->gallery->status = $request->get('status'); $this->gallery->save(); return redirect()->route('gallery/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The Gallery Section Successfully Updated'])); } $this->gallery->albums_id = $request->get('albums_id'); $this->gallery->title = $request->get('title'); $this->gallery->url = $url; $this->gallery->short_description = $request->get('short_description'); $this->gallery->detail_description = $request->get('detail_description'); $this->gallery->status = $request->get('status'); $this->gallery->save(); return redirect()->route('gallery/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The Gallery Section Successfully Updated'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Diplicate Url'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Album id No found'])); }
/** * Update the specified resource in storage. * * @param Request $request * @param int $id * @return Response */ public function UpdateAction(Request $request, $id) { $this->media = Media::find($id); $url = MyHelper::clean(Input::get('title')); if ($this->media) { if ($this->check_gallery_id($this->media->galleries_id)) { if ($this->check_duplicate_url($id, $this->media->gallery_id, $url)) { if ($request->hasfile('media')) { $rand = rand(100000, 9000000) . '_img'; $file = $request->file('media'); $image_name = $file->getClientOriginalName(); $new_image = $rand . $image_name; if (File::exists($this->image_path)) { $old_image = $this->media->media; $gallery_id = $this->media->galleries_id; @unlink($this->image_path . '/' . $gallery_id . '/' . $old_image); $this->dir = $this->image_path . '/' . Input::get('galleries_id'); @mkdir($this->dir); $file->move($this->dir, $new_image); } $this->media->galleries_id = $request->get('galleries_id'); $this->media->title = $request->get('title'); $this->media->media_type = $request->get('media_type'); $this->media->media = $new_image; $this->media->short_description = $request->get('short_description'); $this->media->url = $url; $this->media->detail_description = $request->get('detail_description'); $this->media->status = $request->get('status'); $this->media->save(); return redirect()->route('media/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The media field is successfully Updated'])); } $this->media->galleries_id = $request->get('galleries_id'); $this->media->title = $request->get('title'); $this->media->media_type = $request->get('media_type'); $this->media->short_description = $request->get('short_description'); $this->media->url = $url; $this->media->detail_description = $request->get('detail_description'); $this->media->status = $request->get('status'); $this->media->save(); return redirect()->route('media/list')->with('message', Lang::get('response.CUSTOM_MESSAGE_SUCCESS', ['message' => 'The media field is successfully Updated'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Duplicate Url'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid Gallery id'])); } return redirect()->back()->with('message', Lang::get('response.CUSTOM_MESSAGE_ALERT', ['message' => 'Invalid media id'])); }