Skip to content
Snippets Groups Projects
Commit d519bb1f authored by Tim Repke's avatar Tim Repke
Browse files

first humble prototype

parent 8dc9e0ec
No related branches found
No related tags found
No related merge requests found
<?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(
......
<?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';
......
......@@ -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"],
......
<?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
......
......@@ -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
];
......
......@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment