diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 40bf4e5..df961a3 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,102 +2,43 @@ - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - + + - - + - + - - - - - + - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + @@ -440,6 +381,8 @@ + + @@ -473,9 +416,10 @@ - + + @@ -486,14 +430,15 @@ - + - + - + + diff --git a/app/Http/Controllers/Api/PayoneController.php b/app/Http/Controllers/Api/PayoneController.php index 437c85d..239efe7 100755 --- a/app/Http/Controllers/Api/PayoneController.php +++ b/app/Http/Controllers/Api/PayoneController.php @@ -93,6 +93,15 @@ class PayoneController extends Controller die(); } + /* TODO -- need this? + + if($shopping_payment->txaction == $data['txaction']){ + \Log::channel('payone')->error('PaymentStatus: same txaction error: '.json_encode($data)); + echo "PaymentStatus: same txaction:"; + var_dump($data); + die(); + } + */ //create transaction PaymentTransaction::create([ 'shopping_payment_id' => $shopping_payment->id, @@ -110,13 +119,15 @@ class PayoneController extends Controller $shopping_payment->txaction = $data['txaction']; $shopping_payment->save(); - - if($data['txaction'] == 'failed'){ + $send_link = false; + if($data['txaction'] === 'failed'){ } - if($data['txaction'] == 'paid'){ + + if($data['txaction'] === 'paid'){ $shopping_order->paid = true; $shopping_order->save(); + //if product has actions if($shopping_order->shopping_order_items && $shopping_order->auth_user_id){ foreach($shopping_order->shopping_order_items as $shopping_order_item){ @@ -124,14 +135,18 @@ class PayoneController extends Controller if($shopping_order_item->product->action){ $user = User::findOrFail($shopping_order->auth_user_id); + $user->payment_order_id = $shopping_order_item->product->id; + $user->save(); + $send_link = true; + $date = date("Y-m-d H:i:s", strtotime("+1 years")); foreach ($shopping_order_item->product->action as $do){ if($shopping_order_item->product->getActionName($do) === 'payment_for_account'){ - $user->payment_account = date("Y-m-d H:i:s", strtotime("+1 years")); - $user->wizard = 10; + $user->payment_account = $date; + $user->wizard = 100; } if($shopping_order_item->product->getActionName($do) === 'payment_for_shop'){ - $user->payment_shop = date("Y-m-d H:i:s", strtotime("+1 years")); - $user->wizard = 10; + $user->payment_shop = $date; + $user->wizard = 100; } $user->save(); } @@ -141,7 +156,7 @@ class PayoneController extends Controller } } - if($data['txaction'] == 'appointed'){ + if($data['txaction'] === 'appointed'){ } @@ -152,9 +167,9 @@ class PayoneController extends Controller } $checkout_mail = config('app.checkout_mail'); if($user_shop_email){ - Mail::to($billing_email)->bcc([$user_shop_email, $checkout_mail])->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment)); + Mail::to($billing_email)->bcc([$user_shop_email, $checkout_mail])->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $send_link)); }else{ - Mail::to($billing_email)->bcc($checkout_mail)->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment)); + Mail::to($billing_email)->bcc($checkout_mail)->send(new MailCheckout($data['txaction'], $shopping_order, $shopping_payment, $send_link)); } print("TSOK"); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 31b7b24..b4444b6 100755 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -32,14 +32,15 @@ class HomeController extends Controller } - //login + //login / Dashboard public function show() { if(!Auth::check()){ - return redirect('login'); + return redirect('login'); } $data = [ 'user' => Auth::user(), + 'now' => Carbon::now(), ]; return view('home', $data); } @@ -226,15 +227,16 @@ class HomeController extends Controller $ShoppingPayment = ShoppingPayment::where('reference', $reference)->first(); if($ShoppingPayment && $ShoppingPayment->status === 'success'){ $user = Auth::user(); - if($user && $user->wizard < 4){ - $user->wizard = 4; - $user->save(); - return redirect(route('wizard', [4])); + //is form wizard create payment + if($user && ($user->wizard == 13 || $user->wizard == 20)){ + $user->wizard = 15; //realese Payments + $user->save(); + return redirect(route('wizard_create', [15])); } }else{ \Session()->flash('alert-error', "Es ist ein Fehler bei der Bestellung aufgetreten"); - return redirect(route('wizard')); + return redirect(route('/')); } } diff --git a/app/Http/Controllers/MembershipController.php b/app/Http/Controllers/MembershipController.php new file mode 100755 index 0000000..76babf1 --- /dev/null +++ b/app/Http/Controllers/MembershipController.php @@ -0,0 +1,86 @@ +middleware('auth'); + } + + + public function index() + { + $user = Auth::user(); + + $data = [ + 'user' => $user, + 'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(), + 'upgrade' => Product::where('active', true)->where('show_at', '=', 4)->where('identifier', 'upgrade')->get(), + ]; + return view('user.membership.index', $data); + + } + + + public function storePayment($step = 0){ + if(Input::get('switchers-package-wizard')){ + $user = Auth::user(); + Yard::instance('shopping')->destroy(); + $product = Product::find(Input::get('switchers-package-wizard')); + + if(Input::get('abo_options')){ + $user->abo_options = true; + $user->save(); + } + if($product && $product->active && $product->show_at >= 3){ + $image = ""; + if($product->images->count()){ + $image = $product->images->first()->slug; + } + $qty = Input::get('qty') ? Input::get('qty') : 1; + Yard::instance('shopping')->add($product->id, $product->getLang('name'), $qty, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]); + + do { + $identifier = Util::getToken(); + } while( ShoppingInstance::where('identifier', $identifier)->count() ); + + ShoppingInstance::create([ + 'identifier' => $identifier, + 'user_shop_id' => 1, //is first faker shop! + 'auth_user_id' => Auth::user()->id, + 'subdomain' => url('/'), + 'country_id' => Yard::instance('shopping')->getShippingCountryId(), + + ]); + Yard::instance('shopping')->store($identifier); + //add to DB + $path = route('checkout.checkout_card', ['identifier'=>$identifier]); + //$path = str_replace('http', 'https', $path); + return redirect()->secure($path); + + } + } + \Session()->flash('alert-error', "Fehler beim Produkt"); + return back(); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Pay/PayoneController.php b/app/Http/Controllers/Pay/PayoneController.php index 09b0691..7a58bb9 100644 --- a/app/Http/Controllers/Pay/PayoneController.php +++ b/app/Http/Controllers/Pay/PayoneController.php @@ -68,7 +68,6 @@ class PayoneController extends Controller $this->default = \Config::get('payone.defaults'); } - public function init($shopping_user, $shopping_order){ $this->shopping_user = $shopping_user; $this->shopping_order = $shopping_order; @@ -81,7 +80,7 @@ class PayoneController extends Controller //make Payone payment public function setPrePayment($payment_method, $amount, $currency, $ret = []){ - $this->reference = substr(uniqid(true), 0, 16); + $this->reference = substr(uniqid('m', false), 0, 16); $this->setMethod($payment_method, $ret); $this->urls = [ @@ -342,10 +341,8 @@ class PayoneController extends Controller ]; $request = array_merge($this->default, $this->personalData, $this->deliveryData, $this->method, $this->prepayment, $this->urls); - // dd($request); return Payone::sendRequest($request); - } diff --git a/app/Http/Controllers/UserShopController.php b/app/Http/Controllers/UserShopController.php index 17964ba..4ecfd75 100755 --- a/app/Http/Controllers/UserShopController.php +++ b/app/Http/Controllers/UserShopController.php @@ -21,15 +21,13 @@ class UserShopController extends Controller public function __construct(UserRepository $userRepo) { - $this->middleware('auth'); + $this->middleware('active.shop'); $this->userRepo = $userRepo; } public function index() { $user = Auth::user(); - - if ($user->shop && !$user->shop->set_defaults) { if ($user->account) { $user->shop->title = $user->account->first_name . " " . $user->account->last_name; diff --git a/app/Http/Controllers/Web/CheckoutController.php b/app/Http/Controllers/Web/CheckoutController.php index 7f5005c..4c17b4c 100755 --- a/app/Http/Controllers/Web/CheckoutController.php +++ b/app/Http/Controllers/Web/CheckoutController.php @@ -10,6 +10,7 @@ use App\Models\ShoppingOrder; use App\Models\ShoppingOrderItem; use App\Models\ShoppingPayment; use App\Models\ShoppingUser; +use App\User; use Illuminate\Session\SessionManager; use Illuminate\Support\Collection; use Validator; @@ -43,12 +44,9 @@ class CheckoutController extends Controller // $ShippingCountry = ShippingCountry::where('country_id', 1)->first(); // $selected_country = $ShippingCountry->id; } - if(!$this->getPayments('shopping_user_id') && Util::getAuthUser()){ - $user = Util::getAuthUser(); $user->email; - $account = $user->account; $shopping_user = new ShoppingUser(); $shopping_user->auth_user_id = $user->id; $shopping_user->billing_salutation = $user->account->salutation; @@ -74,6 +72,7 @@ class CheckoutController extends Controller $shopping_user->shipping_city = $user->account->shipping_city; $shopping_user->shipping_country_id = $user->account->shipping_country_id; $shopping_user->shipping_phone = $user->account->shipping_phone; + $shopping_user->abo_options = $user->abo_options; $shopping_user->save(); $this->putPayments('shopping_user_id', $shopping_user->id); @@ -200,6 +199,9 @@ class CheckoutController extends Controller $ret['elv']['iban'] = $data['elv_iban']; $ret['elv']['bic'] = $data['elv_bic']; $ret['elv']['bankaccountholder'] = $data['elv_bankaccountholder']; + //check abo and save the mandate + $this->storeUserPaymentsData($shopping_user, $ret); + } //other $pay = new PayoneController(); @@ -271,6 +273,18 @@ class CheckoutController extends Controller return view('web.templates.checkout-final', $data); } + private function storeUserPaymentsData($shopping_user, $ret){ + if($shopping_user->auth_user_id){ + $user = User::find($shopping_user->auth_user_id); + if($user && $user->account && $user->abo_options){ + if(isset($ret['elv']) && is_array($ret['elv'])){ + $user->account->payment_data = $ret['elv']; + $user->account->save(); + } + } + } + } + private function makeShoppingUser($data){ $data['same_as_billing'] = isset($data['same_as_billing']) ? true : false; @@ -365,6 +379,7 @@ class CheckoutController extends Controller $this->session->put($this->instance, $content); } + private function getPayments($key){ $content = $this->getContent(); if ($content->has($key)){ @@ -372,6 +387,7 @@ class CheckoutController extends Controller } return false; } + private function getContent() { if (is_null($this->session->get($this->instance))) { @@ -380,7 +396,6 @@ class CheckoutController extends Controller return $this->session->get($this->instance); } - public function destroy() { $this->session->remove($this->instance); diff --git a/app/Http/Controllers/WizardController.php b/app/Http/Controllers/WizardController.php index 28fd89e..5c14bde 100755 --- a/app/Http/Controllers/WizardController.php +++ b/app/Http/Controllers/WizardController.php @@ -36,7 +36,6 @@ class WizardController extends Controller public function create() { - if(!Auth::check()){ return redirect('login'); } @@ -46,11 +45,12 @@ class WizardController extends Controller $account = UserAccount::create([]); $user->account_id = $account->id; $user->save(); - return redirect(route('wizard')); + return redirect(route('wizard_create')); } $step = !$user->wizard ? 0 : $user->wizard; - if($step == 10){ + + if($step >= 20){ return redirect('/'); } $data = [ @@ -59,6 +59,10 @@ class WizardController extends Controller 'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(), ]; + if($step == 15){ + return view('user.wizard.create_release', $data); + } + return view('user.wizard.create', $data); } @@ -73,12 +77,12 @@ class WizardController extends Controller $account = UserAccount::create([]); $user->account_id = $account->id; $user->save(); - return redirect(route('wizard')); + return redirect(route('wizard_register')); } $step = !$user->wizard ? 0 : $user->wizard; - if($step == 10){ + if($step >= 10){ return redirect('/'); } $data = [ @@ -93,6 +97,33 @@ class WizardController extends Controller return view('user.wizard.register', $data); } + public function payment() + { + if(!Auth::check()){ + return redirect('login'); + } + + $user = User::findOrFail(Auth::user()->id); + if(!$user->account){ + $account = UserAccount::create([]); + $user->account_id = $account->id; + $user->save(); + return redirect(route('wizard_payment')); + } + + $data = [ + 'user' => Auth::user(), + 'step' => 0, + 'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(), + ]; + + if($user->wizard == 20){ + return view('user.wizard.register_payment', $data); + } + + return redirect(route('/')); + } + public function storeRegister($step = false) { @@ -235,7 +266,7 @@ class WizardController extends Controller $user->account = new UserAccount(); } - if($step == 0){ + if($step == 10){ $rules = array( 'accepted_data_protection' => 'required', 'accepted_active' => 'required', @@ -245,33 +276,33 @@ class WizardController extends Controller $data = [ 'user' => Auth::user(), 'step' => $step, + 'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(), ]; - return view('user.wizard.show', $data)->withErrors($validator); + $user->wizard = 10; + $user->save(); + return view('user.wizard.create', $data)->withErrors($validator); } $account = $user->account; - $account->data_protection = now(); + if($account->data_protection === null){ + $account->data_protection = now(); + } + if($user->agreement === null){ + $user->agreement = now(); + } $account->save(); $user->agreement = now(); - if($user->wizard < 1){ - $user->wizard = 1; - } + $user->wizard = 11; $user->save(); - return redirect(route('wizard', [1])); + return redirect(route('wizard_create', [11])); } - if($step == 1){ + if($step == 11){ if($user->isPasswort()){ - if($user->wizard < 2){ - $user->wizard = 2; - } - //has Passwort -> delete Code! - $user->confirmation_code = null; - $user->confirmation_code_to = null; - $user->confirmation_code_remider = 0; + $user->wizard = 12; $user->save(); - return redirect(route('wizard', [2])); + return redirect(route('wizard_create', [12])); } $rules = array( 'password' => 'required|string|min:6|confirmed', @@ -281,34 +312,31 @@ class WizardController extends Controller $data = [ 'user' => Auth::user(), 'step' => $step, + 'products' => Product::where('active', true)->where('show_at', '=', 3)->orderBy('pos', 'ASC')->get(), ]; - return view('user.wizard.show', $data)->withErrors($validator); - }else{ - $user->fill([ - 'password' => Hash::make(Input::get('password')) - ])->save(); - if($user->wizard < 2){ - $user->wizard = 2; - } - //has Passwort -> delete Code! - $user->confirmation_code = null; - $user->confirmation_code_to = null; - $user->confirmation_code_remider = 0; - $user->save(); - return redirect(route('wizard', [2])); - - - + return view('user.wizard.create', $data)->withErrors($validator); } + + $user->fill([ + 'password' => Hash::make(Input::get('password')) + ])->save(); + $user->wizard = 12; + + $user->save(); + return redirect(route('wizard_create', [12])); } - if($step == 2){ + if($step == 12){ $rules = array( 'salutation' => 'required', - 'first_name'=>'required', - 'last_name'=>'required', - 'address'=>'required', - 'zipcode'=>'required', + 'first_name' => 'required', + 'last_name' => 'required', + 'address' => 'required', + 'zipcode' => 'required', 'city' => 'required', + 'phone' => 'required_without:mobil', + 'mobil' => 'required_without:phone', + 'country_id' => 'required|integer|min:1', + 'birthday' => 'required', ); if(!Input::get('same_as_billing')){ @@ -324,63 +352,65 @@ class WizardController extends Controller } $validator = Validator::make(Input::all(), $rules); if ($validator->fails()) { - return redirect(route('wizard', [2]))->withErrors($validator)->withInput(Input::all()); - }else{ - $data = Input::all(); - $data['same_as_billing'] = Input::get('same_as_billing') == NULL ? 0 : 1; - $user->account->fill($data)->save(); - if($user->wizard < 3){ - $user->wizard = 3; - } - $user->active_date = now(); - $user->active = 1; - $user->save(); - return redirect(route('wizard', [3])); - + return redirect(route('wizard_create', [12]))->withErrors($validator)->withInput(Input::all()); } - } - if($step == 3){ + $data = Input::all(); + $data['same_as_billing'] = Input::get('same_as_billing') == NULL ? 0 : 1; + $user->account->fill($data)->save(); + $user->wizard = 13; + $user->active_date = now(); + $user->active = 1; + $user->confirmation_code = null; + $user->confirmation_code_to = null; + $user->confirmation_code_remider = 0; + $user->save(); + return redirect(route('wizard_create', [13])); - if(Input::get('switchers-package-wizard')){ - Yard::instance('shopping')->destroy(); - $product = Product::find(Input::get('switchers-package-wizard')); - if($product && $product->active && $product->show_at == 3){ - $image = ""; - if($product->images->count()){ - $image = $product->images->first()->slug; - } - Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]); - - do { - $identifier = Util::getToken(); - } while( ShoppingInstance::where('identifier', $identifier)->count() ); - - ShoppingInstance::create([ - 'identifier' => $identifier, - 'user_shop_id' => 1, //is first faker shop! - 'auth_user_id' => $user->id, - 'subdomain' => url('/'), - 'country_id' => Yard::instance('shopping')->getShippingCountryId(), - - ]); - Yard::instance('shopping')->store($identifier); - - //add to DB - $path = route('checkout.checkout_card', ['identifier'=>$identifier]); - //$path = str_replace('http', 'https', $path); - return redirect()->secure($path); - - - - } - } - \Session()->flash('alert-error', "Fehler beim Produkt"); - return redirect(route('wizard', [3])); } } + public function storePayment($step = 0){ + if(Input::get('switchers-package-wizard')){ + $user = Auth::user(); + Yard::instance('shopping')->destroy(); + $product = Product::find(Input::get('switchers-package-wizard')); + + if(Input::get('abo_options')){ + $user->abo_options = true; + $user->save(); + } + if($product && $product->active && $product->show_at == 3){ + $image = ""; + if($product->images->count()){ + $image = $product->images->first()->slug; + } + Yard::instance('shopping')->add($product->id, $product->getLang('name'), 1, $product->price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight]); + + do { + $identifier = Util::getToken(); + } while( ShoppingInstance::where('identifier', $identifier)->count() ); + + ShoppingInstance::create([ + 'identifier' => $identifier, + 'user_shop_id' => 1, //is first faker shop! + 'auth_user_id' => Auth::user()->id, + 'subdomain' => url('/'), + 'country_id' => Yard::instance('shopping')->getShippingCountryId(), + + ]); + Yard::instance('shopping')->store($identifier); + //add to DB + $path = route('checkout.checkout_card', ['identifier'=>$identifier]); + //$path = str_replace('http', 'https', $path); + return redirect()->secure($path); + + } + } + \Session()->flash('alert-error', "Fehler beim Produkt"); + return back(); + } public function delete($id, $relation){ diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php index ec10754..a8728da 100755 --- a/app/Http/Kernel.php +++ b/app/Http/Kernel.php @@ -58,6 +58,8 @@ class Kernel extends HttpKernel 'admin' => \App\Http\Middleware\Admin::class, 'superadmin' => \App\Http\Middleware\SuperAdmin::class, 'sysadmin' => \App\Http\Middleware\SysAdmin::class, + 'active.account' => \App\Http\Middleware\ActiveAccount::class, + 'active.shop' => \App\Http\Middleware\ActiveShop::class, 'subdomain' => \App\Http\Middleware\Subdomain::class, 'checkout' => \App\Http\Middleware\Checkout::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, diff --git a/app/Http/Middleware/ActiveAccount.php b/app/Http/Middleware/ActiveAccount.php new file mode 100755 index 0000000..6a51438 --- /dev/null +++ b/app/Http/Middleware/ActiveAccount.php @@ -0,0 +1,26 @@ +isActiveAccount() ) + { + return $next($request); + } + return redirect('/home'); + + } +} diff --git a/app/Http/Middleware/ActiveShop.php b/app/Http/Middleware/ActiveShop.php new file mode 100755 index 0000000..59bdd59 --- /dev/null +++ b/app/Http/Middleware/ActiveShop.php @@ -0,0 +1,26 @@ +isActiveShop() ) + { + return $next($request); + } + return redirect('/home'); + + } +} diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index d908246..ec4875e 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -56,11 +56,10 @@ class Authenticate if(in_array('user', $guards) && $this->auth->user()->wizard < 20){ return redirect(route('wizard_create')); } - //is wizard - /*if(in_array('user', $guards) && $this->auth->user()->wizard < 5){ - return redirect(route('wizard')); + //20 is payment + if(in_array('user', $guards) && $this->auth->user()->wizard == 20){ + return redirect(route('wizard_payment')); } - */ } diff --git a/app/Http/Middleware/Localization.php b/app/Http/Middleware/Localization.php index 90781d0..39754ff 100755 --- a/app/Http/Middleware/Localization.php +++ b/app/Http/Middleware/Localization.php @@ -2,6 +2,7 @@ namespace App\Http\Middleware; +use Carbon; use Closure; use Auth; @@ -20,8 +21,7 @@ class Localization if ( \Session::has('locale')) { \App::setLocale(\Session::get('locale')); - // You also can set the Carbon locale - //Carbon::setLocale(\Session::get('locale')); + Carbon::setLocale(\Session::get('locale')); } return $next($request); diff --git a/app/Mail/MailCheckout.php b/app/Mail/MailCheckout.php index 0a944ce..74647ef 100644 --- a/app/Mail/MailCheckout.php +++ b/app/Mail/MailCheckout.php @@ -15,16 +15,18 @@ class MailCheckout extends Mailable public $txaction; public $shopping_order; public $shopping_payment; + protected $send_link; public $subject; public $data; - public function __construct($txaction, $shopping_order, $shopping_payment) + public function __construct($txaction, $shopping_order, $shopping_payment, $send_link) { $this->txaction = $txaction; $this->shopping_order = $shopping_order; $this->shopping_payment = $shopping_payment; + $this->send_link = $send_link; $this->subject = __('email.checkout_subject')." mivita.care"; if($shopping_order->user_shop){ @@ -42,6 +44,11 @@ class MailCheckout extends Mailable //make Adresse } if($this->txaction === 'paid'){ + + + if($this->send_link){ + + } return $this->view('emails.checkout')->with([ 'salutation' => $salutation, 'copy1line' => __('email.checkout_copy1line'), @@ -50,6 +57,9 @@ class MailCheckout extends Mailable 'copy3line' => __('email.checkout_copy3line'), 'greetings' => __('email.greetings'), 'sender' => __('email.sender'), + 'send_link' => $this->send_link, + 'url' => Util::getMyMivitaUrl(), + 'button' => Util::getMyMivitaUrl(false), ]); }else{ return $this->view('emails.checkout_status')->with([ @@ -61,6 +71,7 @@ class MailCheckout extends Mailable 'copy3line' => __('email.checkout_copy3line'), 'greetings' => __('email.greetings'), 'sender' => __('email.sender'), + 'send_link' => false, ]); } diff --git a/app/Models/Product.php b/app/Models/Product.php index c63ac30..234d9f1 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -133,6 +133,7 @@ class Product extends Model 'amount', 'active', 'show_at', + 'identifier', 'action' ]; @@ -141,6 +142,7 @@ class Product extends Model 1 => 'User + Berater Shop', 2 => 'nur Berater Shop', 3 => 'Registrierung Shop', + 4 => 'Mitgliedschaft Berater', ]; public $actions = [ diff --git a/app/Models/UserAccount.php b/app/Models/UserAccount.php index 3d2b0d7..ce6b2ad 100644 --- a/app/Models/UserAccount.php +++ b/app/Models/UserAccount.php @@ -124,6 +124,10 @@ class UserAccount extends Model 'birthday', 'website', 'facebook', 'facebook_fanpage', 'instagram' ]; + protected $casts = [ + 'payment_data' => 'array', + ]; + use SoftDeletes; protected $dates = ['deleted_at']; diff --git a/app/Services/Util.php b/app/Services/Util.php index b5c4657..c520777 100644 --- a/app/Services/Util.php +++ b/app/Services/Util.php @@ -16,7 +16,7 @@ class Util } public static function formatDate(){ - if(\App::getLocale() == "en"){ + if(\App::getLocale() === "en"){ return 'yyyy-mm-dd'; } return 'dd.mm.yyyy'; @@ -24,19 +24,26 @@ class Util } public static function formatDateDB(){ - if(\App::getLocale() == "en"){ + if(\App::getLocale() === "en"){ return 'Y-m-d'; } return 'd.m.Y'; } public static function formatDateTimeDB(){ - if(\App::getLocale() == "en"){ + if(\App::getLocale() === "en"){ return 'Y-m-d - H:i'; } return 'd.m.Y - H:i'; } + public static function formatNumber($value){ + if(\App::getLocale() === "en"){ + return number_format($value, 2, '.', ','); + } + return number_format($value, 2, ',', '.'); + } + public static function utf8ize( $mixed ) { if (is_array($mixed)) { foreach ($mixed as $key => $value) { @@ -95,6 +102,10 @@ class Util return false; } + public static function getMyMivitaUrl($protocol = true){ + $pro = $protocol ? config('app.protocol') : ""; + return $pro.config('app.pre_url_crm').config('app.domain').config('app.tld_care'); + } public static function getUserShopBackUrl($reference = ""){ if(\Session::has('user_shop')){ diff --git a/app/User.php b/app/User.php index b160749..5ff1543 100755 --- a/app/User.php +++ b/app/User.php @@ -129,11 +129,21 @@ class User extends Authenticatable } + public function payment_order(){ + return $this->belongsTo('App\Models\Product', 'payment_order_id'); + } + public function files(){ return $this->hasMany('App\Models\File', 'user_id', ''); } + public function shopping_orders(){ + return $this->hasMany('App\Models\ShoppingOrder', 'auth_user_id', ''); + + } + + public function shop() { return $this->hasOne('App\Models\UserShop', 'user_id', 'id'); @@ -141,7 +151,6 @@ class User extends Authenticatable - public function user_update_email() { return $this->hasMany('App\Models\UserUpdateEmail', 'user_id', 'id'); @@ -228,7 +237,6 @@ class User extends Authenticatable } public function daysHumansActiveAccount(){ - Carbon::setLocale(\App::getLocale()); return Carbon::now()->diffForHumans(Carbon::parse($this->payment_account)); } @@ -241,11 +249,9 @@ class User extends Authenticatable } public function daysHumansActiveShop(){ - Carbon::setLocale(\App::getLocale()); return Carbon::now()->diffForHumans(Carbon::parse($this->payment_shop)); } - /** * @return string */ diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index bd1a343..f1a40e5 100755 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -45,16 +45,31 @@ class CreateUsersTable extends Migration $table->rememberToken(); $table->timestamp('last_login')->nullable(); + $table->unsignedInteger('payment_order_id')->nullable(); $table->timestamp('payment_account')->nullable(); $table->timestamp('payment_shop')->nullable(); + $table->boolean('abo_options')->default(false); + $table->timestamps(); $table->softDeletes(); + $table->foreign('account_id') + ->references('id') + ->on('user_accounts'); + + $table->foreign('m_level') + ->references('id') + ->on('user_levels'); + $table->foreign('m_sponsor') ->references('id') ->on('users'); + $table->foreign('payment_order_id') + ->references('id') + ->on('products'); + }); } diff --git a/database/migrations/2018_10_21_164001_create_products_table.php b/database/migrations/2018_10_21_164001_create_products_table.php index 4888844..7aa4143 100644 --- a/database/migrations/2018_10_21_164001_create_products_table.php +++ b/database/migrations/2018_10_21_164001_create_products_table.php @@ -54,6 +54,7 @@ class CreateProductsTable extends Migration $table->unsignedInteger('amount')->nullable(); //for shop $table->tinyInteger('show_at')->unsigned()->nullable()->default(0); + $table->string('identifier', 20)->nullable(); $table->string('action')->nullable(); diff --git a/database/migrations/2019_02_23_161530_create_shopping_users_table.php b/database/migrations/2019_02_23_161530_create_shopping_users_table.php index 9742361..46b9c38 100644 --- a/database/migrations/2019_02_23_161530_create_shopping_users_table.php +++ b/database/migrations/2019_02_23_161530_create_shopping_users_table.php @@ -47,6 +47,9 @@ class CreateShoppingUsersTable extends Migration $table->unsignedInteger('shipping_country_id'); $table->string('shipping_phone')->nullable(); + $table->boolean('abo_options')->default(false); + + $table->timestamps(); $table->foreign('billing_country_id') diff --git a/database/migrations/2019_02_29_170559_create_user_accounts_table.php b/database/migrations/2019_02_29_170559_create_user_accounts_table.php index a38148f..d33e85a 100644 --- a/database/migrations/2019_02_29_170559_create_user_accounts_table.php +++ b/database/migrations/2019_02_29_170559_create_user_accounts_table.php @@ -65,6 +65,8 @@ class CreateUserAccountsTable extends Migration $table->string('facebook_fanpage')->nullable(); $table->string('instagram')->nullable(); + $table->text('payment_data')->nullable(); + $table->timestamp('data_protection')->nullable(); $table->timestamps(); diff --git a/public/css/application.css b/public/css/application.css index 4a10d76..19342d5 100644 --- a/public/css/application.css +++ b/public/css/application.css @@ -11,4 +11,19 @@ a[aria-expanded='true'] > .fa-caret-expand:before { .dropzone { border: 2px dashed; +} + +.card-body { + padding-bottom: 1rem; +} + +.card hr { + border-color: #d6d6de; +} + + +.custom-control.custom-checkbox .custom-control-input:checked ~ .custom-control-label.secondary::before, +.custom-control.custom-radio .custom-control-input:checked ~ .custom-control-label.secondary::before { + border-color: #d7d700; + background-color: #d7d700; } \ No newline at end of file diff --git a/resources/lang/de/cal.php b/resources/lang/de/cal.php new file mode 100755 index 0000000..3a46d61 --- /dev/null +++ b/resources/lang/de/cal.php @@ -0,0 +1,58 @@ + [ + 'January' =>'Januar', + 'February' =>'Februar', + 'March' =>'März', + 'April' => 'April', + 'May' => 'Mai', + 'June' =>'Juni', + 'July' =>'Juli', + 'August' =>'August', + 'September' =>'September', + 'October' =>'Oktober', + 'November' =>'November', + 'December' =>'Dezember', + ], + 'months_short' => [ + 'Jan' => 'Jan', + 'Feb' => 'Feb', + 'Mar' => 'Mär', + 'Apr' => 'Apr', + 'May' => 'Mai', + 'Jun' => 'Jun', + 'Jul' => 'Jul', + 'Aug' => 'Aug', + 'Sep' => 'Sep', + 'Oct' => 'Okt', + 'Nov' => 'Nov', + 'Dec' =>'Dez' + ], + 'weekdays' => [ + 'Sunday' =>'Sonntag', + 'Monday' =>'Montag', + 'Tuesday' =>'Dienstag', + 'Wednesday' =>'Mittwoch', + 'Thursday' =>'Donnerstag', + 'Friday' =>'Freitag', + 'Saturday' =>'Samstag' + ], + 'weekdays_short' => [ + 'Sun' => 'So.', + 'Mon' => 'Mo.', + 'Tue' => 'Di.', + 'Wed' => 'Mi.', + 'Thu' => 'Do.', + 'Fri' => 'Fr.', + 'Sat' => 'Sa.'], + 'weekdays_min' => [ + 'Su' =>'So', + 'Mo' =>'Mo', + 'Tu' =>'Di', + 'We' =>'Mi', + 'Th' =>'Do', + 'Fr' =>'Fr', + 'Sa' =>'Sa' + ] +]; \ No newline at end of file diff --git a/resources/views/admin/product/form.blade.php b/resources/views/admin/product/form.blade.php index 39b4839..9fee8a7 100755 --- a/resources/views/admin/product/form.blade.php +++ b/resources/views/admin/product/form.blade.php @@ -17,17 +17,19 @@ {{ Form::text('name', $product->name, array('placeholder'=>__('Name'), 'class'=>'form-control', 'id'=>'name', 'required')) }}
-
+
{{ Form::text('title', $product->title, array('placeholder'=>__('Title'), 'class'=>'form-control', 'id'=>'title')) }} -
- -
+
{{ Form::select('show_at', $product->showATs, $product->show_at, array('data-live-search'=>'false', 'class'=>'selectpicker', 'id'=>'show_at') ) }} -
+
+ + {{ Form::text('identifier', $product->identifier, array('placeholder'=>__('Kennung'), 'class'=>'form-control', 'id'=>'identifier')) }} +
+
diff --git a/resources/views/admin/site/edit.blade.php b/resources/views/admin/site/edit.blade.php index f58002f..11cd419 100755 --- a/resources/views/admin/site/edit.blade.php +++ b/resources/views/admin/site/edit.blade.php @@ -23,13 +23,13 @@ {!! Form::open(['url' => route('admin_sites_store', [$site]), 'class' => 'form-horizontal', 'id'=>'']) !!}
-   +  
@include('admin.site.form')
-   +  
{!! Form::close() !!} diff --git a/resources/views/emails/checkout.blade.php b/resources/views/emails/checkout.blade.php index 403aa47..e2b0dbc 100644 --- a/resources/views/emails/checkout.blade.php +++ b/resources/views/emails/checkout.blade.php @@ -215,6 +215,43 @@
+ @if($send_link) + + +
+ + + + + + +
+ + + + + + + + + +
+

