public function putcomment() { $inputdetails['userid'] = Auth::user()->ID; $inputdetails['contest_participant_id'] = $_GET['participantid']; $inputdetails['comment'] = $_GET['comment']; $curdate = date('Y-m-d h:i:s'); $inputdetails['createddate'] = $curdate; $savecomment = commentModel::create($inputdetails); if ($savecomment) { return Redirect::to("contest_info/" . $_GET['contest_id'])->with('tab', 'gallery')->with('gallerytype', 'comment')->with('viewcommentforparticipant', $_GET['participantid'])->with('Massage', 'Comment added successfully'); } }
public function putcomments() { $inputdetails = Input::get(); $curdate = date('Y-m-d h:i:s'); $inputdetails['createddate'] = $curdate; $validation = Validator::make($inputdetails, commentModel::$rules); if ($validation->passes()) { $savecomment = commentModel::create($inputdetails); if ($savecomment) { $Response = array('success' => '1', 'message' => 'Comment saved successfully', 'msgcode' => "c134"); $final = array("response" => $Response); return json_encode($final); } } else { $Response = array('success' => '0', 'message' => 'Some details are Missing', 'msgcode' => "c101"); $final = array("response" => $Response); return json_encode($final); } }