Releaseversion

This commit is contained in:
marko
2020-10-31 14:41:22 +01:00
parent 43632b243e
commit b610a3b8d6
8 changed files with 1152 additions and 23 deletions

View File

@@ -9,7 +9,7 @@ session_start();
$login_status =
"<div style=\"border: 1px solid black\">".
"Datum: ".date("Y-m-d")."<br />".
"Angemeldet als <strong>".htmlspecialchars($_SESSION['user']['username'])."</strong> angemeldet.<br />".
"Angemeldet als <strong>".htmlspecialchars($_SESSION['user']['username'])."</strong>.<br />".
"<a href=\"logout.php\">Sitzung beenden</a>".
"</div>";
}

View File

@@ -0,0 +1,461 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
viewBox="0 0 1024 651"
id="svg137"
sodipodi:docname="seilspringen.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
<metadata
id="metadata141">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="640"
inkscape:window-height="480"
id="namedview139"
showgrid="false"
inkscape:zoom="0.51267957"
inkscape:cx="515.28894"
inkscape:cy="390.74462"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="svg137" />
<defs
id="defs7">
<radialGradient
id="a"
cx="545.65"
cy="-64.086"
r="512"
gradientTransform="matrix(-1.0971 1.0726 -.53617 -.54844 1074.7 -217.73)"
gradientUnits="userSpaceOnUse">
<stop
stop-color="#f644ff"
offset="0"
id="stop2" />
<stop
stop-color="#ab00b3"
offset="1"
id="stop4" />
</radialGradient>
</defs>
<path
d="m0 0h1024v651h-1024z"
fill="url(#a)"
id="path9" />
<path
d="m424.44 398.7s-33.84-42.562-43.195-121.06c-9.3542-78.503 28.613-145.66 81.437-164.57 52.824-18.916 138.15-41.979 183.23 44.217 75.935 145.18-84.188 257.02-84.188 257.02"
fill="none"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="4.6799"
id="path11" />
<path
d="m539.28 450.43 18.041-29.512-17.426 3.8763-7.4829 14.976 6.8679 10.66z"
fill="#fff"
id="path13"
style="fill:#ffff00" />
<path
d="m489.85 417.29-37.777 75.466s3.6069 18.728 40.519 20.894c57.997 3.4022 68.619-18.474 68.619-18.474l-38.223-71.354"
fill="#fff"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.8499"
id="path15"
style="fill:#ffff00" />
<path
d="m541.44 165.4c-10.12 0.33745-44.143 8.9091-44.143 40.425 0 19.814 3.1823 45.199 8.0618 62.027-9.2691 1.0047-17.101 2.4716-23.728 4.3508 4.0436-13.69 6.6908-27.591 6.6908-43.89 0-58.499 17.333-62.599 8.7244-62.599-8.6088 0-46.526 19.57-44.191 62.599 1.0341 19.061 7.9116 46.19 13.164 58.909-11.507 19.931-20.072 38.368-20.072 58.689 0 43.855 35.593 79.448 79.448 79.448s79.448-35.593 79.448-79.448c0-14.32-10.072-79.521-76.871-79.521 4.6422-16.811 7.6414-41.323 7.6414-60.564 0-32.533 17.099-40.425 6.5214-40.425-0.33055 0-0.36888-0.011-0.69533 0z"
fill="#fff"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.8499"
id="path17" />
<path
d="m493.87 374.32c5.2454 5.2454 11.491 9.491 18.424 12.425 6.9335 2.9342 14.555 4.5571 22.554 4.5571 7.9986 0 15.62-1.6229 22.554-4.5571 6.9335-2.9342 13.179-7.1799 18.424-12.425"
fill="none"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="4.2677"
id="path19" />
<path
d="m523.01 389.57 3.3768 14.232 9.8707-2.1208 0.90916-25.338"
fill="none"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.523"
id="path21" />
<path
d="m537.55 400.79 10.91 0.22323 0.25978-10.046"
fill="none"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.523"
id="path23" />
<path
d="m537.34 378.19-10.26-9.5995 17.339-0.33486-7.0783 9.9344z"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="4.0147"
id="path25" />
<path
d="m520.12 352.8c1.2455 3.3071-0.42585 6.9977-3.733 8.2432-3.3071 1.2455-6.9977-0.42583-8.2432-3.733-1.2454-3.3071 0.42585-6.9977 3.733-8.2432 3.3071-1.2454 6.9977 0.42585 8.2432 3.733z"
id="path27" />
<path
d="m558.48 353.91c-1.4094 3.2406-5.179 4.7252-8.4196 3.3158s-4.7252-5.179-3.3158-8.4196 5.179-4.7252 8.4196-3.3158 4.7252 5.179 3.3158 8.4196z"
id="path29" />
<path
d="m482.01 440.53-22.496-13.7-26.201-26.734-8.804 14.897c8.8428 7.0878 16.201 18.134 24.202 25.966l25.32 17.541"
fill="#fff"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.8499"
id="path31"
style="fill:#ffff00" />
<path
d="m524.58 521.19c0 7.966-6.1589 14.424-13.756 14.424-7.5974 0-13.756-6.4577-13.756-14.424 0-7.966 6.1589-14.424 13.756-14.424 7.5974 0 13.756 6.4577 13.756 14.424z"
fill="#fff"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.6668"
id="path33" />
<path
d="m567.72 505.89c1.4483 7.7026-1.9366 14.804-7.5605 15.862-5.6239 1.0575-11.357-4.3295-12.805-12.032-1.4484-7.7026 1.9366-14.804 7.5605-15.862 5.6239-1.0574 11.357 4.3295 12.805 12.032z"
fill="#fff"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.6667"
id="path35" />
<path
d="m436.17 403.83c0 6.3158-4.8831 11.436-10.907 11.436-6.0236 0-10.907-5.12-10.907-11.436 0-6.3158 4.8831-11.436 10.907-11.436 6.0236 0 10.907 5.12 10.907 11.436z"
fill="#fff"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.5657"
id="path37" />
<path
d="m538.45 454.78 16.342-34.108"
fill="none"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.8499"
id="path39" />
<path
d="m533.01 440.1 9.2303-17.756"
fill="none"
stroke="#000"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="5.8499"
id="path41" />
<path
d="m390.76 633.91s13.337-51.081 51.607-85.467"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="6.277"
id="path43" />
<path
d="m425.55 617.96s13.337-51.081 51.607-85.467"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="6.277"
id="path45" />
<path
d="m741.08 274.62c9.0754 17.288-9.4609 36.359-13.239 50.879-12.371-4.0526-37.262-2.7014-49.397-17.997-13.689-17.254 16.027-36.627 26.916-24.827-3.2339-14.352 27.513-28.982 35.72-8.0554z"
fill="#fff"
id="path47" />
<path
d="m325.97 259.12c9.0754 17.288-9.4608 36.359-13.239 50.879-12.371-4.0526-37.262-2.7014-49.397-17.997-13.689-17.254 16.027-36.627 26.916-24.826-3.2339-14.352 27.513-28.983 35.72-8.0556z"
fill="#ff9c36"
id="path49" />
<path
d="m382.11 209.92c-2.3286 9.7014-15.874 10.796-22.213 15.107-3.3926-5.7214-13.418-13.579-12.936-23.544 0.54343-11.241 18.489-8.689 18.704-0.48728 3.5868-6.6067 20.332-1.8844 16.445 8.9241z"
fill="#fff"
id="path51" />
<path
d="m379.87 347.05c1.2344 9.9001-11.059 15.692-15.476 21.958-5.1891-4.1617-17.338-7.9884-20.394-17.486-3.4472-10.713 14.249-14.64 17.336-7.0386 1.0323-7.4463 18.369-8.9192 18.534 2.5659z"
fill="#fff"
id="path53" />
<path
d="m663.93 74.014c1.2344 9.9002-11.059 15.692-15.476 21.958-5.1891-4.1616-17.338-7.9883-20.394-17.486-3.4472-10.713 14.249-14.64 17.336-7.0385 1.0323-7.4463 18.369-8.9192 18.534 2.5659z"
fill="#fff"
id="path55" />
<path
d="m488.42 103.98c0.66685 5.3479-5.974 8.4763-8.3598 11.861-2.803-2.248-9.3658-4.3151-11.017-9.4454-1.8621-5.787 7.6968-7.9082 9.3647-3.8021 0.55761-4.0224 9.9224-4.818 10.012 1.386z"
fill="#fff"
id="path57" />
<path
d="m592.79 159.8c0.6668 5.3479-5.974 8.4763-8.3598 11.861-2.8031-2.248-9.3658-4.3151-11.017-9.4454-1.8621-5.787 7.6968-7.9082 9.3648-3.8021 0.55762-4.0224 9.9224-4.818 10.012 1.3861z"
fill="#fff"
id="path59" />
<path
d="m380.57 280.4c0.66684 5.3479-5.974 8.4764-8.3598 11.862-2.803-2.248-9.3658-4.3152-11.017-9.4454-1.8621-5.787 7.6968-7.9081 9.3648-3.8021 0.5576-4.0224 9.9224-4.818 10.012 1.386z"
fill="#fff"
id="path61" />
<path
d="m424.14 186.3c5.0469 1.8903 4.7374 9.2247 6.6293 12.909-3.2918 1.4402-8.1677 6.295-13.478 5.3773-5.9904-1.0352-3.4348-10.487 0.97646-10.06-3.3046-2.3601 0.33518-11.025 5.8726-8.226z"
fill="#fff"
id="path63" />
<path
d="m687.01 215.86c5.0469 1.8902 4.7374 9.2246 6.6293 12.909-3.2919 1.4402-8.1678 6.295-13.478 5.3773-5.9904-1.0352-3.4348-10.487 0.97642-10.06-3.3046-2.3601 0.33521-11.025 5.8726-8.226z"
fill="#fff"
id="path65" />
<path
d="m611.3 210.52c2.6501 4.2777-3.1279 9.1394-4.377 12.789-3.7434-0.9516-11.339-0.4896-14.935-4.254-4.0564-4.2463 5.1312-9.2393 8.3708-6.3427-0.88929-3.5728 8.5806-7.3849 10.942-2.1926z"
fill="#fff"
id="path67" />
<path
d="m711.1 207.91c-4.43 2.3868-8.9339-3.6743-12.502-5.1414 1.176-3.6791 1.1735-11.289 5.1482-14.651 4.4835-3.7926 8.9126 5.6799 5.8256 8.7385 3.6201-0.67198 6.8533 9.0108 1.5279 11.054z"
fill="#00fff4"
id="path69" />
<path
d="m458.25 135.64c-4.3493 18.12-29.65 20.165-41.491 28.218-6.3367-10.687-25.062-25.363-24.162-43.976 1.0151-20.996 34.534-16.229 34.936-0.91024 6.6993-12.34 37.977-3.5198 30.717 16.669z"
fill="#fff"
id="path71" />
<path
d="m525.99 451.2c1.2344 9.9001-11.059 15.692-15.476 21.958-5.1891-4.1617-17.338-7.9884-20.394-17.486-3.4472-10.713 14.249-14.64 17.336-7.0386 1.0323-7.4463 18.369-8.9192 18.534 2.5659z"
fill="#ff36e0"
id="path73" />
<path
d="m364.29 54.276c9.0754 17.288-9.4609 36.359-13.239 50.879-12.37-4.06-37.26-2.71-49.4-18.002-13.69-17.254 16.03-36.627 26.92-24.827-3.24-14.352 27.51-28.982 35.72-8.055z"
fill="#fff"
id="path75" />
<path
d="m672.42 369.78c-2.3285 9.7013-15.874 10.796-22.213 15.107-3.3926-5.7214-13.418-13.579-12.936-23.544 0.54348-11.241 18.489-8.689 18.704-0.48728 3.5867-6.6067 20.332-1.8844 16.445 8.9241z"
fill="#fff"
id="path77" />
<path
d="m323.11 204.07c-7.7302 6.3071-19.17-1.0288-26.825-1.4396 0.76744-6.6072-2.4478-18.932 3.973-26.568 7.2428-8.6136 19.974 4.2892 15.176 10.945 6.8563-3.083 17.318 10.819 7.6764 17.063z"
fill="#fff"
id="path79" />
<path
d="m217.03 385.19c-3.6879 1.878-14.797 10.945-9.3378 22.611 3.4322 7.3345 9.0076 16.18 13.729 21.564-3.2572 1.9776-5.9022 3.8772-8.03 5.721-0.87459-5.7681-2.3028-11.373-5.1261-17.406-10.134-21.655-4.4276-26.175-7.6143-24.684-3.1868 1.4913-13.833 15.304-5.5147 30.828 3.6846 6.8766 10.93 15.728 15.078 19.526-0.80711 9.3714-0.78398 17.68 2.7362 25.202 7.5969 16.234 26.938 23.244 43.172 15.647 16.234-7.5969 23.244-26.938 15.647-43.172-2.4806-5.3008-17.504-27.692-42.231-16.121-1.1937-7.0271-4.3296-16.621-7.6627-23.743-5.6355-12.043-0.67299-17.926-4.5886-16.094-0.12237 0.0572-0.13846 0.0599-0.2574 0.12053z"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="2.3908"
id="path81" />
<path
d="m235.61 470.76c2.8504 1.0331 5.8977 1.5228 8.9726 1.408 3.0749-0.11488 6.1774-0.83443 9.1383-2.22s5.5011-3.3066 7.5595-5.5939c2.0583-2.2873 3.6347-4.9407 4.6678-7.7911"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.7442"
id="path83" />
<path
d="m249.03 471.36 3.7154 4.6833 3.2865-2.4949-4.0527-9.537"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="2.2573"
id="path85" />
<path
d="m256.36 473 4.0772-1.8072-1.6441-3.7638"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="2.2573"
id="path87" />
<path
d="m252.37 464.67-5.461-1.7761 6.3603-3.1275-0.89932 4.9036z"
fill="#fff"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.6408"
id="path89" />
<path
d="m241.6 458.25c1.0339 1.0085 1.0546 2.6642 0.0461 3.6981s-2.6642 1.0546-3.6981 0.0461-1.0546-2.6642-0.0461-3.6981c1.0084-1.0339 2.6642-1.0546 3.6981-0.0461z"
fill="#fff"
id="path91" />
<path
d="m255.99 452.02c0.0397 1.4437-1.0986 2.6463-2.5424 2.6859-1.4438 0.0397-2.6463-1.0986-2.6859-2.5423-0.0397-1.4438 1.0986-2.6463 2.5424-2.6859 1.4437-0.0397 2.6463 1.0986 2.6859 2.5424z"
fill="#fff"
id="path93" />
<path
d="m756.03 420.06c5.7713 1.0232 24.563 8.7245 21.979 26.783-1.6247 11.353-5.5297 25.638-9.7055 34.88 5.2288 1.3358 9.5961 2.8184 13.24 4.4387-1.1944-8.1758-1.5713-16.358-0.23491-25.697 4.7968-33.52-4.7988-37.291 0.134-36.585 4.9328 0.7059 25.055 15.029 20.188 39.493-2.1555 10.837-8.3209 25.818-12.374 32.675 4.9593 12.364 8.3553 23.631 6.689 35.274-3.5961 25.129-26.909 42.605-52.038 39.009-25.129-3.5961-42.605-26.909-39.009-52.038 1.1742-8.2052 12.292-44.74 50.567-39.262-1.2815-10.013-0.99005-24.305 0.58768-35.33 2.6676-18.641-6.483-24.566-0.42195-23.698 0.18938 0.0271 0.21226 0.0239 0.39842 0.057z"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="3.3861"
id="path95" />
<path
d="m766.16 543.67c-3.4357 2.5755-7.3624 4.4961-11.576 5.6089-4.2135 1.1128-8.7139 1.4177-13.297 0.76182-4.5832-0.65586-8.8174-2.2108-12.55-4.4606-3.7323-2.2499-6.9627-5.1947-9.5382-8.6304"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="2.4703"
id="path97" />
<path
d="m748.22 550.03-3.1019 7.8779-5.482-2.0246 1.5568-14.593"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="3.1969"
id="path99" />
<path
d="m738.96 555.26-6.2696-0.76666 0.67492-5.7776"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="3.1969"
id="path101" />
<path
d="m740.94 542.33 6.6663-4.6592-9.9075-1.6136 3.2412 6.2728z"
fill="#fff"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="2.3239"
id="path103" />
<path
d="m752.89 529.19c-0.98484 1.7929-0.3298 4.0446 1.4631 5.0294 1.7928 0.98482 4.0446 0.32979 5.0294-1.463 0.98482-1.7928 0.32978-4.0446-1.4631-5.0294-1.7928-0.98483-4.0446-0.32981-5.0294 1.463z"
fill="#fff"
id="path105" />
<path
d="m730.82 526.68c0.54185 1.9724 2.5801 3.1322 4.5525 2.5903 1.9725-0.54184 3.1322-2.5801 2.5904-4.5525-0.54186-1.9724-2.5801-3.1322-4.5525-2.5904-1.9724 0.54187-3.1322 2.5801-2.5904 4.5526z"
fill="#fff"
id="path107" />
<path
d="m750.62 99.486c-2.9896 1.2632-12.186 7.7351-8.5669 17.166 2.2753 5.929 6.1427 13.16 9.5353 17.635-2.6583 1.3651-4.8334 2.7034-6.6008 4.0268-0.3621-4.5608-1.1664-9.0247-3.038-13.902-6.7178-17.505-2.0019-20.723-4.578-19.734-2.5761 0.98861-11.675 11.199-6.035 23.807 2.4983 5.5849 7.6718 12.913 10.704 16.116-1.1546 7.2856-1.6004 13.786 0.7332 19.867 5.0362 13.123 19.774 19.687 32.897 14.65 13.123-5.0362 19.687-19.774 14.65-32.897-1.6444-4.285-12.146-22.639-32.135-14.968-0.54136-5.5635-2.4588-13.243-4.6684-19.001-3.7359-9.735 0.47448-14.06-2.6908-12.846-0.0989 0.038-0.11172 0.0391-0.20808 0.0798z"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.875"
id="path109" />
<path
d="m760.38 167.47c2.172 0.96727 4.5284 1.5205 6.9401 1.6024 2.4117 0.0818 4.8788-0.30782 7.2723-1.2263 2.3935-0.91852 4.4878-2.2794 6.2256-3.9537s3.1191-3.6619 4.0863-5.8339"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.3679"
id="path111" />
<path
d="m770.85 168.69 2.6448 3.8709 2.7101-1.7681-2.6377-7.6865"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.7702"
id="path113" />
<path
d="m776.49 170.37 3.2902-1.186-1.0759-3.036"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.7702"
id="path115" />
<path
d="m773.83 163.63-4.1726-1.6943 5.1499-2.0913-0.97728 3.7856z"
fill="#fff"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.2868"
id="path117" />
<path
d="m765.76 158.01c0.75247 0.84658 0.67616 2.1429-0.17042 2.8953-0.84659 0.75246-2.1429 0.67616-2.8954-0.17043-0.75247-0.84658-0.67615-2.1429 0.17044-2.8953 0.84658-0.75247 2.1429-0.67616 2.8953 0.17043z"
fill="#fff"
id="path119" />
<path
d="m777.36 153.94c-0.0496 1.1316-1.0071 2.0087-2.1387 1.9591s-2.0086-1.0071-1.9591-2.1387 1.0071-2.0087 2.1387-1.9591 2.0087 1.0071 1.9591 2.1387z"
fill="#fff"
id="path121" />
<path
d="m229.85 71.889c3.1956 0.56677 13.601 4.8318 12.169 14.831-0.9 6.2864-3.0628 14.196-5.3753 19.313 2.8952 0.7398 5.3134 1.5609 7.3309 2.4582-0.6611-4.5271-0.86953-9.058-0.1292-14.229 2.6572-18.56-2.656-20.649 0.0754-20.258 2.7314 0.39104 13.873 8.3225 11.177 21.869-1.1939 6.0005-4.6083 14.296-6.8526 18.093 2.7457 6.8464 4.6257 13.085 3.7026 19.532-1.9921 13.914-14.902 23.59-28.816 21.598-13.914-1.9921-23.59-14.902-21.598-28.816 0.65045-4.5434 6.8077-24.773 28.001-21.739-0.70926-5.5446-0.5474-13.458 0.3266-19.563 1.4777-10.322-3.5889-13.603-0.23285-13.122 0.10486 0.015 0.11753 0.0133 0.2206 0.0316z"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.8749"
id="path123" />
<path
d="m235.45 140.34c-1.9025 1.426-4.0768 2.4893-6.41 3.1054-2.3331 0.61603-4.8251 0.78472-7.3628 0.42141-2.5378-0.36333-4.8823-1.2244-6.9488-2.4704-2.0666-1.2459-3.8552-2.8766-5.2812-4.7792"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.3678"
id="path125" />
<path
d="m225.52 143.85-1.7178 4.362-3.0354-1.1212 0.8625-8.0805"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.7702"
id="path127" />
<path
d="m220.39 146.75-3.4715-0.42474 0.3739-3.1991"
fill="none"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.7702"
id="path129" />
<path
d="m221.49 139.59 3.6914-2.5796-5.4859-0.89383 1.7945 3.4735z"
fill="#fff"
stroke="#fff"
stroke-dashoffset="68"
stroke-linejoin="round"
stroke-width="1.2868"
id="path131" />
<path
d="m228.1 132.32c-0.54539 0.9927-0.18275 2.2396 0.80995 2.7849 0.9927 0.54538 2.2396 0.18276 2.7849-0.80994 0.54538-0.99269 0.18275-2.2396-0.80995-2.7849-0.9927-0.54537-2.2396-0.18274-2.7849 0.80996z"
fill="#fff"
id="path133" />
<path
d="m215.88 130.93c0.29997 1.0922 1.4285 1.7344 2.5207 1.4345 1.0922-0.29995 1.7344-1.4285 1.4345-2.5207-0.29997-1.0922-1.4285-1.7344-2.5207-1.4345-1.0922 0.29995-1.7344 1.4285-1.4345 2.5207z"
fill="#fff"
id="path135" />
</svg>

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -5,27 +5,29 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
require_once("./local/dbConf.php");
require_once("./local/achievementsConf.php");
require_once("./lib/db.php");
require_once("./lib/achievementsLib.php");
require_once("./lib/api.php");
require_once("./auth.php");
$basePath = "/users/cwsvjudo/www";
require_once($basePath."/config/cwsvJudo.config.php");
require_once($basePath."/config/phpcount.config.php");
require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
// require_once($basePath."/ressourcen/phpLib/phpcount/phpcount.php");
// require_once($basePath."/ressourcen/phpLib/cwsvJudo/miscAssis.php");
$dbConnection = getCwsvJudoDbConn();
// $dbConnection = getCwsvJudoDbConn();
$dbConnection = getPdoDbConnection(
$cwsvJudoConfig["db"]["host"],
$cwsvJudoConfig["db"]["name"],
$cwsvJudoConfig["db"]["user"],
$cwsvJudoConfig["db"]["password"]
);
try{
$results = dbQuery(
$dbConnection,
"SELECT * FROM cwsvjudo.achievements;"
);
}
catch(PDOException $db_error){
print "Error!: " . $db_error->getMessage() . "<br/>queryString: ".$queryString."<br />"; var_dump($bindArray);
}
$achievementGroups = getAchievementGroups($dbConnection);
processPostData($dbConnection, $_POST);
?>
<!DOCTYPE html>
@@ -34,24 +36,71 @@ setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<!-- Compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<title>Achievements</title>
<meta name="description" content="Achievements">
<link rel="icon" href="<?echo($config['ressourceUrl']);?>/graphiken/icons/cwsv.ico" />
<link rel="apple-touch-icon" href="<?echo($config['baseUrl']);?>/apple-touch-icon.png">
<style>
<?php
# $css = file_get_contents( $basePath."/pages/desktop/wkParticipo/wkParticipo.css");
# echo(colorThemeCss($_SESSION['user']['userConfig']['colors']));
# echo($css);
?>
</style>
</head>
<body>
<?php echo $login_status; ?>
<h1>Achievements</h1>
<?php echo( arrayKeyed2htmlTableString($results, ["id", "name", "rootId", "level", "description"], $withCaption = true) );?>
<?php
if( hasUserAttribute($dbConnection, $_SESSION['user']['userId'], "inTraining" ) ){
echo( "<h2>Eigene Achievements</h2>" );
echo( htmlUsersUploadBox($dbConnection, $_SESSION['user']['userId']) );
echo(htmlAchievementListForUser(
$dbConnection,
$achievementGroups,
$_SESSION['user']['userId'],
getUsersAchievements($dbConnection, $_SESSION['user']['userId'])
));
}
?>
<?php
$usersKids = getUsersKids($dbConnection, $_SESSION['user']['userId']);
//var_dump($usersKids);
foreach($usersKids as $k){
if( hasUserAttribute($dbConnection, $k['kidId'], "inTraining" ) and ($k['kidId']!=$_SESSION['user']['userId']) ){
echo( "<h2>".$k['vorname']." ".$k['name']."</h2>" );
echo( htmlUsersUploadBox($dbConnection, $k['kidId']) );
echo(htmlAchievementListForUser(
$dbConnection,
$achievementGroups,
$k['kidId'],
getUsersAchievements($dbConnection, $k['kidId'])
));
}
}
?>
<?php
if(isUserAdmin($dbConnection, $_SESSION['user']['userId'])){
echo("<h2 id=\"addAchievementBox\">Add Achievements</h2>");
echo(htmlAddAchievementBox());
echo("<h2>Update Achievements</h2>");
$achievements = getAchievements($dbConnection);
foreach($achievements as $a){
echo( htmlUpdateAchievementBox(
$a['id'],
$a['name'],
$a['description'],
$a['rootId'],
$a['level']
));
echo("<hr />");
}
}
?>
<span id="endOfUpdateAchievementBoxes" style="display:none;" ></span>
</body>
</html>