+ {{ $button }} +

+
+ {{ $url }} +
+
+
+ + + + +
+ + + @endif {{__('email.checkout_mail_pay_info')}} diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 0f21a95..7be3c73 100755 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -16,175 +16,296 @@
@endif - @if($user->payment_account && $user->daysActiveAccount() <= 29) -
-

{{__('Mitgliedschaft Jahresbeitrag') }}

+ +

+ {{-- --}} +
+ Willkommen zurück, {{$user->account->first_name}}! +
Heute ist {{__('cal.weekdays.'.$now->format('l'))}}, {{$now->format('j')}}. {{__('cal.months.'.$now->format('F'))}} {{$now->format('Y')}}
+
+

+ +
- @if($user->daysActiveAccount() < 0) -
Achtung: Deine Mitgliedschaft ist vor {{ $user->daysActiveAccount()*-1 }} Tagen ausgelaufen, bitte aktualisiere jetzt Deine Zahlung!
- @elseif($user->daysActiveAccount() < 14) -
Achtung: Deine Mitgliedschaft läuft in {{$user->daysActiveAccount()}} Tagen aus, bitte aktualisiere jetzt Deine Zahlung!
- @else -
Achtung: Deine Mitgliedschaft läuft in {{$user->daysActiveAccount()}} Tagen aus, bitte aktualisiere jetzt Deine Zahlung!
- {{-- - TODO SEPA - --}} - @endif -

