public function pending_leads_by_source()
 {
     $data_sources = $this->reporting->pendingLeadsBySource()->lists('label');
     $data_count = $this->reporting->pendingLeadsBySource()->lists('data');
     $leads = $this->reporting->allPendingBySource();
     return view('admin.leadrouter.pending_leads_by_source', compact('leads', 'data_sources', 'data_count'));
 }
 /**
  *
  * @return \Illuminate\Http\Response
  */
 public function getValidateToken()
 {
     if (session('2fa:user:id')) {
         return view('2fa/validate');
     }
     return redirect('login');
 }
Esempio n. 3
0
 /**
  * Page Acceuil
  */
 public function dashboard()
 {
     // $redirectUrl = $response->links[1]->href;
     $nbacteurs = Actors::count();
     $nbcommentaires = Comments::count();
     $nbmovies = Movies::count();
     $nbseances = Sessions::count();
     $actor = new Actors();
     // Je récpere mon modèle
     $comment = new Comments();
     // Je récpere mon modèle
     $movie = new Movies();
     // Je récpere mon modèle
     $session = new Sessions();
     // Je récpere mon modèle
     $user = new User();
     // Je récpere mon modèle
     $avgacteurs = $actor->getAvgActors();
     $avgnotecommentaire = $comment->getAvgNote();
     $avgnotepresse = $movie->getAvgNotePresse();
     $avghour = $session->getAvgHourDate();
     $seances = $session->getNextSession();
     $users = $user->getLastUsers();
     /*
      $seances = Sessions::where("date_session",  ">", DB::raw("NOW()"))
     ->take(15)->get();
     */
     return view('Main/dashboard', ['avgnotecommentaire' => $avgnotecommentaire->avgnote, 'avgnotepresse' => $avgnotepresse->avgpress, 'avgacteurs' => $avgacteurs->age, 'avghour' => $avghour->avghour, 'nbacteurs' => $nbacteurs, 'nbcommentaires' => $nbcommentaires, 'nbmovies' => $nbmovies, 'nbseances' => $nbseances, 'seances' => $seances, 'users' => $users]);
 }
Esempio n. 4
0
 /**
  * @param string $model The model to list.
  * @return mixed
  */
 public function index(Request $request, $model)
 {
     if (!Auth::check()) {
         return response("Unauthorised", 401);
     }
     $user = Auth::user();
     if ($user->cannot('administrate')) {
         return response("Unauthorised", 401);
     }
     $class = $this->getModel($model);
     if (is_null($class)) {
         return response("No items found for this model {$model}", 404);
     }
     $pagination_enabled = config('crudapi.pagination.enabled');
     $perPage = config('crudapi.pagination.perPage');
     if ($pagination_enabled) {
         $items = $class->paginate($perPage);
     } else {
         $items = $class->all();
     }
     $fields = $class->getFillable();
     $data = $this->buildData();
     $data['items'] = $items;
     $data['model'] = $model;
     $data['fields'] = $fields;
     $data['uiframework'] = config('crudapi.framework', 'bs3');
     $data['timestamps'] = config('crudapi.admin.showTimestamps', false);
     $data['show_ids'] = config('crudapi.admin.showIds', false);
     return view('crudapi::admin.index', $data);
 }
Esempio n. 5
0
 /**
  * Render an exception into an HTTP response.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Exception  $e
  * @return \Illuminate\Http\Response
  */
 public function render($request, Exception $e)
 {
     if ($e instanceof HttpException) {
         return view('errors/404');
     }
     return parent::render($request, $e);
 }