View File

@@ -33,4 +33,197 @@ if( !empty($anRetMessage) ){
// print_r($anRetMessage);
return $retHtmlString;
}
// one time only function to convert the list of kids within the user
// table itself to an extra entry in a "vormundschafts" table
function convertToVormundschaft($db){
$query = <<<SQL
SELECT * FROM `cwsvjudo`.`wkParticipo_Users` WHERE `kinder` IS NOT NULL;
SQL;
$users = dbQuery($db, $query);
foreach($users as $user){
$kidIds = explode(",", $user['kinder']);
echo("Processing user ".$user['vorname']." ".$user['name']." with kids ".$kidIds."\n");
foreach($kidIds as $kidId){
$query = <<<SQL
INSERT INTO `cwsvjudo`.`vormundschaft` (userId, kidId) VALUE (:userId, :kidId);
SQL;
echo("Adding kid ".$kidId." to user ".$user['id']."\n");
echo($query."\n");
$params = array(
':userId' => array('value' => $user['id'], 'data_type' => PDO::PARAM_INT),
':kidId' => array('value' => $kidId, 'data_type' => PDO::PARAM_INT),
);
dbQuery($db, $query, $params);
}
}
return;
}
/// get all available achievements
function getAchievementList($db){
$results = null;
try{
$results = dbQuery(
$db,
"SELECT * FROM cwsvjudo.achievements;"
);
}
catch(PDOException $db_error){
print "Error!: " . $db_error->getMessage() . "<br/>queryString: ".$queryString."<br />"; var_dump($bindArray);
}
return $results;
}
function getAchievementGroups($db){
return achievementList2achievementGroups( getAchievementList($db) );
}
function arrayKeyed2htmlTableString($anArray, $keyList, $withCaption = false){
$ret = "";
if( !is_array($anArray) )
return "";
$ret .= "<table>";
if($withCaption) {
$ret .= "<tr>";
foreach( $keyList as $caption ){
$ret .= "<th>".$caption."</th>";
}
$ret .= "</tr>";
}
foreach($anArray as $row){
if( !is_array($anArray) )
continue;
$ret .= "<tr>";
foreach( $keyList as $key )
$ret .= "<td>".$row[$key]."</td>";
$ret .= "</tr>";
}
$ret .= "</table>";
return $ret;
}
function getUsersAchievements($db, $userId){
$query = <<<SQL
SELECT * FROM `cwsvjudo`.`achievements<=>user` WHERE `userId` = :userId;
SQL;
$params = [':userId' => array('value'=>$userId, 'data_type'=>PDO::PARAM_INT)];
$result = dbQuery($db, $query, $params);
return $result;
}
function achievementList2achievementGroups ( $list ){
$groups = [];
foreach($list as $a){
if(!array_key_exists($a['rootId'], $groups) ){
$groups[ $a['rootId'] ] = array();
}
$groups[ $a['rootId'] ][ $a['level']] = $a;
}
foreach($groups as $key=>$g){
ksort($groups[$key]);
}
ksort($groups);
return $groups;
}
function htmlUsersUploadBox($db, $userId){
$html = "";
$userData = getUserData($db, $userId);
$html .= "<div><dl>";
$html .= "<dt>Upload Link</dt><dd><a href=\"".$userData['machsUploadUrl']."\">".$userData['machsUploadUrl']."</a></dd>";
$html .= "<dt>Upload Passwort</dt><dd>".$userData['machsUploadPw']."</dd>";
$html .= "</dl></div>";
return $html;
}
function htmlAchievementListForUser($db, $achievementGroups, $userId, $usersAchievmentIds){
//var_dump($db, $achievementGroups, $userId, $usersAchievmentIds);
$ids=[];
foreach($usersAchievmentIds as $a){
$ids[]=$a['achievementId'];
}
$retHtml = "";
if(!canUserGetAchievementToday( $db, $userId) ){
$retHtml .= "<div>Heute wurde schon ein Achievement erreicht!</div>";
}
$retHtml .= "<div class=\"row\">";
foreach($achievementGroups as $g){
$retHtml .= "<div class=\"col s12 m6 l4 xl3\">";
$retHtml .= "<ul class=\"card\">";
$imgUrl = null;
foreach($g as $a){
if($a['imgUrl'] != null){
$imgUrl = $a['imgUrl'];
}
if(in_array($a['id'], $ids)){
$retHtml .= "<li>&#10003; ".$a['name'].": ".$a['description'];
$retHtml .= "</li>";
}
else{
$retHtml .= "<li style=\"color:gray\">".$a['name'].": ".$a['description'];
//if(isUserAdmin($db, $_SESSION['user']['userId'])){
if(canUserGetAchievementToday( $db, $userId) ){
$retHtml .= "<form action=\".\" method=\"POST\">";
$retHtml .= "<input name=\"action\" value=\"giveUserAnAchievement\" type=\"hidden\">";
$retHtml .= "<input name=\"userId\" value=\"".$userId."\" type=\"hidden\">";
$retHtml .= "<input name=\"achievementId\" value=\"".$a['id']."\" type=\"hidden\">";
$retHtml .= "<input style=\"width:100%\" name=\"submit\" type=\"submit\" value=\"Achievement ".$a['name']." geben\">";
$retHtml .= "</form>";
}
if( $imgUrl != null )
$retHtml .= " <div class=\"card-image\" ><img src=\"".$imgUrl."\"/></div>";
$retHtml .= "</li>";
break;
}
}
$retHtml .= "</ul>";
$retHtml .= "</div>";
}
$retHtml .= "</div>";
return $retHtml;
}
function htmlAddAchievementBox(){
$html = "";
$html .= "<form action=\".\" method=\"POST\">";
$html .= "<input name=\"action\" type=\"hidden\" value=\"addAchievement\" />";
$html .= "<input name=\"redirectLocation\" type=\"hidden\" value=\"#endOfUpdateAchievementBoxes\" />";
$html .= "<input name=\"name\" type=\"text\" placeholder=\"name\"/>";
$html .= "<input style=\"width:100%;display:block;\" name=\"description\" type=\"textarea\" placeholder=\"mdDescription\"/>";
$html .= "<input type=\"submit\"/>";
$html .= "</form>";
return $html;
}
function htmlUpdateAchievementBox($achievementId, $name, $description, $rootId, $level){
$html = "";
$html .= "<form action=\".\" method=\"POST\">";
$html .= "<input name=\"action\" type=\"hidden\" value=\"updateAchievement\" />";
$html .= "<input name=\"redirectLocation\" type=\"hidden\" value=\"#addAchievementBox\" />";
$html .= "<div > achievementId: ".$achievementId;
$html .= "<input name=\"achievementId\" type=\"hidden\" value=\"".$achievementId."\"/>";
$html .= "<div />";
$html .= "<div >";
$html .= "<label for=\"name\">name</label>";
$html .= "<input style=\"width:100%;display:block;\" name=\"name\" type=\"text\" value=\"".$name."\"/>";
$html .= "<div/>";
$html .= "<div>";
$html .= "<label for=\"description\">description</label>";
$html .= "<input style=\"width:100%;display:block;\" name=\"description\" type=\"textarea\" value=\"".$description."\"/>";
$html .= "<div/>";
$html .= "<div>";
$html .= "<label for=\"rootId\">rootId</label>";
$html .= "<input style=\"width:100%;display:block;\" name=\"rootId\" type=\"text\" value=\"".$rootId."\"/>";
$html .= "<div/>";
$html .= "<div>";
$html .= "<label for=\"level\">level</label>";
$html .= "<input style=\"width:100%;display:block;\" name=\"level\" type=\"text\" value=\"".$level."\"/>";
$html .= "<div/>";
$html .= "<input type=\"submit\"/>";
$html .= "</form>";
return $html;
}
?>

