| @@ -1,2 +1,25 @@ | |||||
| # mpp-tool | # mpp-tool | ||||
| composer install | |||||
| copy .env to .env.local | |||||
| for example: DATABASE_URL="mysql://root@127.0.0.1:3306/mpp_tool?serverVersion=10.4.14-MariaDB" | |||||
| http://localhost/phpmyadmin | |||||
| New database | |||||
| database name: mpp_tool | |||||
| bin/console doc:sch:up --force | |||||
| Import data: | |||||
| bin/console app:import-din-assets | |||||
| bin/console app:import-benchmark | |||||
| import data | |||||
| symfony server:start | |||||
| password: $2y$12$ZxLx8P4p6PfsvYn5o7DXHuhjE.GL1m4YG4HKp5dEoLtPUwvv1eD42 = test | |||||
| generate password: | |||||
| in httpdocs: php pw_gen.php | |||||
| @@ -154,19 +154,34 @@ function onChangeDinAsset() { | |||||
| function onFormSubmit() { | function onFormSubmit() { | ||||
| $("#submit").on("click", function(e) { | $("#submit").on("click", function(e) { | ||||
| console.log($('#form-risk').serializeArray()); | |||||
| $.ajax({ | |||||
| url: "/calculate-risk", | |||||
| method: "post", | |||||
| data: $('#form-risk').serializeArray(), | |||||
| success: function (data) { | |||||
| console.log(data); | |||||
| }, | |||||
| error: function (xhr, msg, three) { | |||||
| messageBox(false, "Fehler bei der Anfrage."); | |||||
| }, | |||||
| dataType: "json" | |||||
| }); | |||||
| e.preventDefault(); | |||||
| let cycleVal = $("#cycle").val(); | |||||
| if (cycleVal === '') { | |||||
| messageBox(false, "Bitte geben Sie Ihren aktuellen Zyklus ein."); | |||||
| } else { | |||||
| let cycleMin = parseInt($("#cycle").attr("min")); | |||||
| if (cycleVal < cycleMin) { | |||||
| $("#cycle").val(cycleMin); | |||||
| messageBox(false, "Zyklus an Minimal-Wert '" + cycleMin + "' angepasst."); | |||||
| } | |||||
| let cycleMax = parseInt($("#cycle").attr("max")); | |||||
| if (cycleVal > cycleMax) { | |||||
| $("#cycle").val(cycleMax); | |||||
| messageBox(false, "Zyklus an Maximal-Wert '" + cycleMax + "' angepasst."); | |||||
| } | |||||
| $.ajax({ | |||||
| url: "/calculate-risk", | |||||
| method: "post", | |||||
| data: $('#form-risk').serializeArray(), | |||||
| success: function (data) { | |||||
| console.log(data); | |||||
| }, | |||||
| error: function (xhr, msg, three) { | |||||
| messageBox(false, "Fehler bei der Anfrage."); | |||||
| }, | |||||
| dataType: "json" | |||||
| }); | |||||
| } | |||||
| }); | }); | ||||
| } | } | ||||
| @@ -10,11 +10,24 @@ | |||||
| <p>Sie haben die maximale Anzahl an Durchgängen erreicht.</p> | <p>Sie haben die maximale Anzahl an Durchgängen erreicht.</p> | ||||
| {% else %} | {% else %} | ||||
| <div class="container"> | <div class="container"> | ||||
| <a href="{{ path('risk_analysis') }}" class="btn">{{ userHasUnfinishedCatalogue ? 'Arbeitskarte fortsetzen' : 'Arbeitskarte starten' }}</a> | |||||
| <a href="{{ path('risk_analysis') }}" class="btn">Neue Arbeitskarte erstellen</a> | |||||
| {# <p class="alert">Leider ist Ihre Nutzungsdauer von 3 Jahren abgelaufen. Wenn Sie den Fragenkatalog noch einmal bearbeiten möchten, wenden Sie sich bitte an die Geschäftsstelle.</p>#} | {# <p class="alert">Leider ist Ihre Nutzungsdauer von 3 Jahren abgelaufen. Wenn Sie den Fragenkatalog noch einmal bearbeiten möchten, wenden Sie sich bitte an die Geschäftsstelle.</p>#} | ||||
| </div> | </div> | ||||
| {% endif %} | {% endif %} | ||||
| <p>Ihre Arbeitskarten:</p> | |||||
| <ul> | |||||
| <li> | |||||
| <a href="#">411 - Hubwagen</a> | |||||
| </li> | |||||
| <li> | |||||
| <a href="#">411 - Hubwagen</a> | |||||
| </li> | |||||
| <li> | |||||
| <a href="#">411 - Hubwagen</a> | |||||
| </li> | |||||
| </ul> | |||||
| {% if userHasFinishedCatalogue %} | {% if userHasFinishedCatalogue %} | ||||
| <h2>"Ihr MPPScore"</h2> | <h2>"Ihr MPPScore"</h2> | ||||
| <p>Hier erhalten Sie eine Zusammenfassung Ihrer Antworten zu den Fragen aus MPPTool und das Ergebnis der Auswertung als PDF-Dokument.</p> | <p>Hier erhalten Sie eine Zusammenfassung Ihrer Antworten zu den Fragen aus MPPTool und das Ergebnis der Auswertung als PDF-Dokument.</p> | ||||