Пример #1
0
 public function accept($id)
 {
     $offer = Offer::find($id);
     $post = Post::find($offer->post_id);
     $post->sold = $id;
     $post->save();
     $user = User::findOrFail($offer->user_id);
     $poster = User::findOrFail($offer->post_creator);
     $feedback_seller = new Feedback();
     $feedback_seller->post_id = $offer->post_id;
     $feedback_seller->giver_id = $offer->user_id;
     $feedback_seller->receiver_id = $offer->post_creator;
     $feedback_seller->type = 'seller';
     $feedback_seller->save();
     $feedback_buyer = new Feedback();
     $feedback_buyer->post_id = $offer->post_id;
     $feedback_buyer->giver_id = $offer->post_creator;
     $feedback_buyer->receiver_id = $offer->user_id;
     $feedback_buyer->type = 'buyer';
     $feedback_buyer->save();
     Mail::send('emails.offerAccepted', ['user' => $user, 'offer' => $offer, 'poster' => $poster, 'feedback' => $feedback_buyer], function ($m) use($user) {
         $m->to($user->email, $user->name)->subject('Offer Accepted!');
     });
     Mail::send('emails.listingSold', ['user' => $user, 'offer' => $offer, 'poster' => $poster, 'feedback' => $feedback_seller], function ($m) use($user) {
         $m->to($poster->email, $poster->name)->subject('Listing Sold!');
     });
     return Redirect($post->community_id . '/post/' . $post->id)->with('message', 'Offer Accepted');
 }
 public function feed(Request $request)
 {
     if ($request->content == '') {
         return redirect('/feedback');
     }
     $user = new Feedback();
     $user->feed = $request->content;
     $user->save();
     return redirect('/');
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(FeedbackFormRequest $request)
 {
     $traineeId = Auth::user()->id;
     $feedback = new Feedback(array('trainer_id' => $request->get('trainer_id'), 'trainee_id' => $traineeId, 'voice_range' => $request->get('A1'), 'voice_clearity' => $request->get('A2'), 'communication_skills' => $request->get('A3'), 'rapport_building' => $request->get('A4'), 'interaction' => $request->get('A5'), 'topic_usefulness' => $request->get('B1'), 'material_organization' => $request->get('B2'), 'speakers_knowledge' => $request->get('B3'), 'comments' => $request->get('comments')));
     if (Feedback::where('trainee_id', '=', $traineeId)->where('trainer_id', '=', $request->get('trainer_id'))->exists()) {
         return redirect('/trainee')->with('status', 'You have already given feedback');
     } else {
         $feedback->save();
         return redirect('/trainee')->with('status', 'Your feedback has been submitted!');
     }
 }
Пример #4
0
 /**
  * Сохдраняем в БД отзыв
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function saveFeedback(Request $request)
 {
     $this->validate($request, ['email' => 'required|email', 'text' => 'required', 'worker' => 'integer', 'file' => 'file']);
     $feedback = new Feedback();
     $feedback->text = "E-mail: " . $request->email . "\r\nText: " . $request->text;
     $feedback->worker_id = $request->worker;
     if ($request->hasFile('file')) {
         $file = uniqid() . '.' . $request->file('file')->getClientOriginalExtension();
         $request->file('file')->move(public_path('upload/'), $file);
         $feedback->file = $file;
     }
     $feedback->save();
     $request->session()->flash('done', '1');
     return redirect()->route('feedback');
 }
Пример #5
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Request $request)
 {
     $feedback = new Feedback();
     $feedback->user_id = Auth::user()->id;
     $feedback->experience = $request['experience'];
     $feedback->usability = $request['usability'];
     $feedback->comments = $request['comments'];
     $feedback->promotion = $request['promotion'];
     $feedback->device_info = $request['device_info'];
     if ($request['concerns'] != null) {
         $feedback->concerns = implode(', ', $request['concerns']);
     }
     $feedback->refer = $request['refer'];
     $feedback->save();
     Session::flash('message', 'Thanks for giving your valuable feedback!');
     Session::flash('alert-class', 'alert-success');
     return response()->json(['success' => 'success']);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store($id, FeedbackRequest $request)
 {
     $feedback = new Feedback();
     $feedback->rating = $request->count;
     $feedback->comment = $request->comment;
     $feedback->user_id = \Auth::user()->id;
     $feedback->project_id = $request->projectID;
     $myStr = str_random(10);
     if (Input::has('photo')) {
         $imageName = $request->name . '_' . $myStr . '_' . \Auth::user()->id . '.' . $request->file('photo')->getClientOriginalExtension();
         $imageName = $string = str_replace(' ', '', $imageName);
         $imagePath = '/upload/images/' . $imageName;
         $request->file('photo')->move(base_path() . '/public/upload/images/', $imageName);
         $feedback->photo = $imagePath;
     }
     if ($feedback->save()) {
         return redirect('user/feedback/' . $request->projectID);
     } else {
         return 'no';
     }
 }
Пример #7
0
 public function feedback()
 {
     $email = htmlentities($_POST['email']);
     $name = htmlentities($_POST['name']);
     $message = htmlentities($_POST['text_message']);
     $feedback = new Feedback();
     $feedback->email = $email;
     $feedback->name = $name;
     $feedback->message = $message;
     if ($feedback->save()) {
         $thanks = true;
     } else {
         $thanks = false;
     }
     $this->sendEmailToAdmin(['email' => $email, 'name' => $name, 'message_text' => $message], 'feedback');
     session()->flash('message', $thanks);
     return redirect()->back();
 }
 /**
  * créer un feedback de l'offre de stage
  * @param FeedBackEtudiantRequest $request
  * @param $id_stage
  * @return mixed
  */
 public function postFeedbackStage(FeedBackEtudiantRequest $request, $id_stage)
 {
     $feedback = new Feedback();
     $feedback->titre = Input::get('titre');
     $feedback->contenu = Input::get('contenu');
     $feedback->recrutement_feedback = Input::get('recrutement_feedback');
     if (Input::get('ouvertcontact') == 'on') {
         $feedback->isOuvert = true;
     } else {
         $feedback->isOuvert = false;
     }
     if ($feedback->save()) {
         $stage = OffreStage::find($id_stage);
         $stage->feedback_id = $feedback->id;
         if ($stage->save()) {
             return Redirect::to('etudiant/historique-feedback')->with('flash_success', 'Création du feedback enregistré!');
         }
     } else {
         return Redirect::back()->withInput()->withErrors('Publier un feedback échoué!');
     }
 }
Пример #9
0
 /**
  * posts feedback from users.
  *
  * @param id        $request
  *
  * @return json
  */
 public function postFeedback(Request $request)
 {
     $username = $request->username;
     $description = $request->comment;
     $category = $request->type;
     $feedback = new Feedback();
     $feedback->user = $username;
     $feedback->description = $description;
     $feedback->category = $category;
     if ($feedback->save()) {
         return response()->json(['status' => 200, 'done' => true], 200);
     } else {
         return response()->json(['status' => 200, 'done' => false], 200);
     }
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(FeedbackFormRequest $request)
 {
     $feedback = new Feedback(array('trainer_id' => $request->get('trainer_id'), 'voice_range' => $request->get('A1'), 'voice_clearity' => $request->get('A2'), 'communication_skills' => $request->get('A3'), 'rapport_building' => $request->get('A4'), 'interaction' => $request->get('A5'), 'topic_usefulness' => $request->get('B1'), 'material_organization' => $request->get('B2'), 'speakers_knowledge' => $request->get('B3'), 'comments' => $request->get('comments')));
     $feedback->save();
     return redirect('/feedbackIndex')->with('status', 'Your information has been created!');
 }
Пример #11
0
 public function feedbackStore($score, $comment, $geoLat, $geoLong, $photoData, $userEmail, $projectId)
 {
     $feedback = new Feedback();
     $feedback->project_id = htmlspecialchars(trim($projectId));
     $feedback->rating = htmlspecialchars(trim($score));
     $feedback->comment = htmlspecialchars(trim($comment));
     $feedback->long = htmlspecialchars(trim($geoLong));
     $feedback->lat = htmlspecialchars(trim($geoLat));
     /*$feedback->photo=htmlspecialchars(trim($photoData));
       $data=$photoData;
       $data = str_replace('data:image/jpeg;base64,', '', $data);
       $data = str_replace(' ', '+', $data);
       $data = base64_decode($data);
       $file = '/public/upload/images/'. uniqid() . '.jpeg';
       $success = file_put_contents($file, $data);
       if($success){
           $feedback->photo=$file;
       }else{
           $feedback->photo=null;
       }*/
     $user = \App\User::where('email', '=', htmlspecialchars(trim($userEmail)))->first();
     //dd($user->id);
     $feedback->user_id = $user->id;
     if ($feedback->save()) {
         return 'ok';
     } else {
         return 'no';
     }
 }