Homparty dev

This commit is contained in:
Kevin Adametz 2020-12-16 20:03:51 +01:00
parent 9252094a04
commit ac0d5b781e
60 changed files with 3443 additions and 293 deletions

1
.env
View file

@ -13,6 +13,7 @@ APP_URL_CHECKOUT=checkout.
APP_URL_CRM=my.
#APP_CHECKOUT_MAIL=no-reply@mivita.care
APP_CONTACT_MAIL=kevin.adametz@me.com
APP_CHECKOUT_MAIL=kevin.adametz@me.com
APP_INFO_MAIL=kevin.adametz@me.com
APP_DEFAULT_MAIL=kevin.adametz@me.com

193
.idea/workspace.xml generated
View file

@ -5,44 +5,60 @@
</component>
<component name="ChangeListManager">
<list default="true" id="2fbaac5f-25ba-4502-a970-cc14728d7d55" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/app/Http/Controllers/User/HomepartyController.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Http/Controllers/Web/HomepartyController.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/layouts/includes/layout-navbar-without.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/layouts/layout-2-without.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/_edit.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/detail.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/guest_detail.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/guests.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/index.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/self_guest_detail.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Http/Controllers/IngredientController.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Services/HomepartyCart.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/app/Services/HomepartyUserCart.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/public/js/iq-homeparty-cart.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/public/js/summernote-cleaner.js" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/ingredient/edit.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/ingredient/form.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/admin/ingredient/index.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/_address.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/modal_show_products.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/order.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/show_bonus.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/show_calc_bonus_host.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/show_products_order.blade.php" afterDir="false" />
<change afterPath="$PROJECT_DIR$/resources/views/user/homeparty/show_total_order.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.env" beforeDir="false" afterPath="$PROJECT_DIR$/.env" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.phpstorm.meta.php" beforeDir="false" afterPath="$PROJECT_DIR$/.phpstorm.meta.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/_ide_helper.php" beforeDir="false" afterPath="$PROJECT_DIR$/_ide_helper.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/_ide_helper_models.php" beforeDir="false" afterPath="$PROJECT_DIR$/_ide_helper_models.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/Logger.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/Logger.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShippingCountry.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShippingCountry.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShippingPrice.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShippingPrice.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingInstance.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingInstance.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingOrder.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingOrder.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingOrderItem.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingOrderItem.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/ShoppingUser.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/ShoppingUser.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/SySetting.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/SySetting.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/Util.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/Util.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/ModalController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/ModalController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/ProductController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/ProductController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Sys/AdminToolsController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Sys/AdminToolsController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/User/HomepartyController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/User/HomepartyController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Web/ContactController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Web/ContactController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Http/Controllers/Web/HomepartyController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Http/Controllers/Web/HomepartyController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/Homeparty.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/Homeparty.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/HomepartyUser.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/HomepartyUser.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Models/Product.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Models/Product.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Repositories/ContractPDFRepository.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Repositories/ContractPDFRepository.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Repositories/ProductRepository.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Repositories/ProductRepository.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/Services/HTMLHelper.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/Services/HTMLHelper.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/config/app.php" beforeDir="false" afterPath="$PROJECT_DIR$/config/app.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_23_163527_create_shopping_orders_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_23_163527_create_shopping_orders_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2019_02_23_163724_create_shopping_order_items_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2020_10_15_151059_create_homeparties_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2020_10_15_151059_create_homeparties_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/database/migrations/2020_10_15_151136_create_homeparty_users_table.php" beforeDir="false" afterPath="$PROJECT_DIR$/database/migrations/2020_10_15_151136_create_homeparty_users_table.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de/navigation.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/navigation.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/lang/de/validation.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/lang/de/validation.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/customer/_edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/customer/_edit.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/lead/m_data_form_edit.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/lead/m_data_form_edit.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/layouts/includes/layout-navbar.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/layouts/includes/layout-navbar.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/category/images.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/category/images.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/product/form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/product/form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/admin/site/images.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/admin/site/images.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/layouts/application.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/layouts/application.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/layouts/includes/layout-sidenav.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/layouts/includes/layout-sidenav.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/_user_form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/_user_form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/customer/add.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/customer/add.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/_bak_shipping_me.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/_bak_shipping_me.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/_bak_shipping_ot.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/_bak_shipping_ot.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/team/members.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/team/members.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/user_form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/user_form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/sys/admin/customers.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/sys/admin/customers.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/homeparty/detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/homeparty/detail.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/homeparty/guest_detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/homeparty/guest_detail.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/homeparty/guests.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/homeparty/guests.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/homeparty/index.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/homeparty/index.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/homeparty/self_guest_detail.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/homeparty/self_guest_detail.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/list.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/list.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/user/order/yard_view_form.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/user/order/yard_view_form.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/start.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/start.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/kontakt.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/kontakt.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/registrierung.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/registrierung.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/resources/views/web/templates/produkte.blade.php" beforeDir="false" afterPath="$PROJECT_DIR$/resources/views/web/templates/produkte.blade.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/routes/web.php" beforeDir="false" afterPath="$PROJECT_DIR$/routes/web.php" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -282,7 +298,7 @@
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resources/views/layouts/includes" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/resources/views/user/homeparty" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="nodejs_package_manager_path" value="npm" />
@ -291,11 +307,11 @@
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views/layouts/includes" />
<recent name="$PROJECT_DIR$/resources/views/layouts" />
<recent name="$PROJECT_DIR$/resources/views/user/homeparty" />
<recent name="$PROJECT_DIR$/app/Http/Controllers/Web" />
<recent name="$PROJECT_DIR$/app/Http/Controllers/User" />
<recent name="$PROJECT_DIR$/app/Services" />
<recent name="$PROJECT_DIR$/public/js" />
<recent name="$PROJECT_DIR$/resources/views/admin/ingredient" />
<recent name="$PROJECT_DIR$/app/Http/Controllers" />
</key>
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/resources/views/user/order" />
@ -319,6 +335,8 @@
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/bash" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<envs />
<method v="2" />
</configuration>
<configuration name="composer-post-update.sh" type="ShConfigurationType">
@ -330,6 +348,8 @@
<option name="INDEPENDENT_INTERPRETER_PATH" value="true" />
<option name="INTERPRETER_PATH" value="/bin/bash" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="EXECUTE_IN_TERMINAL" value="true" />
<envs />
<method v="2" />
</configuration>
</component>
@ -563,6 +583,24 @@
<workItem from="1602831799597" duration="12765000" />
<workItem from="1602854134928" duration="3330000" />
<workItem from="1602857574059" duration="218000" />
<workItem from="1603107642331" duration="5950000" />
<workItem from="1603264695225" duration="33000" />
<workItem from="1603272469212" duration="17000" />
<workItem from="1603730718098" duration="118000" />
<workItem from="1603985533656" duration="12738000" />
<workItem from="1604392770203" duration="27000" />
<workItem from="1604419165739" duration="43000" />
<workItem from="1604503127063" duration="71000" />
<workItem from="1604507908338" duration="28000" />
<workItem from="1604507968294" duration="8000" />
<workItem from="1604921993804" duration="1271000" />
<workItem from="1604923532802" duration="515000" />
<workItem from="1604939815128" duration="6462000" />
<workItem from="1605006776997" duration="3000" />
<workItem from="1605201129884" duration="22000" />
<workItem from="1605201310540" duration="157000" />
<workItem from="1605599347354" duration="281000" />
<workItem from="1608113166691" duration="26240000" />
</task>
<servers />
</component>
@ -590,87 +628,4 @@
</option>
<option name="oldMeFiltersMigrated" value="true" />
</component>
<component name="WindowStateProjectService">
<state x="855" y="380" key="#Plugins" timestamp="1595923800434">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="855" y="380" key="#Plugins/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1595923800434" />
<state x="688" y="23" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog" timestamp="1596113300502">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="688" y="23" key="#com.intellij.refactoring.rename.AutomaticRenamingDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1596113300502" />
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog" timestamp="1602776251284">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1598026016588" />
<state x="1019" y="499" key="#com.jetbrains.php.actions.copyPaste.importReferences.PhpImportReferencesDialog/-2560.23.2560.1417/2560.-555.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1602776251284" />
<state width="2421" height="408" key="GridCell.Tab.0.bottom" timestamp="1595683782568">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="408" key="GridCell.Tab.0.bottom/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782568" />
<state width="2421" height="408" key="GridCell.Tab.0.center" timestamp="1595683782567">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="408" key="GridCell.Tab.0.center/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782567" />
<state width="2421" height="408" key="GridCell.Tab.0.left" timestamp="1595683782567">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="408" key="GridCell.Tab.0.left/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782567" />
<state width="2421" height="408" key="GridCell.Tab.0.right" timestamp="1595683782568">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="408" key="GridCell.Tab.0.right/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782568" />
<state width="2421" height="501" key="GridCell.Tab.1.bottom" timestamp="1595683782557">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="501" key="GridCell.Tab.1.bottom/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782557" />
<state width="2421" height="501" key="GridCell.Tab.1.center" timestamp="1595683782557">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="501" key="GridCell.Tab.1.center/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782557" />
<state width="2421" height="501" key="GridCell.Tab.1.left" timestamp="1595683782557">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="501" key="GridCell.Tab.1.left/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782557" />
<state width="2421" height="501" key="GridCell.Tab.1.right" timestamp="1595683782557">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="2421" height="501" key="GridCell.Tab.1.right/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1595683782557" />
<state x="758" y="370" key="SettingsEditor" timestamp="1596269067229">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="758" y="370" key="SettingsEditor/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1596269067229" />
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2" timestamp="1598257732352">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1597415323689" />
<state x="1064" y="650" key="com.intellij.openapi.vcs.update.UpdateOrStatusOptionsDialogupdate-v2/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1598257732352" />
<state x="922" y="544" width="1497" height="794" key="find.popup" timestamp="1602856358779">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="531" y="536" width="1497" height="794" key="find.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1598972717568" />
<state x="922" y="544" width="1497" height="794" key="find.popup/-2560.23.2560.1417/2560.-555.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1602856358779" />
<state x="863" y="438" width="1115" height="793" key="find.popup/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1598284238338" />
<state width="600" height="428" key="javadoc.popup" timestamp="1594733832314">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state width="600" height="428" key="javadoc.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1594733832314" />
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup" timestamp="1602844590465">
<screen x="0" y="23" width="2560" height="1417" />
</state>
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup/-2560.23.2560.1417/2560.-527.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1596888361783" />
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup/-2560.23.2560.1417/2560.-555.1440.2537/0.23.2560.1417@0.23.2560.1417" timestamp="1602844590465" />
<state x="945" y="377" width="670" height="676" key="search.everywhere.popup/2560.-527.1440.2537/-2560.23.2560.1417/0.23.2560.1417@0.23.2560.1417" timestamp="1598268751822" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="php">
<url>file://$PROJECT_DIR$/resources/views/admin/category/images.blade.php</url>
<line>15</line>
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
</component>
</project>

View file

@ -5,7 +5,7 @@ namespace PHPSTORM_META {
/**
* PhpStorm Meta file, to provide autocomplete information for PhpStorm
* Generated on 2020-10-16 09:06:15.
* Generated on 2020-11-09 18:07:58.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper

View file

@ -3,7 +3,7 @@
/**
* A helper file for Laravel, to provide autocomplete information to your IDE
* Generated for Laravel 6.18.14 on 2020-10-16 09:06:13.
* Generated for Laravel 6.18.14 on 2020-11-09 18:07:56.
*
* This file should not be included in your code, only analyzed by your IDE!
*

View file

@ -295,6 +295,7 @@ namespace App\Models{
* @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 \Eloquent {}
}
@ -452,6 +453,7 @@ namespace App\Models{
* @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()
* @mixin \Eloquent
*/
class HomepartyUser extends \Eloquent {}
}
@ -990,6 +992,50 @@ namespace App\Models{
class UserMessage extends \Eloquent {}
}
namespace App\Models{
/**
* Class HomepartyUserOrderItem
*
* @property int $id
* @property int $homeparty_id
* @property int $homeparty_user_id
* @property int $product_id
* @property int $qty
* @property float $price
* @property float $price_net
* @property float $tax_rate
* @property int $points
* @property float $margin
* @property float $ek-price
* @property string $slug
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Homeparty $homeparty
* @property HomepartyUser $homeparty_user
* @property Product $product
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereEkPrice($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereHomepartyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereHomepartyUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereMargin($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem wherePoints($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem wherePrice($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem wherePriceNet($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereProductId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereQty($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereTaxRate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereUpdatedAt($value)
* @mixin \Eloquent
*/
class HomepartyUserOrderItem extends \Eloquent {}
}
namespace App\Models{
/**
* App\Models\ShoppingPayment
@ -1072,6 +1118,13 @@ namespace App\Models{
* @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)
* @mixin \Eloquent
* @property string|null $token
* @property bool|null $token_active
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\HomepartyUser[] $homeparty_guests
* @property-read int|null $homeparty_guests_count
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereToken($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereTokenActive($value)
*/
class Homeparty extends \Eloquent {}
}
@ -1259,6 +1312,7 @@ namespace App\Models{
* @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 \Eloquent {}
}

View file

@ -0,0 +1,78 @@
<?php
namespace App\Http\Controllers;
use App\Models\Category;
use App\Models\Ingredient;
use App\Models\IqImage;
use App\Models\ProductCategory;
use App\Models\ProductIngredient;
use\Request;
class IngredientController extends Controller
{
public function __construct()
{
$this->middleware('admin');
}
public function index()
{
$data = [
'values' => Ingredient::all(),
];
return view('admin.ingredient.index', $data);
}
public function edit($id)
{
if($id === "new"){
$model = new Ingredient();
$model->active = true;
}else{
$model = Ingredient::findOrFail($id);
}
$data = [
'model' => $model,
//'trans' => array_keys(config('localization.supportedLocales')),
];
return view('admin.ingredient.edit', $data);
}
public function store()
{
$data = Request::all();
$data['active'] = isset($data['active']) ? true : false;
if($data['id'] === "new"){
$model = Ingredient::create($data);
}else{
$model = Ingredient::find($data['id']);
$model->fill($data)->save();
}
\Session()->flash('alert-save', '1');
return redirect(route('admin_product_ingredients'));
}
public function delete($id){
if(ProductIngredient::where('ingredient_id', $id)->count()) {
\Session()->flash('alert-error', 'Eintrag wird als Produkt-Inhaltsstoff verwendet');
return redirect(route('admin_product_ingredients'));
}
$model = Ingredient::findOrFail($id);
$model->delete();
\Session()->flash('alert-success', 'Eintrag gelöscht');
return redirect(route('admin_product_ingredients'));
}
}

View file

@ -2,6 +2,8 @@
namespace App\Http\Controllers;
use App\Models\Homeparty;
use App\Models\HomepartyUser;
use App\Models\Product;
use App\Models\ShoppingOrder;
use App\Models\ShoppingUser;
@ -61,6 +63,14 @@ class ModalController extends Controller
}
if($data['action'] === 'homeparty-add-product') {
$homeparty = Homeparty::find($data['id']);
$homeparty_user = HomepartyUser::find($data['user_id']);
$data['homeparty'] = $homeparty;
$ret = view("user.homeparty.modal_show_products", compact( 'data', 'homeparty', 'homeparty_user'))->render();
}

View file