Erst wenn Dein Jahresbeitrag bei uns eingeht wird Deine Mitgliedschaft automastisch um ein Jahr verlängert.

-

Die Verlängerung gibt ab erstes Abschlussdatum ein weiteres volles Jahr, bis zum {{$user->modifyActiveAccount()}}

- Mitgliedschaft jetzt hier verlängern -
- @endif +
+ @if($user->active == 1) + @if($user->payment_account && $user->daysActiveAccount() <= 29) +
+ +
+
+ {{__('Mitgliedschaft / Jahresbeitrag') }} +
+
- @if($user->active == 1) -
-

{{__('Your Shop') }}

+ @if($user->daysActiveAccount() <= 0) + @if($user->isActiveAccount()) +
Achtung: Deine Mitgliedschaft läuft heute aus, bitte aktualisiere jetzt Deine Zahlung!
+ @else +
Achtung: Deine Mitgliedschaft ist vor {{ $user->daysActiveAccount()*-1 }} Tagen ausgelaufen, bitte aktualisiere jetzt Deine Zahlung!
+ @endif + @elseif($user->daysActiveAccount() < 14) +
Achtung: Deine Mitgliedschaft läuft in {{$user->daysActiveAccount()}} Tagen aus, bitte aktualisiere jetzt Deine Zahlung!
+ @else +
Achtung: Deine Mitgliedschaft läuft in {{$user->daysActiveAccount()}} Tagen aus, bitte aktualisiere jetzt Deine Zahlung!
+ {{-- + TODO SEPA + --}} + @endif +