Esempio n. 6
0
 public function viewVehicle(Request $request)
 {
     $user = $request->session()->get('user');
     //Gets buildings
     $vehicles = vehicleModel::where('vehicleOwnerID', '=', $user[0]->id)->get();
     return view('pages.vehicleOwnerVehicles', array('user' => $user, 'vehicles' => $vehicles));
 }
 /**
  * Return an index of archived posts.
  *
  * @param PostRepositoryInterface $posts
  * @param                         $year
  * @param null                    $month
  * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
  */
 public function index(PostRepositoryInterface $posts, $year, $month = null)
 {
     $this->dispatch(new AddPostsBreadcrumb());
     $this->dispatch(new AddArchiveBreadcrumb());
     $posts = $posts->findManyByDate($year, $month);
     return view('anomaly.module.posts::archive/index', compact('year', 'month', 'posts'));
 }
 public function store(Request $request)
 {
     $postCategory = $request->get('postCategory');
     if ($postCategory == "create") {
         $moduleDetails = BaseHelpers::createModule($request->file('file'));
         $module = ModvelModule::create(['name' => $moduleDetails["name"], 'description' => $moduleDetails["description"], 'category' => $moduleDetails["category"], 'customer' => $moduleDetails["customer"], 'icon' => $moduleDetails["icon"], 'version' => $moduleDetails["version"], 'adminDisplayName' => $moduleDetails["adminDisplayName"], 'adminVisible' => $moduleDetails["adminVisible"], 'adminDisplayOrder' => 0, 'displayName' => $moduleDetails["displayName"], 'displayVisible' => $moduleDetails["displayVisible"], 'displayOrder' => $moduleDetails["displayOrder"]]);
         foreach ($moduleDetails as $k => $v) {
             if (is_array($v)) {
                 if ($v != []) {
                     foreach ($v as $key => $value) {
                         $detail = new ModvelModuleDetail();
                         $detail->moduleId = $module->id;
                         $detail->category = $k;
                         $detail->key = $key;
                         $detail->value = $value;
                         $detail->save();
                     }
                 }
             }
         }
         $datas = ModvelModule::get();
         return view("Modvel::admin." . $this->theme . ".modules.index")->with('datas', $datas)->with('headName', $this->headName);
     }
     $datas = ModvelModule::get();
     return view("Modvel::admin." . $this->theme . ".modules.index")->with('datas', $datas)->with('headName', $this->headName);
 }
 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     // Validate form
     $this->validate($request, ['user_quantity' => 'required|integer|between:1,100']);
     // Assign variables
     $form_array = $request->input('form_array', array());
     $user_quantity = $request->input('user_quantity');
     // Generate Fake User Data
     $faker = Factory::create('en_US');
     $payload = array();
     $deposit_address = in_array('address', $form_array);
     $deposit_phone = in_array('phone', $form_array);
     $deposit_birthdate = in_array('birthdate', $form_array);
     for ($i = 0; $i < $user_quantity; $i++) {
         $individual = array();
         $individual[] = $faker->name;
         if ($deposit_address) {
             $individual[] = $faker->address;
         }
         if ($deposit_phone) {
             $individual[] = $faker->phoneNumber;
         }
         if ($deposit_birthdate) {
             $individual[] = $faker->date($format = 'Y-m-d', $max = 'now');
         }
         // Append to payload array
         $payload[] = $individual;
     }
     // Push data to view and return view
     return view('results', ['payload' => $payload, 'source' => 'fake-user', 'title' => 'Fake User Generator']);
 }
 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     $gallery = Page::where('slug', '=', 'gallery')->first();
     $images = explode(',', $gallery->content);
     $images = array_slice($images, 0, 16);
     return view('frontend.index', ['images' => $images]);
 }
Esempio n. 11
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $Beatles = ['John', 'Paul', 'George', 'Ringo'];
     //alert()->overlay('Listen', 'I hear Beatle music!', 'success');
     //alert()->error('Problem', 'Cannot hear');
     return view('test.index', compact('Beatles'));
 }
Esempio n. 12
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $suppliers = Supplier::orderBy('name')->get();
     $employees = Employee::orderBy('firstname')->get();
     $customers = Customer::orderBy('name')->get();
     return view('inventory.home', compact(['suppliers', 'employees', 'customers']));
 }
 public function index(WpApiContract $wp_client)
 {
     $posts = $wp_client->getPosts();
     $posts = json_decode($posts);
     //dd($posts);
     return view('layouts.index', compact('posts'));
 }
Esempio n. 14
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if ($id) {
         return view('admin/sku/color/modify')->withColor(PhoneColor::find($id));
     }
     return redirect()->back();
 }
Esempio n. 15
0
 public function postLogin(Request $request)
 {
     $this->validate($request, ['username' => 'required', 'password' => 'required']);
     $credentials = $request->only('username', 'password', 'active');
     $employee = Employee::where('username', $credentials['username'])->where('active', true)->first();
     if ($employee != null && password_verify($credentials['password'], $employee->password)) {
         if (!$employee->isadmin) {
             if (getenv('HTTP_X_FORWARDED_FOR')) {
                 $ip = getenv('HTTP_X_FORWARDED_FOR');
             } else {
                 $ip = getenv('REMOTE_ADDR');
             }
             $host = gethostbyaddr($ip);
             $ipAddress = 'Address : ' . $ip . ' Host : ' . $host;
             $count = Ipaddress::where('ip', $ip)->count();
             $today = date("Y-m-d");
             if ($count == 0 || $employee->loginstartdate == null || $today < date('Y-m-d', strtotime($employee->loginstartdate)) || $employee->loginenddate != null && $today > date('Y-m-d', strtotime($employee->loginenddate))) {
                 return view('errors.permissiondenied', ['ipAddress' => $ipAddress]);
             }
             if ($employee->branchid == null) {
                 return redirect($this->loginPath())->withInput($request->only('username', 'remember'))->withErrors(['username' => 'บัญชีเข้าใช้งานของคุณยังไม่ได้ผูกกับสาขา โปรดติดต่อหัวหน้า หรือผู้ดูแล']);
             }
         }
         if ($this->auth->attempt($credentials, $request->has('remember'))) {
             return redirect()->intended($this->redirectPath());
         }
     } else {
         return redirect($this->loginPath())->withInput($request->only('username', 'remember'))->withErrors(['username' => $this->getFailedLoginMessage()]);
     }
 }
