public function getOferta($id, $id_unic)
 {
     $oferte = Cereri_Oferte::where('id', $id)->where('url', $id_unic)->first();
     if ($oferte->activ == 0) {
         $client = Cereri_Clienti::findOrFail($oferte->cereri_clienti_id);
         $comentarii = Cereri_Comentarii::where('cereri_oferte_id', $id)->get();
         return view('frontend.tickets.layout-ticket')->with('date_rezervare', $oferte)->with('date_client', $client)->with('comentarii', $comentarii);
     } else {
         \App::abort(404);
     }
 }
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  *
  * @return Response
  */
 public function destroy($id)
 {
     Cereri_Clienti::destroy($id);
     Session::flash('flash_message', 'Cereri_Clienti deleted!');
     return redirect('auth/cereri_clienti');
 }
 public function sendFormular(Request $request)
 {
     $response = session('response');
     $datasejur = session('datasejur');
     $tiprezervare = session('tiprezervare');
     if ($tiprezervare != 'pachet') {
         $templateEmail = 'solicitare-oferte-hoteluri';
         $idRezervare = 0;
     } else {
         $templateEmail = 'solicitare-oferta-pachet';
         $idRezervare = 1;
     }
     Mail::send('auth.emails.' . $templateEmail, ['request' => $request, 'response' => $response, 'datasejur' => $datasejur], function ($mail) use($request) {
         $mail->from(config('configurari.mail_from'), config('configurari.mail_from_alias'));
         $mail->to($request->Email, config('configurari.mail_to'));
         $mail->subject('Multumim pentru comanda solicitata');
     });
     //-----------stocare cereri-------------//
     $client = Cereri_Clienti::where('email', $request->Email)->first();
     $date_rezervare = ['response' => serialize($response), 'datasejur' => serialize($datasejur)];
     if ($client) {
         $array = ['nume' => $request->Nume, 'telefon' => $request->Telefon, 'adresa' => getJudeteMobilPay($request->Judet)->judet . '|' . $request->Oras . '|' . $request->Adresa];
         $client->update($array);
     } else {
         $array = ['nume' => $request->Nume, 'email' => $request->Email, 'telefon' => $request->Telefon, 'adresa' => getJudeteMobilPay($request->Judet)->judet . '|' . $request->Oras . '|' . $request->Adresa];
         $client = Cereri_Clienti::create($array);
     }
     $array_cereri_oferte = ['cereri_clienti_id' => $client->id, 'status' => $idRezervare, 'url' => uniqid(), 'activ' => 0, 'descriere' => serialize($date_rezervare)];
     Cereri_Oferte::create($array_cereri_oferte);
     //--------------------------------------//
     return redirect()->back();
 }