@ -5,6 +5,7 @@ namespace App\Http\Controllers;
use App\Models\Country;
use App\Models\Product;
use App\Models\ProductImage;
use App\Models\ProductIngredient;
use App\Repositories\ProductRepository;
use Request;
use Validator;
@ -102,11 +103,25 @@ class ProductController extends Controller
return redirect(route('admin_product_show'));
}
public function delete($id){
$model = Product::findOrFail($id);
$model->delete();
\Session()->flash('alert-success', 'Eintrag gelöscht');
return redirect(route('admin_product_show'));
public function delete($id, $do = 'product', $did = null){
if($do === 'product'){
$model = Product::findOrFail($id);
$model->delete();
\Session()->flash('alert-success', 'Eintrag gelöscht');
return redirect(route('admin_product_show'));
}
if($do === 'ingredient'){
$model = Product::findOrFail($id);
$ProductIngredient = ProductIngredient::where('ingredient_id', $did)->where('product_id', $model->id)->first();
if($ProductIngredient){
$ProductIngredient->delete();
\Session()->flash('alert-success', 'Eintrag gelöscht');
return redirect(route('admin_product_edit', [$model->id]));
}
}
}

View file

@ -10,6 +10,7 @@ use App\Mail\MailInfo;
use App\Models\PaymentMethod;
use App\Models\ShoppingUser;
use App\Models\UserShop;
use App\Repositories\ContractPDFRepository;
use App\Services\CustomerPriority;
use App\Services\Shop;
use App\User;
@ -64,6 +65,22 @@ class AdminToolsController extends Controller
if($data['action'] === 'checkForAll'){
$shopping_users = CustomerPriority::checkForAll();
}
if($data['action'] === 'checkContractPDF'){
//create PDF
$user = User::findOrFail(80);
$pdf = new ContractPDFRepository($user);
$pdf->_set('disk', 'user');
$pdf->_set('dir', '/'.$user->id.'/documents/');
$pdf->_set('user_id', $user->id);
$pdf->_set('identifier', 'contract');
$pdf->createContractPDF();
}
if(strpos($data['action'], 'checkOne_') !== false){
$id = (int) str_replace('checkOne_', '', $data['action']);
$shopping_user = ShoppingUser::findOrFail($id);

View file

@ -5,6 +5,7 @@ namespace App\Http\Controllers\User;
use App\Http\Controllers\Controller;
use App\Models\Homeparty;
use App\Models\HomepartyUser;
use App\Models\HomepartyUserOrderItem;
use App\Models\Product;
use App\Models\ShippingCountry;
use App\Models\ShoppingInstance;
@ -12,6 +13,7 @@ use App\Models\ShoppingOrder;
use App\Models\ShoppingUser;
use App\Models\UserHistory;
use App\Models\UserShop;
use App\Services\HomepartyCart;
use App\Services\Payment;
use App\Services\Util;
use App\User;
@ -92,6 +94,7 @@ class HomepartyController extends Controller
]);
}
}
$validator = Validator::make(Request::all(), $rules);
if ($validator->fails()) {
return back()->withErrors($validator)->withInput(Request::all());
@ -100,15 +103,17 @@ class HomepartyController extends Controller
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() );
} while( Homeparty::where('token', $token)->count() );
$data['token'] = $token;
$data['auth_user_id'] = \Auth::user()->id;
$homeparty = Homeparty::create($data);
$homeparty_user = HomepartyUser::create([
'homeparty_id' => $homeparty->id,
'auth_user_id' => \Auth::user()->id,
'is_host' => true,
'token' => $token,
]);
}else {
$homeparty = $this->getHomparty($id);
@ -143,15 +148,7 @@ class HomepartyController extends Controller
{
$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,
]);
$homeparty_user = new HomepartyUser();
}else{
$homeparty_user = HomepartyUser::findOrFail($gid);
if($homeparty->id !== $homeparty_user->homeparty_id){
@ -194,7 +191,15 @@ class HomepartyController extends Controller
}
$homeparty = $this->getHomparty($id);
$homeparty_user = HomepartyUser::findOrFail($gid);
if($gid === null){
$homeparty_user = HomepartyUser::create([
'homeparty_id' => $homeparty->id,
'auth_user_id' => \Auth::user()->id,
'is_host' => false,
]);
}else{
$homeparty_user = HomepartyUser::findOrFail($gid);
}
if($homeparty->id !== $homeparty_user->homeparty_id){
abort(404);
}
@ -209,20 +214,121 @@ class HomepartyController extends Controller
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();
HomepartyCart::calculateHomeparty($homeparty);
$data = [
'shopping_order' => $shopping_order,
'isAdmin' => false,
'homeparty' => $homeparty,
];
return view('user.order.detail', $data);*/
return view('user.homeparty.order', $data);
}
//perform Request
public function orderStore($id = null)
{
$homeparty = $this->getHomparty($id);
if(Request::ajax()) {
$data = Request::all();
if($data['action'] === 'addProduct') {
if($data['homeparty_id'] == $homeparty->id){
$homeparty_user = HomepartyUser::findOrFail($data['homeparty_user_id']);
if($homeparty_user->homeparty_id !== $homeparty->id){
abort(404);
}
if($product = Product::find($data['product_id'])){
$margin = 0;
if(\Auth::user() && \Auth::user()->user_level){
$margin = \Auth::user()->user_level->margin;
}
$HomepartyUserOrderItem = HomepartyUserOrderItem::where('homeparty_user_id', $homeparty_user->id)->where('product_id', $product->id)->first();
if($HomepartyUserOrderItem){
$HomepartyUserOrderItem->qty = $HomepartyUserOrderItem->qty+1;
$HomepartyUserOrderItem->save();
}else{
$HomepartyUserOrderItem = HomepartyUserOrderItem::create([
'homeparty_id' => $homeparty->id,
'homeparty_user_id' => $homeparty_user->id,
'product_id' => $product->id,
'qty' => 1,
'price' => $product->price,
'price_net' => $product->getPriceWith(true, false),
'tax_rate' => $product->tax,
'points' => $product->points,
'margin' => $margin,
'ek-price' => $product->getPriceWith(false, true),
'slug' => $product->slug
]);
}
}
}
$homeparty_user = HomepartyUser::findOrFail($data['homeparty_user_id']);
HomepartyCart::calculateHomeparty($homeparty);
$html_user_cart = view("user.homeparty.show_products_order", ['homeparty_guest' => $homeparty_user])->render();
$html_bonus = view("user.homeparty.show_bonus", ['homeparty' => $homeparty])->render();
$html_host_bonus = view("user.homeparty.show_calc_bonus_host")->render();
$html_total = view("user.homeparty.show_total_order", ['homeparty' => $homeparty])->render();
return response()->json(['response' => true, 'data'=>$data, 'html_user_cart'=>$html_user_cart, 'html_bonus'=>$html_bonus, 'html_host_bonus'=>$html_host_bonus, 'html_total'=>$html_total]);
}
if($data['action'] === 'updateCart') {
if($data['homeparty_id'] == $homeparty->id){
$homeparty_user = HomepartyUser::findOrFail($data['homeparty_user_id']);
if($homeparty_user->homeparty_id !== $homeparty->id){
abort(404);
}
if(isset($data['product_id']) && $product = Product::find($data['product_id'])){
if(isset($data['order_item_id']) && $HomepartyUserOrderItem = HomepartyUserOrderItem::find($data['order_item_id'])){
if(isset($data['qty'])){
$qty = (int) $data['qty'];
$qty = $qty < 1 ? 1 : $qty;
$qty = $qty > 100 ? 100 : $qty;
$HomepartyUserOrderItem->qty = $qty;
$HomepartyUserOrderItem->save();
}
}
}
}
$homeparty_user = HomepartyUser::findOrFail($data['homeparty_user_id']);
HomepartyCart::calculateHomeparty($homeparty);
$html_user_cart = view("user.homeparty.show_products_order", ['homeparty_guest' => $homeparty_user])->render();
$html_bonus = view("user.homeparty.show_bonus", ['homeparty' => $homeparty])->render();
$html_host_bonus = view("user.homeparty.show_calc_bonus_host")->render();
$html_total = view("user.homeparty.show_total_order", ['homeparty' => $homeparty])->render();
return response()->json(['response' => true, 'data'=>$data, 'html_user_cart'=>$html_user_cart, 'html_bonus'=>$html_bonus, 'html_host_bonus'=>$html_host_bonus, 'html_total'=>$html_total]);
}
if($data['action'] === 'removeFromCart') {
if($data['homeparty_id'] == $homeparty->id){
$homeparty_user = HomepartyUser::findOrFail($data['homeparty_user_id']);
if($homeparty_user->homeparty_id !== $homeparty->id){
abort(404);
}
if(isset($data['product_id']) && $product = Product::find($data['product_id'])){
if(isset($data['order_item_id']) && $HomepartyUserOrderItem = HomepartyUserOrderItem::find($data['order_item_id'])){
$HomepartyUserOrderItem->delete();
}
}
}
$homeparty_user = HomepartyUser::findOrFail($data['homeparty_user_id']);
HomepartyCart::calculateHomeparty($homeparty);
$html_user_cart = view("user.homeparty.show_products_order", ['homeparty_guest' => $homeparty_user])->render();
$html_bonus = view("user.homeparty.show_bonus", ['homeparty' => $homeparty])->render();
$html_host_bonus = view("user.homeparty.show_calc_bonus_host")->render();
$html_total = view("user.homeparty.show_total_order", ['homeparty' => $homeparty])->render();
return response()->json(['response' => true, 'data'=>$data, 'html_user_cart'=>$html_user_cart, 'html_bonus'=>$html_bonus, 'html_host_bonus'=>$html_host_bonus, 'html_total'=>$html_total]);
}
return response()->json(['response' => false, 'data'=>$data]);
}
/* $data = [
'homeparty' => $homeparty,
];
return view('user.homeparty.order', $data);*/
}
public function delete($do, $id = null, $gid=null)
{
@ -233,7 +339,6 @@ class HomepartyController extends Controller
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");
@ -246,7 +351,6 @@ class HomepartyController extends Controller
if ($homeparty->id !== $homeparty_user->homeparty_id) {
abort(404);
}
$homeparty_user->token = null;
$homeparty_user->save();
$homeparty_user->delete();
}
@ -266,4 +370,56 @@ class HomepartyController extends Controller
return $homeparty;
}
public function datatable(){
$query = Product::select('products.*')->where('active', true)->where(function ($q) {
$q->where('show_at', '=', 0)
->orWhere('show_at', '=', 1);
});
return \DataTables::eloquent($query)
->addColumn('add_card', function (Product $product) {
return '<button type="button" class="btn btn-sm btn-md-extra btn-secondary add-product-basket" data-product-id="'.$product->id.'">
<strong>&euro; '.$product->getFormattedPriceWith(false, false).'</strong>&nbsp; +<span class="ion ion-md-cart"></span>
</button>';
})
->addColumn('picture', function (Product $product) {
if(count($product->images)){
return '<img class="img-fluid img-extra" alt="" src="'.route('product_image', [$product->images->first()->slug]).'">';
}
return "";
})
->addColumn('price_net', function (Product $product) {
return $product->getFormattedPriceWith(true, true). "";
})
->addColumn('price_gross', function (Product $product) {
return $product->getFormattedPriceWith(false, true). "";
})
->addColumn('price_vk_gross', function (Product $product) {
return $product->getFormattedPriceWith(false, false). "";
})
->addColumn('action', function (Product $product) {
return '<button class="btn btn-default btn-sm icon-btn md-btn-flat product-tooltip" title="details" data-modal="modal-lg"
data-toggle="modal" data-target="#modals-load-content" data-id="'.$product->id.'" data-route="'.route('modal_load').'"
data-action="user-order-show-product" data-view="customer"><i class="ion ion-md-eye"></i></button>';
})
->filterColumn('product', function($query, $keyword) {
if($keyword != ""){
$query->where('name', 'LIKE', '%'.$keyword.'%');
}
})
->orderColumn('name', 'name $1')
->orderColumn('product', 'name $1')
->orderColumn('number', 'number $1')
->orderColumn('points', 'points $1')
->orderColumn('price_net', 'price_net $1')
->orderColumn('price_gross', 'price_gross $1')
->orderColumn('price_vk_gross', 'price $1')
->orderColumn('contents_total', 'contents_total $1')
->orderColumn('weight', 'weight $1')
->rawColumns(['add_card', 'product', 'quantity', 'picture', 'action'])
->make(true);
}
}

View file