Erst wenn Dein Jahresbeitrag bei uns eingeht wird Deine Mitgliedschaft automastisch um ein Jahr verlängert.

+

Die Verlängerung gibt ab erstes Abschlussdatum ein weiteres volles Jahr, bis zum {{$user->modifyActiveAccount()}}

- @if($user->payment_shop) - @if($user->shop) -

- {{__('open since')}} {{__('at')}} {{ $user->shop->getActiveDateFormat() }}

- @if($user->shop->active) -

- {{__('Status')}} {{ __('active') }}

- @else -

- {{__('Status')}} {{ __('inactive') }}

+
+ +
+ +
@endif - {{__('settings your shop')}} - - @else - {{__('open your shop')}} @endif - @else -

- {{__('Shop nicht gebucht')}}

- @endif -
- @endif -
-

{{__('Activities') }}

+ {{--
+ +
+
+
- @if($user->isActiveAccount() ) -

- {{__('Berater-Mitgliedschaft aktiv')}} {{__('bis zum:')}} {{ $user->getPaymentAccountDateFormat() }}

- @else -

- {{__('Berater-Account inaktiv')}} - @if($user->payment_account) - {{__('abgelaufen am')}}: {{ $user->getPaymentAccountDateFormat() }} - @endif -

- @endif + + + + $1,342.11
+ Umsatz diesen Monat +
+
- @if($user->isActiveShop()) -

- {{__('Berater-Online-Shop aktiv')}} {{__('bis zum')}}: {{ $user->getPaymentShopDateFormat() }}

- @else -

- {{__('Berater-Shop inaktiv')}} - @if($user->payment_shop) - {{__('abgelaufen am')}}: {{ $user->getPaymentShopDateFormat() }} - @endif -

- @endif -
+
+ +
+ + + + 54 Tasks
+ Punkte +
+
- @if($user->active == 1) - @if($user->files->count()) - @foreach($user->files()->whereIdentifier('contract')->get() as $file) - MIVITA_Beratervertrag.pdf - @endforeach - @endif -

- {{__('Daten vollständig, freigeschaltet')}} {{__('at')}}: {{ $user->getActiveDateFormat() }}

+
+ +
+
+ +
--}} - @if($user->account_id) +
+ +
+
+
{{__('Mitgliedschaft') }}
+
+
- @if($user->active == 1) - @if($user->agreement) -

