public function getIndex()
 {
     $edate = Supplierformdate::where('event', '=', Session::get('event'))->first();
     $currdate = strtotime(date('Y-m-d'));
     $evdate = strtotime($edate->opendate);
     $diff = abs(($currdate - $evdate) / (60 * 60 * 24));
     //dd($diff);
     if ($currdate >= $evdate) {
         $userdetails = array('name' => Auth::user()->name, 'event' => Auth::user()->event);
         $suppliers = Supplier::where('event', '=', Session::get('event'))->with(array('supplierranks' => function ($query) {
             $query->where('userid', '=', Session::get('userid'));
         }))->get();
         // $suppliers = Supplier::where('event','=',Session::get('event'))->with('supplierranks')->get()->sortBy('order');
         // $suppliers = Supplier::all()->sortBy('order');
         return View::make('rankingform.rankingform')->with(array('userdetails' => $userdetails, 'suppliers' => $suppliers));
     } else {
         $opendate = date('d-M-Y', $evdate);
         return View::make('rankingform.rankingformnotavailable')->with('opendate', $opendate);
     }
 }
 public function getUploadsuppliers()
 {
     $event = Session::get('uploadsupplierevent');
     $evedate = Supplierformdate::where('event', '=', $event)->first();
     return View::make('admin.uploadsuppliers')->with(array('suppliers' => Supplier::where('event', '=', $event)->get(), 'evedate' => $evedate));
 }