コード例 #1
0
 public function check(Request $request)
 {
     $email = $request->email;
     try {
         $user = User::where('email', $email)->first();
         if ($user == null) {
             $user = new User();
             $user->firstname = $request->firstname;
             $user->lastname = $request->lastname;
             $user->username = $request->username;
             $user->email = $request->email;
             $user->gender = $request->gender;
             $user->country = $request->country;
             $user->birthday = $request->birthday;
             $user->password = \Hash::make($request->password);
             $user->orientation = $request->orientation;
             $user->role = 'user';
             if ($user->save()) {
                 $about = new About();
                 $about->user_id = User::where('email', $email)->get(['id'])[0]->id;
                 $lookingFor = new LookingFor();
                 $lookingFor->user_id = User::where('email', $email)->get(['id'])[0]->id;
                 if ($about->save() && $lookingFor->save()) {
                     return response()->json(['status' => 201], 201);
                 }
             } else {
                 return response()->json(['status' => 404], 404);
             }
         } else {
             return response()->json(['status' => 200, 'exists' => true], 200);
         }
     } catch (Illuminate\Database\QueryException $e) {
         return response()->json(['status' => 505], 505);
     }
 }
コード例 #2
0
ファイル: AboutController.php プロジェクト: GrigorAtaryan/vdc
 public function update_about()
 {
     $data = Input::all();
     $about = new About();
     $about->update_about($data);
     return redirect('auth/about')->with(array('success_update_about' => 'Successfully Updated'));
 }
コード例 #3
0
ファイル: AboutController.php プロジェクト: GrigorAtaryan/vdc
 public function get()
 {
     $about = new About();
     $data_about = $about->get_about();
     $products = new Products();
     $sub_products = new SubProducts();
     $result_category = $products->get_category();
     foreach ($result_category as $results_category) {
         $menu_result[$results_category->category_name] = $sub_products->get_sub_category_by_category_id($results_category->id);
     }
     return view('about', compact('result_category', 'menu_result', 'data_about'));
 }
コード例 #4
0
 /**
  * Handle the command.
  *
  * @param  AboutCommand  $command
  * @return void
  */
 public function handle(AboutCommand $command)
 {
     $about = About::find($command->id);
     $about->body = $command->body;
     $about->title = $command->title;
     $about->save();
 }
コード例 #5
0
 /**
  * Fungsi buat tampilan about us
  */
 public function aboutUs()
 {
     $about = About::first();
     $gallery = Image::all();
     $tipe = Type::all();
     return view('FrontEnd.aboutUs', compact('about', 'gallery', 'tipe'));
 }
コード例 #6
0
ファイル: AboutmeController.php プロジェクト: doguhan/deneme
 public function store(Request $request)
 {
     $about = About::where('user_id', Auth::user()->id)->first();
     if ($about) {
         $about->hakkimda = $request->hakkimda;
         $about->save();
         flash('Güncelleme işlemi başarıyla gercekleşti.', 'info');
         return redirect()->back();
     } else {
         $about = new About();
         $about->user_id = Auth::user()->id;
         $about->hakkimda = $request->hakkimda;
         $about->save();
         flash('Güncelleme işlemi başarıyla gercekleşti.', 'info');
         return redirect()->back();
     }
 }
コード例 #7
0
 public function showabout()
 {
     $about = About::findOrFail(1);
     if ($about->count() == 0) {
         abort(404);
     } else {
         return view('index.about')->withAbouts($about);
     }
 }
コード例 #8
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     $this->validate($request, ['about' => 'required']);
     $about = About::find($id);
     $about->about = $request->get('about');
     $about->save();
     flash()->success('', 'Apie mus redaguotas!');
     return redirect()->back();
 }
コード例 #9
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     // We want to delete the comments table if it exists before running the seed
     DB::table('about')->delete();
     $seederData = array(['text' => 'We offer you awesome tours']);
     foreach ($seederData as $item) {
         About::create($item);
     }
 }
