public function getServiceform($token1) { $status = 0; $token = explode('===', $token1); $lead_id = hotelform::where('token', $token[0])->get(); // dd($lead_id); foreach ($lead_id as $lead) { $leadcode = $lead->leadcode; if ($lead->token == $token[0]) { $status = 1; } } //dd($dealtype); if ($status == 1) { $dealtype = Deal::where('leadcode', $leadcode)->get(); foreach ($dealtype as $dealt) { $evcode = $dealt->Eventcode; # code... } $vip = vipbooking::where('leadcode', $leadcode)->max('id'); $event = Event::where('eventcode', $evcode)->get(); $leadsheet = leadsheet::where('leadcode', $leadcode)->get(); $benefits = benefits::where('leadcode', $leadcode)->get(); return View('form/serviceform')->with(array('lead_id' => $lead_id, 'dealtype' => $dealtype, 'event' => $event, 'leadsheet' => $leadsheet, 'benefits' => $benefits, 'vip' => $vip)); } else { echo 'token expired'; } }
<?php use App\vipbooking; use App\Deal; use App\Event; use App\hotelform; $lastId = hotelform::get()->last(); $lastinvoice = hotelform::where('id', $lastId->id)->get(); foreach ($lastinvoice as $inv) { $leadcode = $inv->leadcode; $token = $inv['token']; $token1 = str_random(30); } $details = Deal::where('leadcode', $leadcode)->get(); foreach ($details as $lead) { $eventc = $lead->Eventcode; } $event = Event::where('eventcode', $eventc)->get(); foreach ($event as $eve) { } ?> <p><b>Dear {{$inv->clientname}} </b></p> <p>We thank <b>{{$lead->Companyname}} </b>for giving us an opportunity to serve you at our initiative <b>{{$lead->Eventname}}</b> to be held on <b>{{$eve->date}}</b> at <b>{{$eve->city}},{{$eve->country}}</b> As part of the confirmation process you need to fill up a Service booking form. </p> <p>Please follow the link to register for the initiative:</p> <p>Service Booking Form Link : {{url('form/serviceform/'.$token."===".$token1)}} </p>
public function postHotelform(Request $request) { // dd('dhkajhd'); $post = Input::get(); $leadcode = Input::get('leadid'); $pemail = Input::get('pemail'); $dealid = Input::get('dealid'); $pname = Input::get('pname'); $confirmation_code = str_random(30); // $fromemail=Input::get('fromemail'); // $empid=Input::get('empid'); // dd($fromemail); $c = new hotelform(); $c->pemail = $pemail; $c->pname = $pname; $c->dealid = $dealid; $c->leadcode = $leadcode; $c->token = $confirmation_code; $c->save(); //update delegate deal info $deal = Deal::where('leadcode', $leadcode)->get(); foreach ($deal as $key) { $event = $key->Eventname; $company = $key->Companyname; } // dd($confirmation_code); $subject = $event . "_" . "Service" . " Booking" . "Form" . "_" . $company; // dd($subject); Mail::send('emails.hotelbooking', ['Hotelbooking' => 'sdsad'], function ($message) use($subject, $pemail) { // note: if you don't set this, it will use the defaults from config/mail.php $message->from('*****@*****.**', 'IDE Consulting Services Pvt Ltd'); $message->to($pemail)->subject($subject); }); $request->session()->flash('alert-success', 'Service Booking Form has been sent to client'); return redirect('reviewer/pendingactivity'); }