@ -82,7 +82,7 @@ class ContactController extends Controller
}
$checkout_mail = config('app.checkout_mail');
$checkout_mail = config('app.contact_mail');
if($user_shop){
Mail::to($contact['email'])->bcc([$user_shop->user->email, $checkout_mail])->send(new MailContact($contact));
}else{

View file

@ -26,19 +26,31 @@ class HomepartyController extends Controller
}
public function detail($token = null)
public function detail($token = null, $gid = null)
{
if(!$token){
abort(404);
}
$homeparty_user = HomepartyUser::where('token', $token)->where('token_active', true)->first();
if(!$homeparty_user){
$homeparty = Homeparty::where('token', $token)->where('token_active', true)->first();
if(!$homeparty){
abort(403, 'Link für die Homeparty wurde nicht gefunden, oder ist nicht mehr aktiv.');
}
$homeparty_user = null;
if($gid){
if($gid === 'new'){
$homeparty_user = new HomepartyUser();
}else{
$homeparty_user = HomepartyUser::find($gid);
if(!$homeparty_user || $homeparty_user->homeparty_id !== $homeparty->id){
abort(403, 'Link für die Homeparty wurde nicht gefunden, oder ist nicht mehr aktiv.');
}
}
}
$data = [
'homeparty' => $homeparty_user->homeparty,
'homeparty' => $homeparty,
'homeparty_user' => $homeparty_user,
];
@ -46,21 +58,33 @@ class HomepartyController extends Controller
}
public function detailStore($token = null)
public function detailStore($token = null, $gid = null)
{
if(!$token){
abort(404);
}
$homeparty_user = HomepartyUser::where('token', $token)->where('token_active', true)->first();
$homeparty = Homeparty::where('token', $token)->where('token_active', true)->first();
if(!$homeparty){
abort(403, 'Link für die Homeparty wurde nicht gefunden, oder ist nicht mehr aktiv.');
}
if($gid === null){
$homeparty_user = HomepartyUser::create([
'homeparty_id' => $homeparty->id,
'auth_user_id' => $homeparty->auth_user_id,
'is_host' => false,
]);
}else{
$homeparty_user = HomepartyUser::find($gid);
if(!$homeparty_user || $homeparty_user->homeparty_id !== $homeparty->id){
abort(403, 'Link für die Homeparty wurde nicht gefunden, oder ist nicht mehr aktiv.');
}
}
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',

View file

@ -51,6 +51,12 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $token
* @property bool|null $token_active
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\HomepartyUser[] $homeparty_guests
* @property-read int|null $homeparty_guests_count
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereToken($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Homeparty whereTokenActive($value)
*/
class Homeparty extends Model
{
@ -62,13 +68,18 @@ class Homeparty extends Model
'status' => 'int',
'order_to' => 'bool',
'active' => 'bool',
'default' => 'bool'
'default' => 'bool',
'token_active' => 'bool'
];
protected $dates = [
'date'
];
protected $hidden = [
'token'
];
protected $fillable = [
'auth_user_id',
'date',
@ -80,7 +91,9 @@ class Homeparty extends Model
'status',
'order_to',
'active',
'default'
'default',
'token',
'token_active',
];
public function auth_user()
@ -116,5 +129,9 @@ class Homeparty extends Model
{
$this->attributes['date'] = isset($value) ? (new Carbon($value))->format('Y-m-d') : NULL;
}
public function getTokenLink(){
return url('homeparty/'.$this->token);
}
}

View file

@ -6,6 +6,7 @@
namespace App\Models;
use App\Services\HomepartyUserCart;
use App\User;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
@ -102,10 +103,15 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Query\Builder|\App\Models\HomepartyUser withTrashed()
* @method static \Illuminate\Database\Query\Builder|\App\Models\HomepartyUser withoutTrashed()
* @mixin \Eloquent
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\HomepartyUserOrderItem[] $homeparty_user_order_items
* @property-read int|null $homeparty_user_order_items_count
*/
class HomepartyUser extends Model
{
use SoftDeletes;
protected $userCart = null;
protected $table = 'homeparty_users';
protected $casts = [
@ -117,16 +123,12 @@ class HomepartyUser extends Model
'shipping_country_id' => 'int',
'has_buyed' => 'bool',
'subscribed' => 'bool',
'token_active' => 'bool'
];
protected $dates = [
'user_deleted_at'
];
protected $hidden = [
'token'
];
protected $fillable = [
'homeparty_id',
@ -157,8 +159,6 @@ class HomepartyUser extends Model
'shipping_email',
'has_buyed',
'subscribed',
'token',
'token_active',
'notice',
'mode',
'user_deleted_at'
@ -184,9 +184,15 @@ class HomepartyUser extends Model
return $this->belongsTo('App\Models\Country','shipping_country_id');
}
public function getTokenLink(){
return url('homeparty/'.$this->token);
public function homeparty_user_order_items(){
return $this->hasMany('App\Models\HomepartyUserOrderItem','homeparty_user_id');
}
public function isAddress(){
if($this->billing_firstname !== null){
return true;
}
return false;
}
}

View file

@ -0,0 +1,174 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class HomepartyUserOrderItem
*
* @property int $id
* @property int $homeparty_id
* @property int $homeparty_user_id
* @property int $product_id
* @property int $qty
* @property float $price
* @property float $price_net
* @property float $tax_rate
* @property int $points
* @property float $margin
* @property float $ek-price
* @property string $slug
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Homeparty $homeparty
* @property HomepartyUser $homeparty_user
* @property Product $product
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereEkPrice($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereHomepartyId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereHomepartyUserId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereMargin($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem wherePoints($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem wherePrice($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem wherePriceNet($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereProductId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereQty($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereTaxRate($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\HomepartyUserOrderItem whereUpdatedAt($value)
* @mixin \Eloquent
*/
class HomepartyUserOrderItem extends Model
{
protected $table = 'homeparty_user_order_items';
protected $casts = [
'homeparty_id' => 'int',
'homeparty_user_id' => 'int',
'product_id' => 'int',
'qty' => 'int',
'price' => 'float',
'price_net' => 'float',
'tax_rate' => 'float',
'points' => 'int',
'margin' => 'float',
'ek-price' => 'float'
];
protected $fillable = [
'homeparty_id',
'homeparty_user_id',
'product_id',
'qty',
'price',
'price_net',
'tax_rate',
'points',
'margin',
'ek-price',
'slug'
];
public function homeparty()
{
return $this->belongsTo(Homeparty::class);
}
public function homeparty_user()
{
return $this->belongsTo(HomepartyUser::class);
}
public function product()
{
return $this->belongsTo(Product::class);
}
public function getFormattedPrice()
{
return formatNumber($this->attributes['price']);
}
public function getFormattedTotalPrice()
{
return formatNumber($this->attributes['price'] * $this->attributes['qty']);
}
public function getFormattedPriceNet()
{
return formatNumber($this->attributes['price_net']);
}
public function getFormattedTotalPriceNet()
{
return formatNumber($this->attributes['price_net'] * $this->attributes['qty']);
}
public function getFormattedEKPrice()
{
return formatNumber($this->attributes['ek-price']);
}
public function getFormattedTotalEKPrice()
{
return formatNumber($this->attributes['ek-price'] * $this->attributes['qty']);
}
public function getFormattedIncomePrice()
{
return formatNumber($this->attributes['price'] - $this->attributes['ek-price']);
}
public function getFormattedTotalIncomePrice()
{
return formatNumber(($this->attributes['price'] - $this->attributes['ek-price']) * $this->attributes['qty']);
}
public function getFormattedTotalPoints()
{
return formatNumber($this->attributes['points'] * $this->attributes['qty'], 0);
}
public function getTotalPrice()
{
return (float) ($this->attributes['price'] * $this->attributes['qty']);
}
public function getTotalPoints()
{
return ($this->attributes['points'] * $this->attributes['qty']);
}
public function geTotalPriceNet()
{
return (float) ($this->attributes['price_net'] * $this->attributes['qty']);
}
public function geTotalEKPrice()
{
return (float) ($this->attributes['ek-price'] * $this->attributes['qty']);
}
public function getIncomePrice()
{
return (float) ($this->attributes['price'] - $this->attributes['ek-price']);
}
public function geTotalIncomePrice()
{
return (float) (($this->attributes['price'] - $this->attributes['ek-price']) * $this->attributes['qty']);
}
}

80
app/Models/Ingredient.php Normal file
View file

@ -0,0 +1,80 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class Ingredient
*
* @property int $id
* @property string $name
* @property string $trans_name
* @property string $inci
* @property string $trans_inci
* @property string $effect
* @property string $trans_effect
* @property bool $active
* @property int $pos
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Collection|Product[] $products
* @package App\Models
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProductIngredient[] $product_ingredients
* @property-read int|null $product_ingredients_count
* @property-read int|null $products_count
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereEffect($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereInci($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereTransEffect($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereTransInci($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereTransName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Ingredient whereUpdatedAt($value)
* @mixin \Eloquent
*/
class Ingredient extends Model
{
protected $table = 'ingredients';
protected $casts = [
'active' => 'bool',
'pos' => 'int'
];
protected $fillable = [
'name',
'trans_name',
'inci',
'trans_inci',
'effect',
'trans_effect',
'active',
'pos'
];
public function products()
{
return $this->belongsToMany(Product::class, 'product_ingredients')
->withPivot('id')
->withTimestamps();
}
public function product_ingredients()
{
return $this->hasMany(ProductIngredient::class, 'product_ingredients', 'id');
}
}

View file

@ -105,6 +105,9 @@ use Illuminate\Database\Eloquent\SoftDeletes;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Product whereWpNumber($value)
* @property bool|null $shipping_addon
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Product whereShippingAddon($value)
* @property-read int|null $ingredients_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\ProductIngredient[] $product_ingredients
* @property-read int|null $product_ingredients_count
*/
class Product extends Model
{
@ -230,6 +233,20 @@ class Product extends Model
return $this->hasMany(CountryPrice::class, 'product_id');
}
public function p_ingredients()
{
return $this->belongsToMany(Ingredient::class, 'product_ingredients')
->withPivot('id')
->withTimestamps();
}
public function product_ingredients()
{
return $this->hasMany(ProductIngredient::class, 'product_ingredients', 'id');
}
public function getActionName($id = 0){
if(isset($this->actions[$id])){
return $this->actions[$id];

View file

@ -0,0 +1,56 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class ProductIngredient
*
* @property int $id
* @property int $product_id
* @property int $ingredient_id
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Ingredient $ingredient
* @property Product $product
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereIngredientId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereProductId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\ProductIngredient whereUpdatedAt($value)
* @mixin \Eloquent
*/
class ProductIngredient extends Model
{
protected $table = 'product_ingredients';
protected $casts = [
'product_id' => 'int',
'ingredient_id' => 'int'
];
protected $fillable = [
'product_id',
'ingredient_id'
];
public function ingredient()
{
return $this->belongsTo(Ingredient::class, 'ingredient_id');
}
public function product()
{
return $this->belongsTo(Product::class, 'product_id');
}
}

View file

@ -34,6 +34,10 @@ class ContractPDFRepository extends BaseRepository {
$this->{$name} = $value;
}
private function convert($str){
return iconv('UTF-8', 'windows-1252', $str);
}
public function createContractPDF() {
$pdf = new ContractPDF();
@ -47,56 +51,58 @@ class ContractPDFRepository extends BaseRepository {
$y = 70;
$nl = 17.5;
$pdf->SetXY($x1, $y);
$pdf->Write(0, $this->model->account->m_account);
$pdf->Write(0, $this->convert($this->model->account->m_account));
$pdf->SetXY($x2, $y);
$pdf->Write(0, now()->format("d.m.Y"));
$y += $nl;
$pdf->SetXY($x1, $y);
$pdf->Write(0, $this->model->account->company);
$pdf->Write(0, $this->convert($this->model->account->company));
$pdf->SetXY($x2, $y);
$pre = $this->model->account->pre_phone_id != "" ? $this->model->account->pre_phone->phone." " : "";
$pdf->Write(0, $pre.$this->model->account->phone);
$pre = $this->model->account->pre_phone_id != "" ? $this->convert($this->model->account->pre_phone->phone)." " : "";
$pdf->Write(0, $pre.$this->convert($this->model->account->phone));
$y += $nl;
$pdf->SetXY($x1, $y);
$pdf->Write(0, $this->model->account->m_first_name);
$pdf->Write(0, $this->convert($this->model->account->m_first_name));
$pdf->SetXY($x2, $y);
$pre = $this->model->account->pre_mobil_id != "" ? $this->model->account->pre_mobil->phone." " : "";
$pdf->Write(0, $pre.$this->model->account->mobil);
$pre = $this->model->account->pre_mobil_id != "" ? $this->convert($this->model->account->pre_mobil->phone)." " : "";
$pdf->Write(0, $pre.$this->convert($this->model->account->mobil));
$y += $nl;
$pdf->SetXY($x1, $y);
$pdf->Write(0, $this->model->account->m_last_name);
$pdf->Write(0, $this->convert($this->model->account->m_last_name));
$pdf->SetXY($x2, $y);
$pdf->Write(0, $this->model->email);
$pdf->Write(0, $this->convert($this->model->email));
$y += $nl;
$pdf->SetXY($x1, $y);
$pdf->Write(0, $this->model->account->address);
$pdf->Write(0, $this->convert($this->model->account->address));
$pdf->SetXY($x2, $y);
$pdf->Write(0, $this->model->account->birthday);
$pdf->Write(0, $this->convert($this->model->account->birthday));
$y += $nl;
$pdf->SetXY($x1, $y);
$pdf->Write(0, $this->model->account->zipcode." ".$this->model->account->city);
$pdf->Write(0, $this->convert($this->model->account->zipcode)." ".$this->convert($this->model->account->city));
$y += $nl;
$pdf->SetXY($x1, $y);
$pre = $this->model->account->country_id ? $this->model->account->country->de." " : "";
$pre = $this->model->account->country_id ? $this->convert($this->model->account->country->de)." " : "";
$pdf->Write(0, $pre);
if($this->model->m_sponsor){
$y += 48;
$pdf->SetXY($x1, $y);
$pdf->Write(0, $this->model->user_sponsor->account->company);
$pdf->Write(0, $this->convert($this->model->user_sponsor->account->company));
$pdf->SetXY($x2, $y);
$pdf->Write(0, $this->model->user_sponsor->account->m_account);
$pdf->Write(0, $this->convert($this->model->user_sponsor->account->m_account));
$y += $nl;
$pdf->SetXY($x1, $y);
$pdf->Write(0, $this->model->user_sponsor->account->m_first_name." ".$this->model->user_sponsor->account->m_last_name);
$pdf->Write(0, $this->convert($this->model->user_sponsor->account->m_first_name)." ".$this->convert($this->model->user_sponsor->account->m_last_name));
$website = $this->model->user_sponsor->shop()->count() ? $this->model->user_sponsor->shop->getSubdomain(false) : "www.mivita.care";
@ -112,9 +118,9 @@ class ContractPDFRepository extends BaseRepository {
$pdf->SetXY($x1, 65);
$pdf->Write(0, $this->model->account->m_first_name." ".$this->model->account->m_last_name);
$pdf->Write(0, $this->convert($this->model->account->m_first_name)." ".$this->convert($this->model->account->m_last_name));
$pdf->SetXY($x2, 65);
$pdf->Write(0, $this->model->account->m_account);
$pdf->Write(0, $this->convert($this->model->account->m_account));
$pdf->AddPage('P', array(210, 297));

View file

@ -9,6 +9,7 @@ use App\Models\Product;
use App\Models\ProductAttribute;
use App\Models\ProductCategory;
use App\Models\ProductImage;
use App\Models\ProductIngredient;
class ProductRepository extends BaseRepository {
@ -40,12 +41,32 @@ class ProductRepository extends BaseRepository {
$this->updateCategories(isset($data['categories']) ? $data['categories'] : array());
$this->updateAttributes(isset($data['attributes']) ? $data['attributes'] : array());
$this->updateIngredients(isset($data['product_ingredients']) ? $data['product_ingredients'] : array());
$this->updateCountryPrices($data);
return $this->model;
}
public function updateIngredients($data = array())
{
$ProductIngredient = $this->model->p_ingredients()->pluck('ingredient_id')->toArray();
//set attr
if(is_array($data)){
foreach ($data as $id) {
//not use
if(!in_array($id, $ProductIngredient)){
ProductIngredient::create([
'product_id' => $this->model->id,
'ingredient_id' => $id,
]);
}
}
}
return true;
}
public function updateCategories($data = array())
{
foreach ($this->model->categories as $category) {

View file

@ -4,6 +4,7 @@ namespace App\Services;
use App\Models\Attribute;
use App\Models\Category;
use App\Models\Country;
use App\Models\Ingredient;
use App\Models\Product;
use App\Models\ShippingCountry;
use App\Models\ShoppingUser;
@ -146,6 +147,18 @@ class HTMLHelper
return $ret;
}
public static function getProductIngredientsOptions($has_ids = array(), $all = true){
$values = Ingredient::where('active', 1)->get();
$ret = "";
$attr = "";
foreach ($values as $value){
if(!in_array($value->id, $has_ids)){
$ret .= '<option value="'.$value->id.'" '.$attr.'>'.$value->name.'</option>\n';
}
}
return $ret;
}
public static function getAttributesOptions($ids = array(), $all = true){
$values = Attribute::where('active', 1)->get();
$ret = "";

View file

@ -0,0 +1,552 @@
<?php
namespace App\Services;
use App\Models\Homeparty;
class HomepartyCart
{
/*private $shipping_price = 0;
private $shipping_price_net = 0;
private $shipping_tax_rate = 0;
private $shipping_tax = 0;
private $shipping_country_id = 0; //default de
private $shipping_is_for;
private $num_comp;
private $ysession;
private $yinstance;
private $shopping_data = [];*/
public static $points = 0;
public static $price = 0;
public static $price_net = 0;
public static $ek_price = 0;
public static $income_price = 0;
private static $homeparty;
private static $userCarts = [];
public static $user_host_id;
public static $is_bonus = false;
public static $is_bonus_coupon = false;
private static $bonus_coupon = 0;
private static $bonus_value = 30;
private static $bonus_price = 0;
private static $bonus_diff = 0;
private static $bonus_points_diff = 0;
private static $bonus_coupon_fault = 0;
private static $bonus_coupon_next_step = 0;
private static $bonus_coupon_next_value = 0;
private static $bonus_start = 200;
private static $bonusTable = [
250 => 15,
300 => 20,
400 => 30,
500 => 35,
600 => 40,
700 => 50,
];
public static function calculateHomeparty(Homeparty $homeparty){
self::$homeparty = $homeparty;
foreach ($homeparty->homeparty_users as $homeparty_user){
if($homeparty_user->is_host){
self::$user_host_id = $homeparty_user->id;
}
self::$userCarts[$homeparty_user->id] = new HomepartyUserCart($homeparty_user);
self::addCart(self::$userCarts[$homeparty_user->id]);
}
self::caluclateBonus();
self::calculateBonusHost();
}
public static function addCart(HomepartyUserCart $homepartyUserCart){
self::$points += $homepartyUserCart->points;
self::$price += $homepartyUserCart->price;
self::$price_net += $homepartyUserCart->price_net;
self::$ek_price += $homepartyUserCart->ek_price;
self::$income_price += $homepartyUserCart->income_price;
}
public static function getUserCart($id){
return isset(self::$userCarts[$id]) ? self::$userCarts[$id] : null;
}
public static function caluclateBonus(){
if(self::$price >= 200){
self::$is_bonus = true;
//TODO get from PRODUCT
self::$bonus_price = 11.90;
self::$price += self::$bonus_price;
self::$price_net += 10;
$bonus_tmp = self::$price - self::$bonus_value;
//look up for coupon in table
foreach (self::$bonusTable as $val=>$coupon){
if($bonus_tmp >= $val){
self::$is_bonus_coupon = true;
self::$bonus_coupon = $coupon;
}else{
if(self::$bonus_coupon_fault === 0){
self::$bonus_coupon_fault = $val - $bonus_tmp;
self::$bonus_coupon_next_step = $val;
self::$bonus_coupon_next_value = $coupon;
}
}
}
$keys = array_keys(self::$bonusTable);
$step = $keys[count($keys)-1];
if($bonus_tmp > $step){
self::$bonus_coupon_next_step = $step;
self::$bonus_coupon_next_value =self::$bonusTable[$step];
}
}else{
self::$bonus_diff = 200 - self::$price;
}
}
public static function calculateBonusHost(){
if(self::$is_bonus){
$bonus_total = self::$bonus_value + self::$bonus_coupon;
$user_cart = self::getUserCart(self::$user_host_id);
//cart lower the bonus
if($user_cart->price <= $bonus_total){
self::$bonus_points_diff = $user_cart->points;
$user_cart->points = 0;
$user_cart->price = 0;
return;
}
$bonus_percent = (100/$user_cart->price*$bonus_total);
self::$bonus_points_diff = round($user_cart->points/100*$bonus_percent);
$user_cart->points -= self::$bonus_points_diff;
$user_cart->price -= $bonus_total;
}
}
public static function getUserCartHost(){
return self::getUserCart(self::$user_host_id);
}
public static function getFormattedPoints()
{
return formatNumber(self::$points, 0);
}
public static function getFormattedPrice()
{
return formatNumber(self::$price);
}
public static function getFormattedPriceNet()
{
return formatNumber(self::$price_net);
}
public static function getFormattedEkPrice()
{
return formatNumber(self::$ek_price);
}
public static function getFormattedIncomePrice()
{
return formatNumber(self::$income_price);
}
public static function getFormattedPriceTax(){
return formatNumber(self::$price - self::$price_net);
}
public static function getFormattedBonusPrice()
{
return formatNumber(self::$bonus_price);
}
public static function getFormattedBonusStart(){
return formatNumber(self::$bonus_start);
}
public static function getFormattedBonusValue(){
return formatNumber(self::$bonus_value);
}
public static function getFormattedBonusDiff(){
return formatNumber(self::$bonus_diff);
}
public static function getFormattedBonusCoupon(){
return formatNumber(self::$bonus_coupon);
}
public static function getFormattedBonusCouponFault(){
return formatNumber(self::$bonus_coupon_fault);
}
public static function getFormattedBonusCouponNextStep(){
return formatNumber(self::$bonus_coupon_next_step);
}
public static function getFormattedBonusCouponNextValue(){
return formatNumber(self::$bonus_coupon_next_value);
}
public static function getFormattedBonusTotal(){
if(self::$is_bonus){
return formatNumber(self::$bonus_value + self::$bonus_coupon);
}
return formatNumber(0);
}
public static function getFormattedBonusPointsDiff(){
return formatNumber( self::$bonus_points_diff, 0 );
}
/* public static function getTaxRate()
{
return config('cart.tax');
}
public function putYardExtra($key, $value){
$content = $this->getYContent();
$content->put($key, $value);
$this->ysession->put($this->yinstance, $content);
}
public function getYardExtra($key){
$content = $this->getYContent();
if ($content->has($key)){
return $content->get($key);
}
return false;
}
public function getShippingCountryName(){
$shippingCountry = ShippingCountry::find($this->shipping_country_id);
if($shippingCountry && $shippingCountry->country){
return $shippingCountry->country->getLocated();
}
return "";
}
public function getShippingCountryCountryId()
{
$shippingCountry = ShippingCountry::find($this->shipping_country_id);
if($shippingCountry && $shippingCountry->country){
return $shippingCountry->country->id;
}
return 1; //default DE
}
public function getShippingCountryId()
{
return $this->shipping_country_id;
}
public function getYContent()
{
if (is_null($this->ysession->get($this->yinstance))) {
return new Collection([]);
}
return $this->ysession->get($this->yinstance);
}
public function reCalculateShippingPrice(){
$this->calculateShippingPrice();
}
public function setShippingCountryWithPrice($shipping_country_id, $shipping_is_for = 'ot')
{
$this->shipping_country_id = $shipping_country_id;
$this->putYardExtra('shipping_country_id', $shipping_country_id);
$this->shipping_is_for = $shipping_is_for;
$this->putYardExtra('shipping_is_for', $shipping_is_for);
$this->calculateShippingPrice();
}
private function calculateShippingPrice(){
$shippingCountry = ShippingCountry::find($this->shipping_country_id);
if(!$shippingCountry){
return;
}
$shipping = $shippingCountry->shipping;
if($this->weight() == 0){
$shipping_price = $shipping->shipping_prices->first();
$shipping_price->price = 0;
$shipping_price->price_comp = 0;
}else{
//first by price
$shipping_price = $this->shippingPriceByTotal($shipping->shipping_prices, $this->total(2, '.', ''));
//sec by weight
if(!$shipping_price){
$shipping_price = $this->shippingPriceByWeight($shipping->shipping_prices, $this->weight());
}
//default
if(!$shipping_price){
$shipping_price = $shipping->shipping_prices->first();
}
}
if($shipping_price){
$price = $shipping_price->price;
$this->num_comp = 0;
if($this->shipping_is_for === 'me'){
$price = $shipping_price->price_comp;
$this->num_comp = $shipping_price->num_comp;
}
$this->shipping_price = $price;
$this->shipping_tax_rate = $shipping_price->tax_rate;
$this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2);
$this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2);
$this->putYardExtra('num_comp', $this->num_comp);
$this->putYardExtra('shipping_price', $this->shipping_price);
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
$this->putYardExtra('shipping_tax', $this->shipping_tax);
$this->putYardExtra('shipping_price_net', $this->shipping_price_net);
}
}
private function shippingPriceByTotal($prices, $total){
foreach ($prices as $price){
if($price->total_from > 0 && $price->total_to > 0){
if($total >= $price->total_from && $total <= $price->total_to){
return $price;
}
}
}
return false;
}
private function shippingPriceByWeight($prices, $weight){
foreach ($prices as $price){
if($price->weight_from > 0 && $price->weight_to > 0){
if($weight >= $price->weight_from && $weight <= $price->weight_to){
return $price;
}
}
}
return false;
}
public function shipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
return $this->numberFormat($this->shipping_price, $decimals, $decimalPoint, $thousandSeperator);
}
public function shippingNet($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
return $this->numberFormat($this->shipping_price_net, $decimals, $decimalPoint, $thousandSeperator);
}
//
private function shippingTax($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
return $this->numberFormat($this->shipping_tax, $decimals, $decimalPoint, $thousandSeperator);
}
//netto
public function subtotalWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$subtotal = (float) $this->shipping_price_net + $this->subtotal(2, '.', '');
return $this->numberFormat($subtotal, $decimals, $decimalPoint, $thousandSeperator);
}
public function taxWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$total = $this->totalWithShipping(2, '.', '');
// $totalTax = (float) $this->tax(2, '.', '') + $this->shipping_tax;
$totalTax = $this->subtotalWithShipping(2, '.', '');
return $this->numberFormat(($total - $totalTax), $decimals, $decimalPoint, $thousandSeperator);
}
public function totalWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$total = (float) ($this->total(2, '.', '')) + $this->shipping_price;
return $this->numberFormat($total, $decimals, $decimalPoint, $thousandSeperator);
}
public function weight($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$content = $this->getContent();
$total = $content->reduce(function ($total, CartItem $cartItem) {
return $total + ($cartItem->options->weight ? ($cartItem->options->weight*$cartItem->qty) : 0);
}, 0);
return $total;
}
public function points()
{
$content = $this->getContent();
$total = $content->reduce(function ($total, CartItem $cartItem) {
return $total + ($cartItem->options->points ? ($cartItem->options->points * $cartItem->qty) : 0);
}, 0);
return $total;
}
public function compCount()
{
$content = $this->getContent();
$count = parent::count();
$comp_count = $content->reduce(function ($comp_count, CartItem $cartItem) {
return $cartItem->options->comp ? $comp_count + 1 : $comp_count;
}, 0);
return $count-$comp_count;
}
public function total($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$content = $this->getContent();
$total = $content->reduce(function ($total, CartItem $cartItem) {
return $total + ($cartItem->qty * $cartItem->price);
}, 0);
return $this->numberFormat($total, $decimals, $decimalPoint, $thousandSeperator);
}
public function tax($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$content = $this->getContent();
$tax = $content->reduce(function ($tax, CartItem $cartItem) {
$priceTax = $cartItem->price / (100 + $cartItem->taxRate) * $cartItem->taxRate;
return $tax + ($cartItem->qty * $priceTax);
}, 0);
return $this->numberFormat($tax, $decimals, $decimalPoint, $thousandSeperator);
}
public function subtotal($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$content = $this->getContent();
$subTotal = $content->reduce(function ($subTotal, CartItem $cartItem) {
$price_net = $cartItem->price / ((100 + $cartItem->taxRate) / 100);
return $subTotal + ($cartItem->qty * $price_net);
}, 0);
return $this->numberFormat($subTotal, $decimals, $decimalPoint, $thousandSeperator);
}
public function getCartItemByProduct($product_id, $set_price='with'){
if($product = Product::find($product_id)) {
$image = "";
if ($product->images->count()) {
$image = $product->images->first()->slug;
}
$price = $product->price;
if($set_price === 'with'){
$price = $product->getPriceWith(false, true);
}
$cartItem = $this->getCartItem($product->id, $product->getLang('name'), 1, $price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points]);
$content = $this->getContent();
if ($content->has($cartItem->rowId)){
return $content->get($cartItem->rowId);
}
return $cartItem;
}
return null;
}
public function getCartItem($id, $name = null, $qty = null, $price = null, array $options = []){
if ($id instanceof Buyable) {
$cartItem = CartItem::fromBuyable($id, $qty ?: []);
} elseif (is_array($id)) {
$cartItem = CartItem::fromArray($id);
} else {
$cartItem = CartItem::fromAttributes($id, $name, $price, $options);
}
return $cartItem;
}
public function destroy()
{
$this->ysession->remove($this->yinstance);
parent::destroy();
}
public function rowPriceNet(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){
$price = round($row->price / ((100 + $row->taxRate) /100), 4);
return $this->numberFormat($price, $decimals, $decimalPoint, $thousandSeperator);
}
public function rowSubtotalNet(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){
$price = round($row->price / ((100 + $row->taxRate) /100), 4);
return $this->numberFormat(($price * $row->qty), $decimals, $decimalPoint, $thousandSeperator);
}
public function getNumComp(){
return $this->num_comp;
}
public function getCompProductBy($comp, $product_id=false){
foreach ($this->content() as $row) {
if($row->options->comp == $comp) {
return $row->options->product_id;
}
}
return false;
}
public function getContentByOrder(){
$ret = [];
$comp = [];
foreach ($this->content() as $row) {
if($row->options->comp){
$comp[100+$row->options->comp] = $row;
}else{
$ret[] = $row;
}
}
ksort($comp);
$ret = array_merge($ret, $comp);
return $ret;
}
*/
protected function numberFormat($value, $decimals, $decimalPoint, $thousandSeperator)
{
if(is_null($decimals)){
$decimals = is_null(config('cart.format.decimals')) ? 2 : config('cart.format.decimals');
}
if(is_null($decimalPoint)){
$decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point');
}
if(is_null($thousandSeperator)){
$thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator');
}
return number_format($value, $decimals, $decimalPoint, $thousandSeperator);
}
}

View file

@ -0,0 +1,423 @@
<?php
namespace App\Services;
use App\Models\HomepartyUser;
use App\Models\Product;
use App\Models\ShippingCountry;
use \Gloudemans\Shoppingcart\Cart;
use Gloudemans\Shoppingcart\CartItem;
use Gloudemans\Shoppingcart\Contracts\Buyable;
use Illuminate\Session\SessionManager;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Collection;
class HomepartyUserCart
{
/*private $shipping_price = 0;
private $shipping_price_net = 0;
private $shipping_tax_rate = 0;
private $shipping_tax = 0;
private $shipping_country_id = 0; //default de
private $shipping_is_for;
private $num_comp;
private $ysession;
private $yinstance;
private $shopping_data = [];*/
public $points;
public $price;
public $price_net;
public $ek_price;
public $income_price;
private $homepartyUser;
public function __construct(HomepartyUser $homepartyUser)
{
$this->homepartyUser = $homepartyUser;
$this->points = 0;
$this->price = 0;
$this->price_net = 0;
$this->ek_price = 0;
$this->income_price = 0;
$this->calculateUserCart();
}
public function calculateUserCart(){
foreach ($this->homepartyUser->homeparty_user_order_items as $order_item) {
$this->points += $order_item->getTotalPoints();
$this->price += $order_item->getTotalPrice();
$this->price_net += $order_item->geTotalPriceNet();
$this->ek_price += $order_item->geTotalEKPrice();
$this->income_price += $order_item->geTotalIncomePrice();
}
}
public function getFormattedPoints()
{
return formatNumber($this->points, 0);
}
public function getFormattedPrice()
{
return formatNumber($this->price);
}
public function getFormattedPriceNet()
{
return formatNumber($this->price_net);
}
public function getFormattedEkPrice()
{
return formatNumber($this->ek_price);
}
public function getFormattedIncomePrice()
{
return formatNumber($this->income_price);
}
/* public static function getTaxRate()
{
return config('cart.tax');
}
public function putYardExtra($key, $value){
$content = $this->getYContent();
$content->put($key, $value);
$this->ysession->put($this->yinstance, $content);
}
public function getYardExtra($key){
$content = $this->getYContent();
if ($content->has($key)){
return $content->get($key);
}
return false;
}
public function getShippingCountryName(){
$shippingCountry = ShippingCountry::find($this->shipping_country_id);
if($shippingCountry && $shippingCountry->country){
return $shippingCountry->country->getLocated();
}
return "";
}
public function getShippingCountryCountryId()
{
$shippingCountry = ShippingCountry::find($this->shipping_country_id);
if($shippingCountry && $shippingCountry->country){
return $shippingCountry->country->id;
}
return 1; //default DE
}
public function getShippingCountryId()
{
return $this->shipping_country_id;
}
public function getYContent()
{
if (is_null($this->ysession->get($this->yinstance))) {
return new Collection([]);
}
return $this->ysession->get($this->yinstance);
}
public function reCalculateShippingPrice(){
$this->calculateShippingPrice();
}
public function setShippingCountryWithPrice($shipping_country_id, $shipping_is_for = 'ot')
{
$this->shipping_country_id = $shipping_country_id;
$this->putYardExtra('shipping_country_id', $shipping_country_id);
$this->shipping_is_for = $shipping_is_for;
$this->putYardExtra('shipping_is_for', $shipping_is_for);
$this->calculateShippingPrice();
}
private function calculateShippingPrice(){
$shippingCountry = ShippingCountry::find($this->shipping_country_id);
if(!$shippingCountry){
return;
}
$shipping = $shippingCountry->shipping;
if($this->weight() == 0){
$shipping_price = $shipping->shipping_prices->first();
$shipping_price->price = 0;
$shipping_price->price_comp = 0;
}else{
//first by price
$shipping_price = $this->shippingPriceByTotal($shipping->shipping_prices, $this->total(2, '.', ''));
//sec by weight
if(!$shipping_price){
$shipping_price = $this->shippingPriceByWeight($shipping->shipping_prices, $this->weight());
}
//default
if(!$shipping_price){
$shipping_price = $shipping->shipping_prices->first();
}
}
if($shipping_price){
$price = $shipping_price->price;
$this->num_comp = 0;
if($this->shipping_is_for === 'me'){
$price = $shipping_price->price_comp;
$this->num_comp = $shipping_price->num_comp;
}
$this->shipping_price = $price;
$this->shipping_tax_rate = $shipping_price->tax_rate;
$this->shipping_price_net = round($price / ((100+$shipping_price->tax_rate) / 100), 2);
$this->shipping_tax = round($price / (100+$shipping_price->tax_rate) * 100, 2);
$this->putYardExtra('num_comp', $this->num_comp);
$this->putYardExtra('shipping_price', $this->shipping_price);
$this->putYardExtra('shipping_tax_rate', $this->shipping_tax_rate);
$this->putYardExtra('shipping_tax', $this->shipping_tax);
$this->putYardExtra('shipping_price_net', $this->shipping_price_net);
}
}
private function shippingPriceByTotal($prices, $total){
foreach ($prices as $price){
if($price->total_from > 0 && $price->total_to > 0){
if($total >= $price->total_from && $total <= $price->total_to){
return $price;
}
}
}
return false;
}
private function shippingPriceByWeight($prices, $weight){
foreach ($prices as $price){
if($price->weight_from > 0 && $price->weight_to > 0){
if($weight >= $price->weight_from && $weight <= $price->weight_to){
return $price;
}
}
}
return false;
}
public function shipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
return $this->numberFormat($this->shipping_price, $decimals, $decimalPoint, $thousandSeperator);
}
public function shippingNet($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
return $this->numberFormat($this->shipping_price_net, $decimals, $decimalPoint, $thousandSeperator);
}
//
private function shippingTax($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
return $this->numberFormat($this->shipping_tax, $decimals, $decimalPoint, $thousandSeperator);
}
//netto
public function subtotalWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$subtotal = (float) $this->shipping_price_net + $this->subtotal(2, '.', '');
return $this->numberFormat($subtotal, $decimals, $decimalPoint, $thousandSeperator);
}
public function taxWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$total = $this->totalWithShipping(2, '.', '');
// $totalTax = (float) $this->tax(2, '.', '') + $this->shipping_tax;
$totalTax = $this->subtotalWithShipping(2, '.', '');
return $this->numberFormat(($total - $totalTax), $decimals, $decimalPoint, $thousandSeperator);
}
public function totalWithShipping($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$total = (float) ($this->total(2, '.', '')) + $this->shipping_price;
return $this->numberFormat($total, $decimals, $decimalPoint, $thousandSeperator);
}
public function weight($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$content = $this->getContent();
$total = $content->reduce(function ($total, CartItem $cartItem) {
return $total + ($cartItem->options->weight ? ($cartItem->options->weight*$cartItem->qty) : 0);
}, 0);
return $total;
}
public function points()
{
$content = $this->getContent();
$total = $content->reduce(function ($total, CartItem $cartItem) {
return $total + ($cartItem->options->points ? ($cartItem->options->points * $cartItem->qty) : 0);
}, 0);
return $total;
}
public function compCount()
{
$content = $this->getContent();
$count = parent::count();
$comp_count = $content->reduce(function ($comp_count, CartItem $cartItem) {
return $cartItem->options->comp ? $comp_count + 1 : $comp_count;
}, 0);
return $count-$comp_count;
}
public function total($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$content = $this->getContent();
$total = $content->reduce(function ($total, CartItem $cartItem) {
return $total + ($cartItem->qty * $cartItem->price);
}, 0);
return $this->numberFormat($total, $decimals, $decimalPoint, $thousandSeperator);
}
public function tax($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$content = $this->getContent();
$tax = $content->reduce(function ($tax, CartItem $cartItem) {
$priceTax = $cartItem->price / (100 + $cartItem->taxRate) * $cartItem->taxRate;
return $tax + ($cartItem->qty * $priceTax);
}, 0);
return $this->numberFormat($tax, $decimals, $decimalPoint, $thousandSeperator);
}
public function subtotal($decimals = null, $decimalPoint = null, $thousandSeperator = null)
{
$content = $this->getContent();
$subTotal = $content->reduce(function ($subTotal, CartItem $cartItem) {
$price_net = $cartItem->price / ((100 + $cartItem->taxRate) / 100);
return $subTotal + ($cartItem->qty * $price_net);
}, 0);
return $this->numberFormat($subTotal, $decimals, $decimalPoint, $thousandSeperator);
}
public function getCartItemByProduct($product_id, $set_price='with'){
if($product = Product::find($product_id)) {
$image = "";
if ($product->images->count()) {
$image = $product->images->first()->slug;
}
$price = $product->price;
if($set_price === 'with'){
$price = $product->getPriceWith(false, true);
}
$cartItem = $this->getCartItem($product->id, $product->getLang('name'), 1, $price, ['image' => $image, 'slug' => $product->slug, 'weight' => $product->weight, 'points' => $product->points]);
$content = $this->getContent();
if ($content->has($cartItem->rowId)){
return $content->get($cartItem->rowId);
}
return $cartItem;
}
return null;
}
public function getCartItem($id, $name = null, $qty = null, $price = null, array $options = []){
if ($id instanceof Buyable) {
$cartItem = CartItem::fromBuyable($id, $qty ?: []);
} elseif (is_array($id)) {
$cartItem = CartItem::fromArray($id);
} else {
$cartItem = CartItem::fromAttributes($id, $name, $price, $options);
}
return $cartItem;
}
public function destroy()
{
$this->ysession->remove($this->yinstance);
parent::destroy();
}
public function rowPriceNet(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){
$price = round($row->price / ((100 + $row->taxRate) /100), 4);
return $this->numberFormat($price, $decimals, $decimalPoint, $thousandSeperator);
}
public function rowSubtotalNet(CartItem $row, $decimals = null, $decimalPoint = null, $thousandSeperator = null){
$price = round($row->price / ((100 + $row->taxRate) /100), 4);
return $this->numberFormat(($price * $row->qty), $decimals, $decimalPoint, $thousandSeperator);
}
public function getNumComp(){
return $this->num_comp;
}
public function getCompProductBy($comp, $product_id=false){
foreach ($this->content() as $row) {
if($row->options->comp == $comp) {
return $row->options->product_id;
}
}
return false;
}
public function getContentByOrder(){
$ret = [];
$comp = [];
foreach ($this->content() as $row) {
if($row->options->comp){
$comp[100+$row->options->comp] = $row;
}else{
$ret[] = $row;
}
}
ksort($comp);
$ret = array_merge($ret, $comp);
return $ret;
}
*/
protected function numberFormat($value, $decimals, $decimalPoint, $thousandSeperator)
{
if(is_null($decimals)){
$decimals = is_null(config('cart.format.decimals')) ? 2 : config('cart.format.decimals');
}
if(is_null($decimalPoint)){
$decimalPoint = is_null(config('cart.format.decimal_point')) ? '.' : config('cart.format.decimal_point');
}
if(is_null($thousandSeperator)){
$thousandSeperator = is_null(config('cart.format.thousand_seperator')) ? ',' : config('cart.format.thousand_seperator');
}
return number_format($value, $decimals, $decimalPoint, $thousandSeperator);
}
}

View file

@ -60,6 +60,7 @@ return [
'pre_url_main' => env('APP_URL_MAIN', ''),
'pre_url_crm' => env('APP_URL_CRM', 'my.'),
'checkout_url' => env('APP_URL_CHECKOUT', 'checkout.'),
'contact_mail' => env('APP_CONTACT_MAIL', 'kontakt@mivita.care'),
'checkout_mail' => env('APP_CHECKOUT_MAIL', 'no-reply@mivita.care'),
'checkout_test_mail' => env('APP_CHECKOUT_TEST_MAIL', 'devtest@mivita.care'),
'info_mail' => env('APP_INFO_MAIL', 'no-reply@mivita.care'),

View file

@ -48,8 +48,6 @@ class CreateShoppingOrdersTable extends Migration
$table->string('tracking', 255)->nullable();
$table->char('mode', 4)->nullable();
$table->timestamps();

View file

@ -27,7 +27,6 @@ class CreateShoppingOrderItemsTable extends Migration
$table->decimal('price', 8, 2)->nullable();
$table->decimal('price_net', 8, 3)->nullable();
$table->decimal('tax_rate', 5, 2)->nullable();
$table->string('slug')->nullable();

View file

@ -28,6 +28,9 @@ class CreateHomepartiesTable extends Migration
$table->boolean('active')->default(false);
$table->boolean('default')->default(false);
$table->string('token')->nullable();
$table->boolean('token_active')->default(true);
$table->timestamps();
});
}

View file

@ -51,9 +51,6 @@ class CreateHomepartyUsersTable extends Migration
$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();

View file

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateIngredientsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('ingredients', function (Blueprint $table) {
$table->increments('id');
$table->string('name')->index();
$table->text('trans_name')->nullable();
$table->text('inci')->nullable();
$table->mediumText('trans_inci')->nullable();
$table->text('effect')->nullable();
$table->mediumText('trans_effect')->nullable();
$table->boolean('active')->default(false);
$table->unsignedTinyInteger('pos')->nullable()->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('ingredients');
}
}

View file

@ -0,0 +1,45 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateProductIngredientsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('product_ingredients', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('product_id')->index();
$table->unsignedInteger('ingredient_id')->index();
$table->timestamps();
$table->foreign('product_id')
->references('id')
->on('products');
$table->foreign('ingredient_id')
->references('id')
->on('ingredients')
->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('product_ingredients');
}
}

284
public/js/iq-homeparty-cart.js Executable file
View file

@ -0,0 +1,284 @@
var IqHomepartyCart = {
form: "#homeparty-order-form",
btn_modal_add: '.add-product-basket',
btn_add: '.add-from-basket',
btn_remove: '.remove-from-basket',
table_input: '.table-input-event-onchange',
oTable: null,
cart_holder: '#insert_show_products_order_',
cart_holders: '.insert_show_products_order',
modal: '#modals-load-content',
remove_item_cart: '.remove_item_form_cart',
insert_show_total_order: '#insert_show_total_order',
insert_show_bonus: '#insert_show_bonus',
insert_show_bonus_host: '#insert_show_bonus_host',
/*
comp_holder: '#holder_html_view_comp_product',
is_for: null,
url: null,
btn_clear: '#clear-products-basket',
cart_input: '.cart-input-event-onchange',
remove_item: '.remove_item_form_cart',
shipping_state: '#change_shipping_state',
comp_products: 'switchers-comp-product',
count_comp_products: 'count_comp_products',
shipping_is_for: 'shipping_is_for',*/
_log: function ($msg){
console.log($msg);
},
init: function () {
var _self = this;
_self.url = $(_self.form).attr('action');
_self._log(_self.url);
$(_self.cart_holders).each(function (key, obj){
_self.reInit($(obj));
});
//_self.showInit();
/*$(_self.shipping_state).on('change', function(){
_self.update_shipping_state($(this));
});*/
return _self;
},
setDatabase: function (oTable){
var _self = this;
_self._log($(oTable));
_self.oTable = oTable;
},
reInitModal: function (){
var _self = this;
$(_self.oTable).find(_self.btn_modal_add).on('click', function(){
_self.add_product_modal($(this))
});
},
add_product_modal: function (_obj){
var _self = this;
_self.performRequest({
product_id: _obj.data('product-id'),
homeparty_id: $(_self.oTable).data('homeparty-id'),
homeparty_user_id: $(_self.oTable).data('homeparty-user-id'),
qty: 1,
action: 'addProduct'
}).done(_self.refreshView);
},
reInit: function (obj){
var _self = this;
var _obj = obj;
obj.find(_self.btn_add).off('click').on('click', function(){
_self.add_product($(this), _obj)
});
obj.find(_self.btn_remove).off('click').on('click', function(){
_self.remove_product($(this), _obj)
});
obj.find(_self.table_input).off('change').on('change', function(){
_self._log($(this));
_self.update_input_table($(this), _obj);
});
obj.find(_self.remove_item_cart).off('click').on('click', function(){
_self.remove_from_cart($(this), _obj);
});
},
add_product: function (_obj, _holder){
var _self = this;
var input = _holder.find('input[name="product_qty_'+_obj.data('order-item-id')+'"]');
var qty = parseInt(input.val()) + 1;
qty = _self.checkNumber(qty);
input.val(qty);
_self.update_cart(_holder, _obj, qty);
},
remove_product: function (_obj, _holder){
var _self = this;
var input = _holder.find('input[name="product_qty_'+_obj.data('order-item-id')+'"]');
var qty = parseInt(input.val()) - 1;
qty = _self.checkNumber(qty);
input.val(qty);
_self.update_cart(_holder, _obj, qty);
},
update_input_table: function (_obj, _holder){
var _self = this;
var qty = parseInt(_obj.val());
qty = _self.checkNumber(qty);
_obj.val(qty);
_self.update_cart(_holder, _obj, qty);
},
update_cart: function (_holder, _obj, qty){
var _self = this;
_self.performRequest({
product_id: _obj.data('product-id'),
order_item_id: _obj.data('order-item-id'),
homeparty_id: _holder.data('homeparty-id'),
homeparty_user_id: _holder.data('homeparty-user-id'),
qty: qty,
action: 'updateCart'
}).done(_self.refreshView);
},
remove_from_cart: function (_obj, _holder){
var _self = this;
_self.performRequest({
product_id: _obj.data('product-id'),
order_item_id: _obj.data('order-item-id'),
homeparty_id: _holder.data('homeparty-id'),
homeparty_user_id: _holder.data('homeparty-user-id'),
action: 'removeFromCart'
}).done(_self.refreshView);
},
refreshView: function (data) {
var _self = IqHomepartyCart;
var obj = $(_self.cart_holder+data.data.homeparty_user_id)
obj.html(data.html_user_cart);
$(_self.insert_show_total_order).html(data.html_total);
$(_self.insert_show_bonus).html(data.html_bonus);
$(_self.insert_show_bonus_host).html(data.html_host_bonus);
$(_self.modal).modal('hide');
_self.reInit(obj);
//$(_self.comp_holder).html(data.html_comp);
// var input = $(_self.table).find('input[name="product_qty_'+data.data.product_id+'"]');
// input.val(data.data.qty);
// _self.showInit();
},
performRequest : function(data) {
var _self = this;
var url = _self.url,
contentType = 'application/x-www-form-urlencoded; charset=UTF-8';
console.log(data);
console.log(url);
return $.ajax({
url: url,
data: data,
type: "POST",
dataType: "json",
cache: false,
contentType: contentType,
encode: true,
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
})
.done(function (data) {
console.log('performRequest');
console.log(data);
}).fail(function (jqXHR, textStatus, errorThrown) {
console.log(jqXHR);
console.log(jqXHR.responseText);
console.log(textStatus);
console.log(errorThrown);
console.log("Sorry, there was a problem!");
});
},
checkNumber : function(number){
if(number < 1 || isNaN(number)){
return 1;
}
if(number >= 100){
return 100;
}
return number;
},
/*
showInit: function (){
var _self = this;
$(_self.btn_clear).on('click', function (){
_self.performRequest({action: 'clearCart'})
.done(_self.refreshDatabaseRefreshAndView)
});
$(_self.cart_input).on('change', function(){
_self.update_input_cart($(this));
});
$(_self.remove_item).on('click', function(event){
event.preventDefault();
_self.update_cart_database($(this).data('product-id'), 0);
});
if(_self.is_for === 'me'){
$('input[name^="'+_self.comp_products+'"]').on('change', function(){
_self.update_comp_product($(this));
});
}
},
update_shipping_state : function (_obj){
var _self = this;
var id = parseInt(_obj.val());
var is_for = _obj.data('is-for');
_self.performRequest({shipping_country_id: id, shipping_is_for: is_for, action: 'updateShippingCountry'})
.done(_self.refreshItemsAndView);
},
update_input_table: function (_obj){
var _self = this;
var qty = parseInt(_obj.val());
qty = _self.checkNumber(qty);
_obj.val(qty);
_self.update_cart(_obj.data('product-id'), qty);
},
update_input_cart: function (_obj){
var _self = this;
var qty = parseInt(_obj.val());
qty = _self.checkNumber(qty);
_obj.val(qty);
_self.update_cart_database(_obj.data('product-id'), qty);
},
update_comp_product: function (_obj){
var _self = this;
_self.performRequest({comp_product_id: _obj.val(), comp_num: _obj.data('comp_num'), count_comp_products: $('input[name="'+_self.count_comp_products+'"]').val(), action: 'updateCompProduct'})
.done(_self.refreshItemsAndView);
},
update_cart_database: function (product_id, qty){
var _self = this;
_self.performRequest({product_id: product_id, qty: qty, action: 'updateCart'})
.done(_self.refreshDatabaseAndView);
},
update_cart: function (product_id, qty){
var _self = this;
_self.performRequest({product_id: product_id, qty: qty, action: 'updateCart'})
.done(_self.refreshItemsAndView);
},
refreshItemsAndView: function (data){
var _self = IqShoppingCart;
$(_self.cart_holder).html(data.html_cart);
$(_self.comp_holder).html(data.html_comp);
_self.showInit();
},
refreshDatabaseAndView: function (data) {
var _self = IqShoppingCart;
$(_self.cart_holder).html(data.html_cart);
$(_self.comp_holder).html(data.html_comp);
var input = $(_self.table).find('input[name="product_qty_'+data.data.product_id+'"]');
input.val(data.data.qty);
_self.showInit();
},
refreshDatabaseRefreshAndView : function (data){
var _self = IqShoppingCart;
$(_self.cart_holder).html(data.html_cart);
$(_self.comp_holder).html(data.html_comp);
_self.showInit();
_self.oTable.draw();
},
checkNumber : function(number){
if(number < 0 || isNaN(number)){
return 0;
}
if(number >= 100){
return 100;
}
return number;
},
*/
};

178
public/js/summernote-cleaner.js Executable file
View file

@ -0,0 +1,178 @@
/* https://github.com/DiemenDesign/summernote-cleaner */
(function (factory) {
if (typeof define === 'function' && define.amd) {
define(['jquery'], factory);
} else if (typeof module === 'object' && module.exports) {
module.exports = factory(require('jquery'));
} else {
factory(window.jQuery);
}
}
(function ($) {
$.extend(true, $.summernote.lang, {
'en-US': {
cleaner: {
tooltip: 'Cleaner',
not: 'Text has been Cleaned!!!',
limitText: 'Text',
limitHTML: 'HTML'
}
}
});
$.extend($.summernote.options, {
cleaner: {
action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options.
newline: '<br>', // Summernote's default is to use '<p><br></p>'
notStyle: 'position:absolute;top:0;left:0;right:0',
icon: '<i class="note-icon"><svg xmlns="http://www.w3.org/2000/svg" id="libre-paintbrush" viewBox="0 0 14 14" width="14" height="14"><path d="m 11.821425,1 q 0.46875,0 0.82031,0.311384 0.35157,0.311384 0.35157,0.780134 0,0.421875 -0.30134,1.01116 -2.22322,4.212054 -3.11384,5.035715 -0.64956,0.609375 -1.45982,0.609375 -0.84375,0 -1.44978,-0.61942 -0.60603,-0.61942 -0.60603,-1.469866 0,-0.857143 0.61608,-1.419643 l 4.27232,-3.877232 Q 11.345985,1 11.821425,1 z m -6.08705,6.924107 q 0.26116,0.508928 0.71317,0.870536 0.45201,0.361607 1.00781,0.508928 l 0.007,0.475447 q 0.0268,1.426339 -0.86719,2.32366 Q 5.700895,13 4.261155,13 q -0.82366,0 -1.45982,-0.311384 -0.63616,-0.311384 -1.0212,-0.853795 -0.38505,-0.54241 -0.57924,-1.225446 -0.1942,-0.683036 -0.1942,-1.473214 0.0469,0.03348 0.27455,0.200893 0.22768,0.16741 0.41518,0.29799 0.1875,0.130581 0.39509,0.24442 0.20759,0.113839 0.30804,0.113839 0.27455,0 0.3683,-0.247767 0.16741,-0.441965 0.38505,-0.753349 0.21763,-0.311383 0.4654,-0.508928 0.24776,-0.197545 0.58928,-0.31808 0.34152,-0.120536 0.68974,-0.170759 0.34821,-0.05022 0.83705,-0.07031 z"/></svg></i>',
keepHtml: true, //Remove all Html formats
keepOnlyTags: [], // If keepHtml is true, remove all tags except these
keepClasses: false, //Remove Classes
badTags: ['style', 'script', 'applet', 'embed', 'noframes', 'noscript', 'html'], //Remove full tags with contents
badAttributes: ['style', 'start'], //Remove attributes from remaining tags
limitChars: 0, // 0|# 0 disables option
limitDisplay: 'both', // none|text|html|both
limitStop: false // true/false
}
});
$.extend($.summernote.plugins, {
'cleaner': function (context) {
var self = this,
ui = $.summernote.ui,
$note = context.layoutInfo.note,
$editor = context.layoutInfo.editor,
options = context.options,
lang = options.langInfo;
var cleanText = function (txt, nlO) {
var out = txt;
if (!options.cleaner.keepClasses) {
var sS = /(\n|\r| class=(")?Mso[a-zA-Z]+(")?)/g;
out = txt.replace(sS, ' ');
}
var nL = /(\n)+/g;
out = out.replace(nL, nlO);
if (options.cleaner.keepHtml) {
var cS = new RegExp('<!--(.*?)-->', 'gi');
out = out.replace(cS, '');
var tS = new RegExp('<(/)*(meta|link|\\?xml:|st1:|o:|font)(.*?)>', 'gi');
out = out.replace(tS, '');
var bT = options.cleaner.badTags;
for (var i = 0; i < bT.length; i++) {
tS = new RegExp('<' + bT[i] + '\\b.*>.*</' + bT[i] + '>', 'gi');
out = out.replace(tS, '');
}
var allowedTags = options.cleaner.keepOnlyTags;
if (typeof(allowedTags) == "undefined") allowedTags = [];
if (allowedTags.length > 0) {
allowedTags = (((allowedTags||'') + '').toLowerCase().match(/<[a-z][a-z0-9]*>/g) || []).join('');
var tags = /<\/?([a-z][a-z0-9]*)\b[^>]*>/gi;
out = out.replace(tags, function($0, $1) {
return allowedTags.indexOf('<' + $1.toLowerCase() + '>') > -1 ? $0 : ''
});
}
var bA = options.cleaner.badAttributes;
for (var ii = 0; ii < bA.length; ii++ ) {
//var aS=new RegExp(' ('+bA[ii]+'="(.*?)")|('+bA[ii]+'=\'(.*?)\')', 'gi');
var aS = new RegExp(' ' + bA[ii] + '=[\'|"](.*?)[\'|"]', 'gi');
out = out.replace(aS, '');
aS = new RegExp(' ' + bA[ii] + '[=0-9a-z]', 'gi');
out = out.replace(aS, '');
}
}
return out;
};
if (options.cleaner.action == 'both' || options.cleaner.action == 'button') {
context.memo('button.cleaner', function () {
var button = ui.button({
contents: options.cleaner.icon,
tooltip: lang.cleaner.tooltip,
container: 'body',
click: function () {
if ($note.summernote('createRange').toString())
$note.summernote('pasteHTML', $note.summernote('createRange').toString());
else
$note.summernote('code', cleanText($note.summernote('code')));
if ($editor.find('.note-status-output').length > 0)
$editor.find('.note-status-output').html('<div class="alert alert-success">' + lang.cleaner.not + '</div>');
}
});
return button.render();
});
}
this.events = {
'summernote.init': function () {
if ($.summernote.interface === 'lite') {
$("head").append('<style>.note-statusbar .pull-right{float:right!important}.note-status-output .text-muted{color:#777}.note-status-output .text-primary{color:#286090}.note-status-output .text-success{color:#3c763d}.note-status-output .text-info{color:#31708f}.note-status-output .text-warning{color:#8a6d3b}.note-status-output .text-danger{color:#a94442}.alert{margin:-7px 0 0 0;padding:7px 10px;border:1px solid transparent;border-radius:0}.alert .note-icon{margin-right:5px}.alert-success{color:#3c763d!important;background-color: #dff0d8 !important;border-color:#d6e9c6}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}</style>');
}
if (options.cleaner.limitChars != 0 || options.cleaner.limitDisplay != 'none') {
var textLength = $editor.find(".note-editable").text().replace(/(<([^>]+)>)/ig, "").replace(/( )/, " ");
var codeLength = $editor.find('.note-editable').html();
var lengthStatus = '';
if (textLength.length > options.cleaner.limitChars && options.cleaner.limitChars > 0)
lengthStatus += 'text-danger">';
else
lengthStatus += '">';
if (options.cleaner.limitDisplay == 'text' || options.cleaner.limitDisplay == 'both') lengthStatus += lang.cleaner.limitText + ': ' + textLength.length;
if (options.cleaner.limitDisplay == 'both') lengthStatus += ' / ';
if (options.cleaner.limitDisplay == 'html' || options.cleaner.limitDisplay == 'both') lengthStatus += lang.cleaner.limitHTML + ': ' + codeLength.length;
$editor.find('.note-status-output').html('<small class="pull-right ' + lengthStatus + '&nbsp;</small>');
}
},
'summernote.keydown': function (we, e) {
if (options.cleaner.limitChars != 0 || options.cleaner.limitDisplay != 'none') {
var textLength = $editor.find(".note-editable").text().replace(/(<([^>]+)>)/ig, "").replace(/( )/, " ");
var codeLength = $editor.find('.note-editable').html();
var lengthStatus = '';
if (options.cleaner.limitStop == true && textLength.length >= options.cleaner.limitChars) {
var key = e.keyCode;
allowed_keys = [8, 37, 38, 39, 40, 46]
if ($.inArray(key, allowed_keys) != -1) {
$editor.find('.cleanerLimit').removeClass('text-danger');
return true;
} else {
$editor.find('.cleanerLimit').addClass('text-danger');
e.preventDefault();
e.stopPropagation();
}
} else {
if (textLength.length > options.cleaner.limitChars && options.cleaner.limitChars > 0)
lengthStatus += 'text-danger">';
else
lengthStatus += '">';
if (options.cleaner.limitDisplay == 'text' || options.cleaner.limitDisplay == 'both')
lengthStatus += lang.cleaner.limitText + ': ' + textLength.length;
if (options.cleaner.limitDisplay == 'both')
lengthStatus += ' / ';
if (options.cleaner.limitDisplay == 'html' || options.cleaner.limitDisplay == 'both')
lengthStatus += lang.cleaner.limitHTML + ': ' + codeLength.length;
$editor.find('.note-status-output').html('<small class="cleanerLimit pull-right ' + lengthStatus + '&nbsp;</small>');
}
}
},
'summernote.paste': function (we, e) {
if (options.cleaner.action == 'both' || options.cleaner.action == 'paste') {
e.preventDefault();
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
msie = msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./);
var ffox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
if (msie)
var text = window.clipboardData.getData("Text");
else
var text = e.originalEvent.clipboardData.getData(options.cleaner.keepHtml ? 'text/html' : 'text/plain');
if (text) {
if (msie || ffox)
setTimeout(function () {
$note.summernote('pasteHTML', cleanText(text, options.cleaner.newline));
}, 1);
else
$note.summernote('pasteHTML', cleanText(text, options.cleaner.newline));
if ($editor.find('.note-status-output').length > 0)
$editor.find('.note-status-output').html('<div class="summernote-cleanerAlert alert alert-success">' + lang.cleaner.not + '</div>');
}
}
}
}
}
});
}));

View file

@ -22,6 +22,7 @@ return [
'products'=>'Produkte',
'overview'=>'Übersicht',
'categories'=>'Kategorien',
'ingredients'=>'Inhaltsstoffe',
'attribute'=>'Attribute',
'contents'=>'Inhalte',
'start_site'=>'Startseite',

View file

@ -25,7 +25,7 @@
<div class="row">
<div class="col-12">
<p>Bild wird rechts hinter die Headline gesetzt und automatisch auf eine Höhe von 60 Pixel skaliert.</p>
<p>Bild wird hinter oder unter die Headline gesetzt und einer Breite von 100% ausgegeben.</p>
</div>
<div class="col-md-8 col-sm-6">
@ -56,7 +56,7 @@
<div class="slim" style="margin:20px auto;"
data-label='<span class="text-green">Foto-Upload</span><br>(Datei suchen oder Drag & Drop)'
data-fetcher="fetch.php"
data-size="600,400"
data-size="1680,640"
data-min-size="100,100"
data-max-file-size="10"
data-status-image-too-small="Bild zu klein<br>min. $0 Pixel"

View file

@ -0,0 +1,37 @@
@extends('layouts.layout-2')
@section('content')
@if ($errors->any())
<div class="row">
<div class="col-sm-12">
<div class="alert alert-danger">
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
</div>
</div>
@endif
<h4 class="font-weight-bold py-2 mb-2">
{{ __('Create/Edit Inhaltsstoff') }}
</h4>
{!! Form::open(['url' => route('admin_product_ingredient_store'), 'class' => 'form-horizontal', 'id'=>'']) !!}
<input type="hidden" name="id" id="id" value="@if($model->id>0){{$model->id}}@else new @endif">
@include('admin.ingredient.form')
<div class="text-left mt-0 mb-2">
<button type="submit" class="btn btn-submit">{{ __('save') }}</button>&nbsp;
<a href="{{ route('admin_product_ingredients') }}" class="btn btn-default">{{ __('back') }}</a>
</div>
{!! Form::close() !!}
@endsection

View file

@ -0,0 +1,43 @@
<div class="card mb-2">
<h5 class="card-header">
{{ __('Inhaltsstoff') }}
</h5>
<div class="card-body">
<div class="form-row">
<div class="form-group col">
<label class="custom-control custom-checkbox float-right">
{!! Form::checkbox('active', 1, $model->active, ['class'=>'custom-control-input']) !!}
<span class="custom-control-label">{{__('aktiv')}}</span>
</label>
<label class="form-label" for="name">{{ __('Name') }}*</label>
{{ Form::text('name', $model->name, array('placeholder'=>__('Name'), 'class'=>'form-control', 'id'=>'name', 'required')) }}
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label class="form-label" for="headline">{{ __('INCI') }}</label>
{{ Form::textarea('inci', $model->inci, array('placeholder'=>__('INCI'), 'class'=>'form-control', 'id'=>'inci', 'rows'=>3)) }}
</div>
</div>
<div class="form-row">
<div class="form-group col">
<label class="form-label" for="headline">{{ __('Wirkung') }}</label>
{{ Form::textarea('effect', $model->effect, array('placeholder'=>__('Wirkung'), 'class'=>'form-control', 'id'=>'inci', 'rows'=>3)) }}
</div>
</div>
<div class="form-row">
<div class="form-group col-sm-2">
<label class="form-label" for="pos">{{ __('pos') }}</label>
{{ Form::text('pos', $model->pos, array('placeholder'=>__('pos'), 'class'=>'form-control', 'id'=>'pos')) }}
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,72 @@
@extends('layouts.layout-2')
@section('content')
<div class="card">
<h6 class="card-header">
{{__('Inhaltsstoffe')}}
</h6>
<div class="card-datatable table-responsive">
<table class="datatables-style table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{__('Pos')}}</th>
<th>{{__('Name')}}</th>
<th>{{__('INCI')}}</th>
<th>{{__('Wirkung') }}</th>
<th>{{__('Status')}}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($values as $value)
<tr>
<td>
<a href="{{route('admin_product_ingredient_edit', [$value->id])}}" class="btn icon-btn btn-sm btn-primary">
<span class="far fa-edit"></span>
</a>
</td>
<td>{{ $value->pos }}</td>
<td>{{ $value->name }}</td>
<td>{{ $value->inci }}</td>
<td>{{ $value->effect }}</td>
<td data-sort="{{ $value->active }}">@if($value->active) <span class="badge badge-pill badge-success"><i class="fa fa-check"></i></span>@else<span class="badge badge-pill badge-danger"><i class="fa fa-times"></i></span>@endif</td>
<td><a class="text-danger" href="{{ route('admin_product_ingredient_delete', [$value->id]) }}" onclick="return confirm('{{__('Really delete entry?')}}');"><i class="far fa-trash-alt"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 ml-4">
<a href="{{route('admin_product_ingredient_edit', ['new'])}}" class="btn btn-sm btn-primary">
{{__('Neuen Inhaltsstoff erstellen')}}
</a>
</div>
</div>
</div>
<script>
$( document ).ready(function() {
$('.datatables-style').dataTable({
"bLengthChange": false,
"iDisplayLength": 100,
"order": [[ 1, "asc" ]],
"aoColumns": [
{ "sWidth": "8%" },
{ "sWidth": "8%" },
{ "sWidth": "19%" },
{ "sWidth": "19%" },
{ "sWidth": "30%" },
{ "sWidth": "10%" },
{ "sWidth": "8%" },
],
"language": {
"url": "/js/German.json"
}
});
});
</script>
@endsection

View file

@ -242,10 +242,51 @@
{{ Form::textarea('usage', $product->usage , array('placeholder'=>__('usage'), 'class'=>'form-control summernote', 'id'=>'usage')) }}
</div>
<div class="form-group">
<label class="form-label" for="ingredients">{{ __('Inhaltsstoffe') }}</label>
<label class="form-label" for="ingredients">{{ __('Hinweise') }}</label>
{{ Form::textarea('ingredients', $product->ingredients , array('placeholder'=>__('ingredients'), 'class'=>'form-control summernote', 'id'=>'ingredients')) }}
</div>
</div>
</div>
<div class="card mb-2">
<h5 class="card-header">
{{ __('Inhalte') }}
</h5>
<div class="card-body">
<div class="card-datatable table-responsive pt-0">
<table class="datatables-style table table-striped table-bordered">
<thead>
<tr>
<th>{{__('Name')}}</th>
<th>{{__('INCI')}}</th>
<th>{{__('Wirkung') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach($product->p_ingredients as $ingredient)
<tr>
<td>{{ $ingredient->name }}</td>
<td>{{ $ingredient->inci }}</td>
<td>{{ $ingredient->effect }}</td>
<td><a class="text-danger" href="{{ route('admin_product_delete', [$product->id, 'ingredient', $ingredient->id]) }}" onclick="return confirm('{{__('Eintrag entfernen?')}}');"><i class="far fa-trash-alt"></i></a></td>
</tr>
@endforeach
</tbody>
</table>
</div>
<div class="form-row">
<div class="form-group col-sm-10">
<label class="form-label" for="title">{{ __('Inhaltsstoffe hinzufügen (Mehrfachauswahl)') }}</label>
<select class="selectpicker" name="product_ingredients[]" id="product_ingredients" data-style="btn-light" data-live-search="false" multiple>
{!! HTMLHelper::getProductIngredientsOptions($product->p_ingredients()->pluck('ingredient_id')->toArray()) !!}
</select>
<a class="btn btn-default btn-xs mt-2" href="{{route('admin_product_ingredients')}}">Inhaltsstoffe anlegen</a>
</div>
<div class="form-group col-sm-2">
<button type="submit" class="btn btn-submit mt-0 mt-sm-4">{{ __('save') }}</button>&nbsp;
</div>
</div>
</div>
</div>

View file

@ -56,7 +56,7 @@
<div class="slim" style="margin:20px auto;"
data-label='<span class="text-green">Foto-Upload</span><br>(Datei suchen oder Drag & Drop)'
data-fetcher="fetch.php"
data-size="1920,400"
data-size="1920,640"
data-min-size="100,100"
data-max-file-size="10"
data-status-image-too-small="Bild zu klein<br>min. $0 Pixel"

View file

@ -142,7 +142,6 @@
<script src="{{ mix('/js/application.js') }}"></script>
<script src="{{ asset('/js/custom.js') }}?v=1{{ get_file_last_time('/js/custom.js') }}"></script>
<script src="{{ asset('/js/iq-shopping-cart.js') }}?v=1{{ get_file_last_time('/js/iq-shopping-cart.js') }}"></script>
@yield('scripts')

View file

@ -143,6 +143,9 @@
<li class="sidenav-item{{ Request::is('admin/product/categories') ? ' active' : '' }}">
<a href="{{ route('admin_product_categories') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-list"></i><div>{{ __('navigation.categories') }}</div></a>
</li>
<li class="sidenav-item{{ Request::is('admin/product/ingredients') ? ' active' : '' }}">
<a href="{{ route('admin_product_ingredients') }}" class="sidenav-link"><i class="sidenav-icon ion ion-ios-ice-cream"></i><div>{{ __('navigation.ingredients') }}</div></a>
</li>
<li class="sidenav-item{{ Request::is('admin/product/attributes') ? ' active' : '' }}">
<a href="{{ route('admin_product_attributes') }}" class="sidenav-link"><i class="sidenav-icon ion ion-md-apps"></i><div>{{ __('navigation.attribute') }}</div></a>
</li>

View file

@ -35,6 +35,8 @@
<button type="submit" name="action" value="makePaymentMethodsDefault" class="btn btn-primary"><i class="ion"></i> make PaymentMethods Default</button>
<button type="submit" name="action" value="checkContractPDF" class="btn btn-primary"><i class="ion"></i> check Contract PDF</button>
</div>

View file

@ -0,0 +1,71 @@
@if($homeparty_user)
@if($homeparty_user->isAddress())
@if($homeparty_user->same_as_billing)
<p>
@if($homeparty_user->billing_company)
{{ $homeparty_user->billing_company }}
<br>
@endif
{{ \App\Services\HTMLHelper::getSalutationLang($homeparty_user->billing_salutation) }}
{{ $homeparty_user->billing_firstname }}
{{ $homeparty_user->billing_lastname }}
<br>
{{ $homeparty_user->billing_address }}
<br>
@if($homeparty_user->billing_address_2)
{{ $homeparty_user->billing_address_2 }}
<br>
@endif
{{ $homeparty_user->billing_zipcode }}
{{ $homeparty_user->billing_city }}
<br>
@if($homeparty_user->billing_country)
{{ $homeparty_user->billing_country->getLocated() }}
<br>
@endif
@if($homeparty_user->billing_email)
E-Mail:{{ $homeparty_user->billing_email }}
<br>
@endif
@if($homeparty_user->billing_phone)
Telefon: {{ $homeparty_user->billing_phone }}
@endif
</p>
@else
<p>
@if($homeparty_user->shipping_company)
{{ $homeparty_user->shipping_company }}
<br>
@endif
{{ \App\Services\HTMLHelper::getSalutationLang($homeparty_user->shipping_salutation) }}
{{ $homeparty_user->shipping_firstname }}
{{ $homeparty_user->shipping_lastname }}
<br>
{{ $homeparty_user->shipping_address }}
<br>
@if($homeparty_user->shipping_address_2)
{{ $homeparty_user->shipping_address_2 }}
<br>
@endif
{{ $homeparty_user->shipping_zipcode }}
{{ $homeparty_user->shipping_city }}
<br>
@if($homeparty_user->shipping_country)
{{ $homeparty_user->shipping_country->getLocated() }}
<br>
@endif
@if($homeparty_user->shipping_email)
E-Mail:{{ $homeparty_user->shipping_email }}
<br>
@endif
@if($homeparty_user->shipping_phone)
Telefon: {{ $homeparty_user->shipping_phone }}
@endif
</p>
@endif
@else
<p>Keine Adresse angelegt</p>
@endif
@endif

View file

@ -13,7 +13,7 @@
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default float-right">zurück</a>
</h4>
{!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-party-form-validation']) !!}
{!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-party-form-validation']) !!}
<div class="card mb-4">
<h5 class="card-header">
@ -74,29 +74,31 @@
</div>
</div>
<div class="text-left mt-3">
<button type="submit" class="btn btn-secondary mr-2 mb-2" name="action" value="homeparty-party-store">{{ __('speichern') }}</button>&nbsp;
<button type="submit" class="btn btn-secondary mr-2 mb-2" name="action" value="homeparty-party-store">
@if($homeparty->id) {{ __('Änderungen speichern') }} @else {{ __('speichern') }} @endif</button>&nbsp;
<a href="{{route('user_homepartys')}}" class="btn btn-default mb-2">zurück zur Übersicht</a>
</div>
{!! Form::close() !!}
@if($homeparty->id)
{!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-user-form-validation']) !!}
<hr>
<div class="card mb-4">
<div class="card mb-3 mt-2">
<div class="col-md-12 px-4 pt-4">
<h6 class="mb-4">Lass den Gastgeber seine Daten selber ausfüllen</h6>
<h6 class="mb-4">Lass den Gastgeber/in seine Daten selber ausfüllen</h6>
<div class="form-group">
<div class="input-group">
<span class="input-group-prepend">
<button class="btn btn-secondary" type="button" title="Kopiert!" data-clipboard-demo data-clipboard-target="#homeparty_link"><i class="ion ion-ios-copy"></i> Link kopieren</button>
</span>
<input type="text" class="form-control" name="homeparty_link" value="{{ $homeparty->homeparty_host->getTokenLink() }}" id="homeparty_link" placeholder="">
<input type="text" class="form-control" name="homeparty_link" value="{{ $homeparty->getTokenLink() }}" id="homeparty_link" placeholder="">
</div>
</div>
<p>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.</p>
<hr>
<p>Teile diesen Link mit dem Gastgeber/in und Gästen (z.B. WhatsApp oder SMS), damit gelangt sie auf eine Zielseite wo sie ihre Daten selber ausfüllen können. Nutze das „Kopier-Symbol“, um den Link gleich in Deine Zwischenablage zu kopieren.</p>
</div>
</div>
<hr>
{!! Form::open(['url' => route('user_homeparty_detail', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-user-form-validation']) !!}
<div class="card mb-4">
<h5 class="card-header">
<div class="row">
<div class="col-xs-12 col-sm-6">

View file

@ -7,21 +7,7 @@
</h4>
{!! Form::open(['url' => route('user_homeparty_guest_detail', [$homeparty->id, $homeparty_user->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-user-form-validation']) !!}
<hr>
<div class="card mb-4">
<div class="col-md-12 px-4 pt-4">
<h6 class="mb-4">Lass den @if($homeparty_user->is_host) Gastgeber @else Gast @endif seine Daten selber ausfüllen</h6>
<div class="form-group">
<div class="input-group">
<span class="input-group-prepend">
<button class="btn btn-secondary" type="button" title="Kopiert!" data-clipboard-demo data-clipboard-target="#homeparty_link"><i class="ion ion-ios-copy"></i> Link kopieren</button>
</span>
<input type="text" class="form-control" name="homeparty_link" value="{{ $homeparty_user->getTokenLink() }}" id="homeparty_link" placeholder="">
</div>
</div>
<p>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.</p>
<hr>
</div>
<h5 class="card-header">
<div class="row">
<div class="col-xs-12 col-sm-6">

View file

@ -25,7 +25,7 @@
{{-- <span class="badge badge-success align-text-bottom ml-1">offen ...</span> --}}
</div>
<div>
<a href="{{route('user_homeparty_guest_detail', [$homeparty->id, $homeparty_user->id])}}" class="btn btn-sm btn-secondary mr-2"><i class="ion ion-ios-cog"></i> Verwalten</a>
<a href="{{route('user_homeparty_guest_detail', [$homeparty->id, $homeparty_user->id])}}" class="btn btn-sm btn-secondary mr-2"><i class="fa fa-edit"></i> bearbeiten</a>
<div class="btn-group project-actions">
<button type="button" class="btn btn-sm btn-default icon-btn borderless rounded-pill md-btn-flat dropdown-toggle hide-arrow" data-toggle="dropdown">
@ -73,37 +73,14 @@
</div>
</div>
</div>
<hr class="m-0">
<div class="card-body py-3">
<div class="form-group mb-0">
<div class="input-group">
<span class="input-group-prepend">
<button class="btn btn-sm btn-secondary" type="button" title="Kopiert!" data-clipboard-demo data-clipboard-target="#homeparty_link_{{$homeparty_user->id}}"><i class="ion ion-ios-copy"></i> Link kopieren</button>
</span>
<input type="text" class="form-control" name="homeparty_link_{{$homeparty_user->id}}" value="{{ $homeparty_user->getTokenLink() }}" id="homeparty_link_{{$homeparty_user->id}}" placeholder="">
</div>
</div>
</div>
</div>
@endforeach
</div>
</div>
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default float-right">zurück zur Übersicht</a>
<script>
$( document ).ready(function() {
var clipboardDemos = new ClipboardJS('[data-clipboard-demo]');
clipboardDemos.on('success', function (e) {
e.clearSelection();
$(e.trigger).tooltip('enable').tooltip('show');
});
clipboardDemos.on('error', function (e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
<div class="text-left mt-1">
<a href="{{route('user_homeparty_detail', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-2"><i class="ion ion-ios-cog"></i> Homparty verwalten</a>
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default mb-2">zurück zur Übersicht</a>
</div>
$('button[data-clipboard-demo]').on('mouseout', function () {
$(this).tooltip('disable');
})
});
</script>
@endsection

View file

@ -59,6 +59,17 @@
</div>
</div>
<hr class="m-0">
<div class="card-body py-3">
<div class="form-group mb-0">
<div class="input-group">
<span class="input-group-prepend">
<button class="btn btn-sm btn-secondary" type="button" title="Kopiert!" data-clipboard-demo data-clipboard-target="#homeparty_link_{{$homeparty->id}}"><i class="ion ion-ios-copy"></i> Link kopieren</button>
</span>
<input type="text" class="form-control" name="homeparty_link_{{$homeparty->id}}" value="{{ $homeparty->getTokenLink() }}" id="homeparty_link_{{$homeparty->id}}" placeholder="">
</div>
</div>
</div>
<hr class="m-0">
<div class="card-body py-3">
<div class="d-flex flex-wrap">
<a href="{{route('user_homeparty_detail', [$homeparty->id])}}" class="btn btn-secondary mr-2 mb-2"><i class="ion ion-ios-cog"></i> Verwalten</a>
@ -72,8 +83,19 @@
</div>
<script>
$( document ).ready(function() {
var clipboardDemos = new ClipboardJS('[data-clipboard-demo]');
clipboardDemos.on('success', function (e) {
e.clearSelection();
$(e.trigger).tooltip('enable').tooltip('show');
});
clipboardDemos.on('error', function (e) {
console.error('Action:', e.action);
console.error('Trigger:', e.trigger);
});
$('button[data-clipboard-demo]').on('mouseout', function () {
$(this).tooltip('disable');
})
});
</script>
@endsection

View file

@ -0,0 +1,66 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">
Produkt hinzufügen /
@if($homeparty_user->is_host)
Gastgeber/in
@else
Gast
@endif
{{ $homeparty_user->billing_firstname }} {{ $homeparty_user->billing_lastname }}
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">×</button>
</div>
<div class="modal-body">
<div class="card-datatable pt-0 table-responsive">
<table id="datatable-homeparty" class="table table-striped table-bordered" data-homeparty-id="{{$homeparty->id}}" data-homeparty-user-id="{{$homeparty_user->id}}">
<thead>
<tr>
<th></th>
<th>{{__('Bild')}}</th>
<th>{{__('Produkt')}}</th>
<th>{{__('Artikelnummer')}}</th>
<th>{{__('EK-Preis brutto')}}</th>
<th>{{__('VK-Preis brutto')}}</th>
<th>{{__('Points')}}</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">schließen</button>
</div>
</div>
<script>
$( document ).ready(function() {
var oTable = $('#datatable-homeparty').DataTable({
"processing": true,
"serverSide": true,
"ajax": '{!! route('user_homeparty_datatable') !!}',
"order": [[4, "asc" ]],
"columns": [
{ data: 'add_card', name: 'add_card', searchable: false, orderable: false },
{ data: 'picture', name: 'picture', searchable: false, width: 35 },
{ data: 'name', name: 'name' },
{ data: 'number', name: 'number' },
{ data: 'price_gross', name: 'price_gross', searchable: false, orderable: false },
{ data: 'price_vk_gross', name: 'price_vk_gross', searchable: false },
{ data: 'points', name: 'points', searchable: false },
],
"bLengthChange": false,
"iDisplayLength": 1000,
"paging": false,
"language": {
"url": "/js/German.json"
},
drawCallback: function (settings) {
iqHomepartyCart.reInitModal();
}
});
iqHomepartyCart.setDatabase('#datatable-homeparty');
});
</script>

View file

@ -0,0 +1,235 @@
@extends('layouts.layout-2')
@section('content')
<style>
.table-small {
font-size: 0.9em;
width: auto;
}
.table-small td {
padding: 0.225rem 1rem 0.225rem 0;
}
.btn-md-extra {
padding: 0.3rem 0.6rem;
font-size: 0.8rem;
line-height: 1.5;
border-radius: 0.25rem;
}
.md-btn-extra {
width: calc(1.7rem + 2px) !important;
line-height: 1.5rem;
}
.form-control.input-extra {
padding: 0.28rem 0.6rem;
font-size: 0.8rem;
font-weight: 500;
min-height: calc(1.8rem + 2px);
height: calc(1.8rem + 2px);
width: 44px;
}
.input-group-min-w {
min-width: 102px;
}
.img-extra {
min-width:55px;
max-height: 120px;
}
.table td.border-top {
border: none;
border-top: 1px solid #ccccdb;
}
.table td {
border: none;
}
.table th {
border: none;
border-bottom: 1px solid #c3c3d2;
}
@media (max-width: 767px) {
.default-style:not([dir=rtl]) div.card-datatable table.dataTable thead th:first-child,
.default-style:not([dir=rtl]) div.card-datatable table.dataTable tbody td:first-child,
.default-style:not([dir=rtl]) div.card-datatable table.dataTable tfoot th:first-child {
padding-left: 0.6rem !important;
}
.img-extra {
min-width:35px;
max-height: 160px;
}
}
.table .foot-small td {
padding: 0.225rem 0.625rem;
}
.table .text-body {
font-size: 0.9em;
}
.table .options a.auto-delete-product {
font-size: 0.7em;
font-weight: bold;
text-transform: uppercase;
}
.table .min-width-80 {
min-width: 160px;
}
</style>
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
<div>{{ __('navigation.my_homeparty') }} / {{ $homeparty->name }} - {{ $homeparty->date }}</div>
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default float-right">zurück</a>
</h4>
{!! Form::open(['url' => route('user_homeparty_order', [$homeparty->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-order-form']) !!}
<div class="card mb-4">
<h5 class="card-header">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center w-100">
<div>Bestellung anlegen</div>
<div class="float-right">
<a href="{{route('user_homeparty_detail', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-ios-cog"></i> Verwalten</a>
<a href="{{route('user_homeparty_guests', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-1"><i class="ion ion-md-person-add"></i> Gäste anlegen</a>
</div>
</div>
</div>
</div>
</h5>
<div class="card-body">
<div class="row">
<div class="col-md-6">
<h6>Lieferadresse Gastgeber/in <a href="{{route('user_homeparty_guest_detail', [$homeparty->id, $homeparty->homeparty_host->id])}}"><i class="fa fa-edit"></i> </a></h6>
@include('user.homeparty._address', ['homeparty_user' => $homeparty->homeparty_host])
</div>
{{-- TODO Berechnung Bonus --}}
<div class="col-md-6">
<h6>Aktuelle Bonusansicht</h6>
<div id="insert_show_bonus">
@include('user.homeparty.show_bonus', ['homeparty' => $homeparty])
</div>
</div>
</div>
</div>
</div>
@if($homeparty->homeparty_host)
<div class="card mb-3">
<h5 class="card-header">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center w-100">
<div>Bestellung Gastgeber/in {{$homeparty->homeparty_host->billing_firstname}} {{$homeparty->homeparty_host->billing_lastname}}</div>
</div>
</div>
<div class="col-12">
<button type="button" class="btn btn-sm btn-secondary btn-block mt-2" data-toggle="modal" data-target="#modals-load-content"
data-id="{{ $homeparty->id }}"
data-action="homeparty-add-product"
data-user_id="{{$homeparty->homeparty_host->id}}"
data-route="{{ route('modal_load') }}"><i class="fa fa-plus-circle"></i> Produkt hinzufügen</button>
</div>
</div>
</h5>
<div class="card-body">
<div class="insert_show_products_order" id="insert_show_products_order_{{$homeparty->homeparty_host->id}}" data-homeparty-id="{{ $homeparty->id }}" data-homeparty-user-id="{{$homeparty->homeparty_host->id}}">
@include('user.homeparty.show_products_order', ['homeparty_guest' => $homeparty->homeparty_host])
</div>
</div>
</div>
@endif
@if($homeparty->homeparty_guests)
@php($g_count = 1)
@foreach($homeparty->homeparty_guests as $homeparty_guest)
<div class="card mb-3">
<h5 class="card-header">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center w-100">
<div>Bestellung {!! $g_count++ !!}. Gast {{$homeparty_guest->billing_firstname}} {{$homeparty_guest->billing_lastname}}</div>
</div>
</div>
<div class="col-12">
<button type="button" class="btn btn-sm btn-secondary btn-block mt-2" data-toggle="modal" data-target="#modals-load-content"
data-id="{{ $homeparty->id }}"
data-action="homeparty-add-product"
data-user_id="{{$homeparty_guest->id}}"
data-route="{{ route('modal_load') }}"><i class="fa fa-plus-circle"></i> Produkt hinzufügen</button>
</div>
</div>
</h5>
<div class="card-body">
<div class="insert_show_products_order" id="insert_show_products_order_{{$homeparty_guest->id}}" data-homeparty-id="{{ $homeparty->id }}" data-homeparty-user-id="{{$homeparty_guest->id}}">
@include('user.homeparty.show_products_order', ['homeparty_guest' => $homeparty_guest])
</div>
</div>
</div>
@endforeach
@endif
<hr>
<div class="card mb-4">
<h5 class="card-header">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center w-100">
<div>Gesamtübersicht</div>
</div>
</div>
</div>
</h5>
{{-- TODO Berechnung des WK --}}
<div class="card-body">
<div id="insert_show_total_order">
@include('user.homeparty.show_total_order', ['homeparty' => $homeparty])
</div>
<hr>
@if($homeparty->homeparty_host && $homeparty->homeparty_host->isAddress())
<div class="float-right">
<button type="submit" class="btn btn-secondary"><i class="ion ion-ios-redo"></i> bestätigen und weiter zur Kasse</button>
</div>
<br><br>
<em class="small text-center"> <i class="fa fa-lock"></i> Du wirst auf unseren checkout Server weitergeletet, die Verbindung ist SSL verschlüsselt.</em>
@else
<div class="alert alert-warning">
Die Bestellung kann erst abgesendet werden, wenn die Lieferadresse Gastgeber/in angelegt ist. <a href="{{route('user_homeparty_guest_detail', [$homeparty->id, $homeparty->homeparty_host->id])}}"><i class="fa fa-edit"></i> </a></h6>
</div>
@endif
</div>
</div>
<div class="text-left mt-3">
<a href="{{route('user_homeparty_detail', [$homeparty->id])}}" class="btn btn-sm btn-secondary mr-2 mb-2"><i class="ion ion-ios-cog"></i> Homparty verwalten</a>
<a href="{{route('user_homepartys')}}" class="btn btn-sm btn-default mb-2">zurück zur Übersicht</a>
</div>
{!! Form::close() !!}
@endsection
@section('scripts')
<script src="{{ asset('/js/iq-homeparty-cart.js') }}?v=1{{ get_file_last_time('/js/iq-homeparty-cart.js') }}"></script>
<script type="application/javascript">
var iqHomepartyCart = IqHomepartyCart.init();
$( document ).ready(function() {
});
</script>
@endsection

View file

@ -1,21 +1,87 @@
@extends('layouts.layout-2-without')
@section('content')
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
<div>Homeparty / {{ $homeparty->name }} - {{ $homeparty->date }}</div>
<a href="{{route('user_homeparty_guests', [$homeparty->id])}}" class="btn btn-sm btn-default float-right">zurück</a>
</h4>
{!! Form::open(['url' => route('homeparty', [$homeparty_user->token]), 'class' => 'form-horizontal', 'id'=>'homeparty-user-form-validation']) !!}
<hr>
@if($homeparty_user === null)
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
<div>Homeparty / {{ $homeparty->name }} - {{ $homeparty->date }}</div>
</h4>
@if(Session::has('alert-save'))
<div class="alert alert-dark-secondary alert-dismissible fade show">
<div class="font-weight-bold">
{{__('saved')}}: {{__('The changes have been saved.')}}
</div>
</div>
@endif
<div class="row">
<div class="col-12">
@php($g_count = 1)
@foreach($homeparty->homeparty_users as $homeparty_user)
<div class="card mb-4">
<div class="card-body d-flex justify-content-between align-items-start pb-2">
<div>
<a href="{{route('homeparty', [$homeparty->token, $homeparty_user->id])}}" class="text-body text-big font-weight-semibold">
@if($homeparty_user->is_host)
<span class="text-muted">Gastgeber/in: </span>
@else
<span class="text-muted">Gast {{$g_count++}}: </span>
@endif
{{$homeparty_user->billing_firstname}} {{$homeparty_user->billing_lastname}}
</a>
{{-- <span class="badge badge-success align-text-bottom ml-1">offen ...</span> --}}
</div>
<div>
<a href="{{route('homeparty', [$homeparty->token, $homeparty_user->id])}}" class="btn btn-sm btn-secondary mr-2"><i class="fa fa-edit"></i> bearbeiten</a>
</div>
</div>
<div class="progress rounded-0" style="height: 2px;">
<div class="progress-bar" style="width: 100%;"></div>
</div>
<div class="card-body pt-1 pb-3">
{{$homeparty->description}}
</div>
<div class="card-body pt-0">
<div class="row">
<div class="col">
<div class="text-muted small">Adresse</div>
<div class="font-weight-bold">{{$homeparty_user->billing_address}}
{{$homeparty_user->billing_zipcode}}
{{$homeparty_user->city}}
@if($homeparty_user->billing_country_id){{ $homeparty_user->billing_country->getLocated() }}@endif
</div>
</div>
<div class="col">
<div class="text-muted small">E-Telefon</div>
<div class="font-weight-bold">{{$homeparty_user->billing_phone}}</div>
</div>
<div class="col">
<div class="text-muted small">E-Mail</div>
<div class="font-weight-bold">{{$homeparty_user->billing_email}}</div>
</div>
</div>
</div>
</div>
@endforeach
</div>
</div>
<a href="{{route('homeparty', [$homeparty->token, 'new'])}}" class="btn btn-md btn-secondary rounded-pill"><span class="ion ion-md-add"></span>&nbsp; Neue Gast anlegen</a>
@else
<h4 class="font-weight-bold py-2 mb-2 d-flex justify-content-between align-items-center w-100 ">
<div>Homeparty / {{ $homeparty->name }} - {{ $homeparty->date }}</div>
<a href="{{route('homeparty', [$homeparty->token])}}" class="btn btn-sm btn-default float-right">zurück</a>
</h4>
{!! Form::open(['url' => route('homeparty', [$homeparty->token, $homeparty_user->id]), 'class' => 'form-horizontal', 'id'=>'homeparty-user-form-validation']) !!}
@if(Session::has('alert-save'))
<div class="alert alert-dark-secondary alert-dismissible fade show">
<div class="font-weight-bold">
{{__('saved')}}: {{__('The changes have been saved.')}}
</div>
</div>
@endif
@endif
<div class="card mb-4">
<div class="col-md-12 px-4 pt-4">
<h6 class="mb-4">Eingabe Deiner persönlichen Daten für die Homeparty</h6>
@ -24,7 +90,7 @@
<h5 class="card-header">
<div class="row">
<div class="col-xs-12 col-sm-6">
@if($homeparty_user->is_host) Gastgeber, @else Gast-, @endif Rechungsadresse
@if($homeparty_user->is_host) Gastgeber/in, @else Gast-, @endif Rechungsadresse
</div>
<div class="col-xs-12 col-sm-6">
<span class="text-tiny float-right">* {{trans('register.required_fields')}}</span>
@ -34,21 +100,21 @@
</h5>
@include('user.homeparty._edit')
<hr class="mt-0">
<div class="form-row px-4">
<div class="form-group">
<label class="custom-control custom-checkbox m-2 ">
<input type="checkbox" class="custom-control-input" name="check_for_ot" id="checkbox_for_me" required>
<span class="custom-control-label secondary">
<span class="fa fa-angle-double-left text-primary fa-lg"></span>
Hiermit willige ich in die im Rahmen der <button type="button" class="btn btn-outline-primary btn-xs update_modal_data_load" data-url="https://my.mivita.test/loading/modal" data-data="data_protection" data-target="#modal-loading">Datenschutzerklärung</button>
genannte Datenverarbeitung ein. Ich wurde darüber informiert, dass ich diese Einwilligung jederzeit widerrufen kann.*
</span>
</label>
</div>
<div class="form-row px-4">
<div class="form-group">
<label class="custom-control custom-checkbox m-2 ">
<input type="checkbox" class="custom-control-input" name="check_for_ot" id="checkbox_for_me" required>
<span class="custom-control-label secondary">
<span class="fa fa-angle-double-left text-primary fa-lg"></span>
Hiermit willige ich in die im Rahmen der <button type="button" class="btn btn-outline-primary btn-xs update_modal_data_load" data-url="https://my.mivita.test/loading/modal" data-data="data_protection" data-target="#modal-loading">Datenschutzerklärung</button>
genannte Datenverarbeitung ein. Ich wurde darüber informiert, dass ich diese Einwilligung jederzeit widerrufen kann.*
</span>
</label>
</div>
</div>
</div>
<div class="text-left mt-3">
<button type="submit" class="btn btn-secondary mr-2 mb-2" name="action" value="homeparty-user-store">{{ __('Änderungen speichern') }}</button>&nbsp;
<button type="submit" class="btn btn-secondary mr-2 mb-2" name="action" value="homeparty-user-store"> @if($homeparty_user->id) {{ __('Änderungen speichern') }} @else {{ __('speichern') }} @endif</button>&nbsp;
</div>
{!! Form::close() !!}
@ -131,4 +197,6 @@
});
</script>
@endif
@endsection

View file

@ -0,0 +1,43 @@
<table class="table table-small">
<tr>
<td>Zielumsatz {{\App\Services\HomepartyCart::getFormattedBonusValue()}} &euro; Gutschein:</td>
<td>{{\App\Services\HomepartyCart::getFormattedPrice()}} &euro; / {{\App\Services\HomepartyCart::getFormattedBonusStart()}} &euro;</td>
</tr>
@if(!\App\Services\HomepartyCart::$is_bonus)
<tr>
<td>fehlen noch:</td>
<td><span class="text-danger font-weight-bold"> {{\App\Services\HomepartyCart::getFormattedBonusDiff()}} &euro;</span></td>
</tr>
<tr>
<td class="border-top">Nächster Bonus:</td>
<td class="border-top">- &euro; </td>
</tr>
<tr>
<td class="">fehlen noch:</td>
<td class="">- &euro;</td>
</tr>
@else
<tr>
<td>fehlen noch:</td>
<td>0 &euro;</td>
</tr>
<tr>
<td class="border-top">Nächster Bonus {{\App\Services\HomepartyCart::getFormattedBonusCouponNextValue()}} &euro; ab:</td>
<td class="border-top">{{\App\Services\HomepartyCart::getFormattedBonusCouponNextStep()}} &euro; </td>
</tr>
<tr>
<td class="">fehlen noch:</td>
<td class="">{{\App\Services\HomepartyCart::getFormattedBonusCouponFault()}} &euro;</td>
</tr>
@endif
<tr>
<td>Gutschein Bonus:</td>
<td>{{\App\Services\HomepartyCart::getFormattedBonusCoupon()}} &euro;</td>
</tr>
<tr>
<td class="border-top"><strong>Gutschein Gesamt</strong></td>
<td class="border-top"><strong>{{\App\Services\HomepartyCart::getFormattedBonusTotal()}} &euro;</strong></td>
</tr>
</table>

View file

@ -0,0 +1,39 @@
@php($user_cart = \App\Services\HomepartyCart::getUserCartHost())
@if(\App\Services\HomepartyCart::$is_bonus)
<tr class="foot-small">
<td colspan="5" class="text-left">Gutschrift Homeparty Gutschein</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="text-right">- {{ \App\Services\HomepartyCart::getFormattedBonusValue() }} &euro;</td>
</tr>
@endif
@if(\App\Services\HomepartyCart::$is_bonus_coupon)
<tr class="foot-small">
<td colspan="5" class="text-left">Gutschrift Bonus</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="text-right">- {{ \App\Services\HomepartyCart::getFormattedBonusCoupon() }} &euro;</td>
</tr>
@endif
@if(\App\Services\HomepartyCart::$is_bonus)
<tr class="foot-small">
<td colspan="5" class="text-left">Abzug Points durch Gutschein</td>
<td class="text-right">- {{ \App\Services\HomepartyCart::getFormattedBonusPointsDiff() }} </td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
@endif
<tr class="foot-small">
<td colspan="5" class="text-left">Versandkosten:</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="text-right">0 &euro;</td>
</tr>
<tr>
<td colspan="4" class="border-top"><strong>Gesamt:</strong></td>
<td class="border-top text-right"><strong>{{$user_cart->getFormattedEkPrice()}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{$user_cart->getFormattedPoints()}}</strong></td>
<td class="border-top text-right"><strong>{{$user_cart->getFormattedIncomePrice()}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{$user_cart->getFormattedPrice()}} &euro;</strong></td>
</tr>

View file

@ -0,0 +1,100 @@
@if($homeparty_guest && $homeparty_guest->homeparty_user_order_items->count())
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>{{__('Bild')}}</th>
<th>{{__('Produkt')}}</th>
<th>{{__('Anzahl')}}</th>
<th>{{__('Marge')}}</th>
<th class="text-right">{{__('EK-Preis')}}</th>
<th class="text-right">{{__('Points')}}</th>
<th class="text-right">{{__('Verdienst')}}</th>
<th class="text-right">{{__('VK-Preis')}}</th>
</tr>
</thead>
<tbody>
@foreach($homeparty_guest->homeparty_user_order_items as $value)
<tr>
<td>
@if(count($value->product->images))
<img class="img-fluid img-extra" alt="" src="{{ route('product_image', [$value->product->images->first()->slug]) }}">
@endif
</td>
<td class="min-width-80">
<strong>{{ $value->product->name }}</strong>
<div class="text-body">
<div>Inhalt: {{ $value->product->contents }}</div>
<div>Art.-Nr.: {{ $value->product->number }}</div>
</div>
<div class="options">
<a href="#" class="auto-delete-product remove_item_form_cart product-tooltip" data-order-item-id="{{$value->id}}" data-product-id="{{ $value->product->id }}"><i class="fa fa-times"></i> Artikel entfernen</a>
</div>
</td>
<td>
<div class="no-line-break input-group-min-w">
<div class="input-group d-inline-flex w-auto">
<span class="input-group-prepend">
<button type="button" class="btn btn-secondary icon-btn md-btn-extra remove-from-basket" data-order-item-id="{{$value->id}}" data-product-id="{{ $value->product->id }}">-</button>
</span>
<input type="text" class="form-control text-center input-extra table-input-event-onchange" name="product_qty_{{$value->id}}" data-order-item-id="{{$value->id}}" data-product-id="{{ $value->product->id }}" value="{{$value->qty}}">
<span class="input-group-append">
<button type="button" class="btn btn-secondary icon-btn md-btn-extra add-from-basket" data-order-item-id="{{$value->id}}" data-product-id="{{ $value->product->id }}">+</button>
</span>
</div>
</div>
</td>
<td>
{{ $value->margin }}%
</td>
<td class="text-right">
{{ $value->getFormattedTotalEKPrice() }} &euro;
</td>
<td class="text-right">
{{ $value->getFormattedTotalPoints() }}
</td>
<td class="text-right">
{{ $value->getFormattedTotalIncomePrice() }} &euro;
</td>
<td class="text-right">
{{ $value->getFormattedTotalPrice() }} &euro;
</td>
</tr>
@endforeach
</tbody>
<tfoot id="insert_show_bonus_host">
@php($user_cart = \App\Services\HomepartyCart::getUserCart($homeparty_guest->id))
@if(!$homeparty_guest->is_host)
<tr class="foot-small">
<td colspan="3" class="border-top">
<select class="custom-select" name="filter_member_id" id="filter_member_id">
<option value="">Lieferung an Gastgeber</option>
<option value="">Lieferung direkt an den Gast</option>
</select>
</td>
<td colspan="5" class="border-top">&nbsp;</td>
</tr>
{{-- <tr>
<td colspan="5" class="text-left">Versandkosten</td>
<td>12</td>
<td>&nbsp;</td>
<td>25,00 &euro;</td>
</tr>
--}}
<tr>
<td colspan="4" class="border-top"><strong>Gesamt:</strong></td>
<td class="border-top text-right"><strong>{{$user_cart->getFormattedEkPrice()}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{$user_cart->getFormattedPoints()}}</strong></td>
<td class="border-top text-right"><strong>{{$user_cart->getFormattedIncomePrice()}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{$user_cart->getFormattedPrice()}} &euro;</strong></td>
</tr>
@else
@include('user.homeparty.show_calc_bonus_host')
@endif
</tfoot>
</table>
</div>
@endif

View file

@ -0,0 +1,103 @@
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>&nbsp;</th>
<th class="text-right">{{__('EK-Preis')}}</th>
<th class="text-right">{{__('Points')}}</th>
<th class="text-right">{{__('Verdienst')}}</th>
<th class="text-right">{{__('VK-Preis')}}</th>
</tr>
</thead>
<tbody>
@if($homeparty->homeparty_host)
@php($user_cart = \App\Services\HomepartyCart::getUserCart($homeparty->homeparty_host->id))
<tr>
<td>
<strong>Gastgeber/in {{$homeparty->homeparty_host->billing_firstname}} {{$homeparty->homeparty_host->billing_lastname}}</strong>
</td>
<td class="text-right">
{{$user_cart->getFormattedEkPrice()}} &euro;
</td>
<td class="text-right">
{{$user_cart->getFormattedPoints()}}
</td>
<td class="text-right">
{{$user_cart->getFormattedIncomePrice()}} &euro;
</td>
<td class="text-right">
{{$user_cart->getFormattedPrice()}} &euro;
</td>
</tr>
@endif
@if($homeparty->homeparty_guests)
@php($g_count = 1)
@foreach($homeparty->homeparty_guests as $homeparty_guest)
@php($user_cart = \App\Services\HomepartyCart::getUserCart($homeparty_guest->id))
<tr>
<td>
<strong> {!! $g_count++ !!}. Gast {{$homeparty_guest->billing_firstname}} {{$homeparty_guest->billing_lastname}}</strong>
</td>
<td class="text-right">
{{$user_cart->getFormattedEkPrice()}} &euro;
</td>
<td class="text-right">
{{$user_cart->getFormattedPoints()}}
</td>
<td class="text-right">
{{$user_cart->getFormattedIncomePrice()}} &euro;
</td>
<td class="text-right">
{{$user_cart->getFormattedPrice()}} &euro;
</td>
</tr>
@endforeach
@endif
</tbody>
<tfoot>
@if(\App\Services\HomepartyCart::$is_bonus)
<tr class="foot-small">
<td colspan="4" class="border-top">
zzgl. anteiliger Bonusgutschein:
</td>
<td class="border-top text-right">{{ App\Services\HomepartyCart::getFormattedBonusPrice() }}&euro;</td>
</tr>
@endif
<tr class="foot-small">
<td colspan="1" class="border-top">
<strong>Gesamtsummen:</strong>
</td>
<td class="border-top text-right"><strong>{{\App\Services\HomepartyCart::getFormattedEkPrice()}}</strong></td>
<td class="border-top text-right"><strong>{{\App\Services\HomepartyCart::getFormattedPoints()}}</strong></td>
<td class="border-top text-right"><strong>{{\App\Services\HomepartyCart::getFormattedIncomePrice()}} &euro;</strong></td>
<td class="border-top text-right"><strong>{{\App\Services\HomepartyCart::getFormattedPrice()}} &euro;</strong></td>
</tr>
<tr class="foot-small">
<td colspan="1" class="text-muted">
Summe ohne MwSt:
</td>
<td class="">&nbsp;</td>
<td class="">&nbsp;</td>
<td class="">&nbsp;</td>
<td class="text-muted text-right">{{\App\Services\HomepartyCart::getFormattedPriceNet()}} &euro;</td>
</tr>
<tr class="foot-small">
<td colspan="1" class="text-muted">
Enthaltene MwSt:
</td>
<td class="">&nbsp;</td>
<td class="">&nbsp;</td>
<td class="">&nbsp;</td>
<td class="text-muted text-right">{{\App\Services\HomepartyCart::getFormattedPriceTax()}} &euro;</td>
</tr>
</tfoot>
</table>
</div>

View file

@ -187,3 +187,7 @@
});
</script>
@endsection
@section('scripts')
<script src="{{ asset('/js/iq-shopping-cart.js') }}?v=1{{ get_file_last_time('/js/iq-shopping-cart.js') }}"></script>
@endsection

View file

@ -82,8 +82,6 @@
min-width: 4em;
display: inline-block;
}
}
}
</style>
<div id="cartContent">

View file

@ -66,15 +66,23 @@
<!-- -->
<section>
<div class="container">
<div class="row">
<p class="">MIVITA ist ein Unternehmen mit Standort in Deutschland, das innovative und umweltfreundliche
sowie hochwertige Produkte vertreibt. Seit seinem Markteintritt bekennt sich das MIVITA Unternehmen zu einem
Werteverständnis, bei dem die Zufriedenheit der Kunden, wie auch die Verantwortung für die Umwelt im Fokus
stehen.</p>
<div class="col-md-12">
@if($site->hasImage())
<img class="img-responsive margin-bottom-20" src="{{ route('iq_image', [$site->iq_image->slug]) }}" alt="">
@endif
<p class="">MIVITA ist ein Unternehmen mit Standort in Deutschland, das innovative und umweltfreundliche
sowie hochwertige Produkte vertreibt. Seit seinem Markteintritt bekennt sich das MIVITA Unternehmen zu einem
Werteverständnis, bei dem die Zufriedenheit der Kunden, wie auch die Verantwortung für die Umwelt im Fokus
stehen.</p>
<div class="divider divider-center divider-color"><!-- divider -->
<i class="fa fa-chevron-down"></i>
</div>
</div>
</div>
<!-- BORN TO BE A WINNER -->
<article class="row">

View file

@ -174,9 +174,9 @@
</div>
<div class="col-md-12" id="show_sales_partnership_message" @if(old('sales_partnership') !== 'JA') style="display: none;" @endif>
<hr class="my-3">
<p class="mb-3">Wahrscheinlich bist Du durch einen unserer bestehenden Vertriebspartner auf uns aufmerksam geworden. Bitte verrate uns daher, wie Du auf MIVITA gekommen bist. Es genügt ein Name oder ein Hinweis auf einen bestehenden Vertriebspartner (z. B. eine Website, ein Facebook-, Instagram-, Youtubeprofil oder ähnliches):*</p>
<p class="mb-3">Durch wen bist Du auf uns aufmerksam geworden (Vertriebspartner, Kunde, Social Media etc.)? Bitte unbedingt einen Namen angeben - das ist wichtig für unsere interne Zuordnung:*</p>
<div class="form-group">
{!! Form::textarea('sales_partnership_message', null, ['class' => 'form-control '.($errors->has('sales_partnership_message') ? 'error is-invalid' : ''), 'placeholder'=>__('Wie bist du auf uns aufmerksam geworden?'), 'rows'=>4]) !!}
{!! Form::textarea('sales_partnership_message', null, ['class' => 'form-control '.($errors->has('sales_partnership_message') ? 'error is-invalid' : ''), 'placeholder'=>__('Vor- und Name, Website, Facebook-, Instagram-, Youtubeprofil oder ähnliches'), 'rows'=>4]) !!}
@if ($errors->has('sales_partnership_message'))
<div class="alert alert-danger error"><!-- DANGER -->
{{ $errors->first('sales_partnership_message') }}

View file

@ -51,7 +51,7 @@
</div>
<div class="col-md-9 col-sm-9">
<h1>{{$headline}} @if($headline_image) <img src="{{ route('iq_image', [$headline_image->slug]) }}" height="60" alt=""/> @endif</h1>
<h1>{{$headline}} @if($headline_image) <img src="{{ route('iq_image', [$headline_image->slug]) }}" class="img-responsive" alt=""/> @endif</h1>
<ul class="shop-item-list row list-inline nomargin">
@foreach($products as $product)
<!-- ITEM -->

View file

@ -150,8 +150,8 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
Route::get('/card/show', 'HomeController@index')->name('my.card_show');
Route::get('/back/to/shop/{reference?}', 'HomeController@backToShop')->name('my.back_to_shop');
Route::get('/homeparty/{token?}', 'Web\HomepartyController@detail')->name('homeparty');
Route::post('/homeparty/{token?}', 'Web\HomepartyController@detailStore')->name('homeparty');
Route::get('/homeparty/{token?}/{gid?}', 'Web\HomepartyController@detail')->name('homeparty');
Route::post('/homeparty/{token?}/{gid?}', 'Web\HomepartyController@detailStore')->name('homeparty');
Route::group(['middleware' => ['auth']], function() {
@ -269,15 +269,13 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
Route::get('/user/homepartys', 'User\HomePartyController@index')->name('user_homepartys');
Route::get('/user/homeparty/detail/{id?}', 'User\HomePartyController@detail')->name('user_homeparty_detail');
Route::post('/user/homeparty/detail/{id?}', 'User\HomePartyController@store')->name('user_homeparty_detail');
Route::get('/user/homeparty/guests/{id?}', 'User\HomePartyController@guests')->name('user_homeparty_guests');
Route::get('/user/homeparty/guest/detail/{id?}/{gid?}', 'User\HomePartyController@guestDetail')->name('user_homeparty_guest_detail');
Route::post('/user/homeparty/guest/detail/{id?}/{gid?}', 'User\HomePartyController@guestStore')->name('user_homeparty_guest_detail');
Route::get('/user/homeparty/order/{id?}', 'User\HomePartyController@order')->name('user_homeparty_order');
Route::post('/user/homeparty/order/{id?}', 'User\HomePartyController@orderStore')->name('user_homeparty_order');
Route::get('/user/homeparty/delete/{do}/{id?}/{gid?}', 'User\HomePartyController@delete')->name('user_homeparty_delete');
Route::get('/user/homeparty/datatable', 'User\HomePartyController@datatable')->name('user_homeparty_datatable');
//products images
Route::post('/user/shop_on_site/upload/image', 'UserShopController@uploadOnSiteImage')->name('user_shop_on_site_upload_image');
@ -311,7 +309,7 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
Route::post('/admin/product/store', 'ProductController@store')->name('admin_product_store');
Route::get('/admin/product/edit/{id}', 'ProductController@edit')->name('admin_product_edit');
Route::get('/admin/product/copy/{id}', 'ProductController@copy')->name('admin_product_copy');
Route::get('/admin/product/delete/{id}', 'ProductController@delete')->name('admin_product_delete');
Route::get('/admin/product/delete/{id}/{do?}/{did?}', 'ProductController@delete')->name('admin_product_delete');
//products images
Route::post('/admin/product/image/upload', 'ProductController@imageUpload')->name('admin_product_image_upload');
Route::get('/admin/product/image/delete/{image_id}/{product_id}', 'ProductController@imageDelete')->name('admin_product_image_delete');
@ -322,6 +320,13 @@ Route::domain(config('app.pre_url_crm').config('app.domain').config('app.tld_car
Route::get('/admin/product/category/edit/{id}', 'CategoryController@edit')->name('admin_product_category_edit');
Route::post('/admin/product/category/store', 'CategoryController@store')->name('admin_product_category_store');
Route::get('/admin/product/category/delete/{id}', 'CategoryController@delete')->name('admin_product_category_delete');
//products categories
Route::get('/admin/product/ingredients', 'IngredientController@index')->name('admin_product_ingredients');
Route::get('/admin/product/ingredient/edit/{id}', 'IngredientController@edit')->name('admin_product_ingredient_edit');
Route::post('/admin/product/ingredient/store', 'IngredientController@store')->name('admin_product_ingredient_store');
Route::get('/admin/product/ingredient/delete/{id}', 'IngredientController@delete')->name('admin_product_ingredient_delete');
//products images
Route::post('/admin/product/category/image/upload', 'CategoryController@imageUpload')->name('admin_product_category_image_upload');
Route::get('/admin/product/category/image/delete{image_id}/{category_id}', 'CategoryController@imageDelete')->name('admin_product_category_image_delete');