public function add_buttonpage() { try { $buttonName = Input::get("buttonName"); $buttonURL = Input::get("buttonURL"); $buttonParent = Input::get("buttonParent"); $buttonChild = Input::get("buttonChild"); $buttonOrder = Input::get("buttonOrder"); $buttonVisible = Input::get("buttonVisible"); if ($buttonVisible == '1') { $buttonVisible = '1'; } else { $buttonVisible = '0'; } $destinationPath_buttonpage = 'asserts/images/Features'; if (Input::hasfile('filebuttonPicture')) { $filename = Input::file("filebuttonPicture")->getClientOriginalName(); $upload_success = Input::file("filebuttonPicture")->move($destinationPath_buttonpage, $filename); } $buttonId = $this->getbuttonid(); $new_buttonpage = new PageButton(); $new_buttonpage->buttonId = $buttonId; $new_buttonpage->buttonName = $buttonName; $new_buttonpage->buttonPicture = $filename; $new_buttonpage->buttonURL = $buttonURL; $new_buttonpage->buttonParent = $buttonParent; $new_buttonpage->buttonChild = $buttonChild; $new_buttonpage->buttonOrder = $buttonOrder; $new_buttonpage->buttonVisible = $buttonVisible; $new_buttonpage->save(); } catch (Exception $_ex) { Session::flash('error', '$$$ --- Error (' . $_ex->getMessage() . ') --- $$$'); } Session::flash('success', '$$$ --- Update Page Successfully --- $$$'); return Redirect::to('qlm-admin/buttons-pages/' . $buttonId); }
function auto_qlm_pagebuttons_newsevents($eventType, $eventName, $eventPictures, $eventId) { $_arData = array('buttonName' => $eventName, 'buttonPicture' => $eventPictures, 'buttonURL' => 'event-details/' . $eventId); if ($eventType == 'success-story') { $_page_update = PageButton::where('buttonOrder', '1')->where('buttonParent', 'news-events')->update($_arData); } if ($eventType == 'latest-news') { $_page_update = PageButton::where('buttonOrder', '2')->where('buttonParent', 'news-events')->update($_arData); } if ($eventType == 'events-trade-shows') { $_page_update = PageButton::where('buttonOrder', '3')->where('buttonParent', 'news-events')->update($_arData); } if ($eventType == 'hot-stuff' || $eventType == 'cool-stuff') { $_page_update = PageButton::where('buttonOrder', '4')->where('buttonParent', 'news-events')->update($_arData); } }