diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 6f062de..b59f657 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -5,14 +5,45 @@ + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -266,16 +304,9 @@ - - - - - - - - + @@ -301,11 +332,6 @@ - - - - - @@ -532,6 +558,11 @@ + + + + + @@ -568,10 +599,11 @@ - + + @@ -613,24 +645,21 @@ - - - - - + - + - + + diff --git a/.phpstorm.meta.php b/.phpstorm.meta.php index f4512e2..8b4dba0 100644 --- a/.phpstorm.meta.php +++ b/.phpstorm.meta.php @@ -5,7 +5,7 @@ namespace PHPSTORM_META { /** * PhpStorm Meta file, to provide autocomplete information for PhpStorm - * Generated on 2020-07-25 15:29:15. + * Generated on 2020-10-16 09:06:15. * * @author Barry vd. Heuvel * @see https://github.com/barryvdh/laravel-ide-helper diff --git a/_ide_helper.php b/_ide_helper.php index e85b6e9..e06a7ad 100644 --- a/_ide_helper.php +++ b/_ide_helper.php @@ -3,7 +3,7 @@ /** * A helper file for Laravel, to provide autocomplete information to your IDE - * Generated for Laravel 6.18.14 on 2020-07-25 15:29:12. + * Generated for Laravel 6.18.14 on 2020-10-16 09:06:13. * * This file should not be included in your code, only analyzed by your IDE! * @@ -17612,10 +17612,10 @@ namespace App\Services\Facade { * * @static */ - public static function putShippingExtra($key, $value) + public static function putYardExtra($key, $value) { /** @var \App\Services\Yard $instance */ - return $instance->putShippingExtra($key, $value); + return $instance->putYardExtra($key, $value); } /** @@ -17623,10 +17623,10 @@ namespace App\Services\Facade { * * @static */ - public static function getShippingExtra($key) + public static function getYardExtra($key) { /** @var \App\Services\Yard $instance */ - return $instance->getShippingExtra($key); + return $instance->getYardExtra($key); } /** @@ -17689,10 +17689,10 @@ namespace App\Services\Facade { * * @static */ - public static function setShippingCountryWithPrice($shipping_country_id) + public static function setShippingCountryWithPrice($shipping_country_id, $shipping_is_for = 'ot') { /** @var \App\Services\Yard $instance */ - return $instance->setShippingCountryWithPrice($shipping_country_id); + return $instance->setShippingCountryWithPrice($shipping_country_id, $shipping_is_for); } /** @@ -17710,6 +17710,17 @@ namespace App\Services\Facade { return $instance->shipping($decimals, $decimalPoint, $thousandSeperator); } + /** + * + * + * @static + */ + public static function shippingNet($decimals = null, $decimalPoint = null, $thousandSeperator = null) + { + /** @var \App\Services\Yard $instance */ + return $instance->shippingNet($decimals, $decimalPoint, $thousandSeperator); + } + /** * * @@ -17758,6 +17769,28 @@ namespace App\Services\Facade { return $instance->weight($decimals, $decimalPoint, $thousandSeperator); } + /** + * + * + * @static + */ + public static function points() + { + /** @var \App\Services\Yard $instance */ + return $instance->points(); + } + + /** + * + * + * @static + */ + public static function compCount() + { + /** @var \App\Services\Yard $instance */ + return $instance->compCount(); + } + /** * Get the total price of the items in the cart. * @@ -17803,6 +17836,28 @@ namespace App\Services\Facade { return $instance->subtotal($decimals, $decimalPoint, $thousandSeperator); } + /** + * + * + * @static + */ + public static function getCartItemByProduct($product_id, $set_price = 'with') + { + /** @var \App\Services\Yard $instance */ + return $instance->getCartItemByProduct($product_id, $set_price); + } + + /** + * + * + * @static + */ + public static function getCartItem($id, $name = null, $qty = null, $price = null, $options = []) + { + /** @var \App\Services\Yard $instance */ + return $instance->getCartItem($id, $name, $qty, $price, $options); + } + /** * * @@ -17814,6 +17869,61 @@ namespace App\Services\Facade { return $instance->destroy(); } + /** + * + * + * @static + */ + public static function rowPriceNet($row, $decimals = null, $decimalPoint = null, $thousandSeperator = null) + { + /** @var \App\Services\Yard $instance */ + return $instance->rowPriceNet($row, $decimals, $decimalPoint, $thousandSeperator); + } + + /** + * + * + * @static + */ + public static function rowSubtotalNet($row, $decimals = null, $decimalPoint = null, $thousandSeperator = null) + { + /** @var \App\Services\Yard $instance */ + return $instance->rowSubtotalNet($row, $decimals, $decimalPoint, $thousandSeperator); + } + + /** + * + * + * @static + */ + public static function getNumComp() + { + /** @var \App\Services\Yard $instance */ + return $instance->getNumComp(); + } + + /** + * + * + * @static + */ + public static function getCompProductBy($comp, $product_id = false) + { + /** @var \App\Services\Yard $instance */ + return $instance->getCompProductBy($comp, $product_id); + } + + /** + * + * + * @static + */ + public static function getContentByOrder() + { + /** @var \App\Services\Yard $instance */ + return $instance->getContentByOrder(); + } + /** * Set the current cart instance. * diff --git a/_ide_helper_models.php b/_ide_helper_models.php index 1fe5428..6611744 100644 --- a/_ide_helper_models.php +++ b/_ide_helper_models.php @@ -170,6 +170,8 @@ namespace App\Models{ * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingCountry whereShippingId($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingCountry whereUpdatedAt($value) * @mixin \Eloquent + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ShoppingOrder[] $shopping_orders + * @property-read int|null $shopping_orders_count */ class ShippingCountry extends \Eloquent {} } @@ -256,10 +258,47 @@ namespace App\Models{ * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem whereUserDeletedAt($value) * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingOrderItem withTrashed() * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingOrderItem withoutTrashed() + * @property int|null $comp + * @property float|null $price_net + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem whereComp($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem wherePriceNet($value) */ class ShoppingOrderItem extends \Eloquent {} } +namespace App\Models{ +/** + * Class Logger + * + * @property int $id + * @property int $user_id + * @property int $model_id + * @property string $model + * @property string $action + * @property string $channel + * @property string $message + * @property int $level + * @property Carbon $created_at + * @property Carbon $updated_at + * @property User $user + * @package App\Models + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger query() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereAction($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereChannel($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereLevel($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereMessage($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereModel($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereModelId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereUserId($value) + */ + class Logger extends \Eloquent {} +} + namespace App\Models{ /** * App\Models\UserUpdateEmail @@ -314,10 +353,109 @@ namespace App\Models{ * @mixin \Eloquent * @property-write mixed $tax * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice whereTaxRate($value) + * @property float|null $price_comp + * @property int|null $num_comp + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice whereNumComp($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice wherePriceComp($value) */ class ShippingPrice extends \Eloquent {} } +namespace App\Models{ +/** + * Class HomepartyUser + * + * @property int $id + * @property int $homeparty_id + * @property int $auth_user_id + * @property bool $is_host + * @property string $billing_salutation + * @property string $billing_company + * @property string $billing_firstname + * @property string $billing_lastname + * @property string $billing_address + * @property string $billing_address_2 + * @property string $billing_zipcode + * @property string $billing_city + * @property int $billing_country_id + * @property string $billing_phone + * @property string $billing_email + * @property bool $same_as_billing + * @property string $shipping_salutation + * @property string $shipping_company + * @property string $shipping_firstname + * @property string $shipping_lastname + * @property string $shipping_address + * @property string $shipping_address_2 + * @property string $shipping_zipcode + * @property string $shipping_city + * @property int $shipping_country_id + * @property string $shipping_phone + * @property string $shipping_email + * @property bool $has_buyed + * @property bool $subscribed + * @property string $token + * @property bool $token_active + * @property string $notice + * @property string $mode + * @property Carbon $created_at + * @property Carbon $updated_at + * @property string $deleted_at + * @property Carbon $user_deleted_at + * @property User $user + * @property Country $country + * @property Homeparty $homeparty + * @package App\Models + * @property-read \App\User $auth_user + * @property-read \App\Models\Country $billing_country + * @property-read \App\Models\Country $shipping_country + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser newQuery() + * @method static \Illuminate\Database\Query\Builder|\App\Models\HomepartyUser onlyTrashed() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser query() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereAuthUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingAddress($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingAddress2($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingCity($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingCompany($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingCountryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingFirstname($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingLastname($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingPhone($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingSalutation($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereBillingZipcode($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereDeletedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereHasBuyed($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereHomepartyId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereIsHost($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereMode($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereNotice($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereSameAsBilling($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingAddress($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingAddress2($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingCity($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingCompany($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingCountryId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingFirstname($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingLastname($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingPhone($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingSalutation($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereShippingZipcode($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereSubscribed($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereToken($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereTokenActive($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUser whereUserDeletedAt($value) + * @method static \Illuminate\Database\Query\Builder|\App\Models\HomepartyUser withTrashed() + * @method static \Illuminate\Database\Query\Builder|\App\Models\HomepartyUser withoutTrashed() + */ + class HomepartyUser extends \Eloquent {} +} + namespace App\Models{ /** * App\Models\Import @@ -429,6 +567,16 @@ namespace App\Models{ * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingUser withoutTrashed() * @property string|null $mode * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereMode($value) + * @property bool|null $faker_mail + * @property string|null $shipping_email + * @property string|null $is_for + * @property string|null $is_from + * @property int|null $shopping_user_id + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereFakerMail($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereIsFor($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereIsFrom($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereShippingEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereShoppingUserId($value) */ class ShoppingUser extends \Eloquent {} } @@ -460,6 +608,10 @@ namespace App\Models{ * @mixin \Eloquent * @property int|null $payment * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance wherePayment($value) + * @property array|null $shopping_data + * @property string|null $back + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereBack($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereShoppingData($value) */ class ShoppingInstance extends \Eloquent {} } @@ -879,6 +1031,51 @@ namespace App\Models{ class ShoppingPayment extends \Eloquent {} } +namespace App\Models{ +/** + * Class Homeparty + * + * @property int $id + * @property Carbon $date + * @property string $name + * @property string $place + * @property string $description + * @property int $pos + * @property int $completed + * @property int $status + * @property bool $order_to + * @property bool $active + * @property bool $default + * @property Carbon $created_at + * @property Carbon $updated_at + * @property Collection|User[] $users + * @package App\Models + * @property int|null $auth_user_id + * @property-read \App\User|null $auth_user + * @property-read \App\Models\HomepartyUser|null $homeparty_host + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\HomepartyUser[] $homeparty_users + * @property-read int|null $homeparty_users_count + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty query() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereActive($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereAuthUserId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereCompleted($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereDate($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereDefault($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereDescription($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereOrderTo($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty wherePlace($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty wherePos($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereUpdatedAt($value) + */ + class Homeparty extends \Eloquent {} +} + namespace App\Models{ /** * App\Models\PaymentTransaction @@ -1019,10 +1216,53 @@ namespace App\Models{ * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingOrder withTrashed() * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingOrder withoutTrashed() * @property-read \App\Models\ShippingCountry $shipping_country + * @property float|null $shipping_net + * @property float|null $subtotal_ws + * @property int|null $points + * @property int|null $shipped + * @property string|null $tracking + * @property string|null $wp_invoice_path + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder wherePoints($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereShipped($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereShippingNet($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereSubtotalWs($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereTracking($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereWpInvoicePath($value) */ class ShoppingOrder extends \Eloquent {} } +namespace App\Models{ +/** + * Class SySetting + * + * @property int $id + * @property string $name + * @property string $slug + * @property string $message + * @property string $action + * @property int $status + * @property bool $active + * @property Carbon $created_at + * @property Carbon $updated_at + * @package App\Models + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting findSimilarSlugs($attribute, $config, $slug) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting query() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereAction($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereActive($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereMessage($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereUpdatedAt($value) + */ + class SySetting extends \Eloquent {} +} + namespace App\Models{ /** * Class CountryPrice diff --git a/app/Http/Controllers/User/HomepartyController.php b/app/Http/Controllers/User/HomepartyController.php new file mode 100755 index 0000000..354d707 --- /dev/null +++ b/app/Http/Controllers/User/HomepartyController.php @@ -0,0 +1,269 @@ +middleware('superadmin'); + + $this->middleware('active.account'); + } + + public function index() + { + $data = [ + 'homepartys' => Homeparty::where('auth_user_id', '=', \Auth::user()->id)->get(), + ]; + return view('user.homeparty.index', $data); + } + + public function detail($id) + { + if($id === 'new'){ + $homeparty = new Homeparty(); + }else{ + $homeparty = $this->getHomparty($id); + } + if($homeparty->homeparty_host){ + $homeparty_user = $homeparty->homeparty_host; + }else{ + $homeparty_user = new HomepartyUser(); + $homeparty_user->is_host = true; + } + $data = [ + 'homeparty' => $homeparty, + 'homeparty_user' => $homeparty_user, + + ]; + return view('user.homeparty.detail', $data); + } + + public function store($id = null) + { + $data = Request::all(); + if($data['action'] === 'homeparty-party-store'){ + $rules = array( + 'date' => 'required', + 'name' => 'required', + 'place' => 'required' + ); + } + if($data['action'] === 'homeparty-user-store'){ + $rules = array( + 'billing_salutation' => 'required', + 'billing_firstname' => 'required', + 'billing_lastname' => 'required', + 'billing_address' => 'required', + 'billing_zipcode' => 'required', + 'billing_city' => 'required', + 'billing_country_id' => 'required', + ); + if (!Request::get('same_as_billing')) { + $rules = array_merge($rules, [ + 'shipping_firstname' => 'required', + 'shipping_lastname' => 'required', + 'shipping_address' => 'required', + 'shipping_zipcode' => 'required', + 'shipping_city' => 'required', + 'shipping_salutation' => 'required', + 'shipping_country_id' => 'required' + ]); + } + } + $validator = Validator::make(Request::all(), $rules); + if ($validator->fails()) { + return back()->withErrors($validator)->withInput(Request::all()); + } + + if($data['action'] === 'homeparty-party-store'){ + if(!$id){ + //first save create and empty user/host + $homeparty = Homeparty::create($data); + do { + $token = Util::uuidToken(); + } while( HomepartyUser::where('token', $token)->count() ); + $homeparty_user = HomepartyUser::create([ + 'homeparty_id' => $homeparty->id, + 'auth_user_id' => \Auth::user()->id, + 'is_host' => true, + 'token' => $token, + ]); + }else { + $homeparty = $this->getHomparty($id); + $homeparty->fill($data)->save(); + } + } + + if($data['action'] === 'homeparty-user-store'){ + $homeparty = $this->getHomparty($id); + $data['same_as_billing'] = isset($data['same_as_billing']) ? true : false; + $data['shipping_country_id'] = isset($data['shipping_country_id']) ? $data['shipping_country_id'] : $data['billing_country_id']; + $homeparty_user = $homeparty->homeparty_host; + $homeparty_user->fill($data)->save(); + } + + \Session()->flash('alert-save', '1'); + return redirect(route('user_homeparty_detail', $homeparty->id)); + } + + + public function guests($id = null) + { + $homeparty = $this->getHomparty($id); + $data = [ + 'homeparty' => $homeparty, + ]; + return view('user.homeparty.guests', $data); + } + + + public function guestDetail($id = null, $gid = null) + { + $homeparty = $this->getHomparty($id); + if($gid === 'new'){ + do { + $token = Util::uuidToken(); + } while( HomepartyUser::where('token', $token)->count() ); + $homeparty_user = HomepartyUser::create([ + 'homeparty_id' => $homeparty->id, + 'auth_user_id' => \Auth::user()->id, + 'is_host' => false, + 'token' => $token, + ]); + }else{ + $homeparty_user = HomepartyUser::findOrFail($gid); + if($homeparty->id !== $homeparty_user->homeparty_id){ + abort(404); + } + } + $data = [ + 'homeparty' => $homeparty, + 'homeparty_user' => $homeparty_user, + ]; + return view('user.homeparty.guest_detail', $data); + } + + public function guestStore($id = null, $gid = null) + { + $data = Request::all(); + $rules = array( + 'billing_salutation' => 'required', + 'billing_firstname' => 'required', + 'billing_lastname' => 'required', + 'billing_address' => 'required', + 'billing_zipcode' => 'required', + 'billing_city' => 'required', + 'billing_country_id' => 'required', + ); + if (!Request::get('same_as_billing')) { + $rules = array_merge($rules, [ + 'shipping_firstname' => 'required', + 'shipping_lastname' => 'required', + 'shipping_address' => 'required', + 'shipping_zipcode' => 'required', + 'shipping_city' => 'required', + 'shipping_salutation' => 'required', + 'shipping_country_id' => 'required' + ]); + } + $validator = Validator::make(Request::all(), $rules); + if ($validator->fails()) { + return back()->withErrors($validator)->withInput(Request::all()); + } + + $homeparty = $this->getHomparty($id); + $homeparty_user = HomepartyUser::findOrFail($gid); + if($homeparty->id !== $homeparty_user->homeparty_id){ + abort(404); + } + $data['same_as_billing'] = isset($data['same_as_billing']) ? true : false; + $data['shipping_country_id'] = isset($data['shipping_country_id']) ? $data['shipping_country_id'] : $data['billing_country_id']; + $homeparty_user->fill($data)->save(); + \Session()->flash('alert-save', '1'); + return redirect(route('user_homeparty_guests', [$homeparty->id])); + } + + + public function order($id = null) + { + $homeparty = $this->getHomparty($id); + abort(404); + + /*$shopping_order = ShoppingOrder::findOrFail($id); + if($shopping_order->auth_user_id !== $user->id){ + abort(404); + } + $shopping_order->getLastShoppingPayment(); + + $data = [ + 'shopping_order' => $shopping_order, + 'isAdmin' => false, + ]; + return view('user.order.detail', $data);*/ + } + + public function delete($do, $id = null, $gid=null) + { + $homeparty = $this->getHomparty($id); + + if($do === 'hpu'){ + $homeparty_user = HomepartyUser::findOrFail($gid); + if($homeparty->id !== $homeparty_user->homeparty_id){ + abort(404); + } + $homeparty_user->token = null; + $homeparty_user->save(); + $homeparty_user->delete(); + \Session()->flash('alert-success', "Homeparty Gast gelöscht"); + return redirect(route('user_homeparty_guests', [$homeparty->id])); + + } + if($do === 'hp') { + + foreach ($homeparty->homeparty_users as $homeparty_user){ + if ($homeparty->id !== $homeparty_user->homeparty_id) { + abort(404); + } + $homeparty_user->token = null; + $homeparty_user->save(); + $homeparty_user->delete(); + } + $homeparty->delete(); + \Session()->flash('alert-success', "Homeparty gelöscht"); + return redirect(route('user_homepartys')); + + } + abort(404); + } + + private function getHomparty($id){ + $homeparty = Homeparty::findOrFail($id); + if($homeparty->auth_user_id !== \Auth::user()->id){ + abort(404); + } + return $homeparty; + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/Web/HomepartyController.php b/app/Http/Controllers/Web/HomepartyController.php new file mode 100755 index 0000000..964c14e --- /dev/null +++ b/app/Http/Controllers/Web/HomepartyController.php @@ -0,0 +1,96 @@ +where('token_active', true)->first(); + + if(!$homeparty_user){ + abort(403, 'Link für die Homeparty wurde nicht gefunden, oder ist nicht mehr aktiv.'); + } + $data = [ + 'homeparty' => $homeparty_user->homeparty, + 'homeparty_user' => $homeparty_user, + ]; + + return view('user.homeparty.self_guest_detail', $data); + } + + + + + public function detailStore($token = null) + { + if(!$token){ + abort(404); + } + $homeparty_user = HomepartyUser::where('token', $token)->where('token_active', true)->first(); + + if(!$homeparty_user){ + abort(403, 'Link für die Homeparty wurde nicht gefunden, oder ist nicht mehr aktiv.'); + } + + + + $rules = array( + 'billing_salutation' => 'required', + 'billing_firstname' => 'required', + 'billing_lastname' => 'required', + 'billing_address' => 'required', + 'billing_zipcode' => 'required', + 'billing_city' => 'required', + 'billing_country_id' => 'required', + ); + if (!Request::get('same_as_billing')) { + $rules = array_merge($rules, [ + 'shipping_firstname' => 'required', + 'shipping_lastname' => 'required', + 'shipping_address' => 'required', + 'shipping_zipcode' => 'required', + 'shipping_city' => 'required', + 'shipping_salutation' => 'required', + 'shipping_country_id' => 'required' + ]); + } + $validator = Validator::make(Request::all(), $rules); + if ($validator->fails()) { + return back()->withErrors($validator)->withInput(Request::all()); + } + + $data = Request::all(); + $data['same_as_billing'] = isset($data['same_as_billing']) ? true : false; + $data['shipping_country_id'] = isset($data['shipping_country_id']) ? $data['shipping_country_id'] : $data['billing_country_id']; + $homeparty_user->fill($data)->save(); + \Session()->flash('alert-save', '1'); + return redirect(route('homeparty', [$token])); + } +} \ No newline at end of file diff --git a/app/Models/Homeparty.php b/app/Models/Homeparty.php new file mode 100644 index 0000000..97dd9b0 --- /dev/null +++ b/app/Models/Homeparty.php @@ -0,0 +1,120 @@ + 'int', + 'completed' => 'int', + 'status' => 'int', + 'order_to' => 'bool', + 'active' => 'bool', + 'default' => 'bool' + ]; + + protected $dates = [ + 'date' + ]; + + protected $fillable = [ + 'auth_user_id', + 'date', + 'name', + 'place', + 'description', + 'pos', + 'completed', + 'status', + 'order_to', + 'active', + 'default' + ]; + + public function auth_user() + { + return $this->belongsTo('App\User', 'auth_user_id'); + } + + public function homeparty_users() + { + return $this->hasMany('App\Models\HomepartyUser', 'homeparty_id'); + } + + public function homeparty_host() + { + return $this->hasOne('App\Models\HomepartyUser', 'homeparty_id')->where('is_host', true); + } + + public function homeparty_guests() + { + return $this->hasMany('App\Models\HomepartyUser', 'homeparty_id')->where('is_host', false); + } + + + public function getDateAttribute($value) + { + if (!$value) { + return ""; + } + return Carbon::parse($value)->format(\Util::formatDateDB()); + } + + public function setDateAttribute($value) + { + $this->attributes['date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL; + } +} + diff --git a/app/Models/HomepartyUser.php b/app/Models/HomepartyUser.php new file mode 100644 index 0000000..e91751d --- /dev/null +++ b/app/Models/HomepartyUser.php @@ -0,0 +1,192 @@ + 'int', + 'auth_user_id' => 'int', + 'is_host' => 'bool', + 'billing_country_id' => 'int', + 'same_as_billing' => 'bool', + 'shipping_country_id' => 'int', + 'has_buyed' => 'bool', + 'subscribed' => 'bool', + 'token_active' => 'bool' + ]; + + protected $dates = [ + 'user_deleted_at' + ]; + + protected $hidden = [ + 'token' + ]; + + protected $fillable = [ + 'homeparty_id', + 'auth_user_id', + 'is_host', + 'billing_salutation', + 'billing_company', + 'billing_firstname', + 'billing_lastname', + 'billing_address', + 'billing_address_2', + 'billing_zipcode', + 'billing_city', + 'billing_country_id', + 'billing_phone', + 'billing_email', + 'same_as_billing', + 'shipping_salutation', + 'shipping_company', + 'shipping_firstname', + 'shipping_lastname', + 'shipping_address', + 'shipping_address_2', + 'shipping_zipcode', + 'shipping_city', + 'shipping_country_id', + 'shipping_phone', + 'shipping_email', + 'has_buyed', + 'subscribed', + 'token', + 'token_active', + 'notice', + 'mode', + 'user_deleted_at' + ]; + + public function homeparty() + { + return $this->belongsTo(Homeparty::class); + } + + public function auth_user() + { + return $this->belongsTo(User::class, 'auth_user_id'); + } + + public function billing_country() + { + return $this->belongsTo('App\Models\Country','billing_country_id'); + } + + public function shipping_country() + { + return $this->belongsTo('App\Models\Country','shipping_country_id'); + } + + public function getTokenLink(){ + return url('homeparty/'.$this->token); + } + + +} diff --git a/app/Models/Logger.php b/app/Models/Logger.php index b65aca7..ad84cc1 100644 --- a/app/Models/Logger.php +++ b/app/Models/Logger.php @@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Model; /** * Class Logger - * + * * @property int $id * @property int $user_id * @property int $model_id @@ -23,10 +23,22 @@ use Illuminate\Database\Eloquent\Model; * @property int $level * @property Carbon $created_at * @property Carbon $updated_at - * * @property User $user - * * @package App\Models + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger query() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereAction($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereChannel($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereLevel($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereMessage($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereModel($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereModelId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereUpdatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Logger whereUserId($value) + * @mixin \Eloquent */ class Logger extends Model { diff --git a/app/Models/ShippingCountry.php b/app/Models/ShippingCountry.php index cabe731..c7733a6 100644 --- a/app/Models/ShippingCountry.php +++ b/app/Models/ShippingCountry.php @@ -23,6 +23,8 @@ use Illuminate\Database\Eloquent\Model; * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingCountry whereShippingId($value) * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingCountry whereUpdatedAt($value) * @mixin \Eloquent + * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ShoppingOrder[] $shopping_orders + * @property-read int|null $shopping_orders_count */ class ShippingCountry extends Model { diff --git a/app/Models/ShippingPrice.php b/app/Models/ShippingPrice.php index c642293..724ee3b 100644 --- a/app/Models/ShippingPrice.php +++ b/app/Models/ShippingPrice.php @@ -37,6 +37,10 @@ use Illuminate\Database\Eloquent\Model; * @mixin \Eloquent * @property-write mixed $tax * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice whereTaxRate($value) + * @property float|null $price_comp + * @property int|null $num_comp + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice whereNumComp($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShippingPrice wherePriceComp($value) */ class ShippingPrice extends Model { diff --git a/app/Models/ShoppingInstance.php b/app/Models/ShoppingInstance.php index 3dc0c31..225d727 100644 --- a/app/Models/ShoppingInstance.php +++ b/app/Models/ShoppingInstance.php @@ -30,6 +30,10 @@ use Illuminate\Database\Eloquent\Model; * @mixin \Eloquent * @property int|null $payment * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance wherePayment($value) + * @property array|null $shopping_data + * @property string|null $back + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereBack($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingInstance whereShoppingData($value) */ class ShoppingInstance extends Model { diff --git a/app/Models/ShoppingOrder.php b/app/Models/ShoppingOrder.php index 218d624..57431b8 100644 --- a/app/Models/ShoppingOrder.php +++ b/app/Models/ShoppingOrder.php @@ -68,6 +68,18 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingOrder withTrashed() * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingOrder withoutTrashed() * @property-read \App\Models\ShippingCountry $shipping_country + * @property float|null $shipping_net + * @property float|null $subtotal_ws + * @property int|null $points + * @property int|null $shipped + * @property string|null $tracking + * @property string|null $wp_invoice_path + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder wherePoints($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereShipped($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereShippingNet($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereSubtotalWs($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereTracking($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrder whereWpInvoicePath($value) */ class ShoppingOrder extends Model { diff --git a/app/Models/ShoppingOrderItem.php b/app/Models/ShoppingOrderItem.php index 450c9b4..0f6372e 100644 --- a/app/Models/ShoppingOrderItem.php +++ b/app/Models/ShoppingOrderItem.php @@ -41,6 +41,10 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem whereUserDeletedAt($value) * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingOrderItem withTrashed() * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingOrderItem withoutTrashed() + * @property int|null $comp + * @property float|null $price_net + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem whereComp($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingOrderItem wherePriceNet($value) */ class ShoppingOrderItem extends Model { diff --git a/app/Models/ShoppingUser.php b/app/Models/ShoppingUser.php index c01721c..da6b78f 100644 --- a/app/Models/ShoppingUser.php +++ b/app/Models/ShoppingUser.php @@ -103,6 +103,16 @@ use Illuminate\Database\Eloquent\SoftDeletes; * @method static \Illuminate\Database\Query\Builder|\App\Models\ShoppingUser withoutTrashed() * @property string|null $mode * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereMode($value) + * @property bool|null $faker_mail + * @property string|null $shipping_email + * @property string|null $is_for + * @property string|null $is_from + * @property int|null $shopping_user_id + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereFakerMail($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereIsFor($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereIsFrom($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereShippingEmail($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ShoppingUser whereShoppingUserId($value) */ class ShoppingUser extends Model { diff --git a/app/Models/SySetting.php b/app/Models/SySetting.php index 6c51cc6..852f046 100644 --- a/app/Models/SySetting.php +++ b/app/Models/SySetting.php @@ -12,7 +12,7 @@ use Illuminate\Database\Eloquent\Model; /** * Class SySetting - * + * * @property int $id * @property string $name * @property string $slug @@ -22,8 +22,21 @@ use Illuminate\Database\Eloquent\Model; * @property bool $active * @property Carbon $created_at * @property Carbon $updated_at - * * @package App\Models + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting findSimilarSlugs($attribute, $config, $slug) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting newModelQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting newQuery() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting query() + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereAction($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereActive($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereCreatedAt($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereId($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereMessage($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereName($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereSlug($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereStatus($value) + * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\SySetting whereUpdatedAt($value) + * @mixin \Eloquent */ class SySetting extends Model { diff --git a/app/Services/Util.php b/app/Services/Util.php index ae5a558..d4f4a90 100644 --- a/app/Services/Util.php +++ b/app/Services/Util.php @@ -2,6 +2,7 @@ namespace App\Services; use App\Models\UserHistory; +use Illuminate\Support\Str; use Yard; class Util @@ -16,6 +17,17 @@ class Util return hash_hmac('sha256', str_random(40), config('app.key')); } + public static function uuidToken() + { + $uuid = (string) Str::uuid(); + $e_uuid = explode("-", $uuid); + if(isset($e_uuid[0]) && $e_uuid[1]){ + return $e_uuid[0]."-".$e_uuid[1]; + + } + return $uuid; + } + public static function formatDate(){ if(\App::getLocale() === "en"){ return 'yyyy-mm-dd'; diff --git a/database/migrations/2020_10_15_151059_create_homeparties_table.php b/database/migrations/2020_10_15_151059_create_homeparties_table.php new file mode 100644 index 0000000..80a4ed9 --- /dev/null +++ b/database/migrations/2020_10_15_151059_create_homeparties_table.php @@ -0,0 +1,44 @@ +increments('id'); + $table->date('date'); + $table->string('name')->nullable(); + $table->string('place')->nullable(); + $table->text('description')->nullable(); + + $table->unsignedTinyInteger('pos')->default(0); + $table->unsignedTinyInteger('completed')->default(0); + $table->unsignedTinyInteger('status')->default(0); + + $table->boolean('order_to')->default(true); + $table->boolean('active')->default(false); + $table->boolean('default')->default(false); + + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('homeparties'); + } +} diff --git a/database/migrations/2020_10_15_151136_create_homeparty_users_table.php b/database/migrations/2020_10_15_151136_create_homeparty_users_table.php new file mode 100644 index 0000000..e02898d --- /dev/null +++ b/database/migrations/2020_10_15_151136_create_homeparty_users_table.php @@ -0,0 +1,95 @@ +increments('id'); + + $table->unsignedInteger('homeparty_id'); + $table->unsignedInteger('auth_user_id'); + + $table->boolean('is_host')->default(false); + + $table->char('billing_salutation', 2)->nullable(); + $table->string('billing_company')->nullable(); + $table->string('billing_firstname')->nullable(); + $table->string('billing_lastname')->nullable(); + $table->string('billing_address')->nullable(); + $table->string('billing_address_2')->nullable(); + $table->string('billing_zipcode')->nullable(); + $table->string('billing_city')->nullable(); + $table->unsignedInteger('billing_country_id'); + $table->string('billing_phone')->nullable(); + $table->string('billing_email')->nullable(); + + + $table->boolean('same_as_billing')->default(true); + $table->char('shipping_salutation', 2)->nullable(); + $table->string('shipping_company')->nullable(); + $table->string('shipping_firstname')->nullable(); + $table->string('shipping_lastname')->nullable(); + $table->string('shipping_address')->nullable(); + $table->string('shipping_address_2')->nullable(); + $table->string('shipping_zipcode')->nullable(); + $table->string('shipping_city')->nullable(); + $table->unsignedInteger('shipping_country_id'); + $table->string('shipping_phone')->nullable(); + $table->string('shipping_email')->nullable(); + + $table->boolean('has_buyed')->default(false); + $table->boolean('subscribed')->default(false); + + $table->string('token')->nullable(); + $table->boolean('token_active')->default(true); + + $table->text('notice')->nullable(); + + $table->char('mode', 4)->nullable(); + + $table->timestamps(); + $table->softDeletes(); + $table->timestamp('user_deleted_at')->nullable(); + + + $table->foreign('billing_country_id') + ->references('id') + ->on('countries'); + + $table->foreign('shipping_country_id') + ->references('id') + ->on('countries'); + + $table->foreign('auth_user_id') + ->references('id') + ->on('users'); + + $table->foreign('homeparty_id') + ->references('id') + ->on('homeparties') + ->onDelete('cascade'); + + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('homeparty_users'); + } +} diff --git a/resources/lang/de/navigation.php b/resources/lang/de/navigation.php index 8e914da..fb905ef 100755 --- a/resources/lang/de/navigation.php +++ b/resources/lang/de/navigation.php @@ -10,6 +10,7 @@ return [ 'my_team' => 'Mein Team', 'my_clients' => 'Meine Kunden', 'my_orders' => 'Meine Bestellungen', + 'my_homeparty' => 'Meine Homeparty', 'member_register' => 'Berater registrieren', 'member'=>'Berater', 'membership' => 'Mitgliedschaft', @@ -29,6 +30,7 @@ return [ 'general'=>'Allgemein', 'modules'=>'Module', 'user_roles'=>'User Rechte', + 'manage'=>'verwalten', 'shipping_costs'=>'Versandkosten', 'payment_methods' => 'Zahlungsarten', 'career_level'=>'Karriere-Level', diff --git a/resources/lang/de/validation.php b/resources/lang/de/validation.php index fc3eb65..74cc151 100755 --- a/resources/lang/de/validation.php +++ b/resources/lang/de/validation.php @@ -154,6 +154,7 @@ return [ 'attributes' => [ 'salutation' => 'Anrede', 'name' => 'Name', + 'place' => 'Ort', 'username' => 'Benutzername', 'email' => 'E-Mail-Adresse', 'email-confirm' => 'E-Mail-Adresse wiederholen', diff --git a/resources/views/admin/customer/_edit.blade.php b/resources/views/admin/customer/_edit.blade.php index 246cf27..9d18bdd 100644 --- a/resources/views/admin/customer/_edit.blade.php +++ b/resources/views/admin/customer/_edit.blade.php @@ -124,7 +124,7 @@
-
+
+ {!! HTMLHelper::getSalutation($homeparty_user->billing_salutation) !!} + + @if ($errors->has('billing_salutation')) + + {{ $errors->first('billing_salutation') }} + + @endif +
+
+
+
+ + {{ Form::text('billing_firstname', $homeparty_user->billing_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'id'=>'billing_firstname', 'required'=>true, 'tabindex' => 4)) }} + @if ($errors->has('billing_firstname')) + + {{ $errors->first('billing_firstname') }} + + @endif + +
+
+ + {{ Form::text('billing_lastname', $homeparty_user->billing_lastname, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'id'=>'billing_lastname', 'required'=>true, 'tabindex' => 5)) }} + @if ($errors->has('billing_lastname')) + + {{ $errors->first('billing_lastname') }} + + @endif + +
+
+
+
+ + {{ Form::text('billing_address', $homeparty_user->billing_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true, 'id'=>'billing_address', 'tabindex' => 6)) }} + @if ($errors->has('billing_address')) + + {{ $errors->first('billing_address') }} + + @endif +
+
+
+
+ + {{ Form::text('billing_address_2', $homeparty_user->billing_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control', 'id'=>'billing_address_2', 'tabindex' => 6)) }} +
+
+
+
+ + {{ Form::text('billing_zipcode', $homeparty_user->billing_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true, 'id'=>'billing_zipcode', 'tabindex' => 7)) }} + @if ($errors->has('billing_zipcode')) + + {{ $errors->first('billing_zipcode') }} + + @endif +
+
+ + {{ Form::text('billing_city', $homeparty_user->billing_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true, 'id'=>'billing_city', 'tabindex' => 8)) }} + @if ($errors->has('billing_city')) + + {{ $errors->first('billing_city') }} + + @endif +
+
+
+
+ + + @if ($errors->has('billing_country_id')) + + {{ $errors->first('billing_country_id') }} + + @endif +
+
+
+
+ + {{ Form::text('billing_phone', $homeparty_user->billing_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control', 'id'=>'billing_phone', 'tabindex' => 11)) }} +
+
+
+
+ + {{ Form::text('billing_email', $homeparty_user->billing_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'billing_email', 'tabindex' => 12)) }} +
+
+
+
+
+
+
Lieferadresse
+
+
+
+
+ + {{ Form::text('shipping_company', $homeparty_user->shipping_company, array('placeholder'=>__('Company name'), 'class'=>'form-control', 'id'=>'shipping_company', 'tabindex' => 16)) }} +
+
+
+
+ + + @if ($errors->has('shipping_salutation')) + + {{ $errors->first('shipping_salutation') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_firstname', $homeparty_user->shipping_firstname, array('placeholder'=>__('First name'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_firstname', 'tabindex' => 18)) }} + @if ($errors->has('shipping_firstname')) + + {{ $errors->first('shipping_firstname') }} + + @endif +
+
+ + {{ Form::text('shipping_lastname', $homeparty_user->shipping_lastname, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_lastname', 'tabindex' => 19)) }} + @if ($errors->has('shipping_lastname')) + + {{ $errors->first('shipping_lastname') }} + + @endif + +
+
+
+
+ + {{ Form::text('shipping_address', $homeparty_user->shipping_address, array('placeholder'=>__('Street'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_address', 'tabindex' => 20)) }} + @if ($errors->has('shipping_address')) + + {{ $errors->first('shipping_address') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_address_2', $homeparty_user->shipping_address_2, array('placeholder'=>__('Wohnung / Gebäude (optional)'), 'class'=>'form-control', 'id'=>'shipping_address_2', 'tabindex' => 21)) }} + @if ($errors->has('shipping_address_2')) + + {{ $errors->first('shipping_address_2') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_zipcode', $homeparty_user->shipping_zipcode, array('placeholder'=>__('Postcode'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_zipcode', 'tabindex' => 22)) }} + @if ($errors->has('shipping_zipcode')) + + {{ $errors->first('shipping_zipcode') }} + + @endif + +
+
+ + {{ Form::text('shipping_city', $homeparty_user->shipping_city, array('placeholder'=>__('City'), 'class'=>'form-control', 'required'=>true, 'id'=>'shipping_city', 'tabindex' => 23)) }} + @if ($errors->has('shipping_city')) + + {{ $errors->first('shipping_city') }} + + @endif +
+
+
+
+ + + @if ($errors->has('shipping_country_id')) + + {{ $errors->first('shipping_country_id') }} + + @endif +
+
+
+
+ + {{ Form::text('shipping_phone', $homeparty_user->shipping_phone, array('placeholder'=>__('Phone'), 'class'=>'form-control', 'id'=>'shipping_phone', 'tabindex' => 26)) }} +
+
+
+
+ + {{ Form::text('shipping_email', $homeparty_user->shipping_email, array('placeholder'=>'E-Mail', 'class'=>'form-control', 'id'=>'shipping_email', 'tabindex' => 27)) }} +
+
+
+
+ +
+
+
+ + {{ Form::hidden('is_host', $homeparty_user->is_host) }} + \ No newline at end of file diff --git a/resources/views/user/homeparty/detail.blade.php b/resources/views/user/homeparty/detail.blade.php new file mode 100644 index 0000000..e20b4c1 --- /dev/null +++ b/resources/views/user/homeparty/detail.blade.php @@ -0,0 +1,241 @@ +@extends('layouts.layout-2') + +@section('content') +

+
{{ __('navigation.my_homeparty') }} / + @if(!$homeparty->id) + anlegen + @else + {{ __('navigation.manage') }} + + @endif +
+ zurück +

+ + {!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-party-form-validation']) !!} + +
+
+
+ @if(!$homeparty->id) +
+ Neue Homeparty anlegen +
+ @else +
+
+
Homeparty verwalten
+ +
+
+ @endif +
+
+ +
+
+
+ + {{ Form::text('name', $homeparty->name, array('placeholder'=>__('Veranstaltungsname'), 'class'=>'form-control', 'required')) }} + @if ($errors->has('name')) + + {{ $errors->first('name') }} + + @endif +
+
+ + {{ Form::text('date', $homeparty->date, array('placeholder'=>Util::formatDate(), 'data-date-format'=>Util::formatDate(), 'data-start_view'=>2, 'class'=>'form-control datepicker-base', 'required')) }} + @if ($errors->has('date')) + + {{ $errors->first('date') }} + + @endif +
+
+ + {{ Form::text('place', $homeparty->place, array('placeholder'=>__('Veranstaltungsort'), 'class'=>'form-control', 'required')) }} + @if ($errors->has('place')) + + {{ $errors->first('place') }} + + @endif +
+ +
+
+ + {{ Form::textarea('description', $homeparty->description , array('placeholder'=>__('Beschreibung'), 'class'=>'form-control', 'rows'=>2)) }} +
+
+
+
+   + zurück zur Übersicht +
+ {!! Form::close() !!} + + + @if($homeparty->id) + {!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-user-form-validation']) !!} +
+
+
+
Lass den Gastgeber seine Daten selber ausfüllen
+
+
+ + + + +
+
+

Teile diesen Link mit dem Gastgeber (z.B. WhatsApp oder SMS), damit gelangt er auf eine Zielseite wo er seine Daten selber ausfüllen kann. Nutze das „Kopier-Symbol“, um den Link gleich in Deine Zwischenablage zu kopieren.

+
+
+
+
+
+ Gastgeber-, Rechungsadresse +
+
+ * {{trans('register.required_fields')}} + Lieferadresse +
+
+
+ @include('user.homeparty._edit') +
+
+   + zurück zur Übersicht +
+ {!! Form::close() !!} + @endif + + + + + +@endsection \ No newline at end of file diff --git a/resources/views/user/homeparty/guest_detail.blade.php b/resources/views/user/homeparty/guest_detail.blade.php new file mode 100644 index 0000000..b59a3b6 --- /dev/null +++ b/resources/views/user/homeparty/guest_detail.blade.php @@ -0,0 +1,141 @@ +@extends('layouts.layout-2') + +@section('content') +

+
{{ __('navigation.my_homeparty') }} / {{ $homeparty->name }} - {{ $homeparty->date }}
+ zurück +

+ + {!! Form::open(['url' => route('user_homeparty_guest_detail', [$homeparty->id, $homeparty_user->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-user-form-validation']) !!} +
+
+
+
Lass den @if($homeparty_user->is_host) Gastgeber @else Gast @endif seine Daten selber ausfüllen
+
+
+ + + + +
+
+

Teile diesen Link mit dem Gastgeber (z.B. WhatsApp oder SMS), damit gelangt er auf eine Zielseite wo er seine Daten selber ausfüllen kann. Nutze das „Kopier-Symbol“, um den Link gleich in Deine Zwischenablage zu kopieren.

+
+
+
+
+
+ @if($homeparty_user->is_host) Gastgeber, @else Gast-, @endif Rechungsadresse +
+
+ * {{trans('register.required_fields')}} + Lieferadresse +
+
+
+ @include('user.homeparty._edit') +
+
+   + zurück zur Übersicht +
+ {!! Form::close() !!} + + + + +@endsection \ No newline at end of file diff --git a/resources/views/user/homeparty/guests.blade.php b/resources/views/user/homeparty/guests.blade.php new file mode 100644 index 0000000..9408ca4 --- /dev/null +++ b/resources/views/user/homeparty/guests.blade.php @@ -0,0 +1,109 @@ +@extends('layouts.layout-2') + +@section('content') +

+
{{ __('navigation.my_homeparty') }} / {{ $homeparty->name }} - {{ $homeparty->date }}
+   Neue Gast anlegen +

+ +
+
+ @php($g_count = 1) + + @foreach($homeparty->homeparty_users as $homeparty_user) +
+ +
+
+
+
+ {{$homeparty->description}} +
+
+
+
+
Adresse
+
{{$homeparty_user->billing_address}} + {{$homeparty_user->billing_zipcode}} + {{$homeparty_user->city}} + @if($homeparty_user->billing_country_id){{ $homeparty_user->billing_country->getLocated() }}@endif +
+
+
+
E-Telefon
+
{{$homeparty_user->billing_phone}}
+
+
+
E-Mail
+
{{$homeparty_user->billing_email}}
+
+
+
+
+
+
+
+ + + + +
+
+
+
+ @endforeach +
+
+ zurück zur Übersicht + +@endsection \ No newline at end of file diff --git a/resources/views/user/homeparty/index.blade.php b/resources/views/user/homeparty/index.blade.php new file mode 100644 index 0000000..5bd2ae5 --- /dev/null +++ b/resources/views/user/homeparty/index.blade.php @@ -0,0 +1,79 @@ +@extends('layouts.layout-2') + +@section('content') +

+
{{ __('navigation.my_homeparty') }} / {{ __('navigation.overview') }}
+   Neue Homeparty anlegen +

+ +
+
+ + @foreach($homepartys as $homeparty) +
+
+
+ {{$homeparty->name}} + {{-- offen ... --}} +
+
+ + +
+
+
+
+
+
+ {{$homeparty->description}} +
+
+
+
+
Datum
+
{{$homeparty->date}}
+
+
+
Ort
+
{{$homeparty->place}}
+
+
+
Gäste
+
{{$homeparty->homeparty_guests->count()}}
+
+
+
Umsatz
+
0
+
+
+
Points
+
0
+
+
+
+
+ +
+ @endforeach +
+
+ +@endsection \ No newline at end of file diff --git a/resources/views/user/homeparty/self_guest_detail.blade.php b/resources/views/user/homeparty/self_guest_detail.blade.php new file mode 100644 index 0000000..189e4b4 --- /dev/null +++ b/resources/views/user/homeparty/self_guest_detail.blade.php @@ -0,0 +1,134 @@ +@extends('layouts.layout-2-without') + +@section('content') +

+
Homeparty / {{ $homeparty->name }} - {{ $homeparty->date }}
+ zurück +

+ + {!! Form::open(['url' => route('homeparty', [$homeparty_user->token]), 'class' => 'form-horizontal', 'id'=>'homeparty-user-form-validation']) !!} +
+ @if(Session::has('alert-save')) + +
+
+ {{__('saved')}}: {{__('The changes have been saved.')}} +
+
+ @endif +
+
+
Eingabe Deiner persönlichen Daten für die Homeparty
+
+
+
+
+
+ @if($homeparty_user->is_host) Gastgeber, @else Gast-, @endif Rechungsadresse +
+
+ * {{trans('register.required_fields')}} + Lieferadresse +
+
+
+ @include('user.homeparty._edit') +
+
+
+ +
+
+
+
+   +
+ {!! Form::close() !!} + + +@endsection \ No newline at end of file diff --git a/resources/views/user/order/_bak_shipping_me.blade.php b/resources/views/user/order/_bak_shipping_me.blade.php index 8fa8aed..ada4e53 100644 --- a/resources/views/user/order/_bak_shipping_me.blade.php +++ b/resources/views/user/order/_bak_shipping_me.blade.php @@ -135,8 +135,8 @@ @endif
- - {{ Form::text('shipping_lastname', $user->account->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }} + + {{ Form::text('shipping_lastname', $user->account->shipping_lastname, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }} @if ($errors->has('shipping_lastname')) {{ $errors->first('shipping_lastname') }} diff --git a/resources/views/user/order/_bak_shipping_ot.blade.php b/resources/views/user/order/_bak_shipping_ot.blade.php index 1bcdcfc..620bf93 100644 --- a/resources/views/user/order/_bak_shipping_ot.blade.php +++ b/resources/views/user/order/_bak_shipping_ot.blade.php @@ -133,8 +133,8 @@ @endif
- - {{ Form::text('shipping_lastname', $shopping_user->shipping_lastname, array('placeholder'=>__('Last Name'), 'class'=>'form-control', 'required'=>true)) }} + + {{ Form::text('shipping_lastname', $shopping_user->shipping_lastname, array('placeholder'=>__('Last name'), 'class'=>'form-control', 'required'=>true)) }} @if ($errors->has('shipping_lastname')) {{ $errors->first('shipping_lastname') }} diff --git a/resources/views/user/team/members.blade.php b/resources/views/user/team/members.blade.php index bea7a5c..6aac39a 100644 --- a/resources/views/user/team/members.blade.php +++ b/resources/views/user/team/members.blade.php @@ -33,7 +33,6 @@

Du möchtest einen neuen Berater registrieren? Super, das freut uns. Sende ihm einfach nachfolgenden Link per Mail, WhatsApp oder SMS zu. Er gelangt damit auf die Registrierungsseite von www.mivita.care. Wichtig ist, dass Du diesen Link nicht veränderst, denn die angehängte Berater-ID identifiziert Dich als Sponsor von dem neuen Berater. Nur so können Dir künftige Provisionen durch Umsätze von ihm zugeordnet werden. Nutze das „Kopier-Symbol“, um den Link gleich in Deine Zwischenablage zu kopieren. -