Example #1
0
 public function store(Request $request)
 {
     $host = Theme::where('user_id', Auth::user()->id)->first();
     if ($host) {
         $host->theme = $request->theme;
         $host->template = $request->template;
         $host->save();
         flash('Güncelleme işlemi başarıyla gercekleşti.', 'info');
         return redirect()->back();
     } else {
         $host = new Theme();
         $host->theme = $request->theme;
         $host->template = $request->template;
         $host->user_id = Auth::user()->id;
         $host->save();
         flash('Güncelleme işlemi başarıyla gercekleşti.', 'info');
         return redirect()->back();
     }
 }
Example #2
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     if (Auth::check()) {
         $users = User::all();
         $admins = User::where('is_admin', '1')->get();
         $themes = Theme::all();
         $products = Product::all();
         return view('dashboards.index', compact('users', 'admins', 'themes', 'products'));
     }
     return redirect()->route('backend.login')->withErrors(['You must be logged in to access Dashboard']);
 }
Example #3
0
 /**
  * Change user's theme
  *
  * @return \Illuminate\Http\Response
  */
 public function changeTheme(Request $request)
 {
     // check if theme exists
     $theme = Theme::find($request->theme);
     if ($theme === null) {
         // stuff to pass into view
         $title = "Error";
         $errmsg = "The theme does not exist.";
         return view('errors.error', compact('errmsg', 'title', 'heading'));
     }
     // update user's theme
     $user = User::find(Auth::user()->id);
     $user->theme = $theme->name;
     $user->save();
     // flash message
     session()->flash('flash_message', 'Theme changed successfully.');
     // redirect back
     return redirect()->back()->with('active_id', '#changeTheme');
 }
Example #4
0
 /** AJAX-метод: получает список тем раздела */
 public function getTheme(Request $request)
 {
     if ($request->ajax()) {
         $themes = new Theme();
         $themes_list = [];
         $query = $themes->whereSection($request->input('choice'))->select('theme')->get();
         foreach ($query as $str) {
             array_push($themes_list, $str->theme);
         }
         return (string) view('tests.getTheme', compact('themes_list'));
     }
 }
Example #5
0
function getThemesByType($ThemeType)
{
    return Theme::where('Code', 'LIKE', '%[' . $ThemeType . ']%')->where('Activ', 1)->orderBy('Code', 'asc')->get();
}
Example #6
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  Theme $theme
  * @return \Illuminate\Http\Response
  */
 public function destroy(Theme $theme)
 {
     $theme->delete();
     $this->message->flash("PUNY HUMAN - You DESTROYED your theme!");
     return redirect()->route('backend.themes.index');
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     Theme::destroy($id);
     Session::flash('flash_message', 'Theme deleted!');
     return redirect('auth/theme');
 }
 public function ListareHoteluriStatiuneCuTema($oras, $thema)
 {
     $oras = Orase::findbyslug($oras);
     $thema = Theme::findbyslug($thema);
     $hoteluri = Hoteluri::where('City', $oras->AidaID)->where('Themes', 'LIKE', '%|' . $thema->AidaID . '|%')->orderby('Stars', 'desc');
     return view('frontend.listare-hoteluri')->with('hoteluri', $hoteluri->get())->with('oras', $oras)->with('thema', $thema);
 }
Example #9
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  Product $product
  * @return \Illuminate\Http\Response
  */
 public function edit(Product $product)
 {
     $themeIds = Theme::lists('color', 'id')->all();
     return view('products.edit', compact('product', 'themeIds'));
 }
 /**
  * Match user session to initialize $theme
  *
  * @throws HttpException
  */
 private function bootTheme(Theme $theme, Store $store)
 {
     // Add file paths for current theme.
     if ($theme->bootTheme($store)) {
         $this->registerViewPaths($theme);
     } else {
         throw new \Exception("Theme not set for current store.");
     }
 }
 public function GetAidaTheme($operator)
 {
     $AidaTheme = Soap::AidaSoap($operator, 'AccThemes', ['AIDA_AccThemesRQ'])->AccomodationThemesList->Theme;
     foreach ($AidaTheme as $thema) {
         $arrayTheme = ['AidaID' => $thema->ID, 'Name' => $thema->Name, 'Code' => $thema->Code];
         Theme::UpdateOrCreate(['AidaID' => $thema->ID], $arrayTheme);
     }
     echo 'Actualizare finalizata cu success. Puteti inchide fereastra.';
 }