- {{__('Einverständniserklärung')}} {{__('at')}}: {{ $user->getAgreementFormat() }} -

- @else -

- {{__('Einverständniserklärung')}} {{ __('nicht akzeptiert') }}

- @endif - @endif - @if($user->account->data_protection) -

- {{__('Privacy policy approved')}} {{__('at')}}: {{ $user->account->getDataProtectionFormat() }} -

- @endif - @endif - @if($user->confirmed == 1) -

- {{__('E-Mail verified')}} {{__('at')}}: {{ $user->getConfirmationDateFormat() }}

- @endif -
+ @if($user->isActiveAccount() ) +

+ {{__('Berater-Mitgliedschaft aktiv')}} {{__('bis zum:')}} {{ $user->getPaymentAccountDateFormat() }}

+ @else +

+ {{__('Berater-Account inaktiv')}} + @if($user->payment_account) + {{__('abgelaufen am')}}: {{ $user->getPaymentAccountDateFormat() }} + @endif +

+ @endif - @if($user->active == 1) + @if($user->isActiveShop()) +

+ {{__('Berater-Online-Shop aktiv')}} {{__('bis zum')}}: {{ $user->getPaymentShopDateFormat() }}

+ @else +

+ {{__('Berater-Shop inaktiv')}} + @if($user->payment_shop) + {{__('abgelaufen am')}}: {{ $user->getPaymentShopDateFormat() }} + @endif +