View File

@@ -0,0 +1,85 @@
<?php
function processPostData($db, $post, $redirectLocation = "."){
if($post['action']){
if($post['action']=="giveUserAnAchievement"){
giveUserAnAchievement(
$db,
$post['userId'],
$post['achievementId']
);
}
if($post['action']=="addAchievement"){
addAchievement(
$db,
$post['name'],
$post['description']
);
}
if($post['action']=="updateAchievement"){
updateAchievement(
$db,
$post['achievementId'],
$post['name'],
$post['description'],
$post['rootId'],
$post['level']
);
}
if($post['redirectLocation'])
$redirectLocation = $post['redirectLocation'];
header("Location: ".$redirectLocation);
}
return;
}
function sendEmail($toEmail, $emailText, $emailSubject){
try{
$date=new DateTime();
mail(
$toEmail,
$emailSubject,
$emailText
);
}
catch(Exception $e) {
echo 'Message: ' .$e->getMessage();
}
}
function attendancesAssocArray2text($attendancesAssocArray){
$ret = "";
foreach($attendancesAssocArray as $date => $attendees){
$ret .= $date."\n";
foreach($attendees as $a){
$ret .= "\n";
$ret .= "Name: ".$a['name'].", ".$a['vorname']."\n";
$ret .= "PLZ: ".$a['corona_PLZ']."\n";
$ret .= "Tel.: ".$a['corona_telephon']."\n";
$ret .= "eMail: ".$a['corona_eMail']."\n";
}
$ret .= "\n";
}
return $ret;
}
function attendancesAssocArray2mdList($attendancesAssocArray, $date=null){
if($date == null)
$date=new DateTime();
$ret = "# Anwesenheitsliste zur Corona-Kontaktverfolgung der Abteilung Judo des CWSV vom ".$date->format("Y-m-d")."\n\n";
foreach($attendancesAssocArray as $d => $attendees){
$ret .= "## ".$d."\n";
$i=0;
foreach($attendees as $a){
$i += 1;
$ret .= "\n";
$ret .= $i." ".$a['name'].", ".$a['vorname']."\n";
$ret .= " - PLZ: ".$a['corona_PLZ']."\n";
$ret .= " - Tel.: ".$a['corona_telephon']."\n";
$ret .= " - eMail: ".$a['corona_eMail']."\n";
}
$ret .= "\n";
}
return $ret;
}
?>

