コード例 #1
0
 public function welcome(Service $serviceModel)
 {
     $sliders = Slider::all();
     $services = $serviceModel->getService();
     $page = Page::where('name', '=', 'home')->firstOrFail();
     return view('welcome')->with('sliders', $sliders)->with('services', $services)->with('page', $page);
 }
コード例 #2
0
ファイル: MainController.php プロジェクト: Blu2z/minesko
 public function index(Page $page, PhotogalleriesGallery $photogalleriesGallery, Banner $banner, Service $service)
 {
     $about = $page->geByTitle('about');
     $banners = $banner->getByWeight();
     $services = $service->getOnTop();
     $gallery = $photogalleriesGallery->random();
     return view('index', ['banners' => $banners, 'services' => $services, 'about' => $about[0], 'gallery' => $gallery]);
 }
コード例 #3
0
 public function update(Request $request, Service $service)
 {
     $insert = $service->fill($request->input())->save();
     if ($insert) {
         return 0;
     } else {
         return 1;
     }
 }
コード例 #4
0
 public function results(Request $request)
 {
     $services = Service::name($request->get('query'))->orderBy('created_at', 'DESC')->get();
     $materials = Material::name($request->get('query'))->orderBy('created_at', 'DESC')->get();
     $results = $materials->merge($services);
     return view('results')->with('results', $results)->with('title', $request->get('query'));
 }
コード例 #5
0
ファイル: Service.php プロジェクト: tfarneau/wandr
 public static function transformMany($services)
 {
     foreach ($services as $k => $v) {
         $services[$k] = Service::transform($v);
     }
     return $services;
 }
コード例 #6
0
 public function selectReportByExpense(Request $request, ExpenseAjax $expense)
 {
     $input = $request->all();
     $exchangerate = DB::table('exchange_rates')->orderBy('id', 'desc')->first();
     $services = Service::select('sections.name AS section_name', 'uom_expenses.name AS expense_uom_name', 'services.*')->leftJoin('sections', 'sections.id', '=', 'services.section_id')->leftJoin('uom_expenses', 'uom_expenses.id', '=', 'services.uom_expense_id')->where('sections.is_active', 1)->whereBetween('services.expense_date', array($input['dateFrom'], $input['dateTo']))->orderBy('services.expense_date')->get();
     return View::make('reports.reportExpenseResult')->with('services', $services)->with('exchangerate', $exchangerate);
 }
コード例 #7
0
 /**
  * post Store
  *
  * @param  Request $request Input data of booking form
  * @param  ConciergeServiceLayer $concierge Concierge injection
  * @return Response         Redirect to Appointments listing
  */
 public function postStore(Request $request, ConciergeServiceLayer $concierge)
 {
     $this->log->info('AgendaController: postStore');
     $issuer = auth()->user();
     $business = Business::findOrFail($request->input('businessId'));
     $contact = $issuer->getContactSubscribedTo($business);
     $service = Service::find($request->input('service_id'));
     $datetime = Carbon::parse($request->input('_date') . ' ' . $business->pref('start_at'))->timezone($business->timezone);
     $comments = $request->input('comments');
     $appointment = $concierge->makeReservation($issuer, $business, $contact, $service, $datetime, $comments);
     if (false === $appointment) {
         $this->log->info('AgendaController: postStore: [ADVICE] Unable to book ');
         Flash::warning(trans('user.booking.msg.store.error'));
         return redirect()->route('user.booking.list');
     }
     $appointmentPresenter = $appointment->getPresenter();
     if ($appointment->exists) {
         $this->log->info('AgendaController: postStore: Appointment saved successfully ');
         Event::fire(new NewBooking($issuer, $appointment));
         Flash::success(trans('user.booking.msg.store.success', ['code' => $appointmentPresenter->code()]));
     } else {
         $this->log->info('AgendaController: postStore: [ADVICE] Appointment is duplicated ');
         Flash::warning(trans('user.booking.msg.store.sorry_duplicated', ['code' => $appointmentPresenter->code()]));
     }
     return redirect()->route('user.booking.list');
 }
コード例 #8
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     for ($i = 1; $i <= 20; $i++) {
         $services = ['name' => 'Сервис_' . $i, 'active' => '1', 'created_at' => '2015-09-19 16:57:25', 'updated_at' => '2015-09-19 16:57:25'];
         \App\Service::create($services);
     }
 }