+ @endif +
+ @if($user->payment_order_id) + + @endif +
+ - {{--
-

{{ __('Einwilligung & Datenschutz') }}

+
- {!! Form::open(['url' => route('user_data_accepted_form'), 'class' => 'form-horizontal' , 'id'=>'data-privacy-form-validations']) !!} +
+ +
+
+
{{__('Your Shop') }}
+
+
+ @if($user->active == 1) + @if($user->payment_shop) + @if($user->shop) +

+ {{__('open since')}} {{__('at')}} {{ $user->shop->getActiveDateFormat() }}

+ @if($user->shop->active) +

+ {{__('Status')}} {{ __('active') }}

+ @else +

+ {{__('Status')}} {{ __('inactive') }}

+ @endif + @else + {{__('open your shop')}} + @endif + @else +

+ {{__('Shop nicht gebucht')}}

+ @endif + @endif +
+ @if($user->isActiveShop()) + + @endif +
+ -
- +
+ +
+ +
+
+
{{__('Activities') }}
+
+
+ @if($user->active == 1) + @if($user->files->count()) + @foreach($user->files()->whereIdentifier('contract')->get() as $file) + MIVITA_Beratervertrag.pdf +
+ @endforeach + @endif +

+ {{__('Daten vollständig, freigeschaltet')}} {{__('at')}}: {{ $user->getActiveDateFormat() }}

+ @endif + @if($user->account_id) + @if($user->active == 1) + @if($user->agreement) +

+ {{__('Einverständniserklärung')}} {{__('at')}}: {{ $user->getAgreementFormat() }} +

+ @else +

+ {{__('Einverständniserklärung')}} {{ __('nicht akzeptiert') }}

+ @endif + @endif + @if($user->account->data_protection) +

+ {{__('Privacy policy approved')}} {{__('at')}}: {{ $user->account->getDataProtectionFormat() }} +

+ @endif + @endif + @if($user->confirmed == 1) +

+ {{__('E-Mail verified')}} {{__('at')}}: {{ $user->getConfirmationDateFormat() }}

+ @endif +
+
+ + +
+
+
+
+
+
+
{{__('Daten') }}
+
+
+ @if($user->active == 1) +

{{__('Ändere Deine persönlichen Datan.')}}

+ {{ __('Adjust data') }} + @endif +
+
+
+ +
+
+
+
{{ __('Sicherheit') }}
+
+
+ @if($user->active == 1) + @if(!$user->isPasswort()) +

{{__('Assign a password for your account.')}}

+ {{__('Create Password')}} + @else +

{{__('Ändere Dein persönliches Passwort.')}}

+ {{__('Change password')}} + @endif + @endif +
+
+
+ +
+
+
+
{{ __('Anmeldung') }}
+
+
+ @if($user->active == 1) +

{{__('Ändere Deine E-Mail Adresse.')}}

+ {{__('Change E-Mail')}} + @endif + +
+
+
+ +
+
+
+
{{ __('Logout') }}
+
+
+

Abmelden und bis bald.

+ {{ __('Logout') }} +
+
+
+ +
+
-
-   - -
- - {!! Form::close() !!} - -
- --}} - - - -
-

{{__('Data, Login & Security') }}

-

{{__('Sign in with your e-mail:')}} {{ Auth::user()->email }}

- {{ __('Adjust data') }} - {{__('Change E-Mail')}} -

- @if(!$user->isPasswort()) -

{{__('Assign a password for your account.')}}

- {{__('Create Password')}} - @else -

{{__('Change your password here to access your account.')}}

- {{__('Change password')}} - @endif -
- @endif - -
-

{{ __('Logout') }}