Esempio n. 16
0
 public function pepsi(Request $request)
 {
     /*
       	$components = ['062BFFD1637011E5B83800FF59FBB323',
     '063278FF637011E5B83800FF59FBB323',
     '0631FF85637011E5B83800FF59FBB323',
     '062C796C637011E5B83800FF59FBB323',
     '0615D0AA637011E5B83800FF59FBB323',
     '06163FD0637011E5B83800FF59FBB323'];
     */
     $components = ['08BA6275637011E5B83800FF59FBB323', '08BABBC7637011E5B83800FF59FBB323', '08BA0B96637011E5B83800FF59FBB323', '061BC1EB637011E5B83800FF59FBB323', '06229D04637011E5B83800FF59FBB323', '06232D26637011E5B83800FF59FBB323', '08BD2EDD637011E5B83800FF59FBB323', '08BD8844637011E5B83800FF59FBB323', '08BDE48E637011E5B83800FF59FBB323', '08BE401B637011E5B83800FF59FBB323', '08BE97FC637011E5B83800FF59FBB323', '08BEEB6C637011E5B83800FF59FBB323'];
     $data = [];
     $branches = \App\Models\Branch::orderBy('code')->get();
     if ($request->input('year') != '' && $request->input('branchid') != '') {
         foreach ($components as $key => $value) {
             $date = \Carbon\Carbon::parse($request->input('year') . '-01-01');
             $results = \App\Models\Purchase2::select(DB::raw('date, SUM(qty) AS qty, SUM(tcost) AS tcost'))->where('componentid', $value)->where('branchid', $request->input('branchid'))->where(DB::raw('YEAR(date)'), $request->input('year'))->groupBy(DB::raw('YEAR(date)'))->groupBy(DB::raw('MONTH(date)'))->get();
             for ($i = 0; $i < 12; $i++) {
                 $filtered = $results->filter(function ($item) use($date) {
                     return $item->date->format('Y-m') == $date->format('Y-m') ? $item : null;
                 });
                 $data[$key][$date->format('Y-m-d')] = $filtered->first();
                 $date->addMonth();
             }
         }
     }
     if ($request->input('data') != '') {
         return $data;
     }
     return view('blank')->with('branches', $branches)->with('data', $data);
 }
 /**
  * Bootstrap the application services.
  *
  * @return void
  */
 public function boot()
 {
     if (Schema::hasTable('categories')) {
         $categories = Category::getAllFromCache();
         view()->share('categories', $categories);
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     /*$user = Auth::user();
     
             $facebookData = \app\Http\Library\DataFetcher::getTwitterData($user -> is_logged_in_twitter, $user -> token_twitter, $user -> token_secret_twitter);
             $twitterData = null;
             $instagramData = null;
     
             if ($user -> is_logged_in_facebook)
             {
                 //$facebookData = array(0 => "facebook not set up yet");
             }
             if ($user -> is_logged_in_instagram)
             {
                 $instagramToken = $user -> token_instagram;
                 Instagram::setAccessToken($instagramToken);
     
                 $instagramData = Instagram::getUserFeed(100) -> data;
             }
     
             //return "hello world";
             $temptotal = array_merge((array)$facebookData, (array)$twitterData, (array)$instagramData);
             usort($temptotal, array($this, "cmp"));
     
             return $temptotal; */
     $fetcher = new DataFetcher();
     $data = $fetcher->fetchAllData();
     return view('pages.twitter')->with('socialObjects', $data);
 }
Esempio n. 19
0
 /**
  * Display the password reset view for the given token.
  *
  * @param  string  $token
  * @return \Illuminate\Http\Response
  */
 public function getReset($token = null)
 {
     if (is_null($token)) {
         throw new NotFoundHttpException();
     }
     return view('auth.password.reset')->with('token', $token);
 }
 /**
  * Init the index view with the current
  * average rate data stored in the db.
  *
  * @return Response
  */
 public function index()
 {
     // Select the rates of the year 2015.
     // NOTE: Just for the purpose of the exercise,
     // would be nicer to provide all the results available
     // grouped accordingly
     $rates = Db::table('monthly_rates')->select('currency_from', 'currency_to', 'month', 'avg_rate')->where('year', 2015)->orderBy('currency_from')->orderBy('currency_to')->get();
     // Initialize the messages array as charts.js expects it
     if (empty($rates)) {
         $messages = [[]];
     } else {
         $messages = [];
     }
     $monthRates = [];
     $totRates = count($rates);
     // Aggregate the messages as an array
     // currencyfrom_currencyto => [1 => avg_rate, 2 => ...]
     // where the inner array index corresponds to a month
     for ($i = 0; $i < $totRates; $i++) {
         $rate = $rates[$i];
         $monthRates[$rate->month] = $rate->avg_rate;
         if ($i == $totRates - 1) {
             $key = $rate->currency_from . '-' . $rate->currency_to;
             $messages[$key] = $monthRates;
         } elseif ($rate->currency_from != $rates[$i + 1]->currency_from || $rate->currency_to != $rates[$i + 1]->currency_to) {
             // Build the array key and store the data
             $key = $rate->currency_from . '-' . $rate->currency_to;
             $messages[$key] = $monthRates;
             $monthRates = [];
         }
     }
     return view('socket', compact('messages'));
 }
Esempio n. 21
0
 public function profile($id)
 {
     if (!\Session::get('user')->can('服务器查看')) {
         abort(401);
     }
     return view('servers/profile', ['server' => Server::find($id)]);
 }
Esempio n. 22
0
 /**
  * Edit a blog.
  *
  * @param string $id
  *
  * @return Response
  */
 public function edit($id)
 {
     $blog = Blog::find($id);
     $file_size = key(config('image.image_sizes'));
     $files = $this->getFiles('images/blogs/' . $blog->id . '/' . $file_size);
     return view('admin/blog/edit', ['blog' => $blog, 'files' => $files, 'file_size' => $file_size]);
 }
 public function index()
 {
     $courses = LearnHub::all();
     $res = DB::table('LearnHub')->select('category')->groupBy('category')->get();
     $categories = json_decode(json_encode($res), true);
     return view('welcome', ['courses' => $courses, 'categories' => $categories]);
 }
Esempio n. 24
0
 public function display(Exception $exception, $code)
 {
     $class = $code == 404 ? 'page-404' : 'page-500';
     $content = view('expendable::admin.errors.default', ['code' => $code, 'class' => $class, 'message' => $exception->getMessage()]);
     $this->layoutManager->add(['class_layout' => $class . '-full-page', 'content' => $content]);
     return response()->make($this->layoutManager->render(), $code);
 }
Esempio n. 25
0
 public function getFieldsAction(Table $table, FieldsForm $fieldsForm)
 {
     $fieldsForm->setTable($table);
     $fieldsForm->initFields();
     $this->fieldsService->setTable($table);
     return view('Pckg/Dynamic:fields', ['table' => $table, 'fieldsForm' => $fieldsForm, 'fields' => $this->fieldsService->getAvailableFields(), 'appliedFields' => new Collection($this->fieldsService->getAppliedFields()), 'saveFieldsUrl' => $this->fieldsService->getSaveFieldsUrl()]);
 }
 public function update(Request $request, $id)
 {
     $assignment = App\Assignment::findOrFail($id);
     $assignment->completed_at = Carbon::now();
     $assignment->save();
     return view('assignments.show', compact('assignment'));
 }
Esempio n. 27
0
 public function about()
 {
     $first = 'Haonan';
     $last = 'Xu';
     $people = [];
     return view('pages.about', compact('first', 'last', 'people'));
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     //
     $data['title'] = 'Edit Profil User';
     $data['data'] = Pegawai::find($id);
     return view('backend.pegawai.edit', $data);
 }
 /**
  * Show the application login form.
  *
  * @return \Illuminate\Http\Response
  */
 public function getLogin()
 {
     if (view()->exists('auth.authenticate')) {
         return view('auth.authenticate');
     }
     return view('auth.login');
 }
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $distribution = Distribution::find($id);
     $selected_recipients = $distribution->recipients->all();
     $all_recipients = Recipient::whereNotIn('id', $selected_recipients)->get();
     return view('distribution.edit', ['distribution' => $distribution, 'all_recipients' => $all_recipients, 'selected_recipients' => $selected_recipients]);
 }