Exemple #1
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //social media
     $sc = new CMS();
     $sc->name = "facebook";
     $sc->data = "http://www.facebook.com/";
     $sc->type = "social_media";
     $sc->save();
     $sc = new CMS();
     $sc->name = "twitter";
     $sc->data = "http://www.twitter.com/";
     $sc->type = "social_media";
     $sc->save();
     $sc = new CMS();
     $sc->name = "plus_google";
     $sc->data = "http://plus.google.com/";
     $sc->type = "social_media";
     $sc->save();
     $sc = new CMS();
     $sc->name = "email";
     $sc->data = "*****@*****.**";
     $sc->type = "social_media";
     $sc->save();
     //end social media
 }
 public function postEdit(Request $request)
 {
     if ($this->forum->count()) {
         $sub = CMS::where("name", "forum")->where("type", "program")->where("created_at", "like", $this->year . "%")->first();
         $sub->data = $request->input('forum');
         $sub->save();
     } else {
         $sub = new CMS();
         $sub->name = 'forum';
         $sub->data = $request->input('forum');
         $sub->type = 'program';
         $sub->save();
     }
     return redirect('admin-cp/forum')->with('success', 'edit');
 }
 public function postEdit(Request $request)
 {
     $submission = CMS::where("name", "submission")->where("type", "paper")->where("created_at", "like", $this->year . "%")->first();
     if (!empty($submission)) {
         $submission = CMS::where("name", "submission")->where("type", "paper")->where("created_at", "like", $this->year . "%")->first();
         $submission->data = $request->get('submission');
         $submission->save();
     } else {
         $submission = new CMS();
         $submission->name = 'submission';
         $submission->data = $request->get('submission');
         $submission->type = 'paper';
         $submission->save();
     }
     return redirect('admin-cp/submission')->with('success', 'edit');
 }
 public function getSubmissionGuidelines()
 {
     $submission = CMS::where("name", "submission")->where("type", "paper")->where("created_at", "like", $this->year . "%")->first();
     $paper = File::where('img_type', "paper")->where("created_at", "like", $this->year . "%")->first();
     $poster = File::where('img_type', "poster")->where("created_at", "like", $this->year . "%")->first();
     $subFiles = File::where('img_type', 'submission')->where("created_at", "like", $this->year . "%")->get();
     $journal = File::where('img_type', 'journal')->where("created_at", "like", $this->year . "%")->get();
     return view('paper.submission', compact(['paper', 'poster', 'submission', 'subFiles', 'journal']))->with('year', $this->curYear);
 }
 public function boot()
 {
     view()->composer('layout.admin_footer', function ($view) {
         $view->with('footer_name', CMS::where("name", "footer_name")->where("type", "footer")->where("created_at", "like", $this->year . "%")->first())->with('footer_link', CMS::where("name", "footer_link")->where("type", "footer")->where("created_at", "like", $this->year . "%")->first())->with('select_year', CMS::where("name", "year")->where("type", "year")->first());
     });
     view()->composer('layout.app_footer', function ($view) {
         $view->with('footer_name', CMS::where("name", "footer_name")->where("type", "footer")->where("created_at", "like", $this->year . "%")->first())->with('footer_logo', CMS::where("name", "footer_logo")->where("type", "footer")->where("created_at", "like", $this->year . "%")->first())->with('footer_link', CMS::where("name", "footer_link")->where("type", "footer")->where("created_at", "like", $this->year . "%")->first());
     });
     view()->composer('layout.app_logo', function ($view) {
         $view->with('website_logo', CMS::where("type", "website logo")->where("created_at", "like", $this->year . "%")->first());
     });
     view()->composer('layout.app_favicon', function ($view) {
         $view->with('favicon', CMS::where("type", "favicon")->where("created_at", "like", $this->year . "%")->first());
     });
 }
Exemple #6
0
 public function postFooterLogo(Request $request)
 {
     $file = $request->file('footer_logo');
     $rand = str_random();
     if ($request->hasFile('footer_logo')) {
         $image['name'] = $rand . '_' . $file->getClientOriginalName();
         $image['original_name'] = $file->getClientOriginalName();
         $image['description'] = "Footer Logo";
         $image['type'] = $file->getClientOriginalExtension();
         $image['img_type'] = "image";
         $image = File::create($image);
         $file->move('assets/images/config', $rand . '_' . $file->getClientOriginalName());
         $cms['data'] = $image->id;
         $cms['name'] = $image['name'];
     } else {
         return "error upload";
     }
     $website = CMS::where("name", "footer_logo")->where("type", "footer")->where("created_at", "like", $this->year . "%")->first();
     if (!empty($website)) {
         $website->name = $cms['name'];
         $website->data = $cms['data'];
         $website->save();
     } else {
         $website = new CMS();
         $website->name = "footer_logo";
         $website->data = $cms['data'];
         $website->type = 'footer';
         $website->save();
     }
     Session::flash('state', 'success');
     return back();
 }