- -   {{ __('Logout') }} -
- - {{-- -
-

{{__('Delete') }}

-

{{__('If you no longer want to use our offer, you can delete your account here.')}}

- {{__('Delete Account')}} -
- --}} - - +
@endsection diff --git a/resources/views/layouts/includes/layout-sidenav.blade.php b/resources/views/layouts/includes/layout-sidenav.blade.php index fbc1e8e..76d9afd 100755 --- a/resources/views/layouts/includes/layout-sidenav.blade.php +++ b/resources/views/layouts/includes/layout-sidenav.blade.php @@ -17,16 +17,18 @@
{{ __('Your Data') }}
- @if(Auth::user()->isActiveShop()) -
  • -
    {{ __('Your Shop') }}
    -
  • - @endif -
  • -
    {{ __('Your Shop') }}
    -
  • + @if(Auth::user()->isActiveShop()) +
  • +
    {{ __('Your Shop') }}
    +
  • + @endif + + @if(Auth::user()->isActiveAccount()) + + @endif + @endif diff --git a/resources/views/user/membership/_abo_options.blade.php b/resources/views/user/membership/_abo_options.blade.php new file mode 100644 index 0000000..81cac1d --- /dev/null +++ b/resources/views/user/membership/_abo_options.blade.php @@ -0,0 +1,8 @@ + +
    + +
    \ No newline at end of file diff --git a/resources/views/user/membership/_upgrade.blade.php b/resources/views/user/membership/_upgrade.blade.php new file mode 100644 index 0000000..d685a4b --- /dev/null +++ b/resources/views/user/membership/_upgrade.blade.php @@ -0,0 +1,47 @@ +@php($months = Carbon::now()->diffInMonths(Carbon::parse($user->payment_account)) +1) + +{!! Form::open(['url' => route('user_membership_store_payment'), 'class' => 'form-horizontal']) !!} + +
    + + + @foreach($upgrade as $product) + + + + + + + + + + @endforeach + +
    + + +
    + @if(count($product->images)) + + @endif +
    +
    {{$product->name}}
    + {!! $product->getLang('copy') !!} +
    +
    +
    {{$product->getFormattedPrice()}} EUR / Monat
    Restlaufzeit: {{$months}} @if($months==1) Monat @else Monate @endif {!! Util::formatNumber($months * $product->price) !!} EUR
    +
    +
    + @include('user.membership._abo_options') +   +

    + Du wirst auf unseren checkout Server weitergeletet, die Verbindung ist SSL verschlüsselt. +
    +{!! Form::close() !!} \ No newline at end of file diff --git a/resources/views/user/membership/index.blade.php b/resources/views/user/membership/index.blade.php new file mode 100644 index 0000000..f3958a4 --- /dev/null +++ b/resources/views/user/membership/index.blade.php @@ -0,0 +1,209 @@ +@extends('layouts.layout-2') + +@section('content') + + @if ($errors->any()) +
    +
    +
    +
      + @foreach ($errors->all() as $error) +
    • {{ $error }}
    • + @endforeach +
    +
    +
    +
    + @endif + +

    + {{ __('Deine Mitgliedschaft') }} +

    + + +
    +
    + + @if($user->isActiveAccount() && !$user->isActiveShop()) +
    +
    {{__('MIVITA BUSINESS Paket')}} {{__('Upgrade')}}
    +
    +
    Erweitere jetzt Deine Mitglidschaft auf MIVITA BUSINESS Paket!
    +

    Berechnet werden die restlichen Monate bis zur Berater-Mitgliedschaft Verlängerung. Danach wird jährlich der MIVITA BUSINESS Paketpreis berechnet.

    + @include('user.membership._upgrade') +
    +
    + @endif + + + + @if($user->abo_options && $user->payment_account) +
    +
    {{__('Abo-Option')}} {{__('deaktivieren')}}
    +
    +

    Abo-Option dekativeren und SEPA Mandat zurückziehen.
    + Die nächste Buchung ist am: {!! Carbon::parse($user->payment_account)->modify('- 29 days')->format('d.m.Y') !!}

    + +   + + +
    +
    + @endif + + + {{-- + TODO + //Warnungen und Zahlungen verlängerung. + //upgrade speichern über api + //Verlängern + //cron sepa + //cron Mails erinnerungen + //downgrade + + --}} + + + + +
    +
    + + {!! Form::open(['url' => route('wizard_store_payment', [20]), 'class' => 'form-horizontal']) !!} +
    + + + @foreach($products as $product) + + + + + + @endforeach + +
    + + +
    + @if(count($product->images)) + + @endif +
    +
    {{$product->name}}
    + {!! $product->getLang('copy') !!} +
    +
    +
    {{$product->getFormattedPrice()}} EUR / p.a.
    +
    +
    +
    + +
    +   +

    + Du wirst auf unseren checkout Server weitergeletet, die Verbindung ist SSL verschlüsselt. +
    + {!! Form::close() !!} + +
    +
    + +
    +
    + +
    +
    {{ __('Mitgliedschaft Details') }}
    +
      + +
    • +
      {{__('gebuchtes Paket')}}
      +
      + @if($user->payment_order_id) + {{ $user->payment_order->name }} + @endif +
      +
    • +
    • +
      {{ __('Berater-Mitgliedschaft') }}
      +
      + @if($user->isActiveAccount() ) + {{ __('aktiv') }} + @else + {{ __('inaktiv') }} + @endif +
      +
    • + @if($user->isActiveAccount() ) +
    • +
      {{__('bis zum')}}
      +
      + {{ $user->getPaymentAccountDateFormat() }} +
      +
    • + @else + @if($user->payment_account) +
    • +
      {{__('abgelaufen am')}}}
      +
      + {{ $user->getPaymentAccountDateFormat() }} +
      +
    • + @endif + @endif +
    • +
      {{ __('Berater-Online-Shop') }}
      +
      + @if($user->isActiveShop() ) + {{ __('aktiv') }} + @else + {{ __('inaktiv') }} + @endif +
      +
    • + @if($user->isActiveShop() ) +
    • +
      {{__('bis zum')}}
      +
      + {{ $user->getPaymentShopDateFormat() }} +
      +
    • + @else + @if($user->payment_shop) +
    • +
      {{__('abgelaufen am')}}
      +
      + {{ $user->getPaymentShopDateFormat() }} +
      +
    • + @endif + @endif + +
    • +
      {{__('Abo-Option')}}
      +
      + @if($user->abo_options) + {{ __('aktiv') }} + @else + {{ __('inaktiv') }} + @endif +
      +
    • + +
    +
    + +
    +
    + +@endsection diff --git a/resources/views/user/wizard/_payment.blade.php b/resources/views/user/wizard/_payment.blade.php new file mode 100644 index 0000000..1c9d163 --- /dev/null +++ b/resources/views/user/wizard/_payment.blade.php @@ -0,0 +1,61 @@ + + @if($user->shopping_orders->count()) + @php + $last_shopping_order = $user->shopping_orders->last(); + $last_shopping_payments = $last_shopping_order->shopping_payments->last(); + @endphp + +
    + Es wurde eine Zahlung ausgeführt. Referenz: {{$last_shopping_payments->reference }}. +
    Bitte warte die Zahlungs-Bestätiung per E-Mail. +
    + @endif + {!! Form::open(['url' => route('wizard_store_payment', [20]), 'class' => 'form-horizontal']) !!} +
    + + + @php($counter = 1) + @foreach($products as $product) + + + + + + @php($counter++) + @endforeach + +
    + + +
    + @if(count($product->images)) + + @endif +
    +
    {{$product->name}}
    + {!! $product->getLang('copy') !!} +
    +
    +
    {{$product->getFormattedPrice()}} EUR / p.a.
    +
    +
    +
    + +
    +   +

    + Du wirst auf unseren checkout Server weitergeletet, die Verbindung ist SSL verschlüsselt. +
    + {!! Form::close() !!} + diff --git a/resources/views/user/wizard/create.blade.php b/resources/views/user/wizard/create.blade.php index 2b6278d..021d11a 100644 --- a/resources/views/user/wizard/create.blade.php +++ b/resources/views/user/wizard/create.blade.php @@ -56,16 +56,6 @@ 4 Paket
    auswählen
    - - - - -
  • - - - 5 - Registrierung -
    abgeschlossen
  • @@ -73,7 +63,7 @@
    - {!! Form::open(['url' => route('wizard_store_create', [0]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation-confirm']) !!} + {!! Form::open(['url' => route('wizard_store_create', [10]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation-confirm']) !!} @include('user.data_confirm')
      @@ -84,14 +74,14 @@
    @if(!$user->isPasswort()) - {!! Form::open(['url' => route('wizard_store_create', [1])]) !!} + {!! Form::open(['url' => route('wizard_store_create', [11])]) !!} @include('user.update_password_first_form')
     
    {!! Form::close() !!} @else - {!! Form::open(['url' => route('wizard_store_create', [1])]) !!} + {!! Form::open(['url' => route('wizard_store_create', [11])]) !!}

    Passwort wurde bereits erstellt.

      {!! Form::close() !!} @@ -100,7 +90,7 @@
    - {!! Form::open(['url' => route('wizard_store_create', [2]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!} + {!! Form::open(['url' => route('wizard_store_create', [12]), 'class' => 'form-horizontal', 'id'=>'lead-form-validation']) !!} @include('user.user_form')
      @@ -110,57 +100,7 @@
    - {!! Form::open(['url' => route('wizard_store_create', [3]), 'class' => 'form-horizontal']) !!} -
    - - -
    - @php($counter = 1) - @foreach($products as $product) -
    - - - - - @php($counter++) - - @endforeach - - -
    - - -
    - @if(count($product->images)) - - @endif -
    -
    {{$product->name}}
    - {!! $product->getLang('copy') !!} -
    -
    -
    {{$product->getFormattedPrice()}} EUR / p.a.
    -
    -
    -   -

    - Sie werden auf unseren checkout Server weitergeletet, die Verbindung ist mit SSL verschlüsselt. -
    - {!! Form::close() !!} -
    -
    -
    -
    -

    Vielen Dank,

    -

    Deine Registrierung ist abgeschlossen!

    -

    Sobald die Zahlung bei uns eingegangen ist, erhälst du automatisch eine E-Mail und dein Account wird freigeschaltet.

    + @include('user.wizard._payment')
    @@ -176,7 +116,7 @@ backButtonSupport: true, useURLhash: false, showStepURLhash: false, - selected: '{{$step}}', + selected: '{{$step-10}}', toolbarSettings: { showNextButton: false, showPreviousButton: false, diff --git a/resources/views/user/wizard/create_release.blade.php b/resources/views/user/wizard/create_release.blade.php new file mode 100644 index 0000000..f556d1e --- /dev/null +++ b/resources/views/user/wizard/create_release.blade.php @@ -0,0 +1,38 @@ +@extends('layouts.layout-2') + +@section('content') + + @if ($errors->any()) +
    +
    +
    +
      + @foreach ($errors->all() as $error) +
    • {{ $error }}
    • + @endforeach +
    +
    +
    +
    + @endif + +

    + {{ __('Registrierung abgeschlossen') }} +

    + +
    +
    +
    +
    +

    Vielen Dank,

    +

    Deine Registrierung und Buchung der Mitgliedschaft ist abgeschlossen!

    +

    Sobald die Zahlung bei uns eingegangen ist, erhälst Du automatisch eine E-Mail und Deine Mitgliedschaft wird automatisch freigeschaltet.

    +
    +
    +
    +
    +@endsection + +@section('scripts') + +@endsection \ No newline at end of file diff --git a/resources/views/user/wizard/register_payment.blade.php b/resources/views/user/wizard/register_payment.blade.php new file mode 100644 index 0000000..6fa56b6 --- /dev/null +++ b/resources/views/user/wizard/register_payment.blade.php @@ -0,0 +1,63 @@ +@extends('layouts.layout-2') + +@section('content') + + @if ($errors->any()) +
    +
    +
    +
      + @foreach ($errors->all() as $error) +
    • {{ $error }}
    • + @endforeach +
    +
    +
    +
    + @endif + +

    + {{ __('Registrierung abschließen') }} +

    + +
    + + +
    +
    +
    + @include('user.wizard._payment') +
    +
    +
    +
    + + + + + +@endsection diff --git a/resources/views/web/templates/checkout.blade.php b/resources/views/web/templates/checkout.blade.php index 9c181bc..2a3f3e5 100644 --- a/resources/views/web/templates/checkout.blade.php +++ b/resources/views/web/templates/checkout.blade.php @@ -546,6 +546,9 @@ {!! Form::text('elv_bic', '', ['class' => 'form-control', 'id'=>'elv_bic', 'placeholder'=>'Beisp.: PBNKDEFF']) !!}
    + @if($shopping_user->abo_options) +

    Abo-Option wurde ausgewählt. Dein SEPA-Mandart wird gespeichert und die jährliche Zahlung automatisch ausgeführt.

    + @endif
    diff --git a/routes/web.php b/routes/web.php index 2f1e83d..c9412cd 100755 --- a/routes/web.php +++ b/routes/web.php @@ -154,6 +154,9 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car Route::post('/wizard/store/create/{step?}', 'WizardController@storeCreate')->name('wizard_store_create'); Route::post('/wizard/store/register/{step?}', 'WizardController@storeRegister')->name('wizard_store_register'); + Route::get('/wizard/payment', 'WizardController@payment')->name('wizard_payment'); + Route::post('/wizard/store/payment/{step?}', 'WizardController@storePayment')->name('wizard_store_payment'); + Route::get('/wizard/delete/file/{id}/{relation}', 'WizardController@delete')->name('wizard_delete_file'); Route::get('/storage/file/{id}/{disk}', function($id = null, $disk = null) @@ -221,6 +224,8 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car Route::post('/user/shop_on_site/upload/image', 'UserShopController@uploadOnSiteImage')->name('user_shop_on_site_upload_image'); Route::get('/user/shop_on_site/{image_id}/{user_shop_id}', 'UserShopController@deleteOnSiteImage')->name('user_shop_on_site_delete_image'); + Route::get('/user/membership', 'MembershipController@index')->name('user_membership'); + Route::post('/user/membership/store/payment', 'MembershipController@storePayment')->name('user_membership_store_payment'); }); Route::group(['middleware' => ['admin']], function() @@ -333,8 +338,6 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car Route::get('/admin/levels', 'UserLevelController@index')->name('admin_levels'); Route::post('/admin/level/store', 'UserLevelController@store')->name('admin_level_store'); - - }); @@ -346,11 +349,6 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car Route::get('/sysadmin/tools/shopping_orders', 'SyS\AdminToolsController@shoppingOrders')->name('sysadmin_tools_shopping_orders'); Route::post('/sysadmin/tools/shopping_orders', 'SyS\AdminToolsController@shoppingOrdersStore')->name('sysadmin_tools_shopping_orders'); }); - - - - - }); /* ROUTING the checkout.mivita ... */