public function postBookingform(Request $request) { $post = Input::get(); $email = Input::get('vip_email'); $logo = Input::get('logo'); $leadcode = Input::get('leadid'); $dealid = Input::get('dealid'); $confirmation_code = str_random(30); $c = new vipbooking(); $c->email = $email; $c->deal_id = $dealid; $c->leadcode = $leadcode; $c->confirmation_code = $confirmation_code; $c->save(); //update delegate deal info $i = delegatedealinfo::where('deal_id', $dealid)->update(array('logo' => $logo, 'vip' => 'NULL')); // dd($confirmation_code); $subject = "hi"; Mail::send('emails.booking', ['Booking' => 'sdsad'], function ($message) use($subject, $email) { // 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($email)->subject($subject); }); $request->session()->flash('alert-success', 'VIP Booking Form has been sent to client'); return redirect('initiator/pendingactivity'); }
public function postRejectvip(Request $request) { $post = Input::get(); //dd($post); $vipid = Input::get('rejid'); $leadcode = Input::get('leadcode'); $email = Input::get('email'); $empid = Input::get('empid'); $status = Input::get('reject_status'); $rcm = Input::get('reject_comment'); $empid = Employee::where('emp_ide_id', $empid)->get(); foreach ($empid as $email) { $fromemail = $email->email; } $selectdata = vipbooking::where('id', $vipid)->get(); foreach ($selectdata as $data) { $email = $data->email; $empid = $data->empid; $clientname = $data->clientname; $leadcode = $data->leadcode; $dealid = $data->deal_id; } $confirmation_code = str_random(30); $c = new vipbooking(); $c->email = $email; $c->clientname = $clientname; $c->empid = $empid; $c->deal_id = $dealid; $c->leadcode = $leadcode; $c->confirmation_code = $confirmation_code; $c->save(); $i = vipbooking::where('id', $vipid)->update(array('status' => $status, 'rcomments' => $rcm)); $i = delegatedealinfo::where('leadcode', $leadcode)->update(array('vip' => 'NULL')); $getdetails = DB::table('deal')->join('vipbooking', 'deal.leadcode', '=', 'vipbooking.leadcode')->where('deal.leadcode', '=', $leadcode)->where('vipbooking.leadcode', '=', $leadcode)->get(); foreach ($getdetails as $get) { $sendemail = $get->pemail; } // dd($email); // dd($confirmation_code); $deal = Deal::where('leadcode', $leadcode)->get(); foreach ($deal as $key) { $event = $key->Eventname; $company = $key->Companyname; } $subject = "Rejection" . "_" . $event . "_" . "Delegate" . "Booking" . "Form" . "_" . $company; Mail::send('emails.rejectmail', array('selectdata' => $selectdata), function ($message) use($subject, $email) { // note: if you don't set this, it will use the defaults from config/mail.php $message->from($fromemail, 'IDE Consulting Services Pvt Ltd'); $message->to($email)->subject($subject); }); $request->session()->flash('alert-success', 'Invoice has been sent to client !'); return Redirect::back(); //$request->session()->flash('alert-success', 'VIP Booking Form has been sent to client'); //return Redirect::back(); }