public function store($type) { switch ($type) { case 'lienlac': $id = Input::get("id"); $data = array("address" => Input::get("tenbophan"), "tel" => Input::get("sodienthoai"), "fax" => Input::get("sofax"), "email" => Input::get("email"), "facebook" => Input::get("facebook"), "link" => Input::get("urlfacebook"), "vitri" => Input::get("vitri")); Contact::UpdateLL($id, $data); $contact = Contact::getAContact($id); return View::make('admin.lienlac.edit')->with("contact", $contact)->with("message", "Chỉnh sửa liên lạc hoàn tất!")->with("title", "Chỉnh sửa liên lạc"); case 'baiviet': $filename = Input::get('anhcu'); if (isset($_FILES['anhnho']) && $_FILES['anhnho']['name'] != "") { if (File::exists(Input::get('anhcu'))) { File::delete(Input::get('anhcu')); } $file = Input::file('anhnho'); // $file->resize(96,96); $destinationPath = 'uploads/'; $filename = md5($file->getClientOriginalName()) . "." . $file->getClientOriginalExtension(); Input::file('anhnho')->move($destinationPath, $filename); $filename = $destinationPath . "/" . $filename; } $data = array("tieude" => Input::get('tieude'), "anhnho" => $filename, "loai" => Input::get('loaibaiviet'), "noidung" => Input::get('noidung'), "thoidiemsua" => date("Y-m-d H:i:s", time())); $id = Input::get('id'); TinTuc::UpdateTT($data, $id); $thread = TinTuc::getAThread($id); return View::make('admin.threads.edit')->with("thread", $thread)->with("message", "Chỉnh sửa tin tức hoàn tất!")->with("title", "Chỉnh sửa bài viết"); default: return $this->index(); } }