コード例 #9
0
 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     if (!\App\Service::find('broadcast')) {
         DB::table('pweb_services')->insert(['key' => 'broadcast', 'icon' => 'microphone', 'currency_type' => 'virtual', 'price' => 50, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('virtual_to_cubi')) {
         DB::table('pweb_services')->insert(['key' => 'virtual_to_cubi', 'icon' => 'shuffle', 'currency_type' => 'virtual', 'price' => 10, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('cultivation_change')) {
         DB::table('pweb_services')->insert(['key' => 'cultivation_change', 'icon' => 'refresh', 'currency_type' => 'virtual', 'price' => 100, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('gold_to_virtual')) {
         DB::table('pweb_services')->insert(['key' => 'gold_to_virtual', 'icon' => 'shuffle', 'currency_type' => 'gold', 'price' => 1000000, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('level_up')) {
         DB::table('pweb_services')->insert(['key' => 'level_up', 'icon' => 'plus', 'currency_type' => 'virtual', 'price' => 10, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('max_meridian')) {
         DB::table('pweb_services')->insert(['key' => 'max_meridian', 'icon' => 'lock-open', 'currency_type' => 'virtual', 'price' => 500, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('reset_exp')) {
         DB::table('pweb_services')->insert(['key' => 'reset_exp', 'icon' => 'reload', 'currency_type' => 'virtual', 'price' => 0, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('reset_sp')) {
         DB::table('pweb_services')->insert(['key' => 'reset_sp', 'icon' => 'reload', 'currency_type' => 'virtual', 'price' => 0, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('reset_stash_password')) {
         DB::table('pweb_services')->insert(['key' => 'reset_stash_password', 'icon' => 'lock-open', 'currency_type' => 'virtual', 'price' => 150, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
     if (!\App\Service::find('teleport')) {
         DB::table('pweb_services')->insert(['key' => 'teleport', 'icon' => 'globe', 'currency_type' => 'virtual', 'price' => 0, 'enabled' => 1, 'created_at' => \Carbon\Carbon::now(), 'updated_at' => \Carbon\Carbon::now()]);
     }
 }
コード例 #10
0
ファイル: User.php プロジェクト: ritey/audious
 /**
  * Get user's playlists.
  * @param  String $service_name Service name i.e. Soundcloud
  * @return Collection of playlists with songs attached.
  */
 public function getPlaylists($service_name)
 {
     // Get Service object to parse id later.
     $service = Service::where('name', $service_name)->first();
     // Get playlists and songs.
     return $this->playlists()->with('songs')->where('service_id', $service->id)->get();
 }
コード例 #11
0
 public function create()
 {
     $props = [];
     $props['user'] = $this->currentUser;
     $props['account'] = $this->currentUser->agentAccount;
     $props['service'] = Service::find($this->params['service_id']);
     return view('applications.create', ['params' => $props]);
 }
コード例 #12
0
ファイル: IndexController.php プロジェクト: MammutCris/Josse
 public function index()
 {
     $events = \App\Event::get();
     $sliders = \App\Slider::get();
     $services = \App\Service::get();
     $site = \App\Site::where('active', '1')->firstOrFail();
     return view('pages.index', ['events' => $events, 'sliders' => $sliders, 'services' => $services, 'site' => $site]);
 }
コード例 #13
0
 public function home()
 {
     $title = "Event Company TN";
     $events = Event::all();
     $services = Service::all();
     $about = DB::select('select * from about');
     $video = DB::select('select iframe from video');
     return view('index', ['title' => $title, 'about' => $about, 'services' => $services, 'events' => $events, 'video' => $video]);
 }
コード例 #14
0
 /**
  * Store a newly created resource in storage.
  *
  * @param  Request $request
  *
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request)
 {
     $services = Service::create(['brand' => ucwords($request->brand), 'product' => ucwords($request->product), 'variant' => ucwords($request->variant), 'age' => $request->age, 'pincode' => $request->pincode, 'status' => $request->status, 'user_id' => $request->user_id]);
     Mail::send('auth/emails.request', ['services' => $services], function ($m) use($services) {
         $m->to('*****@*****.**', 'Team AfterCares');
         $m->from('*****@*****.**', 'Team AfterCares')->subject('New Service Request');
     });
     return json_encode($services);
 }
コード例 #15
0
ファイル: ServiceEnabled.php プロジェクト: huludini/pw-web
 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $service = Service::find($request->segment(2));
     if (!$service->enabled) {
         flash()->error(trans('service.disabled'));
         return redirect()->back();
     }
     return $next($request);
 }
コード例 #16
0
ファイル: CartController.php プロジェクト: zangee3/avs
 public function create(ApplicationRequest $request)
 {
     $services = Service::join('service_visas', 'services.id', '=', 'service_visas.service_id')->select('services.id', 'services.name', 'min_process', 'max_process')->orderBy('min_process')->orderBy('max_process')->where('country_id', '=', $request->get('country'))->groupBy('services.id')->get();
     $service = $services->first();
     $states = DB::table('states')->orderBy('name', 'asc')->lists('name', 'id');
     $countries = Country::orderBy('name')->lists('name', 'id');
     $country = Country::find($request->get('country'));
     return View('apply', ['services' => $services->lists('title', 'id'), 'service' => $service, 'country' => $country, 'countries' => $countries, 'states' => $states]);
 }
コード例 #17
0
ファイル: DatabaseSeeder.php プロジェクト: tfarneau/wandr
 public function run()
 {
     Model::unguard();
     DB::table('services')->delete();
     $services = array(['user_id' => 1, 'slug' => 'slack', 'status' => 'ADDED', 'var1' => 'DS ByMySide', 'var2' => 'https://hooks.slack.com/services/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', 'var3' => null, 'var4' => null, 'var5' => null, 'var6' => null], ['user_id' => 1, 'slug' => 'ga', 'status' => 'ADDED', 'var1' => 'My GA Account', 'var2' => '*****@*****.**', 'var3' => 'SlackReport-233ac4da5625.p12', 'var4' => '/keys/1/SlackReport-233ac4da5625.p12', 'var5' => null, 'var6' => null]);
     foreach ($services as $service) {
         Service::create($service);
     }
     Model::reguard();
 }
コード例 #18
0
 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     //$corporalserv = Service::corporal()->paginate();
     //$facialserv   = Service::facial()->paginate();
     //$roomserv     = Service::room()->paginate();
     //$otherserv    = Service::other()->paginate();
     //return view('welcome', compact(['corporalserv', 'facialserv', 'roomserv', 'otherserv']));
     $services = Service::all();
     return view('welcome', compact('services'));
 }
コード例 #19
0
 public function update(EditServiceRequest $request, $id)
 {
     $id_user = Auth::user()->id;
     $services = Service::findOrFail($id);
     $services->iduser_update->{$id_user};
     $services->fill($request->all());
     $services->save();
     Session::flash('message', $services->name . ' Se actualizo exitosamente');
     return redirect()->back();
 }
コード例 #20
0
 public function postEdit(Request $request)
 {
     $services = Service::all();
     foreach ($services as $service) {
         $service->enabled = $request->{$service->key . '_enabled'};
         $service->price = $request->{$service->key . '_price'};
         $service->save();
     }
     flash()->success(trans('services.edit_success'));
     return redirect('admin/services');
 }
コード例 #21
0
function getName($code, $branch)
{
    // Try getting a normal product for this code
    $product = Stock::where('Code', '=', $code)->where('BranchId', '=', $branch)->first();
    if (!$product) {
        // If we failed try getting a service.
        $service = Service::where('Code', '=', $code)->where('BranchId', '=', $branch)->first();
        return $service->Description;
    }
    return $product->Description;
}
コード例 #22
0
 /**
  * Get the validation messages that apply to the request.
  *
  * @return array
  */
 public function messages()
 {
     $service = Service::findorFail($this->input('service_id'));
     $messages = [];
     foreach ($service->fields as $field) {
         foreach ($field->rulemessages as $rm) {
             $messages[$rm->rule] = $rm->message;
         }
     }
     return $messages;
 }
コード例 #23
0
 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return Response
  */
 public function show($id, Phpgmaps $gmpas)
 {
     $service = Service::findOrFail($id);
     $config['center'] = $service->lat . ', ' . $service->lng;
     $config['zoom'] = 15;
     $gmpas->initialize($config);
     $marker = [];
     $marker['position'] = $service->lat . ', ' . $service->lng;
     $gmpas->add_marker($marker);
     $map = $gmpas->create_map();
     return view('services.show')->with('map', $map)->with('service', $service)->with('title', $service->name);
 }
コード例 #24
0
ファイル: PdfController.php プロジェクト: juliocga/GitAkzara
 public function invoice($id)
 {
     $user = Auth::user();
     $reservation = Reservation::findOrFail($id);
     $service = Service::findOrFail($reservation->serviceid);
     $date = date('Y-m-d');
     $view = \View::make('user.reservations.thisreservation', compact('date', 'service', 'reservation', 'user'))->render();
     //return view('user.reservations.thisreservation', compact('data', 'date', 'invoice'));
     $pdf = \App::make('dompdf.wrapper');
     //dd($pdf);
     $pdf->loadHTML($view);
     return $pdf->download('Reservation');
 }
コード例 #25
0
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function requestStatus(Request $request)
 {
     $services = Service::findOrFail($request->submit);
     $services->update(['status' => $request->status]);
     $user = User::where('id', '=', $services->user_id)->get()->first();
     if (isset($services->status)) {
         Mail::send('auth/emails.statusChange', ['services' => $services], function ($m) use($user) {
             $m->from('*****@*****.**', 'Team AfterCares');
             $m->to($user->email, $user->name)->subject('Change in status of request');
         });
         return back()->withInput();
     }
 }
コード例 #26
0
ファイル: HomeController.php プロジェクト: laravelista/kyle
 /**
  * Show the report for all things.
  *
  * @return [type]
  */
 public function report()
 {
     $services = Service::orderBy('month')->orderBy('day')->where('active', 1)->with(['client', 'category'])->get();
     $clients = Client::orderBy('name')->whereHas('services', function ($query) {
         $query->where('active', 1);
     })->with(['services' => function ($query) {
         $query->where('active', 1);
     }])->get();
     $categories = Category::orderBy('name')->whereHas('services', function ($query) {
         $query->where('active', 1);
     })->with(['services' => function ($query) {
         $query->where('active', 1);
     }])->get();
     return view('report')->with(compact('services', 'clients', 'categories'));
 }
コード例 #27
0
ファイル: ServiceController.php プロジェクト: kharhys/revenue
 public function index(Request $request)
 {
     if ($request->get('department')) {
         $services = \App\Service::filterByDepartment($request->get('department'))->get();
         $departments = \App\Department::where('id', $request->get('department'))->get();
     } elseif ($request->get('domain')) {
         $domain = \App\Domain::findOrfail($request->get('domain'));
         $services = $domain->services()->get();
         $departments = $domain->departments()->get();
     } else {
         $services = $this->services;
         $departments = \App\Department::all();
     }
     return view('services.index', ['services' => $services, 'departments' => $departments]);
 }
コード例 #28
0
ファイル: HomeController.php プロジェクト: DiCore/hours
 public function getHome()
 {
     $services = \App\Service::all();
     $categories = \Auth::user()->categories;
     $servicesnp = new Collection();
     foreach ($services as $service) {
         $service->name = '(' . $service->category->name . ')-' . $service->name;
     }
     foreach ($categories as $category) {
         foreach ($category->services as $service) {
             $service->name = '(' . $service->category->name . ')-' . $service->name;
             $servicesnp->push($service);
         }
     }
     return view('pages.home', compact('services', 'servicesnp'));
 }
コード例 #29
0
ファイル: UserController.php プロジェクト: tfarneau/wandr
 public function dashboard()
 {
     // Get services
     $services = Service::transformMany(Auth::user()->services->toArray());
     $ga_services = [];
     $slack_services = [];
     foreach ($services as $v) {
         if ($v['slug'] == "ga") {
             array_push($ga_services, $v);
         } else {
             if ($v['slug'] == "slack") {
                 array_push($slack_services, $v);
             }
         }
     }
     // Get generators
     $generators = Generator::where('user_id', Auth::user()->id)->get();
     return view('pages.dashboard')->with(['ga_services' => $ga_services, 'slack_services' => $slack_services, 'generators' => $generators]);
 }
コード例 #30
0
ファイル: VisasController.php プロジェクト: zangee3/avs
 /**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create(Request $request)
 {
     $visa = new Visa();
     $visa->name = $request->get("name");
     $visa->description = $request->get("description", "");
     $visa->save();
     $service = Service::findOrFail($request->get("service", 0));
     $product = new Product();
     $product->visa_id = $visa->id;
     $product->service_id = $service->id;
     $product->price = $request->get('price', 0);
     $product->save();
     $requirements = $request->get('requirements');
     if (is_array($requirements)) {
         foreach ($requirements as $req) {
             $visa->requirement()->attach($req);
         }
     }
     return redirect()->action("VisasController@adminIndex")->with('message', 'Visa added');
 }