Add initial files and database migration for ticket pricing system
- Created new directories and index files for controls, factory, and views. - Added .htaccess files for URL rewriting in layout and images directories. - Included a logo image in the layout/images directory. - Implemented load_prices.php to load ticket prices from the database into settings. - Developed admin panel settings page for enabling ticket sales. - Created tickets management page in the admin panel to display and edit ticket prices. - Added upgrade.php for database migrations, including creating the ticket_prices table and adding weekend price column.
This commit is contained in:
@@ -6,7 +6,19 @@
|
|||||||
"mcp__serena__list_dir",
|
"mcp__serena__list_dir",
|
||||||
"Bash(curl:*)",
|
"Bash(curl:*)",
|
||||||
"WebSearch",
|
"WebSearch",
|
||||||
"Bash(php:*)"
|
"Bash(php:*)",
|
||||||
|
"mcp__serena__read_file",
|
||||||
|
"mcp__serena__activate_project",
|
||||||
|
"mcp__serena__initial_instructions",
|
||||||
|
"mcp__serena__check_onboarding_performed",
|
||||||
|
"mcp__serena__find_file",
|
||||||
|
"mcp__serena__search_for_pattern",
|
||||||
|
"mcp__serena__find_symbol",
|
||||||
|
"mcp__serena__get_symbols_overview",
|
||||||
|
"mcp__serena__insert_after_symbol",
|
||||||
|
"mcp__serena__replace_symbol_body",
|
||||||
|
"mcp__serena__replace_content",
|
||||||
|
"Bash(npx sass:*)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
.serena/.gitignore
vendored
Normal file
1
.serena/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/cache
|
||||||
117
.serena/project.yml
Normal file
117
.serena/project.yml
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
# the name by which the project can be referenced within Serena
|
||||||
|
project_name: "bilety.brzezovka.pl"
|
||||||
|
|
||||||
|
|
||||||
|
# list of languages for which language servers are started; choose from:
|
||||||
|
# al bash clojure cpp csharp
|
||||||
|
# csharp_omnisharp dart elixir elm erlang
|
||||||
|
# fortran fsharp go groovy haskell
|
||||||
|
# java julia kotlin lua markdown
|
||||||
|
# matlab nix pascal perl php
|
||||||
|
# php_phpactor powershell python python_jedi r
|
||||||
|
# rego ruby ruby_solargraph rust scala
|
||||||
|
# swift terraform toml typescript typescript_vts
|
||||||
|
# vue yaml zig
|
||||||
|
# (This list may be outdated. For the current list, see values of Language enum here:
|
||||||
|
# https://github.com/oraios/serena/blob/main/src/solidlsp/ls_config.py
|
||||||
|
# For some languages, there are alternative language servers, e.g. csharp_omnisharp, ruby_solargraph.)
|
||||||
|
# Note:
|
||||||
|
# - For C, use cpp
|
||||||
|
# - For JavaScript, use typescript
|
||||||
|
# - For Free Pascal/Lazarus, use pascal
|
||||||
|
# Special requirements:
|
||||||
|
# Some languages require additional setup/installations.
|
||||||
|
# See here for details: https://oraios.github.io/serena/01-about/020_programming-languages.html#language-servers
|
||||||
|
# When using multiple languages, the first language server that supports a given file will be used for that file.
|
||||||
|
# The first language is the default language and the respective language server will be used as a fallback.
|
||||||
|
# Note that when using the JetBrains backend, language servers are not used and this list is correspondingly ignored.
|
||||||
|
languages:
|
||||||
|
- php
|
||||||
|
|
||||||
|
# the encoding used by text files in the project
|
||||||
|
# For a list of possible encodings, see https://docs.python.org/3.11/library/codecs.html#standard-encodings
|
||||||
|
encoding: "utf-8"
|
||||||
|
|
||||||
|
# whether to use project's .gitignore files to ignore files
|
||||||
|
ignore_all_files_in_gitignore: true
|
||||||
|
|
||||||
|
# list of additional paths to ignore in this project.
|
||||||
|
# Same syntax as gitignore, so you can use * and **.
|
||||||
|
# Note: global ignored_paths from serena_config.yml are also applied additively.
|
||||||
|
ignored_paths: []
|
||||||
|
|
||||||
|
# whether the project is in read-only mode
|
||||||
|
# If set to true, all editing tools will be disabled and attempts to use them will result in an error
|
||||||
|
# Added on 2025-04-18
|
||||||
|
read_only: false
|
||||||
|
|
||||||
|
# list of tool names to exclude. We recommend not excluding any tools, see the readme for more details.
|
||||||
|
# Below is the complete list of tools for convenience.
|
||||||
|
# To make sure you have the latest list of tools, and to view their descriptions,
|
||||||
|
# execute `uv run scripts/print_tool_overview.py`.
|
||||||
|
#
|
||||||
|
# * `activate_project`: Activates a project by name.
|
||||||
|
# * `check_onboarding_performed`: Checks whether project onboarding was already performed.
|
||||||
|
# * `create_text_file`: Creates/overwrites a file in the project directory.
|
||||||
|
# * `delete_lines`: Deletes a range of lines within a file.
|
||||||
|
# * `delete_memory`: Deletes a memory from Serena's project-specific memory store.
|
||||||
|
# * `execute_shell_command`: Executes a shell command.
|
||||||
|
# * `find_referencing_code_snippets`: Finds code snippets in which the symbol at the given location is referenced.
|
||||||
|
# * `find_referencing_symbols`: Finds symbols that reference the symbol at the given location (optionally filtered by type).
|
||||||
|
# * `find_symbol`: Performs a global (or local) search for symbols with/containing a given name/substring (optionally filtered by type).
|
||||||
|
# * `get_current_config`: Prints the current configuration of the agent, including the active and available projects, tools, contexts, and modes.
|
||||||
|
# * `get_symbols_overview`: Gets an overview of the top-level symbols defined in a given file.
|
||||||
|
# * `initial_instructions`: Gets the initial instructions for the current project.
|
||||||
|
# Should only be used in settings where the system prompt cannot be set,
|
||||||
|
# e.g. in clients you have no control over, like Claude Desktop.
|
||||||
|
# * `insert_after_symbol`: Inserts content after the end of the definition of a given symbol.
|
||||||
|
# * `insert_at_line`: Inserts content at a given line in a file.
|
||||||
|
# * `insert_before_symbol`: Inserts content before the beginning of the definition of a given symbol.
|
||||||
|
# * `list_dir`: Lists files and directories in the given directory (optionally with recursion).
|
||||||
|
# * `list_memories`: Lists memories in Serena's project-specific memory store.
|
||||||
|
# * `onboarding`: Performs onboarding (identifying the project structure and essential tasks, e.g. for testing or building).
|
||||||
|
# * `prepare_for_new_conversation`: Provides instructions for preparing for a new conversation (in order to continue with the necessary context).
|
||||||
|
# * `read_file`: Reads a file within the project directory.
|
||||||
|
# * `read_memory`: Reads the memory with the given name from Serena's project-specific memory store.
|
||||||
|
# * `remove_project`: Removes a project from the Serena configuration.
|
||||||
|
# * `replace_lines`: Replaces a range of lines within a file with new content.
|
||||||
|
# * `replace_symbol_body`: Replaces the full definition of a symbol.
|
||||||
|
# * `restart_language_server`: Restarts the language server, may be necessary when edits not through Serena happen.
|
||||||
|
# * `search_for_pattern`: Performs a search for a pattern in the project.
|
||||||
|
# * `summarize_changes`: Provides instructions for summarizing the changes made to the codebase.
|
||||||
|
# * `switch_modes`: Activates modes by providing a list of their names
|
||||||
|
# * `think_about_collected_information`: Thinking tool for pondering the completeness of collected information.
|
||||||
|
# * `think_about_task_adherence`: Thinking tool for determining whether the agent is still on track with the current task.
|
||||||
|
# * `think_about_whether_you_are_done`: Thinking tool for determining whether the task is truly completed.
|
||||||
|
# * `write_memory`: Writes a named memory (for future reference) to Serena's project-specific memory store.
|
||||||
|
excluded_tools: []
|
||||||
|
|
||||||
|
# list of tools to include that would otherwise be disabled (particularly optional tools that are disabled by default)
|
||||||
|
included_optional_tools: []
|
||||||
|
|
||||||
|
# fixed set of tools to use as the base tool set (if non-empty), replacing Serena's default set of tools.
|
||||||
|
# This cannot be combined with non-empty excluded_tools or included_optional_tools.
|
||||||
|
fixed_tools: []
|
||||||
|
|
||||||
|
# list of mode names to that are always to be included in the set of active modes
|
||||||
|
# The full set of modes to be activated is base_modes + default_modes.
|
||||||
|
# If the setting is undefined, the base_modes from the global configuration (serena_config.yml) apply.
|
||||||
|
# Otherwise, this setting overrides the global configuration.
|
||||||
|
# Set this to [] to disable base modes for this project.
|
||||||
|
# Set this to a list of mode names to always include the respective modes for this project.
|
||||||
|
base_modes:
|
||||||
|
|
||||||
|
# list of mode names that are to be activated by default.
|
||||||
|
# The full set of modes to be activated is base_modes + default_modes.
|
||||||
|
# If the setting is undefined, the default_modes from the global configuration (serena_config.yml) apply.
|
||||||
|
# Otherwise, this overrides the setting from the global configuration (serena_config.yml).
|
||||||
|
# This setting can, in turn, be overridden by CLI parameters (--mode).
|
||||||
|
default_modes:
|
||||||
|
|
||||||
|
# initial prompt for the project. It will always be given to the LLM upon activating the project
|
||||||
|
# (contrary to the memories, which are loaded on demand).
|
||||||
|
initial_prompt: ""
|
||||||
|
|
||||||
|
# override of the corresponding setting in serena_config.yml, see the documentation there.
|
||||||
|
# If null or missing, the value from the global config is used.
|
||||||
|
symbol_info_budget:
|
||||||
6
.vscode/ftp-kr.json
vendored
6
.vscode/ftp-kr.json
vendored
@@ -12,6 +12,10 @@
|
|||||||
"ignoreRemoteModification": true,
|
"ignoreRemoteModification": true,
|
||||||
"ignore": [
|
"ignore": [
|
||||||
".git",
|
".git",
|
||||||
"/.vscode"
|
"/.vscode",
|
||||||
|
"CLAUDE.md",
|
||||||
|
"/.sereana",
|
||||||
|
"/.claude",
|
||||||
|
".gitignore"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
177
.vscode/ftp-kr.sync.cache.json
vendored
177
.vscode/ftp-kr.sync.cache.json
vendored
@@ -23,8 +23,8 @@
|
|||||||
},
|
},
|
||||||
"class.DbModel.php": {
|
"class.DbModel.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 1392,
|
"size": 1397,
|
||||||
"lmtime": 0,
|
"lmtime": 1771797002635,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Excel.php": {
|
"class.Excel.php": {
|
||||||
@@ -41,22 +41,23 @@
|
|||||||
},
|
},
|
||||||
"class.S.php": {
|
"class.S.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 7661,
|
"size": 7625,
|
||||||
"lmtime": 1746049759245,
|
"lmtime": 1771797056545,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Tpl.php": {
|
"class.Tpl.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 1673,
|
"size": 1755,
|
||||||
"lmtime": 1746048812215,
|
"lmtime": 1771797039461,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"controls": {
|
"controls": {
|
||||||
|
"207286": {},
|
||||||
"class.Apanel.php": {
|
"class.Apanel.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 5166,
|
"size": 5395,
|
||||||
"lmtime": 1746048812388,
|
"lmtime": 1771797091338,
|
||||||
"modified": true
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Cron.php": {
|
"class.Cron.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
@@ -66,20 +67,20 @@
|
|||||||
},
|
},
|
||||||
"class.Scanner.php": {
|
"class.Scanner.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 3453,
|
"size": 3550,
|
||||||
"lmtime": 1746048812463,
|
"lmtime": 1771797058858,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Site.php": {
|
"class.Site.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 570,
|
"size": 625,
|
||||||
"lmtime": 1746048812539,
|
"lmtime": 1771797034132,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Tickets.php": {
|
"class.Tickets.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 20131,
|
"size": 21496,
|
||||||
"lmtime": 1746050141213,
|
"lmtime": 1771797086011,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Users.php": {
|
"class.Users.php": {
|
||||||
@@ -93,13 +94,20 @@
|
|||||||
"size": 200,
|
"size": 200,
|
||||||
"lmtime": 1746048812782,
|
"lmtime": 1746048812782,
|
||||||
"modified": false
|
"modified": false
|
||||||
|
},
|
||||||
|
"index.php": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 0,
|
||||||
|
"lmtime": 0,
|
||||||
|
"modified": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"factory": {
|
"factory": {
|
||||||
|
"879348": {},
|
||||||
"class.Apanel.php": {
|
"class.Apanel.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 1208,
|
"size": 1273,
|
||||||
"lmtime": 1746048812856,
|
"lmtime": 1771796998145,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Cron.php": {
|
"class.Cron.php": {
|
||||||
@@ -110,14 +118,14 @@
|
|||||||
},
|
},
|
||||||
"class.Tickets.php": {
|
"class.Tickets.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 2515,
|
"size": 2630,
|
||||||
"lmtime": 1746048813029,
|
"lmtime": 1771796997296,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Users.php": {
|
"class.Users.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 1510,
|
"size": 1519,
|
||||||
"lmtime": 0,
|
"lmtime": 1771797051167,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
".htaccess": {
|
".htaccess": {
|
||||||
@@ -125,6 +133,12 @@
|
|||||||
"size": 200,
|
"size": 200,
|
||||||
"lmtime": 1746048813105,
|
"lmtime": 1746048813105,
|
||||||
"modified": false
|
"modified": false
|
||||||
|
},
|
||||||
|
"index.php": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 0,
|
||||||
|
"lmtime": 0,
|
||||||
|
"modified": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
".htaccess": {
|
".htaccess": {
|
||||||
@@ -134,6 +148,7 @@
|
|||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"view": {
|
"view": {
|
||||||
|
"330138": {},
|
||||||
"class.Cron.php": {
|
"class.Cron.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 46,
|
"size": 46,
|
||||||
@@ -142,8 +157,8 @@
|
|||||||
},
|
},
|
||||||
"class.Site.php": {
|
"class.Site.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 827,
|
"size": 863,
|
||||||
"lmtime": 0,
|
"lmtime": 1771797032107,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"class.Users.php": {
|
"class.Users.php": {
|
||||||
@@ -157,13 +172,27 @@
|
|||||||
"size": 200,
|
"size": 200,
|
||||||
"lmtime": 1746048813184,
|
"lmtime": 1746048813184,
|
||||||
"modified": false
|
"modified": false
|
||||||
|
},
|
||||||
|
"index.php": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 0,
|
||||||
|
"lmtime": 0,
|
||||||
|
"modified": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
".claude": {
|
||||||
|
"settings.local.json": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 184,
|
||||||
|
"lmtime": 1771797522111,
|
||||||
|
"modified": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"config.php": {
|
"config.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 8616,
|
"size": 8763,
|
||||||
"lmtime": 1746049434100,
|
"lmtime": 1771797005444,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"cron.php": {
|
"cron.php": {
|
||||||
@@ -178,6 +207,22 @@
|
|||||||
"lmtime": 0,
|
"lmtime": 0,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
|
"dev": {
|
||||||
|
"team": {
|
||||||
|
"2026-02-22_22-51_php81-kompatybilnosc.md": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 4570,
|
||||||
|
"lmtime": 1771797146637,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"session-state.json": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 730,
|
||||||
|
"lmtime": 1771797155895,
|
||||||
|
"modified": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
".gitignore": {
|
".gitignore": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 0,
|
"size": 0,
|
||||||
@@ -192,12 +237,88 @@
|
|||||||
},
|
},
|
||||||
"index.php": {
|
"index.php": {
|
||||||
"type": "-",
|
"type": "-",
|
||||||
"size": 1675,
|
"size": 1774,
|
||||||
"lmtime": 1746049418854,
|
"lmtime": 1771797586319,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"info.php": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 14,
|
||||||
|
"lmtime": 1771795279292,
|
||||||
"modified": false
|
"modified": false
|
||||||
},
|
},
|
||||||
"layout": {},
|
"layout": {},
|
||||||
"libraries": {},
|
"libraries": {
|
||||||
|
"bootstrap": {},
|
||||||
|
"bootstrap-4.1.3": {},
|
||||||
|
"ckeditor": {},
|
||||||
|
"context-menu.js": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 2843,
|
||||||
|
"lmtime": 0,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"countdown": {},
|
||||||
|
"dataTable": {},
|
||||||
|
"datepicker": {},
|
||||||
|
"daterange": {},
|
||||||
|
"filemanager-9.14.1": {},
|
||||||
|
"font-awesome-4.7.0": {},
|
||||||
|
"font-awesome-6.1.1": {},
|
||||||
|
"functions.js": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 3098,
|
||||||
|
"lmtime": 0,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"grid": {},
|
||||||
|
".htaccess": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 200,
|
||||||
|
"lmtime": 0,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"icheck-1.0.2": {},
|
||||||
|
"jquery": {},
|
||||||
|
"jquery-confirm": {},
|
||||||
|
"jquery-gantt": {},
|
||||||
|
"license.txt": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 16728,
|
||||||
|
"lmtime": 1748556485000,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"medoo": {},
|
||||||
|
"moment": {},
|
||||||
|
"phpmailer": {},
|
||||||
|
"phpqrcode": {},
|
||||||
|
"qrcode-scanner": {},
|
||||||
|
"rb-download.tar.gz": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 132796,
|
||||||
|
"lmtime": 1771797357906,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"rb.php": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 552317,
|
||||||
|
"lmtime": 1748556485000,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"tagsinput": {},
|
||||||
|
"typeahead.bundle.js": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 96186,
|
||||||
|
"lmtime": 0,
|
||||||
|
"modified": false
|
||||||
|
},
|
||||||
|
"xlsxwriter.class.php": {
|
||||||
|
"type": "-",
|
||||||
|
"size": 48385,
|
||||||
|
"lmtime": 0,
|
||||||
|
"modified": false
|
||||||
|
}
|
||||||
|
},
|
||||||
"orders": {},
|
"orders": {},
|
||||||
"templates": {
|
"templates": {
|
||||||
"admin-panel": {
|
"admin-panel": {
|
||||||
|
|||||||
99
CLAUDE.md
Normal file
99
CLAUDE.md
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
# CLAUDE.md
|
||||||
|
|
||||||
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
||||||
|
|
||||||
|
## Project Overview
|
||||||
|
|
||||||
|
Online ticket sales system for **Kompleks Turystyczny Brzezovka** (amusement park in Kolbuszowa, Poland). Handles ticket purchase, shopping cart, Przelewy24 payments, QR code generation, invoice issuing (via fakturowo.pl API), and a QR ticket scanner for staff.
|
||||||
|
|
||||||
|
Live at: `bilety.brzezovka.pl`
|
||||||
|
|
||||||
|
## Architecture
|
||||||
|
|
||||||
|
Custom PHP MVC without a framework. No Composer — all dependencies are vendored in `libraries/`.
|
||||||
|
|
||||||
|
### Request Flow
|
||||||
|
|
||||||
|
1. `.htaccess` rewrites URLs as `/{module}/{action}/{params}` → `index.php?module=X&action=Y&...`
|
||||||
|
2. `index.php` bootstraps: autoloader, config, DB connections (Medoo + RedBeanPHP), session
|
||||||
|
3. `\view\Site::show()` → `\controls\Site::route()` resolves `module`/`action` to a controller method via `\controls\{Module}::{action}()`
|
||||||
|
4. Controllers return rendered HTML via `\Tpl::view('template-name', $vars)`
|
||||||
|
|
||||||
|
### Autoloader Convention
|
||||||
|
|
||||||
|
`spl_autoload_register` maps namespaced classes to files:
|
||||||
|
- `\controls\Tickets` → `autoload/controls/class.Tickets.php`
|
||||||
|
- `\factory\Tickets` → `autoload/factory/class.Tickets.php`
|
||||||
|
- `\view\Site` → `autoload/view/class.Site.php`
|
||||||
|
- `\S`, `\Tpl`, `\DbModel`, `\Html` → `autoload/class.{Name}.php`
|
||||||
|
|
||||||
|
### Layer Responsibilities
|
||||||
|
|
||||||
|
| Layer | Namespace/Dir | Role |
|
||||||
|
|-------|--------------|------|
|
||||||
|
| Controllers | `autoload/controls/` | Handle actions, coordinate logic, return rendered views |
|
||||||
|
| Factory (Services) | `autoload/factory/` | Business logic, DB queries, data processing |
|
||||||
|
| Views | `autoload/view/` | Layout assembly (wraps controller output in site layout) |
|
||||||
|
| Templates | `templates/` | PHP template files rendered by `Tpl::view()` |
|
||||||
|
| Core classes | `autoload/` (root) | `S` (utility/session), `Tpl` (templating), `DbModel` (active record), `Html` (form helpers) |
|
||||||
|
|
||||||
|
### Key Modules
|
||||||
|
|
||||||
|
| Module | Controller | Purpose |
|
||||||
|
|--------|-----------|---------|
|
||||||
|
| `tickets` | `controls\Tickets` | Public ticket shop: browse, add/remove from cart, checkout, payment |
|
||||||
|
| `apanel` | `controls\Apanel` | Admin panel: order list, order editing, ticket validation |
|
||||||
|
| `scanner` | `controls\Scanner` | QR code scanner for on-site ticket verification |
|
||||||
|
| `users` | `controls\Users` | User login/logout, settings, permissions |
|
||||||
|
|
||||||
|
### Database
|
||||||
|
|
||||||
|
MySQL via two ORMs used in parallel:
|
||||||
|
- **Medoo** (`$mdb` global) — primary query builder for tickets/orders
|
||||||
|
- **RedBeanPHP** (`\R::`) — used in cron jobs (CEIDG import)
|
||||||
|
|
||||||
|
Main tables: `orders`, `order_tickets`, `users`
|
||||||
|
|
||||||
|
### Entry Points
|
||||||
|
|
||||||
|
| File | Purpose |
|
||||||
|
|------|---------|
|
||||||
|
| `index.php` | Main app entry (web requests) |
|
||||||
|
| `ajax.php` | AJAX endpoint (same autoloader, Medoo only) |
|
||||||
|
| `api.php` | API endpoint (autoloader + Medoo + PHPMailer + RedBeanPHP) |
|
||||||
|
| `cron.php` | Scheduled tasks (email reminders, CEIDG import) |
|
||||||
|
|
||||||
|
### External Integrations
|
||||||
|
|
||||||
|
- **Przelewy24** — payment gateway (merchant config in `config.php`)
|
||||||
|
- **fakturowo.pl** — invoice/receipt generation via API
|
||||||
|
- **PHPMailer** — email sending (SMTP via `bilety@brzezovka.pl`)
|
||||||
|
- **phpqrcode** — QR code generation for order hashes
|
||||||
|
|
||||||
|
## Frontend
|
||||||
|
|
||||||
|
- Bootstrap 5.2, jQuery 3.6, Font Awesome 6.1
|
||||||
|
- SCSS in `layout/style-scss/` compiled to `layout/style-css/style.css`
|
||||||
|
- SCSS compile comment: `// out: ../style-css/style.css, compress: true, sourceMap: true` (Live Sass Compiler)
|
||||||
|
- DataTables for admin order list
|
||||||
|
- html5-qrcode for scanner
|
||||||
|
- Datepicker for ticket date selection
|
||||||
|
|
||||||
|
## Key Conventions
|
||||||
|
|
||||||
|
- All controller methods are `static public` and accessed via URL routing
|
||||||
|
- Global `$settings`, `$mdb`, `$user` are used throughout (no DI)
|
||||||
|
- Ticket config (prices, types, dynamic pricing) lives entirely in `config.php`
|
||||||
|
- Session-based shopping cart stored at `$_SESSION['basket']`
|
||||||
|
- Admin auth is a single shared password (`$settings['admin-password']`), stored in session as `$_SESSION['user']`
|
||||||
|
- Template rendering: `\Tpl::view('path/template-name', ['key' => $value])` — variables accessible as `$this->key` in templates
|
||||||
|
- AJAX responses: controllers `echo json_encode(...)` then `exit;`
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
- No build system, test framework, or package manager
|
||||||
|
- SCSS compilation: use VS Code "Live Sass Compiler" extension (configured via first-line comment in `style.scss`)
|
||||||
|
- Deployment: FTP sync (`.vscode/ftp-kr.sync.cache.json` present)
|
||||||
|
- PHP version: compatible with PHP 7.4+ (no typed properties, uses legacy autoload pattern)
|
||||||
|
- Timezone: `Europe/Warsaw`
|
||||||
|
- Language: Polish (all UI text, comments, variable names mix PL/EN)
|
||||||
2
ajax.php
2
ajax.php
@@ -41,5 +41,7 @@ $mdb = new medoo( [
|
|||||||
'charset' => 'utf8'
|
'charset' => 'utf8'
|
||||||
] );
|
] );
|
||||||
|
|
||||||
|
require_once 'load_prices.php';
|
||||||
|
|
||||||
$user = \S::get_session( 'user' );
|
$user = \S::get_session( 'user' );
|
||||||
?>
|
?>
|
||||||
2
api.php
2
api.php
@@ -30,3 +30,5 @@ $mdb = new medoo( [
|
|||||||
'password' => $database['password'],
|
'password' => $database['password'],
|
||||||
'charset' => 'utf8'
|
'charset' => 'utf8'
|
||||||
] );
|
] );
|
||||||
|
|
||||||
|
require_once 'load_prices.php';
|
||||||
@@ -203,6 +203,48 @@ class Apanel
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function tickets()
|
||||||
|
{
|
||||||
|
global $settings;
|
||||||
|
|
||||||
|
return \Tpl::view('admin-panel/tickets', [
|
||||||
|
'tickets' => $settings['tickets']
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function tickets_save()
|
||||||
|
{
|
||||||
|
global $mdb;
|
||||||
|
|
||||||
|
if (empty($_POST['tickets']) || !is_array($_POST['tickets'])) {
|
||||||
|
echo json_encode(['status' => 'error', 'message' => 'Brak danych']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($_POST['tickets'] as $ticketId => $data) {
|
||||||
|
$ticketId = preg_replace('/[^a-z0-9\-]/', '', $ticketId);
|
||||||
|
|
||||||
|
$price = trim($data['price'] ?? '') !== '' ? (float) $data['price'] : null;
|
||||||
|
$priceWkd = trim($data['price_weekend'] ?? '') !== '' ? (float) $data['price_weekend'] : null;
|
||||||
|
$day0 = trim($data['day0'] ?? '') !== '' ? (float) $data['day0'] : null;
|
||||||
|
$day12 = trim($data['day1_2'] ?? '') !== '' ? (float) $data['day1_2'] : null;
|
||||||
|
$day37 = trim($data['day3_7'] ?? '') !== '' ? (float) $data['day3_7'] : null;
|
||||||
|
|
||||||
|
$stmt = $mdb->pdo->prepare('REPLACE INTO ticket_prices (ticket_id, price, price_weekend, dynamic_price_day0, dynamic_price_day1_2, dynamic_price_day3_7) VALUES (:tid, :price, :priceWkd, :day0, :day12, :day37)');
|
||||||
|
$stmt->execute([
|
||||||
|
':tid' => $ticketId,
|
||||||
|
':price' => $price,
|
||||||
|
':priceWkd' => $priceWkd,
|
||||||
|
':day0' => $day0,
|
||||||
|
':day12' => $day12,
|
||||||
|
':day37' => $day37,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
echo json_encode(['status' => 'ok']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
static public function use_ticket() {
|
static public function use_ticket() {
|
||||||
global $mdb;
|
global $mdb;
|
||||||
|
|
||||||
@@ -216,4 +258,22 @@ class Apanel
|
|||||||
|
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function settings()
|
||||||
|
{
|
||||||
|
$enable_sell = \factory\Apanel::getSetting('enable_sell', '1');
|
||||||
|
|
||||||
|
return \Tpl::view('admin-panel/settings', [
|
||||||
|
'enable_sell' => $enable_sell
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function settings_save()
|
||||||
|
{
|
||||||
|
$enable_sell = isset($_POST['enable_sell']) ? '1' : '0';
|
||||||
|
\factory\Apanel::saveSetting('enable_sell', $enable_sell);
|
||||||
|
|
||||||
|
echo json_encode(['status' => 'ok']);
|
||||||
|
exit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -8,7 +8,9 @@ class Tickets
|
|||||||
{
|
{
|
||||||
global $settings;
|
global $settings;
|
||||||
|
|
||||||
if ( !$settings['tickets']['enable_sell'] )
|
$enable_sell = \factory\Apanel::getSetting('enable_sell', '1');
|
||||||
|
|
||||||
|
if ( !$enable_sell || $enable_sell === '0' )
|
||||||
return \Tpl::view( 'tickets/disabled-sell' );
|
return \Tpl::view( 'tickets/disabled-sell' );
|
||||||
|
|
||||||
return \Tpl::view('tickets/main-view', [
|
return \Tpl::view('tickets/main-view', [
|
||||||
@@ -51,8 +53,13 @@ class Tickets
|
|||||||
$addon = 0;
|
$addon = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$is_weekend = $selected_date && in_array((new \DateTime($selected_date))->format('N'), ['6', '7']);
|
||||||
|
$base_price = $is_weekend
|
||||||
|
? ($settings['tickets'][$ticket_id]['price_weekend'] ?? $settings['tickets'][$ticket_id]['price'])
|
||||||
|
: $settings['tickets'][$ticket_id]['price'];
|
||||||
|
|
||||||
$basket[$ticket_id][$diffDays]['ticket_id'] = $ticket_id;
|
$basket[$ticket_id][$diffDays]['ticket_id'] = $ticket_id;
|
||||||
$basket[$ticket_id][$diffDays]['ticket_price'] = $settings['tickets'][$ticket_id]['price'] + $addon;
|
$basket[$ticket_id][$diffDays]['ticket_price'] = $base_price + $addon;
|
||||||
$basket[$ticket_id][$diffDays]['product_id'] = $settings['tickets'][$ticket_id]['product_id'];
|
$basket[$ticket_id][$diffDays]['product_id'] = $settings['tickets'][$ticket_id]['product_id'];
|
||||||
$basket[$ticket_id][$diffDays]['quantity'] = 1;
|
$basket[$ticket_id][$diffDays]['quantity'] = 1;
|
||||||
$basket[$ticket_id][$diffDays]['date'] = $selected_date;
|
$basket[$ticket_id][$diffDays]['date'] = $selected_date;
|
||||||
|
|||||||
0
autoload/controls/index.php
Normal file
0
autoload/controls/index.php
Normal file
@@ -60,4 +60,30 @@ class Apanel {
|
|||||||
|
|
||||||
return $basket;
|
return $basket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function getSetting($key, $default = null)
|
||||||
|
{
|
||||||
|
global $mdb;
|
||||||
|
|
||||||
|
try {
|
||||||
|
$mdb->pdo->exec("CREATE TABLE IF NOT EXISTS site_settings (
|
||||||
|
setting_key VARCHAR(100) PRIMARY KEY,
|
||||||
|
setting_value TEXT
|
||||||
|
)");
|
||||||
|
} catch (\Exception $e) {}
|
||||||
|
|
||||||
|
$stmt = $mdb->pdo->prepare("SELECT setting_value FROM site_settings WHERE setting_key = :key LIMIT 1");
|
||||||
|
$stmt->execute([':key' => $key]);
|
||||||
|
$row = $stmt->fetch(\PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
return $row ? $row['setting_value'] : $default;
|
||||||
|
}
|
||||||
|
|
||||||
|
static public function saveSetting($key, $value)
|
||||||
|
{
|
||||||
|
global $mdb;
|
||||||
|
|
||||||
|
$stmt = $mdb->pdo->prepare("REPLACE INTO site_settings (setting_key, setting_value) VALUES (:key, :val)");
|
||||||
|
$stmt->execute([':key' => $key, ':val' => $value]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
0
autoload/factory/index.php
Normal file
0
autoload/factory/index.php
Normal file
0
autoload/view/index.php
Normal file
0
autoload/view/index.php
Normal file
146
config.php
146
config.php
@@ -9,52 +9,35 @@ $settings['email_port'] = 25;
|
|||||||
$settings['email_login'] = 'bilety@brzezovka.pl';
|
$settings['email_login'] = 'bilety@brzezovka.pl';
|
||||||
$settings['email_password'] = 'biletyonline';
|
$settings['email_password'] = 'biletyonline';
|
||||||
|
|
||||||
$settings['tickets']['enable_sell'] = true;
|
// Park rozrywki i dinozaurow
|
||||||
|
|
||||||
// $settings['tickets']['price_0day'][indywidua] = 5;
|
|
||||||
// $settings['tickets']['price_0day'][rodzinn1] = 5;
|
|
||||||
// $settings['tickets']['price_0day'][rodzinny2] = 5;
|
|
||||||
//TODO: Bilet ulgowy - do 140 cm wzrostu
|
|
||||||
if ( !empty($_SESSION['lower_price_ticket']) )
|
|
||||||
$settings['tickets']['plac-zabaw-ulgowy']['price'] = 1;
|
|
||||||
else
|
|
||||||
$settings['tickets']['plac-zabaw-ulgowy']['price'] = 45;
|
|
||||||
|
|
||||||
$settings['tickets']['plac-zabaw-ulgowy']['price_promo'] = 36;
|
|
||||||
$settings['tickets']['plac-zabaw-ulgowy']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['plac-zabaw-ulgowy']['name'] = 'Park rozrywki i dinozaurów - ulgowy';
|
$settings['tickets']['plac-zabaw-ulgowy']['name'] = 'Park rozrywki i dinozaurów - ulgowy';
|
||||||
$settings['tickets']['plac-zabaw-ulgowy']['color'] = "orange";
|
$settings['tickets']['plac-zabaw-ulgowy']['color'] = "orange";
|
||||||
$settings['tickets']['plac-zabaw-ulgowy']['product_id'] = 1;
|
$settings['tickets']['plac-zabaw-ulgowy']['product_id'] = 1;
|
||||||
|
|
||||||
|
$settings['tickets']['plac-zabaw-normalny']['name'] = "Park rozrywki i dinozaurów - normalny";
|
||||||
|
$settings['tickets']['plac-zabaw-normalny']['color'] = "orange";
|
||||||
|
$settings['tickets']['plac-zabaw-normalny']['product_id'] = 3;
|
||||||
|
|
||||||
$settings['tickets']['park-wodny-ulgowy']['price']= 35;
|
// Park wodny
|
||||||
$settings['tickets']['park-wodny-ulgowy']['price_promo']= 28;
|
|
||||||
$settings['tickets']['park-wodny-ulgowy']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['park-wodny-ulgowy']['name'] = 'Park wodny - ulgowy';
|
$settings['tickets']['park-wodny-ulgowy']['name'] = 'Park wodny - ulgowy';
|
||||||
$settings['tickets']['park-wodny-ulgowy']['color'] = 'blue';
|
$settings['tickets']['park-wodny-ulgowy']['color'] = 'blue';
|
||||||
$settings['tickets']['park-wodny-ulgowy']['product_id'] = 2;
|
$settings['tickets']['park-wodny-ulgowy']['product_id'] = 2;
|
||||||
$settings['tickets']['park-wodny-ulgowy']['alert'] = "strefa wodna czynna od 28.06.2025";
|
$settings['tickets']['park-wodny-ulgowy']['alert'] = "strefa wodna czynna od 28.06.2025";
|
||||||
|
|
||||||
|
$settings['tickets']['park-wodny-normalny']['name'] = "Park wodny - normalny";
|
||||||
|
$settings['tickets']['park-wodny-normalny']['color'] = "blue";
|
||||||
|
$settings['tickets']['park-wodny-normalny']['product_id'] = 4;
|
||||||
|
$settings['tickets']['park-wodny-normalny']['alert'] = "strefa wodna czynna od 28.06.2025";
|
||||||
|
|
||||||
$settings['tickets']['gift-plac-zabaw-ulgowy']['price'] = 45;
|
// Bilety prezentowe Park Rozrywki
|
||||||
// $settings['tickets']['gift-plac-zabaw-ulgowy']['price_promo'] = 999;
|
|
||||||
$settings['tickets']['gift-plac-zabaw-ulgowy']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['gift-plac-zabaw-ulgowy']['name'] = 'Bilet prezentowy Park Rozrywki i Dinozaurów - ulgowy';
|
$settings['tickets']['gift-plac-zabaw-ulgowy']['name'] = 'Bilet prezentowy Park Rozrywki i Dinozaurów - ulgowy';
|
||||||
$settings['tickets']['gift-plac-zabaw-ulgowy']['color'] = "orange";
|
$settings['tickets']['gift-plac-zabaw-ulgowy']['color'] = "orange";
|
||||||
$settings['tickets']['gift-plac-zabaw-ulgowy']['product_id'] = 10;
|
$settings['tickets']['gift-plac-zabaw-ulgowy']['product_id'] = 10;
|
||||||
|
|
||||||
|
$settings['tickets']['gift-plac-zabaw-normalny']['name'] = "Bilet prezentowy Park Rozrywki i Dinozaurów - normalny";
|
||||||
|
$settings['tickets']['gift-plac-zabaw-normalny']['color'] = "orange";
|
||||||
|
$settings['tickets']['gift-plac-zabaw-normalny']['product_id'] = 9;
|
||||||
|
|
||||||
$settings['bilety-ulgowe'] = array(
|
$settings['bilety-ulgowe'] = array(
|
||||||
'plac-zabaw-ulgowy',
|
'plac-zabaw-ulgowy',
|
||||||
'gift-plac-zabaw-ulgowy',
|
'gift-plac-zabaw-ulgowy',
|
||||||
@@ -62,43 +45,6 @@ $settings['bilety-ulgowe'] = array(
|
|||||||
'park-wodny-ulgowy'
|
'park-wodny-ulgowy'
|
||||||
);
|
);
|
||||||
|
|
||||||
//TODO: Bilet normalny - od 140 cm wzrostu
|
|
||||||
$settings['tickets']['plac-zabaw-normalny']['price'] = 52;
|
|
||||||
$settings['tickets']['plac-zabaw-normalny']['price_promo'] = 41.60;
|
|
||||||
$settings['tickets']['plac-zabaw-normalny']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['plac-zabaw-normalny']['name'] = "Park rozrywki i dinozaurów - normalny";
|
|
||||||
$settings['tickets']['plac-zabaw-normalny']['color'] = "orange";
|
|
||||||
$settings['tickets']['plac-zabaw-normalny']['product_id'] = 3;
|
|
||||||
|
|
||||||
|
|
||||||
$settings['tickets']['park-wodny-normalny']['price'] = 40;
|
|
||||||
$settings['tickets']['park-wodny-normalny']['price_promo'] = 32;
|
|
||||||
$settings['tickets']['park-wodny-normalny']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['park-wodny-normalny']['name'] = "Park wodny - normalny";
|
|
||||||
$settings['tickets']['park-wodny-normalny']['color'] = "blue";
|
|
||||||
$settings['tickets']['park-wodny-normalny']['product_id'] = 4;
|
|
||||||
$settings['tickets']['park-wodny-normalny']['alert'] = "strefa wodna czynna od 28.06.2025";
|
|
||||||
|
|
||||||
|
|
||||||
$settings['tickets']['gift-plac-zabaw-normalny']['price'] = 52;
|
|
||||||
// $settings['tickets']['plac-zabaw-normalny']['price_promo'] = 999;
|
|
||||||
$settings['tickets']['gift-plac-zabaw-normalny']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['gift-plac-zabaw-normalny']['name'] = "Bilet prezentowy Park Rozrywki i Dinozaurów - normalny";
|
|
||||||
$settings['tickets']['gift-plac-zabaw-normalny']['color'] = "orange";
|
|
||||||
$settings['tickets']['gift-plac-zabaw-normalny']['product_id'] = 9;
|
|
||||||
|
|
||||||
$settings['bilety-normalne'] = array(
|
$settings['bilety-normalne'] = array(
|
||||||
'plac-zabaw-normalny',
|
'plac-zabaw-normalny',
|
||||||
// 'park-historyczny-normalny',
|
// 'park-historyczny-normalny',
|
||||||
@@ -106,51 +52,19 @@ $settings['bilety-normalne'] = array(
|
|||||||
'park-wodny-normalny',
|
'park-wodny-normalny',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Bilety All Open
|
||||||
//TODO: Bilety All Open - bilety do wszystkich parków
|
|
||||||
$settings['tickets']['bilet-all-open-ulgowy']['price']= 75;
|
|
||||||
$settings['tickets']['bilet-all-open-ulgowy']['price_promo']= 60;
|
|
||||||
$settings['tickets']['bilet-all-open-ulgowy']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['bilet-all-open-ulgowy']['name'] = 'All Open - ulgowy';
|
$settings['tickets']['bilet-all-open-ulgowy']['name'] = 'All Open - ulgowy';
|
||||||
$settings['tickets']['bilet-all-open-ulgowy']['color'] = 'green';
|
$settings['tickets']['bilet-all-open-ulgowy']['color'] = 'green';
|
||||||
$settings['tickets']['bilet-all-open-ulgowy']['product_id'] = 5;
|
$settings['tickets']['bilet-all-open-ulgowy']['product_id'] = 5;
|
||||||
|
|
||||||
|
|
||||||
$settings['tickets']['bilet-all-open-normalny']['price']= 85;
|
|
||||||
$settings['tickets']['bilet-all-open-normalny']['price_promo']= 68.80;
|
|
||||||
$settings['tickets']['bilet-all-open-normalny']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['bilet-all-open-normalny']['name'] = 'All Open - normalny';
|
$settings['tickets']['bilet-all-open-normalny']['name'] = 'All Open - normalny';
|
||||||
$settings['tickets']['bilet-all-open-normalny']['color'] = 'green';
|
$settings['tickets']['bilet-all-open-normalny']['color'] = 'green';
|
||||||
$settings['tickets']['bilet-all-open-normalny']['product_id'] = 6;
|
$settings['tickets']['bilet-all-open-normalny']['product_id'] = 6;
|
||||||
|
|
||||||
|
|
||||||
$settings['tickets']['gift-bilet-all-open-ulgowy']['price']= 75;
|
|
||||||
// $settings['tickets']['gift-bilet-all-open-ulgowy']['price_promo']= 999;
|
|
||||||
$settings['tickets']['gift-bilet-all-open-ulgowy']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['gift-bilet-all-open-ulgowy']['name'] = 'Bilet prezentowy All Open - ulgowy';
|
$settings['tickets']['gift-bilet-all-open-ulgowy']['name'] = 'Bilet prezentowy All Open - ulgowy';
|
||||||
$settings['tickets']['gift-bilet-all-open-ulgowy']['color'] = 'green';
|
$settings['tickets']['gift-bilet-all-open-ulgowy']['color'] = 'green';
|
||||||
$settings['tickets']['gift-bilet-all-open-ulgowy']['product_id'] = 5;
|
$settings['tickets']['gift-bilet-all-open-ulgowy']['product_id'] = 5;
|
||||||
|
|
||||||
|
|
||||||
$settings['tickets']['gift-bilet-all-open-normalny']['price']= 85;
|
|
||||||
// $settings['tickets']['gift-bilet-all-open-normalny']['price_promo']= 999;
|
|
||||||
$settings['tickets']['gift-bilet-all-open-normalny']['dynamic_prices'] = [
|
|
||||||
'day0' => 5,
|
|
||||||
'day1_2' => 3,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['gift-bilet-all-open-normalny']['name'] = 'Bilet prezentowy All Open - normalny';
|
$settings['tickets']['gift-bilet-all-open-normalny']['name'] = 'Bilet prezentowy All Open - normalny';
|
||||||
$settings['tickets']['gift-bilet-all-open-normalny']['color'] = 'green';
|
$settings['tickets']['gift-bilet-all-open-normalny']['color'] = 'green';
|
||||||
$settings['tickets']['gift-bilet-all-open-normalny']['product_id'] = 11;
|
$settings['tickets']['gift-bilet-all-open-normalny']['product_id'] = 11;
|
||||||
@@ -160,29 +74,13 @@ $settings['bilety-all-open'] = array(
|
|||||||
'bilet-all-open-normalny',
|
'bilet-all-open-normalny',
|
||||||
'gift-bilet-all-open-ulgowy',
|
'gift-bilet-all-open-ulgowy',
|
||||||
'gift-bilet-all-open-normalny',
|
'gift-bilet-all-open-normalny',
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
//TODO: Bilety rodzinne - bilety dla rodzin
|
// Bilety rodzinne
|
||||||
$settings['tickets']['bilet-rodzina-2+1']['price']= 220;
|
|
||||||
$settings['tickets']['bilet-rodzina-2+1']['price_promo']= 176;
|
|
||||||
$settings['tickets']['bilet-rodzina-2+1']['dynamic_prices'] = [
|
|
||||||
'day0' => 15,
|
|
||||||
'day1_2' => 9,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['bilet-rodzina-2+1']['name'] = 'Rodzina 2+1';
|
$settings['tickets']['bilet-rodzina-2+1']['name'] = 'Rodzina 2+1';
|
||||||
$settings['tickets']['bilet-rodzina-2+1']['color'] = 'violet';
|
$settings['tickets']['bilet-rodzina-2+1']['color'] = 'violet';
|
||||||
$settings['tickets']['bilet-rodzina-2+1']['product_id'] = 7;
|
$settings['tickets']['bilet-rodzina-2+1']['product_id'] = 7;
|
||||||
|
|
||||||
|
|
||||||
$settings['tickets']['bilet-rodzina-2+2']['price']= 280;
|
|
||||||
$settings['tickets']['bilet-rodzina-2+2']['price_promo']= 224;
|
|
||||||
$settings['tickets']['bilet-rodzina-2+2']['dynamic_prices'] = [
|
|
||||||
'day0' => 20,
|
|
||||||
'day1_2' => 12,
|
|
||||||
'day3_7' => 1,
|
|
||||||
];
|
|
||||||
$settings['tickets']['bilet-rodzina-2+2']['name'] = 'Rodzina 2+2';
|
$settings['tickets']['bilet-rodzina-2+2']['name'] = 'Rodzina 2+2';
|
||||||
$settings['tickets']['bilet-rodzina-2+2']['color'] = 'violet';
|
$settings['tickets']['bilet-rodzina-2+2']['color'] = 'violet';
|
||||||
$settings['tickets']['bilet-rodzina-2+2']['product_id'] = 8;
|
$settings['tickets']['bilet-rodzina-2+2']['product_id'] = 8;
|
||||||
@@ -192,7 +90,6 @@ $settings['bilety-rodzinne'] = array(
|
|||||||
'bilet-rodzina-2+2'
|
'bilet-rodzina-2+2'
|
||||||
);
|
);
|
||||||
|
|
||||||
$settings['tickets']['gift-price']['price']= 15;
|
|
||||||
$settings['tickets']['gift-price']['name'] = 'Koszt przesyłki';
|
$settings['tickets']['gift-price']['name'] = 'Koszt przesyłki';
|
||||||
$settings['tickets']['gift-price']['product_id'] = 999999;
|
$settings['tickets']['gift-price']['product_id'] = 999999;
|
||||||
|
|
||||||
@@ -200,14 +97,7 @@ $settings['gift-price-delivery'] = array(
|
|||||||
'gift-price'
|
'gift-price'
|
||||||
);
|
);
|
||||||
|
|
||||||
//TODO: Karnet imienny - na cały sezon
|
// Karnet imienny
|
||||||
$settings['tickets']['karnet-imienny-na-caly-sezon']['price']= 250;
|
|
||||||
// $settings['tickets']['karnet-imienny-na-caly-sezon']['price_promo']= 176;
|
|
||||||
$settings['tickets']['karnet-imienny-na-caly-sezon']['dynamic_prices'] = [
|
|
||||||
'day0' => 0,
|
|
||||||
'day1_2' => 0,
|
|
||||||
'day3_7' => 0,
|
|
||||||
];
|
|
||||||
$settings['tickets']['karnet-imienny-na-caly-sezon']['name'] = 'Karnet imienny na cały sezon';
|
$settings['tickets']['karnet-imienny-na-caly-sezon']['name'] = 'Karnet imienny na cały sezon';
|
||||||
$settings['tickets']['karnet-imienny-na-caly-sezon']['color'] = 'violet';
|
$settings['tickets']['karnet-imienny-na-caly-sezon']['color'] = 'violet';
|
||||||
$settings['tickets']['karnet-imienny-na-caly-sezon']['product_id'] = 12;
|
$settings['tickets']['karnet-imienny-na-caly-sezon']['product_id'] = 12;
|
||||||
@@ -216,7 +106,7 @@ $settings['karnety'] = array(
|
|||||||
'karnet-imienny-na-caly-sezon'
|
'karnet-imienny-na-caly-sezon'
|
||||||
);
|
);
|
||||||
|
|
||||||
$settings['tickets']['ticket-protection']['price'] = 5;
|
// Ochrona kupujacego
|
||||||
$settings['tickets']['ticket-protection']['name'] = 'Ochrona kupującego';
|
$settings['tickets']['ticket-protection']['name'] = 'Ochrona kupującego';
|
||||||
$settings['tickets']['ticket-protection']['product_id'] = 0;
|
$settings['tickets']['ticket-protection']['product_id'] = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -1,108 +0,0 @@
|
|||||||
# Migracja PHP 7.4 → 8.1 — poprawki kompatybilności
|
|
||||||
|
|
||||||
**Data:** 2026-02-22 22:51
|
|
||||||
**Orkiestrator:** Claude Code (Team)
|
|
||||||
**Zapytanie:** Otwarty projekt był napisany pod PHP 7.4, obecnie na serwerze ktoś zmienił wersję na 8.1 przez co strona wywala błąd 500. Przeanalizuj projekt i popraw metody które mogą być problematyczne.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Analiza
|
|
||||||
- **Typ:** debug + refactor
|
|
||||||
- **Złożoność:** 4/5
|
|
||||||
- **Pliki kontekstowe:** 20 plików PHP przeanalizowanych
|
|
||||||
|
|
||||||
## Routing
|
|
||||||
- **Agent główny:** Claude Code — debug wymaga bezpośredniego dostępu do plików i edycji
|
|
||||||
- **Wsparcie:** Gemini CLI (niedostępny — 429 rate limit) → fallback do Claude Code
|
|
||||||
|
|
||||||
## Wynik — lista poprawek
|
|
||||||
|
|
||||||
### KRYTYCZNE (powodują Fatal Error / 500)
|
|
||||||
|
|
||||||
#### 1. Krótkie tagi `<?` zamiast `<?php` (4 pliki)
|
|
||||||
Jeśli `short_open_tag=Off` w php.ini PHP 8.1, pliki nie są parsowane jako PHP → klasy nie istnieją → Fatal Error "Class not found".
|
|
||||||
|
|
||||||
| Plik | Zmiana |
|
|
||||||
|------|--------|
|
|
||||||
| `autoload/controls/class.Tickets.php` | `<?` → `<?php` |
|
|
||||||
| `autoload/controls/class.Apanel.php` | `<?` → `<?php` |
|
|
||||||
| `autoload/factory/class.Tickets.php` | `<?` → `<?php` |
|
|
||||||
| `autoload/factory/class.Apanel.php` | `<?` → `<?php` |
|
|
||||||
|
|
||||||
#### 2. `DbModel::$data` niezainicjalizowane (TypeError)
|
|
||||||
`array_key_exists()` na `null` rzuca `TypeError` w PHP 8.0+.
|
|
||||||
|
|
||||||
| Plik | Zmiana |
|
|
||||||
|------|--------|
|
|
||||||
| `autoload/class.DbModel.php` | `public $data;` → `public $data = [];` |
|
|
||||||
|
|
||||||
#### 3. `S::json_to_array()` — niezainicjalizowana zmienna `$values`
|
|
||||||
Undefined variable → w PHP 8.0+ Warning, potencjalny problem z return.
|
|
||||||
|
|
||||||
| Plik | Zmiana |
|
|
||||||
|------|--------|
|
|
||||||
| `autoload/class.S.php` | Dodano `$values = [];` przed pętlą |
|
|
||||||
|
|
||||||
### WYSOKIE (Warning/Deprecation, mogą powodować problemy)
|
|
||||||
|
|
||||||
#### 4. `$_GET['debug']` bez isset check
|
|
||||||
| Plik | Linia | Zmiana |
|
|
||||||
|------|-------|--------|
|
|
||||||
| `index.php` | 38 | Dodano `isset()` check |
|
|
||||||
|
|
||||||
#### 5. `$_SESSION['lower_price_ticket']` bez isset
|
|
||||||
| Plik | Linia | Zmiana |
|
|
||||||
|------|-------|--------|
|
|
||||||
| `config.php` | 18 | `if(...)` → `if(!empty(...))` |
|
|
||||||
|
|
||||||
#### 6. `S::get_session()` — dostęp do niezdefiniowanego klucza sesji
|
|
||||||
| Plik | Zmiana |
|
|
||||||
|------|--------|
|
|
||||||
| `autoload/class.S.php` | `$_SESSION[$var]` → `$_SESSION[$var] ?? null` |
|
|
||||||
|
|
||||||
#### 7. `S::get()` — uproszczone, explicit `return null`
|
|
||||||
| Plik | Zmiana |
|
|
||||||
|------|--------|
|
|
||||||
| `autoload/class.S.php` | Dodano explicit `return null` na końcu metody |
|
|
||||||
|
|
||||||
#### 8. Routing — `explode('_', null)` i `ucfirst(null)`
|
|
||||||
| Plik | Zmiana |
|
|
||||||
|------|--------|
|
|
||||||
| `autoload/view/class.Site.php` | `\S::get('module')` → `\S::get('module') ?? ''` |
|
|
||||||
| `autoload/controls/class.Site.php` | j.w. |
|
|
||||||
|
|
||||||
### ŚREDNIE (Deprecation notices, suppressed przez error_reporting)
|
|
||||||
|
|
||||||
#### 9. Null-safety w funkcjach string
|
|
||||||
| Plik | Metoda | Zmiana |
|
|
||||||
|------|--------|--------|
|
|
||||||
| `autoload/class.S.php` | `noPL()` | Cast `(string) $val` |
|
|
||||||
| `autoload/class.S.php` | `no_pl_excel()` | Cast `(string) $val` |
|
|
||||||
| `autoload/class.S.php` | `seo()` | Cast `(string) $val` |
|
|
||||||
| `autoload/class.S.php` | `number_display()` | Cast `(float) $value` |
|
|
||||||
| `autoload/class.S.php` | `send_email()` | `!empty()` check przed `file_exists()` |
|
|
||||||
| `autoload/class.Tpl.php` | `secureHTML()` | Cast `(string) $val` w `stripslashes()` |
|
|
||||||
| `autoload/factory/class.Users.php` | `login()` | Cast `(string) $email` w `strtolower()` |
|
|
||||||
|
|
||||||
#### 10. Niezdefiniowane zmienne / klucze tablic
|
|
||||||
| Plik | Metoda | Zmiana |
|
|
||||||
|------|--------|--------|
|
|
||||||
| `controls/class.Tickets.php` | `ticket_add()` | `$basket[...]` → `!empty($basket[...])` |
|
|
||||||
| `controls/class.Tickets.php` | `ticket_subtract()` | Dodano `isset()` check |
|
|
||||||
| `controls/class.Tickets.php` | `basketFormHandler()` | `$_POST` → null-safe z `?? ''` |
|
|
||||||
| `controls/class.Tickets.php` | `basketFormHandler()` | `$val['date']` → `!empty()` |
|
|
||||||
| `controls/class.Tickets.php` | `order_confirm()` | Inicjalizacja `$order_successful/$order_fail = false` |
|
|
||||||
| `controls/class.Apanel.php` | `ticket_inc()` | `$basket[...]` → `!empty()` |
|
|
||||||
| `controls/class.Scanner.php` | `scanner_get_data()` | `strtotime(null)` → `?? 'now'` |
|
|
||||||
|
|
||||||
## Recenzja
|
|
||||||
- **Werdykt:** accept (Claude Code — samodzielna analiza i poprawki)
|
|
||||||
- **Uwagi:** Gemini niedostępny (429), Claude przejął całość. Wszystkie 20 plików PHP przeanalizowane. Poprawiono 13 plików.
|
|
||||||
|
|
||||||
## Statystyki sesji
|
|
||||||
- Zadania w sesji: 1
|
|
||||||
- Zużycie kontekstu: Claude ~35% | Codex 0% | Gemini 0% (failed)
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*Wygenerowano przez /team — orkiestrator Claude/Codex/Gemini*
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
{
|
|
||||||
"session_start": "2026-02-22 22:47",
|
|
||||||
"agents": {
|
|
||||||
"claude": { "tasks": 1, "tokens_estimate": 70000, "context_limit": 200000, "errors": 0 },
|
|
||||||
"codex": { "tasks": 0, "tokens_estimate": 0, "context_limit": 200000, "errors": 0 },
|
|
||||||
"gemini": { "tasks": 0, "tokens_estimate": 0, "context_limit": 1000000, "errors": 1 }
|
|
||||||
},
|
|
||||||
"history": [
|
|
||||||
{
|
|
||||||
"timestamp": "22:51",
|
|
||||||
"task": "Migracja PHP 7.4 → 8.1 — analiza + poprawki kompatybilności",
|
|
||||||
"agent": "claude",
|
|
||||||
"type": "debug+refactor",
|
|
||||||
"status": "success",
|
|
||||||
"tokens_estimate": 70000,
|
|
||||||
"review_verdict": "accept",
|
|
||||||
"support_agent": "gemini",
|
|
||||||
"support_status": "failed (429 rate limit)"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -52,5 +52,7 @@ $mdb = new medoo([
|
|||||||
'password' => $database['password'],
|
'password' => $database['password'],
|
||||||
'charset' => 'utf8'
|
'charset' => 'utf8'
|
||||||
]);
|
]);
|
||||||
|
require_once 'load_prices.php';
|
||||||
|
|
||||||
$user = \S::get_session('user');
|
$user = \S::get_session('user');
|
||||||
echo \view\Site::show();
|
echo \view\Site::show();
|
||||||
BIN
layout/.DS_Store
vendored
Normal file
BIN
layout/.DS_Store
vendored
Normal file
Binary file not shown.
9
layout/.htaccess
Normal file
9
layout/.htaccess
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteBase /
|
||||||
|
RewriteRule ^index\.php$ - [L]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule . /index.php [L]
|
||||||
|
</IfModule>
|
||||||
9
layout/images/.htaccess
Normal file
9
layout/images/.htaccess
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteBase /
|
||||||
|
RewriteRule ^index\.php$ - [L]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule . /index.php [L]
|
||||||
|
</IfModule>
|
||||||
BIN
layout/images/logo copy.png
Normal file
BIN
layout/images/logo copy.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
9
layout/style-css/.htaccess
Normal file
9
layout/style-css/.htaccess
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteBase /
|
||||||
|
RewriteRule ^index\.php$ - [L]
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule . /index.php [L]
|
||||||
|
</IfModule>
|
||||||
0
layout/style-css/countdown/index.php
Normal file
0
layout/style-css/countdown/index.php
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
0
layout/style-scss/index.php
Normal file
0
layout/style-scss/index.php
Normal file
@@ -167,8 +167,7 @@ body {
|
|||||||
top: 20%;
|
top: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-child(2) {
|
&:nth-child(2) {}
|
||||||
}
|
|
||||||
|
|
||||||
&:nth-child(3) {
|
&:nth-child(3) {
|
||||||
top: 80%;
|
top: 80%;
|
||||||
@@ -355,6 +354,7 @@ body {
|
|||||||
@include respond-below(md) {
|
@include respond-below(md) {
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include respond-below(sm) {
|
@include respond-below(sm) {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
}
|
}
|
||||||
@@ -401,6 +401,7 @@ body {
|
|||||||
font-size: 36px;
|
font-size: 36px;
|
||||||
min-width: 130px;
|
min-width: 130px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include respond-below(sm) {
|
@include respond-below(sm) {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
min-width: unset;
|
min-width: unset;
|
||||||
@@ -410,24 +411,32 @@ body {
|
|||||||
|
|
||||||
//przyciski
|
//przyciski
|
||||||
.ticket-quantity {
|
.ticket-quantity {
|
||||||
margin-left: 30px;
|
margin-left: auto;
|
||||||
|
|
||||||
@include respond-below(sm) {
|
@include respond-below(sm) {
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.button {
|
||||||
width: 30px;
|
padding: 10px 20px;
|
||||||
height: 30px;
|
border-radius: 8px;
|
||||||
border-radius: 50%;
|
border: none;
|
||||||
border: 1px solid $base-font-color;
|
background-color: $cGreen;
|
||||||
color: $base-font-color;
|
color: #fff;
|
||||||
background-color: transparent;
|
font-size: 14px;
|
||||||
text-align: center;
|
font-weight: 700;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: darken($cGreen, 8%);
|
||||||
}
|
}
|
||||||
|
|
||||||
span {
|
&.added {
|
||||||
padding: 0 5px;
|
background-color: darken($cGreen, 12%);
|
||||||
|
transform: scale(1.05);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -435,6 +444,7 @@ body {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
row-gap: 15px;
|
row-gap: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@include respond-below(xs) {
|
@include respond-below(xs) {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
@@ -559,6 +569,7 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//shoping cart
|
//shoping cart
|
||||||
.shopping-cart {
|
.shopping-cart {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -688,6 +699,10 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.mobile-cart-btn {
|
.mobile-cart-btn {
|
||||||
|
&.cart-bounce {
|
||||||
|
animation: cartBounce 0.5s ease;
|
||||||
|
}
|
||||||
|
|
||||||
position: fixed;
|
position: fixed;
|
||||||
bottom: 50px;
|
bottom: 50px;
|
||||||
right: 0;
|
right: 0;
|
||||||
@@ -723,6 +738,7 @@ body {
|
|||||||
line-height: 1;
|
line-height: 1;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.mobile-cart-btn--img {
|
.mobile-cart-btn--img {
|
||||||
img {
|
img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -770,6 +786,11 @@ body {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ticket-date {
|
||||||
|
color: #888;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
.btn_t1 {
|
.btn_t1 {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
@@ -829,7 +850,8 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
thead {
|
thead {
|
||||||
display: none; /* Приховуємо заголовки */
|
display: none;
|
||||||
|
/* Приховуємо заголовки */
|
||||||
}
|
}
|
||||||
|
|
||||||
tr {
|
tr {
|
||||||
@@ -1148,8 +1170,7 @@ body {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-child(3) {
|
&:nth-child(3) {}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#myTable_length {
|
#myTable_length {
|
||||||
@@ -1413,3 +1434,23 @@ body {
|
|||||||
font-style: italic;
|
font-style: italic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes cartBounce {
|
||||||
|
|
||||||
|
0%,
|
||||||
|
100% {
|
||||||
|
transform: translateX(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
25% {
|
||||||
|
transform: translateX(-8px) scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
50% {
|
||||||
|
transform: translateX(4px) scale(1.05);
|
||||||
|
}
|
||||||
|
|
||||||
|
75% {
|
||||||
|
transform: translateX(-2px);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,316 +0,0 @@
|
|||||||
|
|
||||||
RedBeanPHP
|
|
||||||
Written by Gabor de Mooij
|
|
||||||
|
|
||||||
RedBean is DUAL Licensed New BSD and GPLv2. You may choose the license that fits
|
|
||||||
best for your project.
|
|
||||||
|
|
||||||
New BSD License
|
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without
|
|
||||||
modification, are permitted provided that the following conditions are met:
|
|
||||||
* Redistributions of source code must retain the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer.
|
|
||||||
* Redistributions in binary form must reproduce the above copyright
|
|
||||||
notice, this list of conditions and the following disclaimer in the
|
|
||||||
documentation and/or other materials provided with the distribution.
|
|
||||||
* Neither the name of RedBeanPHP nor the
|
|
||||||
names of its contributors may be used to endorse or promote products
|
|
||||||
derived from this software without specific prior written permission.
|
|
||||||
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY GABOR DE MOOIJ ''AS IS'' AND ANY
|
|
||||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL GABOR DE MOOIJ BE LIABLE FOR ANY
|
|
||||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
||||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
RedBeanPHP is Written by Gabor de Mooij (G.J.G.T de Mooij) Copyright (c) 2018.
|
|
||||||
|
|
||||||
|
|
||||||
GPLv2 LICENSE
|
|
||||||
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
Version 2, June 1991
|
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
|
||||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
|
||||||
of this license document, but changing it is not allowed.
|
|
||||||
|
|
||||||
Preamble
|
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
|
||||||
License is intended to guarantee your freedom to share and change free
|
|
||||||
software--to make sure the software is free for all its users. This
|
|
||||||
General Public License applies to most of the Free Software
|
|
||||||
Foundation's software and to any other program whose authors commit to
|
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
|
||||||
the GNU Lesser General Public License instead.) You can apply it to
|
|
||||||
your programs, too.
|
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
|
||||||
price. Our General Public Licenses are designed to make sure that you
|
|
||||||
have the freedom to distribute copies of free software (and charge for
|
|
||||||
this service if you wish), that you receive source code or can get it
|
|
||||||
if you want it, that you can change the software or use pieces of it
|
|
||||||
in new free programs; and that you know you can do these things.
|
|
||||||
|
|
||||||
To protect your rights, we need to make restrictions that forbid
|
|
||||||
anyone to deny you these rights or to ask you to surrender the rights.
|
|
||||||
These restrictions translate to certain responsibilities for you if you
|
|
||||||
distribute copies of the software, or if you modify it.
|
|
||||||
|
|
||||||
For example, if you distribute copies of such a program, whether
|
|
||||||
gratis or for a fee, you must give the recipients all the rights that
|
|
||||||
you have. You must make sure that they, too, receive or can get the
|
|
||||||
source code. And you must show them these terms so they know their
|
|
||||||
rights.
|
|
||||||
|
|
||||||
We protect your rights with two steps: (1) copyright the software, and
|
|
||||||
(2) offer you this license which gives you legal permission to copy,
|
|
||||||
distribute and/or modify the software.
|
|
||||||
|
|
||||||
Also, for each author's protection and ours, we want to make certain
|
|
||||||
that everyone understands that there is no warranty for this free
|
|
||||||
software. If the software is modified by someone else and passed on, we
|
|
||||||
want its recipients to know that what they have is not the original, so
|
|
||||||
that any problems introduced by others will not reflect on the original
|
|
||||||
authors' reputations.
|
|
||||||
|
|
||||||
Finally, any free program is threatened constantly by software
|
|
||||||
patents. We wish to avoid the danger that redistributors of a free
|
|
||||||
program will individually obtain patent licenses, in effect making the
|
|
||||||
program proprietary. To prevent this, we have made it clear that any
|
|
||||||
patent must be licensed for everyone's free use or not licensed at all.
|
|
||||||
|
|
||||||
The precise terms and conditions for copying, distribution and
|
|
||||||
modification follow.
|
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
|
||||||
a notice placed by the copyright holder saying it may be distributed
|
|
||||||
under the terms of this General Public License. The "Program", below,
|
|
||||||
refers to any such program or work, and a "work based on the Program"
|
|
||||||
means either the Program or any derivative work under copyright law:
|
|
||||||
that is to say, a work containing the Program or a portion of it,
|
|
||||||
either verbatim or with modifications and/or translated into another
|
|
||||||
language. (Hereinafter, translation is included without limitation in
|
|
||||||
the term "modification".) Each licensee is addressed as "you".
|
|
||||||
|
|
||||||
Activities other than copying, distribution and modification are not
|
|
||||||
covered by this License; they are outside its scope. The act of
|
|
||||||
running the Program is not restricted, and the output from the Program
|
|
||||||
is covered only if its contents constitute a work based on the
|
|
||||||
Program (independent of having been made by running the Program).
|
|
||||||
Whether that is true depends on what the Program does.
|
|
||||||
|
|
||||||
1. You may copy and distribute verbatim copies of the Program's
|
|
||||||
source code as you receive it, in any medium, provided that you
|
|
||||||
conspicuously and appropriately publish on each copy an appropriate
|
|
||||||
copyright notice and disclaimer of warranty; keep intact all the
|
|
||||||
notices that refer to this License and to the absence of any warranty;
|
|
||||||
and give any other recipients of the Program a copy of this License
|
|
||||||
along with the Program.
|
|
||||||
|
|
||||||
You may charge a fee for the physical act of transferring a copy, and
|
|
||||||
you may at your option offer warranty protection in exchange for a fee.
|
|
||||||
|
|
||||||
2. You may modify your copy or copies of the Program or any portion
|
|
||||||
of it, thus forming a work based on the Program, and copy and
|
|
||||||
distribute such modifications or work under the terms of Section 1
|
|
||||||
above, provided that you also meet all of these conditions:
|
|
||||||
|
|
||||||
a) You must cause the modified files to carry prominent notices
|
|
||||||
stating that you changed the files and the date of any change.
|
|
||||||
|
|
||||||
b) You must cause any work that you distribute or publish, that in
|
|
||||||
whole or in part contains or is derived from the Program or any
|
|
||||||
part thereof, to be licensed as a whole at no charge to all third
|
|
||||||
parties under the terms of this License.
|
|
||||||
|
|
||||||
c) If the modified program normally reads commands interactively
|
|
||||||
when run, you must cause it, when started running for such
|
|
||||||
interactive use in the most ordinary way, to print or display an
|
|
||||||
announcement including an appropriate copyright notice and a
|
|
||||||
notice that there is no warranty (or else, saying that you provide
|
|
||||||
a warranty) and that users may redistribute the program under
|
|
||||||
these conditions, and telling the user how to view a copy of this
|
|
||||||
License. (Exception: if the Program itself is interactive but
|
|
||||||
does not normally print such an announcement, your work based on
|
|
||||||
the Program is not required to print an announcement.)
|
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
|
||||||
identifiable sections of that work are not derived from the Program,
|
|
||||||
and can be reasonably considered independent and separate works in
|
|
||||||
themselves, then this License, and its terms, do not apply to those
|
|
||||||
sections when you distribute them as separate works. But when you
|
|
||||||
distribute the same sections as part of a whole which is a work based
|
|
||||||
on the Program, the distribution of the whole must be on the terms of
|
|
||||||
this License, whose permissions for other licensees extend to the
|
|
||||||
entire whole, and thus to each and every part regardless of who wrote it.
|
|
||||||
|
|
||||||
Thus, it is not the intent of this section to claim rights or contest
|
|
||||||
your rights to work written entirely by you; rather, the intent is to
|
|
||||||
exercise the right to control the distribution of derivative or
|
|
||||||
collective works based on the Program.
|
|
||||||
|
|
||||||
In addition, mere aggregation of another work not based on the Program
|
|
||||||
with the Program (or with a work based on the Program) on a volume of
|
|
||||||
a storage or distribution medium does not bring the other work under
|
|
||||||
the scope of this License.
|
|
||||||
|
|
||||||
3. You may copy and distribute the Program (or a work based on it,
|
|
||||||
under Section 2) in object code or executable form under the terms of
|
|
||||||
Sections 1 and 2 above provided that you also do one of the following:
|
|
||||||
|
|
||||||
a) Accompany it with the complete corresponding machine-readable
|
|
||||||
source code, which must be distributed under the terms of Sections
|
|
||||||
1 and 2 above on a medium customarily used for software interchange; or,
|
|
||||||
|
|
||||||
b) Accompany it with a written offer, valid for at least three
|
|
||||||
years, to give any third party, for a charge no more than your
|
|
||||||
cost of physically performing source distribution, a complete
|
|
||||||
machine-readable copy of the corresponding source code, to be
|
|
||||||
distributed under the terms of Sections 1 and 2 above on a medium
|
|
||||||
customarily used for software interchange; or,
|
|
||||||
|
|
||||||
c) Accompany it with the information you received as to the offer
|
|
||||||
to distribute corresponding source code. (This alternative is
|
|
||||||
allowed only for noncommercial distribution and only if you
|
|
||||||
received the program in object code or executable form with such
|
|
||||||
an offer, in accord with Subsection b above.)
|
|
||||||
|
|
||||||
The source code for a work means the preferred form of the work for
|
|
||||||
making modifications to it. For an executable work, complete source
|
|
||||||
code means all the source code for all modules it contains, plus any
|
|
||||||
associated interface definition files, plus the scripts used to
|
|
||||||
control compilation and installation of the executable. However, as a
|
|
||||||
special exception, the source code distributed need not include
|
|
||||||
anything that is normally distributed (in either source or binary
|
|
||||||
form) with the major components (compiler, kernel, and so on) of the
|
|
||||||
operating system on which the executable runs, unless that component
|
|
||||||
itself accompanies the executable.
|
|
||||||
|
|
||||||
If distribution of executable or object code is made by offering
|
|
||||||
access to copy from a designated place, then offering equivalent
|
|
||||||
access to copy the source code from the same place counts as
|
|
||||||
distribution of the source code, even though third parties are not
|
|
||||||
compelled to copy the source along with the object code.
|
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
|
||||||
except as expressly provided under this License. Any attempt
|
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
|
||||||
void, and will automatically terminate your rights under this License.
|
|
||||||
However, parties who have received copies, or rights, from you under
|
|
||||||
this License will not have their licenses terminated so long as such
|
|
||||||
parties remain in full compliance.
|
|
||||||
|
|
||||||
5. You are not required to accept this License, since you have not
|
|
||||||
signed it. However, nothing else grants you permission to modify or
|
|
||||||
distribute the Program or its derivative works. These actions are
|
|
||||||
prohibited by law if you do not accept this License. Therefore, by
|
|
||||||
modifying or distributing the Program (or any work based on the
|
|
||||||
Program), you indicate your acceptance of this License to do so, and
|
|
||||||
all its terms and conditions for copying, distributing or modifying
|
|
||||||
the Program or works based on it.
|
|
||||||
|
|
||||||
6. Each time you redistribute the Program (or any work based on the
|
|
||||||
Program), the recipient automatically receives a license from the
|
|
||||||
original licensor to copy, distribute or modify the Program subject to
|
|
||||||
these terms and conditions. You may not impose any further
|
|
||||||
restrictions on the recipients' exercise of the rights granted herein.
|
|
||||||
You are not responsible for enforcing compliance by third parties to
|
|
||||||
this License.
|
|
||||||
|
|
||||||
7. If, as a consequence of a court judgment or allegation of patent
|
|
||||||
infringement or for any other reason (not limited to patent issues),
|
|
||||||
conditions are imposed on you (whether by court order, agreement or
|
|
||||||
otherwise) that contradict the conditions of this License, they do not
|
|
||||||
excuse you from the conditions of this License. If you cannot
|
|
||||||
distribute so as to satisfy simultaneously your obligations under this
|
|
||||||
License and any other pertinent obligations, then as a consequence you
|
|
||||||
may not distribute the Program at all. For example, if a patent
|
|
||||||
license would not permit royalty-free redistribution of the Program by
|
|
||||||
all those who receive copies directly or indirectly through you, then
|
|
||||||
the only way you could satisfy both it and this License would be to
|
|
||||||
refrain entirely from distribution of the Program.
|
|
||||||
|
|
||||||
If any portion of this section is held invalid or unenforceable under
|
|
||||||
any particular circumstance, the balance of the section is intended to
|
|
||||||
apply and the section as a whole is intended to apply in other
|
|
||||||
circumstances.
|
|
||||||
|
|
||||||
It is not the purpose of this section to induce you to infringe any
|
|
||||||
patents or other property right claims or to contest validity of any
|
|
||||||
such claims; this section has the sole purpose of protecting the
|
|
||||||
integrity of the free software distribution system, which is
|
|
||||||
implemented by public license practices. Many people have made
|
|
||||||
generous contributions to the wide range of software distributed
|
|
||||||
through that system in reliance on consistent application of that
|
|
||||||
system; it is up to the author/donor to decide if he or she is willing
|
|
||||||
to distribute software through any other system and a licensee cannot
|
|
||||||
impose that choice.
|
|
||||||
|
|
||||||
This section is intended to make thoroughly clear what is believed to
|
|
||||||
be a consequence of the rest of this License.
|
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
|
||||||
original copyright holder who places the Program under this License
|
|
||||||
may add an explicit geographical distribution limitation excluding
|
|
||||||
those countries, so that distribution is permitted only in or among
|
|
||||||
countries not thus excluded. In such case, this License incorporates
|
|
||||||
the limitation as if written in the body of this License.
|
|
||||||
|
|
||||||
9. The Free Software Foundation may publish revised and/or new versions
|
|
||||||
of the General Public License from time to time. Such new versions will
|
|
||||||
be similar in spirit to the present version, but may differ in detail to
|
|
||||||
address new problems or concerns.
|
|
||||||
|
|
||||||
Each version is given a distinguishing version number. If the Program
|
|
||||||
specifies a version number of this License which applies to it and "any
|
|
||||||
later version", you have the option of following the terms and conditions
|
|
||||||
either of that version or of any later version published by the Free
|
|
||||||
Software Foundation. If the Program does not specify a version number of
|
|
||||||
this License, you may choose any version ever published by the Free Software
|
|
||||||
Foundation.
|
|
||||||
|
|
||||||
10. If you wish to incorporate parts of the Program into other free
|
|
||||||
programs whose distribution conditions are different, write to the author
|
|
||||||
to ask for permission. For software which is copyrighted by the Free
|
|
||||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
|
||||||
make exceptions for this. Our decision will be guided by the two goals
|
|
||||||
of preserving the free status of all derivatives of our free software and
|
|
||||||
of promoting the sharing and reuse of software generally.
|
|
||||||
|
|
||||||
NO WARRANTY
|
|
||||||
|
|
||||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
|
||||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
|
||||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
|
||||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
|
||||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
||||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
|
||||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
|
||||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
|
||||||
REPAIR OR CORRECTION.
|
|
||||||
|
|
||||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
|
||||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
|
||||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
|
||||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
|
||||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
|
||||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
|
||||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
|
||||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
|
||||||
29
load_prices.php
Normal file
29
load_prices.php
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
// Ladowanie cen biletow z bazy danych do $settings['tickets']
|
||||||
|
// Wymaga: $mdb (Medoo), $settings['tickets'] (struktura z config.php)
|
||||||
|
|
||||||
|
$_dbStmt = $mdb->query('SELECT * FROM ticket_prices');
|
||||||
|
$_dbPrices = [];
|
||||||
|
if ($_dbStmt) {
|
||||||
|
foreach ($_dbStmt->fetchAll(\PDO::FETCH_ASSOC) as $_row) {
|
||||||
|
$_dbPrices[$_row['ticket_id']] = $_row;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($settings['tickets'] as $tid => &$_ticket) {
|
||||||
|
if (isset($_dbPrices[$tid])) {
|
||||||
|
$_r = $_dbPrices[$tid];
|
||||||
|
$_ticket['price'] = (float) ($_r['price'] ?? 0);
|
||||||
|
$_ticket['price_weekend'] = (float) ($_r['price_weekend'] ?? 0);
|
||||||
|
$_ticket['dynamic_prices'] = [
|
||||||
|
'day0' => (float) ($_r['dynamic_price_day0'] ?? 0),
|
||||||
|
'day1_2' => (float) ($_r['dynamic_price_day1_2'] ?? 0),
|
||||||
|
'day3_7' => (float) ($_r['dynamic_price_day3_7'] ?? 0),
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$_ticket['price'] = $_ticket['price'] ?? 0;
|
||||||
|
$_ticket['price_weekend'] = $_ticket['price_weekend'] ?? 0;
|
||||||
|
$_ticket['dynamic_prices'] = $_ticket['dynamic_prices'] ?? ['day0' => 0, 'day1_2' => 0, 'day3_7' => 0];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
unset($_ticket, $_dbStmt, $_dbPrices, $_r);
|
||||||
54
templates/admin-panel/settings.php
Normal file
54
templates/admin-panel/settings.php
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
$enable_sell = $this->enable_sell;
|
||||||
|
?>
|
||||||
|
<div id="admin-settings">
|
||||||
|
<div class="container">
|
||||||
|
<div class="tickets-orders">
|
||||||
|
<h1>Ustawienia</h1>
|
||||||
|
<div class="card p-4 mb-3">
|
||||||
|
<div class="form-check form-switch">
|
||||||
|
<input class="form-check-input" type="checkbox" id="enable_sell" <?= $enable_sell == '1' ? 'checked' : '' ?>>
|
||||||
|
<label class="form-check-label" for="enable_sell">Sprzedaz biletow wlaczona</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="button" class="btn btn-t1" id="save-settings">Zapisz ustawienia</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#save-settings').on('click', function() {
|
||||||
|
var postData = {};
|
||||||
|
if ($('#enable_sell').is(':checked')) {
|
||||||
|
postData['enable_sell'] = '1';
|
||||||
|
}
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/apanel/settings_save/',
|
||||||
|
type: 'POST',
|
||||||
|
data: postData,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.status === 'ok') {
|
||||||
|
$.alert({
|
||||||
|
title: 'Sukces',
|
||||||
|
content: 'Ustawienia zapisano',
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$.alert({
|
||||||
|
title: 'Blad',
|
||||||
|
content: res.message || 'Wystapil blad',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
$.alert({
|
||||||
|
title: 'Blad',
|
||||||
|
content: 'Nie udalo sie zapisac ustawien',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
132
templates/admin-panel/tickets.php
Normal file
132
templates/admin-panel/tickets.php
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
$tickets = $this->tickets;
|
||||||
|
$exclude = ['ticket-protection', 'gift-price'];
|
||||||
|
|
||||||
|
// Sortowanie: pary ulgowy/normalny obok siebie
|
||||||
|
$seen_bases = [];
|
||||||
|
foreach ($tickets as $tid => $t) {
|
||||||
|
if (in_array($tid, $exclude)) continue;
|
||||||
|
$base = preg_replace('/-(ulgowy|normalny)$/', '', $tid);
|
||||||
|
if (!in_array($base, $seen_bases)) {
|
||||||
|
$seen_bases[] = $base;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$ordered = [];
|
||||||
|
foreach ($seen_bases as $base) {
|
||||||
|
if (isset($tickets[$base . '-ulgowy']))
|
||||||
|
$ordered[$base . '-ulgowy'] = $tickets[$base . '-ulgowy'];
|
||||||
|
if (isset($tickets[$base . '-normalny']))
|
||||||
|
$ordered[$base . '-normalny'] = $tickets[$base . '-normalny'];
|
||||||
|
if (!isset($tickets[$base . '-ulgowy']) && !isset($tickets[$base . '-normalny']) && isset($tickets[$base]))
|
||||||
|
$ordered[$base] = $tickets[$base];
|
||||||
|
}
|
||||||
|
$tickets = $ordered;
|
||||||
|
?>
|
||||||
|
<div id="tickets-prices">
|
||||||
|
<div class="container">
|
||||||
|
<div class="tickets-orders">
|
||||||
|
<h1>Cennik biletow</h1>
|
||||||
|
<div style="overflow-x:auto;">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Bilet</th>
|
||||||
|
<th>Cena PN-PT</th>
|
||||||
|
<th>Cena SB-ND</th>
|
||||||
|
<th>Doplata: dzis</th>
|
||||||
|
<th>Doplata: 1-2 dni</th>
|
||||||
|
<th>Doplata: 3-7 dni</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($tickets as $tid => $t) : ?>
|
||||||
|
<?php if (in_array($tid, $exclude)) continue; ?>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<?= htmlspecialchars($t['name']); ?>
|
||||||
|
<br><small class="text-muted"><?= htmlspecialchars($tid); ?></small>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" step="0.01" min="0" class="form-control"
|
||||||
|
name="tickets[<?= $tid; ?>][price]"
|
||||||
|
value="<?= $t['price'] ?? ''; ?>">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" step="0.01" min="0" class="form-control"
|
||||||
|
name="tickets[<?= $tid; ?>][price_weekend]"
|
||||||
|
value="<?= $t['price_weekend'] ?? ''; ?>">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" step="0.01" min="0" class="form-control"
|
||||||
|
name="tickets[<?= $tid; ?>][day0]"
|
||||||
|
value="<?= $t['dynamic_prices']['day0'] ?? ''; ?>">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" step="0.01" min="0" class="form-control"
|
||||||
|
name="tickets[<?= $tid; ?>][day1_2]"
|
||||||
|
value="<?= $t['dynamic_prices']['day1_2'] ?? ''; ?>">
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" step="0.01" min="0" class="form-control"
|
||||||
|
name="tickets[<?= $tid; ?>][day3_7]"
|
||||||
|
value="<?= $t['dynamic_prices']['day3_7'] ?? ''; ?>">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?php $tp = $this->tickets['ticket-protection'] ?? null; ?>
|
||||||
|
<?php if ($tp) : ?>
|
||||||
|
<h3 class="mt-4">Doplaty</h3>
|
||||||
|
<div class="row mb-3" style="max-width:400px;">
|
||||||
|
<label class="col-8 col-form-label"><?= htmlspecialchars($tp['name']); ?></label>
|
||||||
|
<div class="col-4">
|
||||||
|
<input type="number" step="0.01" min="0" class="form-control"
|
||||||
|
name="tickets[ticket-protection][price]"
|
||||||
|
value="<?= $tp['price'] ?? ''; ?>">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
<button type="button" class="btn btn-t1" id="save-prices">Zapisz ceny</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#save-prices').on('click', function() {
|
||||||
|
var postData = {};
|
||||||
|
$('input[name^="tickets["]').each(function() {
|
||||||
|
postData[$(this).attr('name')] = $(this).val();
|
||||||
|
});
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: '/apanel/tickets_save/',
|
||||||
|
type: 'POST',
|
||||||
|
data: postData,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(res) {
|
||||||
|
if (res.status === 'ok') {
|
||||||
|
$.alert({
|
||||||
|
title: 'Sukces',
|
||||||
|
content: 'Ceny zapisano',
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$.alert({
|
||||||
|
title: 'Blad',
|
||||||
|
content: res.message || 'Wystapil blad',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function() {
|
||||||
|
$.alert({
|
||||||
|
title: 'Blad',
|
||||||
|
content: 'Nie udalo sie zapisac cen',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@@ -69,6 +69,16 @@
|
|||||||
Lista zamówień
|
Lista zamówień
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/apanel/tickets/">
|
||||||
|
Cennik
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="/apanel/settings/">
|
||||||
|
Ustawienia
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<form action="/apanel/unlogin/" method="POST" class="unlogin">
|
<form action="/apanel/unlogin/" method="POST" class="unlogin">
|
||||||
<button type="submit" class="btn-t2">Wylogować się</button>
|
<button type="submit" class="btn-t2">Wylogować się</button>
|
||||||
|
|||||||
@@ -19,7 +19,12 @@
|
|||||||
<?php foreach ($this->cart as $ticket_id => $combinations) : ?>
|
<?php foreach ($this->cart as $ticket_id => $combinations) : ?>
|
||||||
<?php foreach ($combinations as $key => $value) : ?>
|
<?php foreach ($combinations as $key => $value) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td data-label="BILETY"><?= $this->settings['tickets'][$ticket_id]['name']; ?> (x<?= $value["quantity"]; ?>)</td>
|
<td data-label="BILETY">
|
||||||
|
<?= $this->settings['tickets'][$ticket_id]['name']; ?> (x<?= $value["quantity"]; ?>)
|
||||||
|
<?php if (!empty($value['date'])) : ?>
|
||||||
|
<br><small class="ticket-date"><?= $value['date']; ?></small>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
<td data-label="CENA"><?= $value['ticket_price']; ?> zł</td>
|
<td data-label="CENA"><?= $value['ticket_price']; ?> zł</td>
|
||||||
<td data-label="WARTOŚĆ"><?= $value['ticket_price'] * $value["quantity"]; ?> zł</td>
|
<td data-label="WARTOŚĆ"><?= $value['ticket_price'] * $value["quantity"]; ?> zł</td>
|
||||||
<td data-label="ZMIENIĆ ILOŚĆ">
|
<td data-label="ZMIENIĆ ILOŚĆ">
|
||||||
|
|||||||
@@ -35,7 +35,12 @@
|
|||||||
<?php foreach ($this->cart as $ticket_id => $combinations) : ?>
|
<?php foreach ($this->cart as $ticket_id => $combinations) : ?>
|
||||||
<?php foreach ($combinations as $key => $value) : ?>
|
<?php foreach ($combinations as $key => $value) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td data-label="BILETY"><?= $this->settings['tickets'][$ticket_id]['name']; ?> (x<?= $value["quantity"]; ?>)</td>
|
<td data-label="BILETY">
|
||||||
|
<?= $this->settings['tickets'][$ticket_id]['name']; ?> (x<?= $value["quantity"]; ?>)
|
||||||
|
<?php if (!empty($value['date'])) : ?>
|
||||||
|
<br><small class="ticket-date"><?= $value['date']; ?></small>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
<td data-label="CENA"><?= $value['ticket_price']; ?> zł</td>
|
<td data-label="CENA"><?= $value['ticket_price']; ?> zł</td>
|
||||||
<td data-label="WARTOŚĆ"><?= $value['ticket_price'] * $value["quantity"]; ?> zł</td>
|
<td data-label="WARTOŚĆ"><?= $value['ticket_price'] * $value["quantity"]; ?> zł</td>
|
||||||
<td data-label="ZMIENIĆ ILOŚĆ">
|
<td data-label="ZMIENIĆ ILOŚĆ">
|
||||||
|
|||||||
@@ -7,22 +7,25 @@ if (isset($_POST['selected_date'])) {
|
|||||||
$interval = $today->diff($selected);
|
$interval = $today->diff($selected);
|
||||||
$days_diff = (int)$interval->format('%r%a');
|
$days_diff = (int)$interval->format('%r%a');
|
||||||
|
|
||||||
function date_price($item, $days_diff) {
|
$is_weekend = in_array($selected->format('N'), ['6', '7']);
|
||||||
|
|
||||||
|
function date_price($item, $days_diff, $is_weekend = false) {
|
||||||
|
$base = $is_weekend ? ($item['price_weekend'] ?? $item['price']) : $item['price'];
|
||||||
|
|
||||||
if($days_diff == 0) {
|
if($days_diff == 0) {
|
||||||
$price = $item['price'] + $item['dynamic_prices']['day0'];
|
$price = $base + $item['dynamic_prices']['day0'];
|
||||||
return $price . ' zł';
|
return $price . ' zł';
|
||||||
}
|
}
|
||||||
elseif ($days_diff == 1 || $days_diff == 2) {
|
elseif ($days_diff == 1 || $days_diff == 2) {
|
||||||
$price = $item['price'] + $item['dynamic_prices']['day1_2'];
|
$price = $base + $item['dynamic_prices']['day1_2'];
|
||||||
return $price . ' zł';
|
return $price . ' zł';
|
||||||
}
|
}
|
||||||
elseif ($days_diff >= 3 && $days_diff <= 7) {
|
elseif ($days_diff >= 3 && $days_diff <= 7) {
|
||||||
$price = $item['price'] + $item['dynamic_prices']['day3_7'];
|
$price = $base + $item['dynamic_prices']['day3_7'];
|
||||||
return $price . ' zł';
|
return $price . ' zł';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$price = $item['price'];
|
return $base . ' zł';
|
||||||
return $price . ' zł';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,72 +49,53 @@ if (isset($_POST['selected_date'])) {
|
|||||||
<h2>Do 31 marca ceny na wszystkie bilety <span>-20%</span></h2>
|
<h2>Do 31 marca ceny na wszystkie bilety <span>-20%</span></h2>
|
||||||
</div> -->
|
</div> -->
|
||||||
|
|
||||||
<!-- Bilet ulgowy -->
|
<!-- Bilety indywidualne (ulgowy + normalny w parach) -->
|
||||||
|
<?php
|
||||||
|
$ulgowe = $this->settings['bilety-ulgowe'];
|
||||||
|
$normalne = $this->settings['bilety-normalne'];
|
||||||
|
$count = max(count($ulgowe), count($normalne));
|
||||||
|
?>
|
||||||
<div class="ticket-container">
|
<div class="ticket-container">
|
||||||
<div class="title-container">
|
<div class="title-container">
|
||||||
<h2 class="title">Bilet ulgowy</h2>
|
<h2 class="title">Bilety indywidualne</h2>
|
||||||
<p class="description">do 140cm wzrostu</p>
|
<p class="description">ulgowy (do 140cm) / normalny (od 140cm)</p>
|
||||||
</div>
|
</div>
|
||||||
<? foreach($this -> settings['bilety-ulgowe'] as $key => $item) : ?>
|
<?php for ($i = 0; $i < $count; $i++) : ?>
|
||||||
|
<?php if (isset($ulgowe[$i])) : $item = $ulgowe[$i]; ?>
|
||||||
<div class="ticket">
|
<div class="ticket">
|
||||||
<div class="ticket-description ticket-description--<?= $this->settings['tickets'][$item]['color']; ?>">
|
<div class="ticket-description ticket-description--<?= $this->settings['tickets'][$item]['color']; ?>">
|
||||||
<h3 class="ticket__name"><?= explode( '-', $this -> settings['tickets'][$item]['name'])[0]; ?></h3>
|
<h3 class="ticket__name"><?= $this->settings['tickets'][$item]['name']; ?></h3>
|
||||||
<p class="description">bilet całodniowy</p>
|
<p class="description">bilet całodniowy</p>
|
||||||
|
|
||||||
<? if($this->settings['tickets'][$item]['alert']) : ?>
|
<? if($this->settings['tickets'][$item]['alert']) : ?>
|
||||||
<p class="ticket-alert"><?= $this->settings['tickets'][$item]['alert']; ?></p>
|
<p class="ticket-alert"><?= $this->settings['tickets'][$item]['alert']; ?></p>
|
||||||
<? endif; ?>
|
<? endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="price">
|
<h3 class="price">
|
||||||
<?php
|
<?php echo date_price($this->settings['tickets'][$item], $days_diff, $is_weekend); ?>
|
||||||
echo date_price(
|
|
||||||
$this -> settings['tickets'][$item],
|
|
||||||
$days_diff
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
</h3>
|
</h3>
|
||||||
<!-- <h3 class="price"><?= $this -> settings['tickets'][$item]['price']; ?> zł</h3> -->
|
|
||||||
<div class="ticket-quantity">
|
<div class="ticket-quantity">
|
||||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
<button class="add button" ticket_id="<?= $item; ?>">Dodaj do koszyka</button>
|
||||||
<span>1x</span>
|
|
||||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<? endforeach; ?>
|
<?php endif; ?>
|
||||||
</div>
|
<?php if (isset($normalne[$i])) : $item = $normalne[$i]; ?>
|
||||||
|
|
||||||
<!-- Bilet normalny -->
|
|
||||||
<div class="ticket-container">
|
|
||||||
<div class="title-container">
|
|
||||||
<h2 class="title">Bilet normalny</h2>
|
|
||||||
<p class="description">od 140cm wzrostu</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<? foreach($this -> settings['bilety-normalne'] as $key => $item) : ?>
|
|
||||||
<div class="ticket">
|
<div class="ticket">
|
||||||
<div class="ticket-description ticket-description--<?= $this->settings['tickets'][$item]['color']; ?>">
|
<div class="ticket-description ticket-description--<?= $this->settings['tickets'][$item]['color']; ?>">
|
||||||
<h3 class="ticket__name"><?= explode( '-', $this -> settings['tickets'][$item]['name'])[0]; ?></h3>
|
<h3 class="ticket__name"><?= $this->settings['tickets'][$item]['name']; ?></h3>
|
||||||
<p class="description">bilet całodniowy</p>
|
<p class="description">bilet całodniowy</p>
|
||||||
|
|
||||||
<? if($this->settings['tickets'][$item]['alert']) : ?>
|
<? if($this->settings['tickets'][$item]['alert']) : ?>
|
||||||
<p class="ticket-alert"><?= $this->settings['tickets'][$item]['alert']; ?></p>
|
<p class="ticket-alert"><?= $this->settings['tickets'][$item]['alert']; ?></p>
|
||||||
<? endif; ?>
|
<? endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="price">
|
<h3 class="price">
|
||||||
<?php
|
<?php echo date_price($this->settings['tickets'][$item], $days_diff, $is_weekend); ?>
|
||||||
echo date_price(
|
|
||||||
$this -> settings['tickets'][$item],
|
|
||||||
$days_diff
|
|
||||||
);
|
|
||||||
?>
|
|
||||||
</h3>
|
</h3>
|
||||||
<div class="ticket-quantity">
|
<div class="ticket-quantity">
|
||||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
<button class="add button" ticket_id="<?= $item; ?>">Dodaj do koszyka</button>
|
||||||
<span>1x</span>
|
|
||||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<? endforeach; ?>
|
<?php endif; ?>
|
||||||
|
<?php endfor; ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<? if($selected >= DateTime::createFromFormat('d-m-Y', '28-06-2025')): ?>
|
<? if($selected >= DateTime::createFromFormat('d-m-Y', '28-06-2025')): ?>
|
||||||
@@ -139,9 +123,7 @@ if (isset($_POST['selected_date'])) {
|
|||||||
?>
|
?>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="ticket-quantity">
|
<div class="ticket-quantity">
|
||||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
<button class="add button" ticket_id="<?= $item; ?>">Dodaj do koszyka</button>
|
||||||
<span>1x</span>
|
|
||||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<? endforeach; ?>
|
<? endforeach; ?>
|
||||||
@@ -169,9 +151,7 @@ if (isset($_POST['selected_date'])) {
|
|||||||
?>
|
?>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="ticket-quantity">
|
<div class="ticket-quantity">
|
||||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
<button class="add button" ticket_id="<?= $item; ?>">Dodaj do koszyka</button>
|
||||||
<span>1x</span>
|
|
||||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<? endforeach; ?>
|
<? endforeach; ?>
|
||||||
@@ -193,14 +173,13 @@ if (isset($_POST['selected_date'])) {
|
|||||||
<?php
|
<?php
|
||||||
echo date_price(
|
echo date_price(
|
||||||
$this -> settings['tickets'][$item],
|
$this -> settings['tickets'][$item],
|
||||||
$days_diff
|
$days_diff,
|
||||||
|
$is_weekend
|
||||||
);
|
);
|
||||||
?>
|
?>
|
||||||
</h3>
|
</h3>
|
||||||
<div class="ticket-quantity">
|
<div class="ticket-quantity">
|
||||||
<button class="add button" ticket_id="<?= $item; ?>"><i class="fa fa-plus"></i></button>
|
<button class="add button" ticket_id="<?= $item; ?>">Dodaj do koszyka</button>
|
||||||
<span>1x</span>
|
|
||||||
<button class="subtract button" ticket_id="<?= $item; ?>" diffdays="<?= $days_diff; ?>"><i class="fa fa-minus"></i></button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<? endforeach; ?>
|
<? endforeach; ?>
|
||||||
@@ -305,6 +284,7 @@ $(function() {
|
|||||||
$('body').on('click', '.add', function() {
|
$('body').on('click', '.add', function() {
|
||||||
var ticket_id = $(this).attr('ticket_id');
|
var ticket_id = $(this).attr('ticket_id');
|
||||||
var date = $('#flatpickr').val();
|
var date = $('#flatpickr').val();
|
||||||
|
var $btn = $(this);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@@ -319,33 +299,14 @@ $(function() {
|
|||||||
response = jQuery.parseJSON(data);
|
response = jQuery.parseJSON(data);
|
||||||
$('.shopping-cart-container').html(response.shopping_cart);
|
$('.shopping-cart-container').html(response.shopping_cart);
|
||||||
|
|
||||||
// if (!$('.shopping-cart').hasClass('shopping-cart-active'))
|
// animacja przycisku
|
||||||
// $('.shopping-cart').addClass('shopping-cart--active');
|
$btn.addClass('added');
|
||||||
}
|
setTimeout(function() { $btn.removeClass('added'); }, 600);
|
||||||
});
|
|
||||||
|
|
||||||
});
|
// bounce koszyka
|
||||||
//subtract
|
var $cartBtn = $('.mobile-cart-btn');
|
||||||
$('body').on('click', '.subtract', function() {
|
$cartBtn.addClass('cart-bounce');
|
||||||
var ticket_id = $(this).attr('ticket_id');
|
setTimeout(function() { $cartBtn.removeClass('cart-bounce'); }, 600);
|
||||||
var diffdays = $(this).attr('diffdays');
|
|
||||||
console.log(diffdays);
|
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
cache: false,
|
|
||||||
url: '/tickets/ticket_subtract/',
|
|
||||||
data: {
|
|
||||||
ticket_id: ticket_id,
|
|
||||||
diffdays: diffdays
|
|
||||||
},
|
|
||||||
beforeSend: function() {},
|
|
||||||
success: function(data) {
|
|
||||||
response = jQuery.parseJSON(data);
|
|
||||||
$('.shopping-cart-container').html(response.shopping_cart);
|
|
||||||
// if (response.cart_count = 0)
|
|
||||||
// $('.shopping-cart').removeClass('shopping-cart--active');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
49
upgrade.php
Normal file
49
upgrade.php
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
error_reporting(E_ALL);
|
||||||
|
ini_set('display_errors', 1);
|
||||||
|
header('Content-Type: text/plain; charset=utf-8');
|
||||||
|
|
||||||
|
require_once 'config.php';
|
||||||
|
require_once 'libraries/medoo/medoo.php';
|
||||||
|
|
||||||
|
$mdb = new medoo([
|
||||||
|
'database_type' => 'mysql',
|
||||||
|
'database_name' => $database['name'],
|
||||||
|
'server' => $database['host'],
|
||||||
|
'username' => $database['user'],
|
||||||
|
'password' => $database['password'],
|
||||||
|
'charset' => 'utf8'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$migrations = [
|
||||||
|
|
||||||
|
'ticket_prices' => "CREATE TABLE IF NOT EXISTS ticket_prices (
|
||||||
|
ticket_id VARCHAR(100) PRIMARY KEY,
|
||||||
|
price DECIMAL(10,2) DEFAULT NULL,
|
||||||
|
price_weekend DECIMAL(10,2) DEFAULT NULL,
|
||||||
|
dynamic_price_day0 DECIMAL(10,2) DEFAULT NULL,
|
||||||
|
dynamic_price_day1_2 DECIMAL(10,2) DEFAULT NULL,
|
||||||
|
dynamic_price_day3_7 DECIMAL(10,2) DEFAULT NULL,
|
||||||
|
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8",
|
||||||
|
|
||||||
|
'ticket_prices_add_price_weekend' => "ALTER TABLE ticket_prices ADD COLUMN IF NOT EXISTS price_weekend DECIMAL(10,2) DEFAULT NULL AFTER price",
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
$ok = 0;
|
||||||
|
$errors = 0;
|
||||||
|
|
||||||
|
foreach ($migrations as $name => $sql) {
|
||||||
|
$result = $mdb->query($sql);
|
||||||
|
if ($result !== false) {
|
||||||
|
echo "[OK] $name\n";
|
||||||
|
$ok++;
|
||||||
|
} else {
|
||||||
|
$err = $mdb->error();
|
||||||
|
echo "[BLAD] $name: " . (is_array($err) ? end($err) : $err) . "\n";
|
||||||
|
$errors++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "\nGotowe: $ok OK, $errors bledow.\n";
|
||||||
Reference in New Issue
Block a user