323
homepage/machs/lib/db.php Normal file
View File

@@ -0,0 +1,323 @@
<?php
// get a Connection to the database
function getPdoDbConnection($hostname, $dbName, $user, $password){
try{
$dbConnection = new PDO(
'mysql:host='.$hostname.';dbname='.$dbName,
$user,
$password
);
}
catch(PDOException $dbError){
echo( "Error whilst getting a dbConnection!: " . $dbError->getMessage() );
}
return $dbConnection;
}
function createDb($dbConnection){
<<<SQL
CREATE TABLE `cwsvjudo`.`anwesenheit` (
`id` INT UNSIGNED NOT NULL ,
`userId` INT UNSIGNED NOT NULL ,
`date` DATE NOT NULL DEFAULT CURRENT_TIMESTAMP ,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
ALTER TABLE `cwsvjudo`.`anwesenheit` ADD UNIQUE `attandence` (`userId`, `id`);
SQL;
}
/// perform a pdo-query
///
/// @param aDbConnection
/// @param $aQueryString
/// @param $aBindArray e.g. array(
/// ':userId' => array('value'=>$anUserId, 'data_type'=>PDO::PARAM_INT),
/// ':attributeId'=> array('value'=>$anAttributeId, 'data_type'=>PDO::PARAM_INT) )
/// @param $someOption
function dbQuery($aDbConnection, $aQueryString, $aBindArray = array(), $someOptions = array()){
// Standardbelegungen
if( empty($someOptions['dbCharset' ]) ) $someOptions['dbCharset' ] = "ISO-8859-1";
if( empty($someOptions['outCharset']) ) $someOptions['outCharset'] = "UTF-8";
if( empty($someOptions['dontFetch' ]) ) $someOptions['dontFetch' ] = false;
/// @toDo: Bisher wird nur die Rückgabe konvertiert. Eigentlich muss
/// doch auch die Eingabe konvertiert werden. Aber das jetzt
/// umzustellen wird schwer! Die User m Wettkampfplaner sind ja z.B.
/// als UTF8 in latin1(?) gespeichert.
/// @toDo: Die Standardwerte sollten vielleicht aus einer config
/// kommen, nicht hardcoded
try{
$pdoStatement = $aDbConnection->prepare( $aQueryString );
foreach( $aBindArray as $bindName => $bind ){
if( $bind['data_type'] == PDO::PARAM_STR)
$bind['value'] = iconv(
$someOptions['outCharset'],
$someOptions['dbCharset'],
$bind['value']
);
$pdoStatement->bindValue(
$bindName,
$bind['value'],
(isset($bind['data_type'])?$bind['data_type']:PDO::PARAM_STR)
);
}
$pdoResult = $pdoStatement->execute();
if(!$pdoResult){
echo("Error during dbQuery!\n");
echo("DB-Error:\n"); var_dump($aDbConnection->errorInfo());
// echo($pdoStatement.errorInfo());
}
if($someOptions['dontFetch']){
$ret = NULL;
}
else{
$ret = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);
}
}
catch(PDOException $db_error){
print "Error!: " . $db_error->getMessage() . "<br/>";
return null;
}
// Zeichensatzkonvertierung
if( is_array($ret) ){
foreach($ret as &$entry){
array_walk(
$entry,
function (&$value, $key, $someOptions) {
$value = iconv($someOptions['dbCharset'], $someOptions['outCharset'], $value);
},
$someOptions
);
}
}
//var_dump($ret);
//var_dump($aQueryString);
//var_dump($aBindArray);
return $ret;
}
function getLastAttendances($db, $minDate=null){
if ($minDate == null){
$minDate = new DateTime;
$minDate->sub(new DateInterval("P1M")); // from the current date subtract a *P*eriod of *1* *M*onth
}
$query = <<<SQL
SELECT userId, date, vorname, name, corona_PLZ, corona_telephon, corona_eMail
FROM `cwsvjudo`.`anwesenheit`
JOIN `cwsvjudo`.`wkParticipo_Users`
ON `cwsvjudo`.`anwesenheit`.`userId` = `cwsvjudo`.`wkParticipo_Users`.`id`
WHERE :minDate <= date
ORDER BY `date` DESC, `name`;
SQL;
$params = array(
'minDate' => array('value' => $minDate->format('Y-m-d'), 'data_type' => PDO::PARAM_STR)
);
$options = array();
$ret = dbQuery($db, $query, $params, $options);
return $ret;
}
function getUsersWithAttribute($dbConnection, $attributeName){
$query = <<<SQL
SELECT userId, name, vorname
FROM `cwsvjudo`.`wkParticipo_Users`
JOIN `cwsvjudo`.`wkParticipo_user<=>userAttributes`
ON `cwsvjudo`.`wkParticipo_Users`.`id` =`cwsvjudo`.`wkParticipo_user<=>userAttributes`.`userId`
WHERE `cwsvjudo`.`wkParticipo_user<=>userAttributes`.`attributeId` IN (
SELECT `id` FROM `cwsvjudo`.`wkParticipo_userAttributes` WHERE `name` = :attributeName
);
SQL;
$params = array(
':attributeName' => array('value'=>$attributeName, 'data_type'=>PDO::PARAM_STR)
);
return dbQuery($dbConnection, $query, $params);
}
function giveUserAnUserAttribute($dbConnection, $userId, $attributeName){
$query = <<<SQL
INSERT INTO `cwsvjudo`.`wkParticipo_user<=>userAttributes` (`userId`, `attributeId`)
SELECT :userId, `id`
FROM `cwsvjudo`.`wkParticipo_userAttributes`
WHERE `name` = :attributeName;
SQL;
$params = array(
':userId' => array('value'=>$userId, 'data_type'=>PDO::PARAM_INT),
':attributeName' => array('value'=>$attributeName, 'data_type'=>PDO::PARAM_STR)
);
return dbQuery($dbConnection, $query, $params);
}
function hasUserAttribute($dbConnection, $userId, $attributeName){
$query = <<<SQL
SELECT `wkParticipo_user<=>userAttributes`.userId, `wkParticipo_userAttributes`.name
FROM `wkParticipo_user<=>userAttributes` LEFT JOIN `wkParticipo_userAttributes`
ON `wkParticipo_user<=>userAttributes`.`attributeId` = `wkParticipo_userAttributes`.`id`
WHERE `wkParticipo_userAttributes`.name = :attributeName AND userId=:userId;",
SQL;
$params = array(
':userId' => array('value'=>$userId, 'data_type'=>PDO::PARAM_INT),
':attributeName' => array('value'=>$attributeName, 'data_type'=>PDO::PARAM_STR)
);
$attributedUsers = dbQuery($dbConnection, $query, $params);
foreach($attributedUsers as $u)
if($u['userId']==$userId)
return true;
return false;
}
function giveJudokasAttendence($dbConnection, $date, $ids){
$values = array();
try{
foreach( $ids as $id){
array_push( $values, "(\"".$date."\", ".$id.")");;
}
$query = "INSERT INTO `cwsvjudo`.`anwesenheit` (`date`, `userId`) VALUES ".join(",", $values).";";
dbQuery($dbConnection, $query, array(), ['dontFetch' => true]);
}
catch(PDOException $db_error){
print "Error!: " . $db_error->getMessage() . "<br/>";
return null;
}
}
function getUsersKidsIds($db, $userId){
$query = <<<SQL
SELECT `kidId`
FROM `vormundschaft`
WHERE userId = :userId;
SQL;
$params = [':userId'=>['value'=>$userId, 'data_type'=>PDO::PARAM_INT]];
$result = dbQuery($db, $query, $params);
return $result;
}
function getUsersKids($db, $userId){
$query = <<<SQL
SELECT *
FROM `wkParticipo_Users`
JOIN `vormundschaft`
ON `wkParticipo_Users`.`id` = `vormundschaft`.`kidId`
WHERE `vormundschaft`.`userId` = :userId;
SQL;
$params = [':userId'=>['value'=>$userId, 'data_type'=>PDO::PARAM_INT]];
$result = dbQuery($db, $query, $params);
return $result;
}
// updates corona data of an user
function updateCoronaData($db, $userId, $columnName, $columnValue){
$coronaColumnNames = ["corona_PLZ", "corona_telephon", "corona_eMail"];
if( !in_array( $columnName, $coronaColumnNames) ){
return;
}
$query = "UPDATE `cwsvjudo`.`wkParticipo_Users` SET `".$columnName."`=:val WHERE `id`=:id;";
$params = array(
':val' => array('value'=>$columnValue, 'data_type'=>PDO::PARAM_STR),
':id' => array('value'=>$userId, 'data_type'=>PDO::PARAM_INT)
);
dbQuery($db, $query, $params);
return;
}
function addCoronaUser($db, $name, $vorname, $corona_PLZ, $corona_telephon, $corona_eMail){
$query = <<<SQL
INSERT INTO `cwsvjudo`.`wkParticipo_Users` (name, vorname, corona_PLZ, corona_telephon, corona_eMail)
VALUES (:name, :vorname, :plz, :telephon, :email);
SQL;
$params = array(
':name' => array('value'=>$name, 'data_type'=>PDO::PARAM_STR),
':vorname' => array('value'=>$vorname, 'data_type'=>PDO::PARAM_STR),
':plz' => array('value'=>$corona_PLZ, 'data_type'=>PDO::PARAM_STR),
':telephon' => array('value'=>$corona_telephon, 'data_type'=>PDO::PARAM_STR),
':email' => array('value'=>$corona_eMail, 'data_type'=>PDO::PARAM_STR),
);
dbQuery($db, $query, $params);
$newId = $db->lastInsertId();
giveUserAnUserAttribute($db, $newId, "inTraining");
return;
}
function giveUserAnAchievement($db, $userId, $achievementId){
$query = <<<SQL
INSERT INTO `cwsvjudo`.`achievements<=>user` (`userId`, `achievementId`) VALUE (:userId, :achievementId);
SQL;
$params = [':userId'=>['value'=>$userId, 'data_type'=>PDO::PARAM_INT], 'achievementId'=>['value'=>$achievementId, 'data_type'=>PDO::PARAM_INT]];
dbQuery($db, $query, $params);
sendEmail("cwsvjudo@arcor.de", "kwT", "User ".$userId." got achievement ".$achievementId);
return;
}
function isUserAdmin($dbConn, $userId){
$adminUsers =
dbQuery(
$dbConn,
"SELECT `wkParticipo_user<=>userAttributes`.userId, `wkParticipo_userAttributes`.name from `wkParticipo_user<=>userAttributes` LEFT JOIN `wkParticipo_userAttributes` ON `wkParticipo_user<=>userAttributes`.attributeId = `wkParticipo_userAttributes`.id WHERE `wkParticipo_userAttributes`.name = :attributeName;",
array(":attributeName"=>array('value'=>"isAdmin", 'data_type'=>PDO::PARAM_STR))
);
foreach($adminUsers as $adminUser)
if($adminUser['userId']==$userId)
return true;
return false;
}
function getUserData($db, $userId){
$query = <<<SQL
SELECT *
FROM `cwsvjudo`.`wkParticipo_Users`
WHERE `id` = :userId;
SQL;
$params = [':userId'=>['value'=>$userId, 'data_type'=>PDO::PARAM_INT]];
$userData = dbQuery($db, $query, $params);
return $userData[0];
}
function getAchievements($db){
$query = <<<SQL
SELECT *
FROM `cwsvjudo`.`achievements`;
SQL;
return dbQuery($db, $query);
}
function addAchievement($db, $name, $description){
$query = <<<SQL
INSERT INTO `cwsvjudo`.`achievements` (name, description)
VALUES (:name, :description);
SQL;
$params=[
':name' => ['value'=>$name, 'data_type'=>PDO::PARAM_STR],
':description' => ['value'=>$description, 'data_type'=>PDO::PARAM_STR],
];
dbQuery($db, $query, $params, ['dontFetch'=>true]);
return;
}
function updateAchievement($db, $achievementId, $name, $description, $rootId, $level){
$query = <<<SQL
UPDATE `cwsvjudo`.`achievements`
SET name=:name, description=:description, rootId=:rootId, level=:level
WHERE `id`=:achievementId;
SQL;
$params=[
':name' => ['value'=>$name, 'data_type'=>PDO::PARAM_STR],
':description' => ['value'=>$description, 'data_type'=>PDO::PARAM_STR],
':rootId' => ['value'=>$rootId, 'data_type'=>PDO::PARAM_INT],
':level' => ['value'=>$level, 'data_type'=>PDO::PARAM_INT],
':achievementId' => ['value'=>$achievementId, 'data_type'=>PDO::PARAM_INT],
];
dbQuery($db, $query, $params, ['dontFetch'=>true]);
return;
}
function canUserGetAchievementToday($db, $userId){
$achievements = getUsersAchievements($db, $userId);
foreach($achievements as $a){
if( date('Ymd') == date('Ymd', strtotime($a['timestamp'])) )
return false;
}
return true;
}
?>

View File

@@ -30,7 +30,7 @@ function checkCredentials($username, $password, $db_server, $db_user, $db_passwo
),
);
$message['success'] = 'Anmeldung erfolgreich, <a href="index.php">weiter zum Inhalt</a>.';
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/achievements?user=' . $_POST['f']['username']);
header('Location: http://' . $_SERVER['HTTP_HOST'] . '/machs?user=' . $_POST['f']['username']);
} else {
sleep(1);
$message['error'] = 'Das Kennwort ist nicht korrekt.';

18
homepage/machs/logout.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
session_start();
$_SESSION = array();
if (ini_get('session.use_cookies')) {
$params = session_get_cookie_params();
setcookie(
session_name(),
'',
time() - 42000,
$params['path'],
$params['domain'],
$params['secure"'],
$params['httponly']
);
}
session_destroy();
header('Location: ./login.php');
?>