コード例 #10
0
 public function update(Request $request, About $about)
 {
     $insert = $about->fill($request->input())->save();
     $image = \Input::get('image');
     if ($image != '') {
         $imagename = 'about-' . rand(11111, 99999) . '-gudperna.png';
         $image = str_replace(' ', '+', $image);
         list($type, $image) = explode(';', $image);
         list(, $image) = explode(',', $image);
         $image = base64_decode($image);
         file_put_contents('upload/img/' . $imagename, $image);
         $about->image = $imagename;
         $about->save();
     }
     if ($insert) {
         return 0;
     } else {
         return 1;
     }
 }
コード例 #11
0
 public function getAbout(Request $request)
 {
     if ($request->input('id') == null) {
         $news = News::all();
         $about = About::first();
         return view('home.about')->with(['news' => $news, 'about' => $about]);
     } else {
         $item = News::where('id', $request->input('id'))->first();
         if ($item == null) {
             return redirect('about');
         }
         return view('home.news')->with('item', $item);
     }
 }
コード例 #12
0
 public function edit()
 {
     $user = User::findOrFail(Auth::user()->id);
     $entity = Entity::where('user_id', Auth::user()->id)->firstOrFail();
     $about = About::where('user_id', Auth::user()->id)->firstOrFail();
     $contact = Contact::where('user_id', Auth::user()->id)->firstOrFail();
     $home = Home::where('user_id', Auth::user()->id)->firstOrFail();
     $quote = Quote::where('user_id', Auth::user()->id)->get();
     $quote_count = $quote->count();
     $skill = Skill::where('user_id', Auth::user()->id)->get();
     $skill_count = $skill->count();
     $skill_slider = SkillSlider::where('user_id', Auth::user()->id)->get();
     $skill_slider_count = $skill_slider->count();
     $portfolio_piece = PortfolioPiece::where('user_id', Auth::user()->id)->get();
     $portfolio_piece_count = $portfolio_piece->count();
     return view('edit')->with('user', $user)->with('home', $home)->with('entity', $entity)->with('contact', $contact)->with('about', $about)->with('skill', $skill)->with('skill_count', $skill_count)->with('quote', $quote)->with('quote_count', $quote_count)->with('skill_slider', $skill_slider)->with('skill_slider_count', $skill_slider_count)->with('portfolio_piece', $portfolio_piece)->with('portfolio_piece_count', $portfolio_piece_count);
 }
コード例 #13
0
 public function postabout()
 {
     $about = About::findOrFail(1);
     if ($about->count() == 0) {
         if (About::create(Input::all())) {
             return Redirect::back()->withErros(Null);
         } else {
             return Redirect::back()->withErros('Store fail!');
         }
     } else {
         $about->title = Input::get('title');
         $about->content = Input::get('content');
         if ($about->save()) {
             return Redirect::back()->withErros(Null);
         } else {
             return Redirect::back()->withErros('Store fail!');
         }
     }
 }
コード例 #14
0
 public function updateAboutMe()
 {
     $user = User::find(Auth::user()->id);
     $about = About::where('user_id', Auth::user()->id)->firstOrFail();
     if (isset($user) && $about != NULL) {
         if (Input::get('about_first_title') != '') {
             $about->first_title = Input::get('about_first_title');
         }
         if (Input::get('about_first_caption') != '') {
             $about->first_caption = Input::get('about_first_caption');
         }
         if (Input::get('about_second_title') != '') {
             $about->second_title = Input::get('about_second_title');
         }
         if (Input::get('about_second_caption') != '') {
             $about->second_caption = Input::get('about_second_caption');
         }
         if (Input::get('about_third_title') != '') {
             $about->third_title = Input::get('about_third_title');
         }
         if (Input::get('about_third_caption') != '') {
             $about->third_caption = Input::get('about_third_caption');
         }
         if (Input::get('about_extra_1') != '') {
             $about->extra_1 = Input::get('about_extra_1');
         }
         if (Input::get('about_extra_2') != '') {
             $about->extra_2 = Input::get('about_extra_2');
         }
         $about->save();
         return redirect('home')->with('status', 'success');
     } else {
         return 'An error has occurred';
         //'no';
     }
 }
