public function postRejectvip(Request $request)
 {
     $post = Input::get();
     //dd($post);
     $vipid = Input::get('rejid');
     $leadcode = Input::get('leadcode');
     $email = Input::get('email');
     $status = Input::get('reject_status');
     $rcm = Input::get('reject_comment');
     $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) {
         $email = $get->email;
     }
     // dd($confirmation_code);
     $subject = "hi";
     if ($i > 0) {
         $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', '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();
 }
 public function getViewdetails($dealid)
 {
     $leadsheet = leadsheet::where('leadcode', $dealid)->get();
     // dd($leadsheet);
     $varr = Auth::user()->empid;
     $evarr = User::where('empid', $varr)->get();
     $emp = Employee::where('emp_ide_id', $varr)->get();
     foreach ($emp as $empp) {
         $fromemail = $empp->email;
     }
     // dd($fromemail);
     $lead_id = Deal::where('leadcode', $dealid)->get();
     foreach ($lead_id as $editlead) {
         $dealid = $editlead->Id;
         $leadcode = $editlead->leadcode;
     }
     // dd($dealid);
     $editlead = vipbooking::where('leadcode', $leadcode)->where('deal_id', $dealid)->where('id', DB::raw("(select max(`id`) from vipbooking)"))->get();
     $delegateinfo = delegatedealinfo::where('leadcode', $leadcode)->where('deal_id', $dealid)->get();
     //dd(count($editlead));
     return View('initiator/viewdetails')->with(array('lead_id' => $lead_id, 'editlead' => $editlead, 'emp' => $emp, 'delegateinfo' => $delegateinfo, 'leadsheet' => $leadsheet));
 }