diff --git a/registration-system/config.local.php b/registration-system/config.local.php index ddee6d7fca8c95d042be9ef76adbd0e78c34abd9..50f42b2431f794b7e1abf67e67623253ea3eebdc 100644 --- a/registration-system/config.local.php +++ b/registration-system/config.local.php @@ -1,19 +1,13 @@ <?php -/** - * Created by PhpStorm. - * User: tim - * Date: 10/4/14 - * Time: 9:30 PM - */ $config_verbose_level = 0; // 0 = nothing, 1 = important, 2 = somewhat important, 3 = detailed verbose, 4 = with sql $config_admin_verbose_level = 0; // URL where site is hosted with trailing slash -$config_baseurl = "http://fsfahrt.repke.eu/anmeldung/registration-system/"; +$config_baseurl = "localhost/fsfahrt"; //"http://fsfahrt.repke.eu/anmeldung/registration-system/"; // absolute path to doc root withOUT trailing slash -$config_basepath = "/var/www/vhosts/fsfahrt.repke.eu/httpdocs/anmeldung/registration-system"; +$config_basepath = __DIR__; //"/var/www/vhosts/fsfahrt.repke.eu/httpdocs/anmeldung/registration-system"; // database config $config_db = array( diff --git a/registration-system/frameworks/environment.php b/registration-system/frameworks/environment.php index fc62cb30984bd47a37125b7eb391cf6db9f6f764..123d7627b9c31045cfc43d05682710b9d08c1c4a 100644 --- a/registration-system/frameworks/environment.php +++ b/registration-system/frameworks/environment.php @@ -1,7 +1,7 @@ <?php -require '../config.inc.php'; -require '../lang.php'; +require __DIR__.'/../config.inc.php'; +require __DIR__.'/../lang.php'; require 'medoo.php'; require 'commons.php'; require 'soft_protect.php'; diff --git a/registration-system/index.php b/registration-system/index.php index da68623ef91e7af732355ab61720caa5bc2e0fc6..4d0cccc67c8cd3fe126ce8bca8e37c876d065e34 100644 --- a/registration-system/index.php +++ b/registration-system/index.php @@ -75,6 +75,10 @@ function index_show_signup() { $openstatus = $environment->getRegistrationState($fid); $waitlist_confirmed = $environment->isInWaitlistMode(); + + echo '<div id="signup-container">'; + echo '<h2>Anmeldung</h2>'; + // Anmeldung erfolgreich if(isset($_REQUEST['success'])) { echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Die Anmeldung war erfolgreich.</div>'; @@ -90,7 +94,7 @@ function index_show_signup() { // Formulardaten empfangen -> auswerten! elseif(isset($_REQUEST['submit']) || isset($_REQUEST['storySubmit'])){ - comm_verbose(1,"Formular bekommen"); + comm_verbose(1, "Formular bekommen"); $sub = $signup_method->validateSubmission(); @@ -112,11 +116,12 @@ function index_show_signup() { ($openstatus == 0 || ($waitlist_confirmed && $openstatus < 2 ))) { $signup_method->getActiveMethod()->showInlineHTML(); + + // future feature: option to show edit view (when $_GET['bid'] isset) } // Anmeldeoptionen anzeigen else { - if($openstatus > 0 && !$waitlist_confirmed) { echo '<div style="text-align:center; font-size: 20pt; font-weight: bold">Die Anmeldung wurde geschlossen.</div>'; @@ -134,6 +139,8 @@ function index_show_signup() { $methods = $signup_method->getSignupMethodsBaseInfo(); $link = '?fid=' . $fid . ($waitlist_confirmed ? '&waitlist' : '') . '&method='; + echo '<p>Es stehen verschiedene Methoden zur Anmeldung offen. Wähle eine davon:'; + echo '<ul id="method-list">'; foreach ($methods as $method) { echo '<li><a href="' . $link . $method['id'] . '">' . $method["name"] . '</a> <br />' . $method['description'] . '</li>'; @@ -142,6 +149,8 @@ function index_show_signup() { } } + + echo '</div>'; // close signup-container } @@ -164,6 +173,12 @@ function index_show_alleFahrten() { $foos = $environment->database->select("fahrten", ['fahrt_id','titel','ziel','von','bis','beschreibung','leiter','kontakt', 'max_bachelor'], "ORDER BY fahrt_id DESC"); + + if(!$foos) { + echo 'Keine Fahrten im System gefunden'; + return; + } + $fids = []; foreach($foos as $foo){ index_show_fahrtHeader($foo); @@ -230,11 +245,16 @@ function index_show_fahrtHeader_js($fahrten){ };'; foreach($pins as $p){ - echo' - var ziel_'.$p['fahrt_id'].' = new google.maps.LatLng('.str_replace(" ", ", ", $p["map_pin"] ).'); - var marker_'.$p['fahrt_id'].'; - var map_'.$p['fahrt_id'].'; + // if not valid GPS pos, fallback to Kheta! + if(!preg_match("/\\d+\\.\\d+ \\d+\\.\\d+/m", $p["map_pin"])) + $p["map_pin"] = '71.555267 99.690962'; + + echo ' + var ziel_' . $p['fahrt_id'] . ' = new google.maps.LatLng(' . str_replace(" ", ", ", $p["map_pin"]) . '); + var marker_' . $p['fahrt_id'] . '; + var map_' . $p['fahrt_id'] . '; '; + } echo' function initialize() { @@ -287,7 +307,7 @@ function index_show_signupTable($fid){ $environment = Environment::getEnv(); - echo '<h2>Angemeldet</h2>'; + echo '<h2>Anmeldungen</h2>'; $data = $environment->database->select('bachelor', ["pseudo","antyp","abtyp","anday","abday","comment","studityp"], diff --git a/registration-system/view/signups/abstract_signup_class.php b/registration-system/view/signups/abstract_signup_class.php index 50c26fbd736c079687babb20f969fdc6570aea7e..b8e9f1cf91f1b73d157551b02ea873dff660976b 100644 --- a/registration-system/view/signups/abstract_signup_class.php +++ b/registration-system/view/signups/abstract_signup_class.php @@ -1,21 +1,15 @@ <?php -abstract class SignupMethod { - - // ================================================================================================================= - // Abstract functions - // to be implemented by each method - // ================================================================================================================= - +interface SignupMethodStatics { /** * @return string with humanly readable name of this method */ - abstract public static function getName(); + public static function getName(); /** * @return string with a short description */ - abstract public static function getAltText(); + public static function getAltText(); /** * This method will return some meta info about that method. It should return an associative array of that form: @@ -28,7 +22,17 @@ abstract class SignupMethod { * * @return object containing meta info (see description) */ - abstract public static function getMetaInfo(); + public static function getMetaInfo(); +} + +abstract class SignupMethod implements SignupMethodStatics { + + // ================================================================================================================= + // Abstract functions + // to be implemented by each method + // ================================================================================================================= + + /** * @return array of (relative to '/view/signups/<folder>/') scripts to include in frontend diff --git a/registration-system/view/signups/index.php b/registration-system/view/signups/index.php index 324f66c7fefe821049e210d6dc74e102ac7372d5..a8bd912dcbe87202099a492a4ccdc789b83d3057 100644 --- a/registration-system/view/signups/index.php +++ b/registration-system/view/signups/index.php @@ -24,7 +24,7 @@ class SignupMethods { "id" => $method["id"], "name" => $method["class"]::getName(), "description" => $method["class"]::getAltText(), - "contributors" => $method["class"]::getMetaInfo() + "meta" => $method["class"]::getMetaInfo() ]); } return $tmp; @@ -59,16 +59,17 @@ class SignupMethods { } private function loadSignupMethod($folder_name) { - $tmp_file_name = __DIR__ . '/' . $folder_name . '/index.php'; + $tmp_method_folder = basename($folder_name); + $tmp_file_name = __DIR__ . '/' . $tmp_method_folder . '/index.php'; try { if (file_exists($tmp_file_name)) { require_once $tmp_file_name; - $tmp_class_name = ucfirst($folder_name . 'SignupMethod'); + $tmp_class_name = ucfirst($tmp_method_folder . 'SignupMethod'); if (class_exists($tmp_class_name)) { return [ - 'id' => $folder_name, + 'id' => $tmp_method_folder, 'class' => $tmp_class_name, 'classFile' => $tmp_file_name ]; diff --git a/registration-system/view/style.css b/registration-system/view/style.css index aef61437369c641a8aef6f262305f9263c58f879..3de1aa68253a559e52286337d33a4f77f4236ab9 100644 --- a/registration-system/view/style.css +++ b/registration-system/view/style.css @@ -49,22 +49,6 @@ div#menubox { /*height: 40px;*/ } -div#menubox a { - padding-left: 10px; - padding-right: 10px; - line-height: 40px; - text-decoration: none; - color: black; - display: block; - float: left; -} - -div#menubox a:hover { - font-weight: bold; - background-color: #4e7dac; - color: white; -} - div#mainbox { padding: 10px 0 20px 0; } @@ -169,8 +153,8 @@ div#headerbox p { } h2 { - margin: 5px; - margin-bottom: 15px; + margin: 0 0 15px 0; + padding-left: 1em; border-bottom: 1px dotted black; } @@ -324,11 +308,24 @@ a.editenum { display: block; height: 20px; line-height: 20px; width: 20px; font- margin-bottom: 15px; border-bottom: 1px dotted black; margin-left: -10px; - float: none !important; font-weight: bold; font-size: 1.5em; } +a.fahrthead { + padding-left: 10px; + padding-right: 10px; + line-height: 40px; + text-decoration: none; + color: black; + display: block; +} +a.fahrthead:hover { + font-weight: bold; + background-color: #4e7dac; + color: white; +} + .fahrt pre a, .fahrt p a{ display: inline !important; border: 0 !important; @@ -353,65 +350,21 @@ a.editenum { display: block; height: 20px; line-height: 20px; width: 20px; font- background-color: #FFBABA; } -/* ----------- My Form ----------- */ -.myform{ - margin:0 auto; - width:400px; - padding:14px; -} - -/* ----------- stylized ----------- */ -#stylized{ - border:solid 2px #b7ddf2; - background:#ebf4fb; -} -#stylized h1 { - font-size:1.5em; - - color:black; - font-weight:bold; - margin-bottom:8px; -} -#stylized p{ - font-size:11px; - color:#666666; - margin-bottom:20px; - border-bottom:solid 1px #b7ddf2; - padding-bottom:10px; -} -#stylized label{ - display:block; - font-weight:bold; - text-align:right; - width:140px; - float:left; -} -#stylized .small{ - color:#666666; - display:block; - font-size:11px; - font-weight:normal; - text-align:right; - width:140px; -} -#stylized input, #stylized select, #stylized textarea{ - float:left; - font-size:12px; - padding:4px 2px; - border:solid 1px #aacfe4; - width:200px; - margin:2px 0 20px 10px; -} -#stylized button{ - clear:both; - margin-left:150px; - width:125px; - height:31px; - background:#666666 url(img/button.png) no-repeat; - text-align:center; - line-height:31px; - color:#FFFFFF; - font-size:11px; - font-weight:bold; +ul#method-list { + list-style-type: square; +} + +ul#method-list a { + font-weight: bold; +} + +ul#method-list a:hover { + padding: 10px; + background-color: #4D4DFF; + color: #FF00FF; + font-weight: bold; } +#signup-container { + margin: 2em 0; +} \ No newline at end of file