コード例 #15
0
ファイル: ProfileController.php プロジェクト: TRomesh/Coupley
 /**
  * edit favs data.
  *
  * @param object        $request
  *
  *
  * @return json
  */
 public function editfavs(Request $request)
 {
     $email = $request->email;
     $favs = $request->favs;
     try {
         $userID = User::where('email', $email)->get(['id']);
         if (About::where('user_id', $userID[0]->id)->update(['favourites' => $favs])) {
             return response()->json(['status' => 200], 200);
         } else {
             return response()->json(['status' => 200], 200);
         }
     } catch (Illuminate\Database\QueryException $e) {
         return response()->json(['status' => 200], 200);
     }
 }
コード例 #16
0
 public function index(Sitemenu $sitemenu)
 {
     $this->data['about'] = About::first();
     $this->data['meta'] = $sitemenu->getMeta('about');
     return view('pages.about.index', $this->data);
 }
コード例 #17
0
 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  $id
  * @return Response
  */
 public function updateDescription($id)
 {
     $user = Auth::user();
     $aboutUs = About::find($id);
     $aboutUs->detail = Input::get('detail');
     $aboutUs->save();
     $gallery = Image::all();
     return Redirect('aboutUsAdmin')->with('user', 'aboutUs', 'gallery');
 }
コード例 #18
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // get about
     $about = About::all();
     return $about;
 }
コード例 #19
0
 public function postEditAbout(Request $request)
 {
     $validator = $this->validatorForAbout($request->all());
     if ($validator->fails()) {
         return redirect()->back()->withErrors($validator->messages())->withInput();
     }
     $about = About::first();
     $about->content = $request->input('content');
     $about->save();
     $msg = "Информация о компании изменена";
     return redirect('admin/news')->with('msg', $msg);
 }
