diff --git a/registration-system/admin/pages.php b/registration-system/admin/pages.php index 0c8c44febba394b80d9da3739afee89b4fdfcd63..b2557fdecdb651254f1aa1d57cefb6295f269186 100644 --- a/registration-system/admin/pages.php +++ b/registration-system/admin/pages.php @@ -1,5 +1,8 @@ <?php +require_once("../frameworks/medoo.php"); +require_once("../config.inc.php"); + function page_stuff() { global $text; @@ -8,7 +11,7 @@ function page_stuff() function page_list() { - global $text, $headers; + global $text, $headers, $admin_db; $headers =<<<END <link rel="stylesheet" type="text/css" href="../view/css/DataTables/css/jquery.dataTables.min.css" /> <script type="text/javascript" src="../view/js/jquery-1.11.1.min.js"></script> @@ -16,23 +19,58 @@ function page_list() END; $text .= "Meldeliste"; + $columns = array( + "bachelor_id", + "fahrt_id", + "forname", + "sirname", + "pseudo", + "antyp", + "abtyp", + "anday", + "abday", + "comment", + "studityp" + ); + $columnFunctions = array( + "Anmelde-ID" => function($person) { return $person["bachelor_id"]; }, + "FahrtID" => function($person) { return $person["fahrt_id"]; }, + "Name" => function($person) { return $person["forname"]." ".$person["sirname"]." (".$person["pseudo"].")"; }, + "Anreisetyp" => function($person) { return ""; }, + "Abreisetyp" => function($person) { return ""; }, + "Anreisetag" => function($person) { return ""; }, + "Abreisetag" => function($person) { return ""; }, + "Kommentar" => function($person) { return ""; }, + "StudiTyp" => function($person) { return ""; } + ); + $text .=<<<END <table id="mlist"> <thead> <tr> - <th>Column 1</th> - <th>Column 2</th> +END; + foreach($columnFunctions as $key => $value) + { + $text .= "<th>".$key."</th>"; + } + $text .=<<<END </tr> </thead> <tbody> - <tr> - <td>Row 1 Data 1</td> - <td>Row 1 Data 2</td> - </tr> - <tr> - <td>Row 2 Data 1</td> - <td>Row 2 Data 2</td> - </tr> +END; + // TODO: generate table content + + $people = $admin_db->select('bachelor',$columns); + foreach($people as $person) { + $text .= "<tr>"; + foreach($columnFunctions as $key => $value) + { + $text .= "<td>".$value($person)."</td>"; + } + $text .= "</tr>"; + } + + $text .=<<<END </tbody> </table> <script type='text/javascript'> diff --git a/registration-system/admin/pages_cost.php b/registration-system/admin/pages_cost.php index b8f60c4a106f7bd94e87f65f31e9eb107e1fd07b..3bbfa97b74f0692e5a242569af1dad93e9744e8e 100644 --- a/registration-system/admin/pages_cost.php +++ b/registration-system/admin/pages_cost.php @@ -8,3 +8,104 @@ global $config_studitypen, $config_reisearten, $config_essen, $admin_db, $config_current_fahrt_id, $config_admin_verbose_level, $config_verbose_level, $text, $headers, $ajax; +$h = array("Position", "Anzahl", "Satz", "Summe"); +$d = array(array("Mett", 100, 3.2), + array("Zwiebel", 300, 5), + array("Brötchen", 200, 0.2)); +$s[3] = array(1,2); +$t[2] = " €"; +$t[3] = " €"; +$text .= html_table($h, $d, $s, $t); + + + +/** + * $headers + * is an array of the headers + * $data + * is an array with the data to output + * $sum + * is an array declaring which cols should be summed up and put below the table, + * second dimension declares which cols need to be multiplied (if no second dimension, just sum at the end) + * $type + * is an array declaring type of data to put behind the value (i.e. €), not all cols need to be declared + * + * return value: variable containing the html code for echo + */ +function html_table($header, $data, $sum = array(), $type = array()){ + $summy = array(); + + $ret = "<table class=\"cost-table\"> + <thead> + <tr>\n"; + foreach($header as $h) + $ret.= "<th>".$h."</th>\n"; + $ret.=" </tr> + </thead> + <tbody>\n"; + foreach($data as $row){ + $ret.="<tr>"; + for($i = 0; $i < count($header); $i++){ + $ret.= "<td".numeric_class($row, $sum, $i).">"; + if(isset($row[$i])){ + $ret .= prepval($row[$i],(isset($type[$i]) ? $type[$i] : "")); + if(isset($sum[$i])){ + if(!isset($summy[$i])) + $summy[$i] = $row[$i]; + else + $summy[$i] += $row[$i]; + } + } elseif(isset($sum[$i])) { + if(count($sum[$i])>1){ + $tmp = NULL; + foreach($sum[$i] as $s){ + $tmp = (is_null($tmp)) ? $row[$s] : $tmp*$row[$s]; + } + $ret .= prepval($tmp,(isset($type[$i]) ? $type[$i] : "")); + + if(!isset($summy[$i])) + $summy[$i] = $tmp; + else + $summy[$i] += $tmp; + } else { + // do nothing, sum at the end + } + } + $ret.="</td>"; + } + $ret.="</tr>"; + } + $ret.= "</tbody>\n"; + if(count($sum)>0){ + $ret.= "<tfoot> + <tr>\n"; + for($i = 0; $i < count($header); $i++){ + if(isset($sum[$i])){ + $ret.='<td>'.prepval($summy[$i],(isset($type[$i]) ? $type[$i] : "")).'</td>'; + } else { + $ret.='<td class="cost-table-invisible"></td>'; + } + } + $ret.= " </tr> + </tfoot>\n"; + } + $ret.= "</table>"; + + return $ret; +} + +function prepval($val, $post){ + if(strpos($post, "€")!==false) + return number_format($val, 2, ',', ' ').$post; + return $val.$post; +} + +function numeric_class($a,$b,$c){ + $d = ' class="cost-table-numeric"'; + if(isset($a[$c])){ + if(is_numeric($a[$c])) + return $d; + } + if(isset($b[$c])) + return $d; +} \ No newline at end of file diff --git a/registration-system/frameworks/commons.php b/registration-system/frameworks/commons.php index 9555878212f65dceb59631ec6a5c1198fbfa6393..21b03fc77886b53c6a84500d7ab56d5cea4c2b25 100644 --- a/registration-system/frameworks/commons.php +++ b/registration-system/frameworks/commons.php @@ -1,5 +1,7 @@ <?php +$invalidCharsRegEx = "/^[^0-9<>!?.::,#*@^_$\\\"'%;()&+]{2,50}$/"; // d©_©b + /** * converts mail into safe for web format * @param $mail - mail to convert diff --git a/registration-system/frameworks/soft_protect.php b/registration-system/frameworks/soft_protect.php new file mode 100644 index 0000000000000000000000000000000000000000..7a720175941a085395511810028dbcc5738b8301 --- /dev/null +++ b/registration-system/frameworks/soft_protect.php @@ -0,0 +1,28 @@ +<?php +class soft_protect +{ + private $elements = array(); + public function add($elements, $regex) + { + array_push($this->elements, array($elements, $regex)); + return $this; + } + + public function write() + { + $lines = array(); + array_push($lines, "<script type='text/javascript'>"); + foreach($this->elements as $element) + { + $elems = array(); + foreach($element[0] as $protectkey) + { + array_push($elems, "'".addslashes($protectkey)."'"); + } + array_push($lines, "soft_protect([".implode(",", $elems)."], ".$element[1].");"); + } + array_push($lines, "</script>"); + return implode("\r\n", $lines); + } +} +?> \ No newline at end of file diff --git a/registration-system/fsfahrt_22082014.sql b/registration-system/fsfahrt_22082014.sql new file mode 100644 index 0000000000000000000000000000000000000000..e81c69fe569b3a6d493aad58a43bae9cec9549a1 --- /dev/null +++ b/registration-system/fsfahrt_22082014.sql @@ -0,0 +1,122 @@ +-- phpMyAdmin SQL Dump +-- version 4.1.12 +-- http://www.phpmyadmin.net +-- +-- Host: localhost:3306 +-- Generation Time: Aug 22, 2014 at 08:31 PM +-- Server version: 5.1.73-0ubuntu0.10.04.1 +-- PHP Version: 5.4.16 + +SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; +SET time_zone = "+00:00"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `fsfahrt` +-- +CREATE DATABASE IF NOT EXISTS `fsfahrt` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; +USE `fsfahrt`; + +-- -------------------------------------------------------- + +-- +-- Table structure for table `bachelor` +-- + +DROP TABLE IF EXISTS `bachelor`; +CREATE TABLE IF NOT EXISTS `bachelor` ( + `bachelor_id` varchar(15) NOT NULL, + `fahrt_id` int(11) NOT NULL, + `version` int(11) NOT NULL, + `forname` varchar(50) NOT NULL, + `sirname` varchar(50) NOT NULL, + `anday` varchar(10) NOT NULL, + `abday` date NOT NULL, + `antyp` varchar(100) NOT NULL, + `abtyp` varchar(100) NOT NULL, + `pseudo` varchar(50) NOT NULL, + `mehl` varchar(100) NOT NULL, + `essen` varchar(50) NOT NULL, + `public` int(11) NOT NULL, + `virgin` int(11) NOT NULL, + `studityp` varchar(11) NOT NULL, + `comment` text NOT NULL, + `paid` int(10) DEFAULT NULL COMMENT 'zahlung erhalten am unix timestamp', + `repaid` int(10) DEFAULT NULL COMMENT 'rückzahlung abgeschickt am unix timestamp', + `backstepped` int(10) DEFAULT NULL COMMENT 'rücktritt als unix timestamp', + PRIMARY KEY (`bachelor_id`,`fahrt_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `bachelor` +-- + +INSERT INTO `bachelor` (`bachelor_id`, `fahrt_id`, `version`, `forname`, `sirname`, `anday`, `abday`, `antyp`, `abtyp`, `pseudo`, `mehl`, `essen`, `public`, `virgin`, `studityp`, `comment`, `paid`, `repaid`, `backstepped`) VALUES +('5b61b92044983e1', 2, 1, 'asd', 'ad', '2012-03-20', '2014-03-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'ffas', 'asdasd@asd.de', 'Alles', 1, 0, '0', 'dasd', NULL, NULL, NULL), +('f35f12ca7c55462', 2, 1, 'fcacs', 'ads', '2012-03-20', '2014-03-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'fas', 'asd@asd.de', 'Alles', 0, 0, '0', 'adasdasda', NULL, NULL, NULL), +('068e4198f255a1e', 2, 1, 'göll', 'asd', '2012-03-20', '2014-03-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'adsad', 'adskd@asdl.de', 'Alles', 1, 0, '0', 'adasd', NULL, NULL, NULL), +('d748d40c0d7e475', 2, 1, 'ad', 'adsd', '2012-03-20', '2014-03-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'asdadl', 'asdas@asd.de', 'Vegan', 1, 0, '0', 'ad', NULL, NULL, NULL), +('ec2cac23f915bf9', 2, 1, 'gbhg', 'ncvbx', '2012-03-20', '2014-03-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Bus/Bahn', 'cvxcvxsdfs', 'ads@asdl.de', 'Alles', 1, 0, '0', 'ycyxc', NULL, NULL, 1408205076), +('78a322842b66657', 2, 1, 'lkblka', 'kbvnfj', '2012-03-20', '2014-03-20', 'individuell', 'gemeinsam mit Rad', 'kmkm', 'sdkk@ksad.de', 'Vegan', 1, 0, 'MasterErsti', 'asda', NULL, NULL, NULL), +('8d70b435d61c302', 2, 1, 'gm', 'sdlkjflkj', '2013-03-20', '2014-03-20', 'gemeinsam mit Rad', 'individuell', 'skldfmlk', 'sfjdkl@dfjklj.de', 'Grießbrei', 1, 0, 'Hoersti', 'asddsa', NULL, NULL, NULL), +('c8c1d8a327fd88f', 2, 1, 'lkdnl', 'sdkjfhnk', '2013-03-20', '2014-03-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'adhsj', 'fsfahrt@byom.de', 'Frutarisch', 1, 0, 'Hoersti', 'adas', 1408205076, NULL, NULL), +('7f5609769cce5f1', 2, 1, 'lkdnl', 'sdkjfhnk', '2013-03-20', '2014-03-20', 'gemeinsam mit Bus/Bahn', 'gemeinsam mit Rad', 'adhsj', 'fsfahrt@byom.de', 'Frutarisch', 1, 0, 'Hoersti', 'adas', 1408105076, 1408205076, NULL); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `fahrten` +-- + +DROP TABLE IF EXISTS `fahrten`; +CREATE TABLE IF NOT EXISTS `fahrten` ( + `fahrt_id` int(11) NOT NULL AUTO_INCREMENT, + `titel` varchar(200) NOT NULL, + `ziel` varchar(100) NOT NULL, + `von` date NOT NULL, + `bis` date NOT NULL, + `regopen` int(1) NOT NULL, + `beschreibung` text NOT NULL, + `leiter` varchar(100) NOT NULL, + `kontakt` varchar(100) NOT NULL, + PRIMARY KEY (`fahrt_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Dumping data for table `fahrten` +-- + +INSERT INTO `fahrten` (`fahrt_id`, `titel`, `ziel`, `von`, `bis`, `regopen`, `beschreibung`, `leiter`, `kontakt`) VALUES +(1, 'Porno laut im Flur Fahrt', 'Irgendwo', '2012-10-17', '2012-10-19', 0, 'irgendein Text', 'Willi', 'hans@wurst.de'), +(2, 'Vodka in Hand Fahrt', 'Halbinsel', '2013-10-18', '2013-10-20', 1, 'Mehr Text passt nicht!', 'Tim', 'wahr@gi.na'); + +-- -------------------------------------------------------- + +-- +-- Table structure for table `notes` +-- + +DROP TABLE IF EXISTS `notes`; +CREATE TABLE IF NOT EXISTS `notes` ( + `note_id` int(11) NOT NULL AUTO_INCREMENT, + `fahrt_id` int(11) NOT NULL, + `note` text NOT NULL, + PRIMARY KEY (`note_id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; + +-- +-- Dumping data for table `notes` +-- + +INSERT INTO `notes` (`note_id`, `fahrt_id`, `note`) VALUES +(1, 1, 'fahrt1 note'), +(2, 2, '<h1><b><marquee>Testnotiz 123</marquee><br></b></h1>hier kann man <i>notizen </i>hinterlassen test<br><br><h2><b>Dumme Bemerkung</b></h2>Notiz =<span class="wysiwyg-color-red"> unlimited tits!</span><b><br></b><b><br></b>'); + +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; diff --git a/registration-system/index.php b/registration-system/index.php index cb52e52b0032531eb0ad038601626437fc705f84..4bcf3ad7f161506daa72bb32384760ba17e32e85 100644 --- a/registration-system/index.php +++ b/registration-system/index.php @@ -5,6 +5,7 @@ require 'config.inc.php'; require 'frameworks/medoo.php'; require 'frameworks/commons.php'; require 'lang.php'; +require 'frameworks/soft_protect.php'; $index_db = new medoo(array( @@ -90,7 +91,7 @@ function index_form_to_db($data){ * */ function index_check_form(){ - global $config_studitypen, $config_essen, $config_reisearten, $index_db; + global $config_studitypen, $config_essen, $config_reisearten, $index_db, $invalidCharsRegEx; $errors = array(); $data = array(); @@ -103,9 +104,9 @@ function index_check_form(){ $possible_dates = comm_get_possible_dates($fid); - index_check_field('forname', '/^[a-z-äüöß]{2,50}$/ui', $data, $errors, "Fehlerhafter oder fehlender Vorname!"); - index_check_field('sirname', '/^[a-z-äüöß]{2,50}$/ui', $data, $errors, "Fehlerhafter oder fehlender Nachname!"); - index_check_field('pseudo', '/^\w{2,50}$/u', $data, $errors, "Fehlerhafter oder fehlender Anzeigename!"); + index_check_field('forname', $invalidCharsRegEx, $data, $errors, "Fehlerhafter oder fehlender Vorname!"); + index_check_field('sirname', $invalidCharsRegEx, $data, $errors, "Fehlerhafter oder fehlender Nachname!"); + index_check_field('pseudo', $invalidCharsRegEx, $data, $errors, "Fehlerhafter oder fehlender Anzeigename!"); index_check_field('mehl', 'mail', $data, $errors, "Fehlerhafte oder fehlende E-Mail-Adresse!"); index_check_field('anday', array_slice($possible_dates,0, -1), $data, $errors, 'Hilfe beim Ausfüllen: <a href="https://www.hu-berlin.de/studium/bewerbung/imma/exma">hier klicken!</a>'); index_check_field('antyp', $config_reisearten, $data, $errors, 'Trolle hier lang: <a href="https://www.hu-berlin.de/studium/bewerbung/imma/exma">hier klicken!</a>'); @@ -197,7 +198,7 @@ function index_check_field($index, $check, &$datarr, &$errarr, $errmess){ * @param null $bachelor - if not null: prefill form with these data (take care, keys have to exist!) */ function index_show_formular($fid, $bid = NULL, $bachelor = NULL){ - global $index_db, $config_studitypen, $config_essen, $config_reisearten; + global $index_db, $config_studitypen, $config_essen, $config_reisearten, $invalidCharsRegEx; $possible_dates = comm_get_possible_dates($fid); @@ -227,6 +228,9 @@ function index_show_formular($fid, $bid = NULL, $bachelor = NULL){ index_show_formular_helper_sel2("Abreise","abday", array_slice($possible_dates,1), $bachelor["abday"] ,"abtyp",$config_reisearten,$bachelor["abtyp"],""); + $soft_prot = new soft_protect(); + echo $soft_prot->add(array('forname', 'sirname', 'pseudo'), $invalidCharsRegEx)->write(); + echo' <label>Anmerkung</label> <textarea id="comment" name ="comment" rows="3" cols="50">'.$bachelor["comment"].'</textarea> @@ -234,7 +238,7 @@ function index_show_formular($fid, $bid = NULL, $bachelor = NULL){ <button type="submit" name="submit" id="submit" value="submit">Anmelden!</button> <div class="spacer"></div> </form> - </div>'; + </div>'; } /** @@ -275,7 +279,7 @@ function index_show_formular_helper_sel2($name, $id, $values, $selected, $id2, $ echo '<label style="text-align:left">'.$name.' <span class="small">'.$subtext.'</span> </label><table><tr><td> - <select name="'.$id.'" id="'.$id.'" style="width:90px">'; + <select name="'.$id.'" id="'.$id.'" style="width:110px; text-align: center">'; foreach($values as $val){ echo '<option value="'.$val.'"'; if($val == $selected) echo ' selected'; @@ -369,4 +373,4 @@ function index_show_signupTable($fid){ } echo '</table>'; } -} +} \ No newline at end of file diff --git a/registration-system/ssh-keygen b/registration-system/ssh-keygen new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/registration-system/status.php b/registration-system/status.php index a64d74ab61201f125d59a11e54499bd4a1abee45..b3773579e7975d3ef5b803de39679a35a034fed8 100644 --- a/registration-system/status.php +++ b/registration-system/status.php @@ -34,54 +34,35 @@ function show_content(){ if(!$data) die("Kein gültiger Hash gegeben!"); + $infolist = Array( + 'Anmelde ID' => $data['bachelor_id'], + 'Vor-/Nachname' => $data['forname'].' '.$data['sirname'].(strlen($data['pseudo']) > 0 ? ' ('.$data['pseudo'].')' : ""), + 'eMail-Adresse' => $data['mehl'], + 'Anreisetag & Art' => $data["anday"].' ('.$data["antyp"].')', + 'Abreisetag & Art' => $data["abday"].' ('.$data["abtyp"].')', + 'Essenswunsch' => $data["essen"], + 'Zahlung erhalten' => ((is_null($data["paid"])) ? "nein" : date('d.m.Y',$data["paid"])), + 'Rückzahlung gesendet' => ((is_null($data["repaid"])) ? "nein" : date('d.m.Y',$data["repaid"])), + //'Zurückgetreten' => (($data["backstepped"]==1) ? "ja" : "nein"), + 'Kommentar' => $data["comment"] + ); + echo ' - <table> - <tr> - <td>Melde-ID</td> - <td>'.$data["bachelor_id"].'</td> - </tr> - <tr> - <td>Name</td> - <td>'.$data["forname"].' '.$data["sirname"].' ('.$data["pseudo"].')</td> - </tr> - <tr> - <td>E-Mail-Adresse</td> - <td>'.$data["mehl"].'</td> - </tr> - <tr> - <td>Anreisetag + Art</td> - <td>'.$data["anday"].' ('.$data["antyp"].')</td> - </tr> - <tr> - <td>Abreisetag + Art</td> - <td>'.$data["abday"].' ('.$data["abtyp"].')</td> - </tr> - <tr> - <td>Essenswunsch</td> - <td>'.$data["essen"].'</td> - </tr> - <tr> - <td>Zahlung erhalten</td> - <td>'.((is_null($data["paid"])) ? "nein" : date('d.m.Y',$data["paid"])).'</td> - </tr> - <tr> - <td>Rückzahlung gesendet</td> - <td>'.((is_null($data["repaid"])) ? "nein" : date('d.m.Y',$data["repaid"])).'</td> - </tr> - <!--tr> - <td>Zurückgetreten</td> - <td>'.(($data["backstepped"]==1) ? "ja" : "nein").'</td> - </tr--> - <tr> - <td>Kommentar</td> - <td>'.$data["comment"].'</td> - </tr> - </table>'; + <div class="fahrt"><div class="fahrttitle">Anmeldedaten</div> + <div class="fahrttable">'; + + foreach($infolist as $key => $value) + { + echo '<div>'; // (invisible(magic(style))) table row + echo "<div style='display:table-cell; font-weight: bold; padding: 3px 40px 3px 0'>$key</div><div style='display:table-cell'>$value</div>"; + echo '</div>'; + } + echo '</div></div>'; $mailto = $status_db->get("fahrten", "kontakt", array("fahrt_id"=>$config_current_fahrt_id)); $subject= $config_mailtag.'Änderung zu '.$data["forname"].' '.$data["sirname"].' ('.$data["pseudo"].')'; - echo '<a style="float:none" href="mailto:'.$mailto.'?subject='.str_replace(" ", "%20",$subject).'">Änderung melden</a>'; + echo '<a style="float:none;font-weight:bold" href="mailto:'.$mailto.'?subject='.str_replace(" ", "%20",$subject).'">Änderung melden</a>'; } diff --git a/registration-system/view/admin_style.css b/registration-system/view/admin_style.css new file mode 100644 index 0000000000000000000000000000000000000000..4f8dec9e1916a0307d0ab0a063be6dae010ca00d --- /dev/null +++ b/registration-system/view/admin_style.css @@ -0,0 +1,72 @@ +html,body { + font-family:Verdana,Helvetica,sans-serif; + font-size:12pt; + padding: 0; + margin:0; + height:100% +} +body{ + margin-top: 40px; + height:100%; +} +a:link, a:visited { + background-color:inherit; + color:#ff8400;; + text-decoration:none; +} +a:active, a:hover { + background-color:inherit; + color:#ff6000; + text-decoration:none; +} +#linkbar{ + border-bottom: 1px dashed coral; + width: 100%; + position: fixed; + top:0; + left: 0; + right: 0; + padding: 5px; + background: #f5f5f5; +} +#linkbar a{ + border-left: 1px dotted #d3d3d3; + padding: 0 5px; +} + +#admin-content{ + +} +#logout{ + float:right; + height:20px; + width: 25px; + background: #f5f5f5; + color:#f5f5f5; + border:0 !important; +} +form table tr td{ + border-left: 1px dotted #d3d3d3; + padding: 0 5px; +} + +.cost-table{ + +} +.cost-table td{ + padding-left: 12px; + padding-right: 12px; +} +.cost-table tr{ + +} +.cost-table tfoot{ + border-top: 1px dashed #222; + border-bottom: 1px double +} +.cost-table-numeric{ + text-align:right; +} +.cost-table-invisible{ + border: 0; +} \ No newline at end of file diff --git a/registration-system/view/admin_template.html b/registration-system/view/admin_template.html index abce2e7f7af623d712e46f9dca310253dc860538..30fd191036fe91e4ccbf9ef97484590076221b6d 100644 --- a/registration-system/view/admin_template.html +++ b/registration-system/view/admin_template.html @@ -4,59 +4,10 @@ <head> <title>FSFahrt - Admin Panel</title> <meta charset="UTF-8" /> + <link rel="stylesheet" href="../view/admin_style.css" /> {headers} <style type="text/css"> - html,body { - font-family:Verdana,Helvetica,sans-serif; - font-size:12pt; - padding: 0; - margin:0; - height:100% - } - body{ - margin-top: 40px; - height:100%; - } - a:link, a:visited { - background-color:inherit; - color:#ff8400;; - text-decoration:none; - } - a:active, a:hover { - background-color:inherit; - color:#ff6000; - text-decoration:none; - } - #linkbar{ - border-bottom: 1px dashed coral; - width: 100%; - position: fixed; - top:0; - left: 0; - right: 0; - padding: 5px; - background: #f5f5f5; - } - #linkbar a{ - border-left: 1px dotted #d3d3d3; - padding: 0 5px; - } - - #admin-content{ - - } - #logout{ - float:right; - height:20px; - width: 25px; - background: #f5f5f5; - color:#f5f5f5; - border:0 !important; - } - form table tr td{ - border-left: 1px dotted #d3d3d3; - padding: 0 5px; - } + </style> </head> <body> @@ -71,4 +22,4 @@ </div> </body> -</html> \ No newline at end of file +</html> \ No newline at end of file diff --git a/registration-system/view/default_index.php b/registration-system/view/default_index.php index 3c40f4cd6cbede7eaf2df8a44eac6d7698c90d24..e137bdd411522a621fc8b15a18e48834c8e58108 100644 --- a/registration-system/view/default_index.php +++ b/registration-system/view/default_index.php @@ -6,7 +6,8 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" href="view/style.css" /> - + <script type="text/javascript" src="view/js/jquery-1.11.1.min.js"></script> + <script type="text/javascript" src="view/js/soft_protect.js"></script> </head> <body> <div id="headerbox"> @@ -25,4 +26,4 @@ <img src="view/graphics/studityp_5.gif" style="position: fixed;bottom: 5px;left:0px" /> </body> -</html> +</html> \ No newline at end of file diff --git a/registration-system/view/js/soft_protect.js b/registration-system/view/js/soft_protect.js new file mode 100644 index 0000000000000000000000000000000000000000..a02220e7272ab2268ca51a82c1f299a73fbc4aec --- /dev/null +++ b/registration-system/view/js/soft_protect.js @@ -0,0 +1,12 @@ +function soft_protect(elementIds, regex) +{ + for(var i = 0; i < elementIds.length; ++i) + { + $('#'+elementIds[i]).keyup(function(event) { + if (!event.target.value.match(regex)) + event.target.style.backgroundColor="#f00"; + else + event.target.style.backgroundColor="#fff"; + }); + } +} \ No newline at end of file diff --git a/registration-system/view/style.css b/registration-system/view/style.css index f1250e1dee7e7dcca945af288ca923c8ce9f7707..d0f221f0a54364bfd60f5a0a8dfba938e3361329 100644 --- a/registration-system/view/style.css +++ b/registration-system/view/style.css @@ -1,299 +1,310 @@ -* { - padding: 0; - margin: 0; -} -/* -Neon Green: #6FFF00 -Neon Pink: #FF00FF -Neon Yellow: #FFFF00 -Neon Blue: #4D4DFF -Neon Red: #FE0001 -Neon Orange: #FF4105 -Neon Purple: #993CF3 -*/ -body { - background-color:#FF00FF; - font-family: sans-serif; - text-align: justify; - font-size: 1em; -} - -div#headerbox, div#menubox, div#mainbox, div#footerbox { - margin: 0 auto; - width: 1000px; - border-left: 1px solid black; - border-right: 1px solid black; - background-color: #f9f9f9; -} - -div#headerbox { - height: 400px; - background-image: url(graphics/header.jpg); - border-bottom: 1px solid black; -} - -div#menubox { - border-bottom: 1px solid black; - /*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; -} - -div#footerbox { - background-color: #4e7dac; - border-bottom: 1px solid black; - padding: 5px 0 5px 0; - text-align: center; - font-size: 10px; - color: white; - margin-bottom: 20px; -} - -input, textarea, select { - border: 1px solid black; - padding: 1px; -} -select option { padding-right: 10px; } -textarea.textfield { width: 100%; max-width: 350px; height: 100px; } - -ul { - margin-left: 20px; - list-style-type: circle; -} - -li { - margin-left: 20px; -} - -.hidden { display: none; } - -th { padding: 0 1px 0 1px; } - -h1 { - padding-top: 10px; - margin-left: 20px; - color: white; - font-size: 3.3em; - font-family: sans-serif; -} - -div#headerbox p { - color: white; - margin-top: 0px; - margin-left: 20px; - font-size: 1.5em; - font-family: sans-serifl; -} - -h2 { - margin: 5px; - margin-bottom: 15px; - border-bottom: 1px dotted black; -} - -h3 { - margin-bottom: 10px; - margin-left: 10px; -} - -p { margin: 15px; } -div.event_info { margin: 0 15px 5px 15px; } -p.event_date { background: url(event_date_icon.png) left center no-repeat; line-height: 20px; padding-left: 25px; } - -a { color: black; text-decoration: none; } -a:hover { text-decoration: underline; } - -a.email_all { - margin-left: 70px; - padding-left: 30px; - line-height: 25px; - background: white url(mail_all.jpg) no-repeat left center; -} -a.csv_download { margin-left: 70px; padding-left: 30px; line-height: 25px; background: url(csv_icon.gif) no-repeat left center; display: block; } - -ul.user_list { - list-style-image: url(user_small.gif); -} - -.event_name { - background: url(event.jpg) no-repeat left center; - padding-left: 40px; -} -h2.event_name { line-height: 50px; } -h3.event_name { line-height: 40px; } - -h3.signup { - background: url(signup.gif) no-repeat left center; - padding-left: 45px; - line-height: 45px; -} - -table.fieldset { margin-left: 30px; } -div.asterisk { margin-left: 30px; font-size: 10px; } - -h3.signup_people { - background: url(group.jpg) no-repeat left center; - padding-left: 55px; - line-height: 50px; - margin-top: 15px; -} - -table.signups, div.signups { width: 90%; margin: 30px auto;} -table.signups tr th { } -table.signups tr th, tr td { text-align: left; padding: 1px 4px 1px 4px; } - -p.edit_link { - padding: 10px; - border: 1px dotted black; - padding-left: 30px; - background: url(edit.jpg) no-repeat 10px center; -} - -.add_event { - line-height: 50px; - padding-left: 50px; - background: url(add_event.png) no-repeat left center; -} - -.edit_event { - padding-left: 20px; - background: url(edit.jpg) no-repeat left center; -} - -.login { - line-height: 50px; - padding-left: 50px; - background: url(login.gif) no-repeat left center; -} - -.password_forgotten { - line-height: 42px; - padding-left: 50px; - background: url(password_forgotten.gif) no-repeat left center; -} - -.edit_user { - line-height: 50px; - padding-left: 50px; - background: url(edit_user.png) no-repeat left center; -} - -.settings { - line-height: 50px; - padding-left: 50px; - background: url(settings.jpg) no-repeat left center; -} - -.user { - line-height: 50px; - padding-left: 50px; - background: url(group.jpg) no-repeat left center; -} - -a.editenum { display: block; height: 20px; line-height: 20px; width: 20px; font-size: 0px; padding: 8px; background: url(edit.jpg) left center no-repeat; color: #FFF; } - -.fahrt{ - padding: 30px; -} - -.fahrt a{ - margin-bottom: 15px; - border-bottom: 1px dotted black; - margin-left: -10px; - float: none !important; - font-weight: bold; - font-size: 1.5em; -} - -.message{ - margin: 5px; - padding: 5px; - font-size: 10pt; - border: 1px solid; - text-align:left; - color: #4F8A10; - background-color: #DFF2BF; -} -.error{ - color: #D8000C; - 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; -} \ No newline at end of file +* { + padding: 0; + margin: 0; +} +/* +Neon Green: #6FFF00 +Neon Pink: #FF00FF +Neon Yellow: #FFFF00 +Neon Blue: #4D4DFF +Neon Red: #FE0001 +Neon Orange: #FF4105 +Neon Purple: #993CF3 +*/ +body { + /*background-color:#FF00FF;*/ + background: url(http://rasputin.de/CF/Jugend/p/anibg.gif); + font-family: sans-serif; + text-align: justify; + font-size: 1em; +} + +div#headerbox, div#menubox, div#mainbox, div#footerbox { + margin: 0 auto; + width: 1000px; + border-left: 1px solid black; + border-right: 1px solid black; + background-color: #f9f9f9; +} + +div#headerbox { + height: 400px; + background-image: url(graphics/header.jpg); + border-bottom: 1px solid black; +} + +div#menubox { + border-bottom: 1px solid black; + /*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; +} + +div#footerbox { + background-color: #4e7dac; + border-bottom: 1px solid black; + padding: 5px 0 5px 0; + text-align: center; + font-size: 10px; + color: white; + margin-bottom: 20px; +} + +input, textarea, select { + border: 1px solid black; + padding: 1px; +} +select option { padding-right: 10px; } +textarea.textfield { width: 100%; max-width: 350px; height: 100px; } + +ul { + margin-left: 20px; + list-style-type: circle; +} + +li { + margin-left: 20px; +} + +.hidden { display: none; } + +th { padding: 0 1px 0 1px; } + +h1 { + padding-top: 10px; + margin-left: 20px; + color: white; + font-size: 3.3em; + font-family: sans-serif; +} + +div#headerbox p { + color: white; + margin-top: 0px; + margin-left: 20px; + font-size: 1.5em; + font-family: sans-serifl; +} + +h2 { + margin: 5px; + margin-bottom: 15px; + border-bottom: 1px dotted black; +} + +h3 { + margin-bottom: 10px; + margin-left: 10px; +} + +p { margin: 15px; } +div.event_info { margin: 0 15px 5px 15px; } +p.event_date { background: url(event_date_icon.png) left center no-repeat; line-height: 20px; padding-left: 25px; } + +a { color: black; text-decoration: none; } +a:hover { text-decoration: underline; } + +a.email_all { + margin-left: 70px; + padding-left: 30px; + line-height: 25px; + background: white url(mail_all.jpg) no-repeat left center; +} +a.csv_download { margin-left: 70px; padding-left: 30px; line-height: 25px; background: url(csv_icon.gif) no-repeat left center; display: block; } + +ul.user_list { + list-style-image: url(user_small.gif); +} + +.event_name { + background: url(event.jpg) no-repeat left center; + padding-left: 40px; +} +h2.event_name { line-height: 50px; } +h3.event_name { line-height: 40px; } + +h3.signup { + background: url(signup.gif) no-repeat left center; + padding-left: 45px; + line-height: 45px; +} + +table.fieldset { margin-left: 30px; } +div.asterisk { margin-left: 30px; font-size: 10px; } + +h3.signup_people { + background: url(group.jpg) no-repeat left center; + padding-left: 55px; + line-height: 50px; + margin-top: 15px; +} + +table.signups, div.signups { width: 90%; margin: 30px auto;} +table.signups tr th { } +table.signups tr th, tr td { text-align: left; padding: 1px 4px 1px 4px; } + +p.edit_link { + padding: 10px; + border: 1px dotted black; + padding-left: 30px; + background: url(edit.jpg) no-repeat 10px center; +} + +.add_event { + line-height: 50px; + padding-left: 50px; + background: url(add_event.png) no-repeat left center; +} + +.edit_event { + padding-left: 20px; + background: url(edit.jpg) no-repeat left center; +} + +.login { + line-height: 50px; + padding-left: 50px; + background: url(login.gif) no-repeat left center; +} + +.password_forgotten { + line-height: 42px; + padding-left: 50px; + background: url(password_forgotten.gif) no-repeat left center; +} + +.edit_user { + line-height: 50px; + padding-left: 50px; + background: url(edit_user.png) no-repeat left center; +} + +.settings { + line-height: 50px; + padding-left: 50px; + background: url(settings.jpg) no-repeat left center; +} + +.user { + line-height: 50px; + padding-left: 50px; + background: url(group.jpg) no-repeat left center; +} + +a.editenum { display: block; height: 20px; line-height: 20px; width: 20px; font-size: 0px; padding: 8px; background: url(edit.jpg) left center no-repeat; color: #FFF; } + +.fahrt{ + padding: 30px; +} + +.fahrttable { + display: table; +} + +.fahrttable div { + display: table-row; +} + +.fahrt a, .fahrttitle { + margin-bottom: 15px; + border-bottom: 1px dotted black; + margin-left: -10px; + float: none !important; + font-weight: bold; + font-size: 1.5em; +} + +.message{ + margin: 5px; + padding: 5px; + font-size: 10pt; + border: 1px solid; + text-align:left; + color: #4F8A10; + background-color: #DFF2BF; +} +.error{ + color: #D8000C; + 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; +} +