コード例 #20
0
 public function run()
 {
     DB::table('about')->delete();
     About::create(['title' => 'Photo Site', 'body' => 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quis alias rerum obcaecati itaque suscipit sequi, ipsum illum provident atque cupiditate explicabo nisi ullam veniam saepe cum cumque nam repudiandae velit? &#10 Lorem ipsum dolor sit amet, consectetur adipisicing elit. Non iusto sed in quia blanditiis vitae fuga perspiciatis quae. Libero et adipisci voluptatem mollitia nam ipsa, voluptatum voluptate repudiandae quia, nisi.']);
 }
コード例 #21
0
 public function posteditabout(Request $request)
 {
     $model_about = new About();
     $model_about->about = $request->input('about');
     $model_about->save();
 }
コード例 #22
0
ファイル: init.php プロジェクト: ponydevs/MLPVC-RR
<?php

// Autoload classes \\
$_dir = rtrim(dirname(__FILE__), '\\/') . DIRECTORY_SEPARATOR;
require $_dir . '../vendor/autoload.php';
require $_dir . 'constants.php';
use App\About;
use App\PostgresDbWrapper;
use App\RegExp;
// Database connection & Required Functionality Checking \\
try {
    if (PHP_OS === 'WINNT') {
        $inipath = 'in/to ' . php_ini_loaded_file() . ' then restart ' . About::getServerSoftware();
    }
    if (About::iniGet('short_open_tag') !== true) {
        throw new Exception("Short open tags (&lt;?) are disabled\nUncomment/add the line <strong>short_open_tag=On</strong> {$inipath} to fix");
    }
    if (!function_exists('curl_init')) {
        throw new Exception("cURL extension is disabled or not installed\n" . (PHP_OS !== 'WINNT' ? "Run <strong>sudo apt-get install php7.0-curl</strong>" : "Uncomment/add the line <strong>extension=php_curl.dll</strong> {$inipath}") . ' to fix');
    }
    if (!function_exists('imagecreatefrompng')) {
        throw new Exception("GD extension is disabled or not installed" . (PHP_OS !== 'WINNT' ? "\nRun <strong>sudo apt-get install php7.0-gd</strong> to fix" : ""));
    }
    if (!class_exists('DOMDocument', false)) {
        throw new Exception("XML extension is disabled or not installed" . (PHP_OS !== 'WINNT' ? "\nRun <strong>sudo apt-get install php7.0-xml</strong> to fix" : ''));
    }
    if (!function_exists('mb_substr') || !function_exists('mb_strlen')) {
        throw new Exception("mbstring extension is disabled or not installed" . (PHP_OS !== 'WINNT' ? "\nRun <strong>sudo apt-get install php7.0-mbstring</strong> to fix" : ''));
    }
    if (!function_exists('pdo_drivers')) {
        throw new Exception("PDO extension is disabled or not installed\nThe site requires PHP 7.0+ to function, please upgrade your server.");
コード例 #23
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($id)
 {
     if ($about = About::whereId($id)->first()->delete()) {
         return Redirect::action('AboutController@index')->with('message', 'Descripcion eliminada.');
     } else {
         Session::flash('message', 'Algo salio mal');
         Session::flash('classMessage', 'danger');
         return Redirect::action('AboutController@index');
     }
 }
コード例 #24
0
 public function about()
 {
     $about = About::first();
     $setting = Setting::first();
     return view('sites.about', compact('about', 'setting'));
 }
コード例 #25
0
ファイル: about.php プロジェクト: ponydevs/MLPVC-RR
<div id="content">
	<img src="/img/logo.svg" alt="MLP Vector Club Website Logo">
	<h1><a href="http://mlp-vectorclub.deviantart.com/">MLP-VectorClub</a> Website</h1>
	<p>Handling requests, reservations & the Color Guide since 2015</p>
<?php 
use App\About;
use App\CoreUtils;
$about = file_get_contents(INCPATH . 'views/about.html');
if (!empty($about)) {
    echo str_replace(GITHUB_URL . '/blob/master/www', '', $about);
    $osver = About::getServerOS();
    $phpver = About::getPHPVersion();
    $server = About::getServerSoftware();
    $pgver = About::getPostgresVersion();
    $esver = About::getElasticSearchVersion();
    $elastic = isset($esver) ? ", ElasticSearch {$esver}" : '';
    echo <<<HTML
<strong>Server Software:</strong> {$osver}, PHP {$phpver}, {$server}, PostgreSQL {$pgver}{$elastic}<br>
</section>
HTML;
} else {
    echo CoreUtils::notice('warn', 'This section went missing due to a bug, and will be restored ASAP. Until then the section\'s contents are available at <a href="' . GITHUB_URL . '#attributions">' . GITHUB_URL . '#attributions</a>');
}
?>
	<section>
		<h2>Statistics</h2>
		<p>Here you can see various graphs about the site. The information below is cached to reduce server load, you can see when each graph was last updated below their title.</p>
		<div id="stats">
			<div class="stats-posts">
				<h3>Posts in the last 2 months</h3>
				<div class="stats-wrapper">
コード例 #26
0
 public function about()
 {
     $about_model = About::all();
     return view('main.about', ['model' => $about_model]);
 }
コード例 #27
0
 /**
  * returns about information
  */
 public function getAbout()
 {
     return response()->json(About::find(1));
 }
コード例 #28
0
 public function about()
 {
     $about = \App\About::where('active', '1')->firstOrFail();
     return view('about', ['page' => 'about', 'about' => $about]);
 }
コード例 #29
0
ファイル: AboutsController.php プロジェクト: nirlewin/test
 /**
  * Delete the given About.
  *
  * @param  int      $id
  * @return Redirect
  */
 public function getDelete($id = null)
 {
     $about = About::destroy($id);
     // Redirect to the group management page
     return redirect('admin/abouts')->with('success', Lang::get('message.success.delete'));
 }
コード例 #30
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function index()
 {
     $about = About::first();
     return View('admin.about')->with('title', 'Edit About Page')->with('about', $about);
 }