Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • fsini-informatik/fsfahrttool
  • kleemeis/fsfahrttool
2 results
Show changes
Showing
with 4321 additions and 34 deletions
This diff is collapsed.
<table class="cost-table">
<thead>
<tr>
<th>Position - {{io}}</th>
<th>Summe</th>
<th ng-show="tform.$visible"></th>
</tr>
</thead>
<tbody>
<!-- extra -->
<tr ng-repeat="(key,row) in extra">
<td>{{row.pos || "&nbsp;" }}</td>
<td class="cost-table-numeric">{{row.val || 0 | currency}}</td>
<td ng-show="tform.$visible"></td>
</tr>
<!-- editable stuff -->
<tr ng-repeat="row in col | filter:filterRow">
<td>
<span editable-text="row.pos" e-form="tableform" e-ng-change="chang(row, 'pos', $data)">
{{row.pos || "&nbsp;" }}
</span>
</td>
<td class="cost-table-numeric">
<span editable-text="row.val" e-form="tableform" e-style="width: 35pt" e-ng-change="chang(row, 'val', $data)">
{{row.val || 0 | currency}}
</span>
</td>
<td ng-show="tform.$visible" style="vertical-align: bottom;"><button type="button" ng-click="$parent.$parent.deleteRow(io,$index)" class="button-delete">del</button></td>
</tr>
</tbody>
</table>
<button type="button" ng-disabled="tform.$waiting" ng-show="tform.$visible" ng-click="$parent.addRow(col)" class="button-add">add row</button>
\ No newline at end of file
<form editable-form name="tableform" onaftersave="saveTable()" oncancel="cancel()" onshow="prepareForm()">
<table class="table-moneyio">
<tr>
<td>
<table-moneyio-col col="table.entries.in" extra="table.extra.in" io="in" tform="tableform"></table-moneyio-col>
</td>
<td>
<table-moneyio-col col="table.entries.out" extra="table.extra.out" io="out" tform="tableform"></table-moneyio-col>
</td>
<td></td>
<td></td>
</tr>
<tr>
<td class="cost-table-numeric table-moneyio-sum">{{ moneyioDataService.colSum(table.entries.in, table.extra.in) | currency }}</td>
<td class="cost-table-numeric table-moneyio-sum">{{ moneyioDataService.colSum(table.entries.out, table.extra.out) | currency }}</td>
<td class="cost-table-numeric table-moneyio-sum" ng-class="{red:'red-text', yellow:'yellow-text', green: 'green-text'}[moneyioDataService.diffColor(table.extra)]" data-type="info" data-title="Differenz (Prognose)" bs-tooltip>{{ moneyioDataService.diff(table.extra) | currency }}</td>
<td class="cost-table-numeric table-moneyio-sum" ng-class="{red:'red-text', yellow:'yellow-text', green: 'green-text'}[moneyioDataService.diffRColor(table.extra)]" data-type="info" data-title="Differenz (Real)" bs-tooltip>{{ moneyioDataService.diffR(table.extra) | currency }}</td>
</tr>
</table>
<!-- buttons -->
<div class="btn-edit">
<button type="button" class="button-edit" ng-show="!tableform.$visible" ng-click="tableform.$show()">edit</button>
</div>
<div class="btn-form" ng-show="tableform.$visible">
<button type="submit" ng-disabled="tableform.$waiting" class="button-save">save</button> |
<button type="button" ng-disabled="tableform.$waiting" ng-click="tableform.$cancel()" class="button-cancel">cancel</button>
</div>
</form>
<div class="debug" style="margin-top: 30px;">
{{ table.entries || "&nbsp;" | json }}
</div>
<div class="debug" style="margin-top: 30px;">
{{ table.extra || "&nbsp;" | json }}
</div>
\ No newline at end of file
<div ng-show="table.editmode" class="pages-cost-edit">
<div style="float: left">
<table>
<thead>
<tr>
<th>&nbsp;</th>
<th>Tag 1</th>
<th>Tag 2</th>
<th>Tag 3</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="(key,row) in table.edit.VAR">
<td>{{table.bez[key]}}</td>
<td ng-repeat="col in row">
<input ng-model="col.val" type="input" name="{{key}}.val" />
<input ng-model="col.ind" type="checkbox" name="{{key}}.ind" data-placement="top-left" data-type="info" data-title="{{tooltip.ind.title}}" bs-tooltip />
<input ng-model="col.an" type="checkbox" name="{{key}}.an" data-placement="top-left" data-type="info" data-title="{{tooltip.an.title}}" bs-tooltip />
<input ng-model="col.ab" type="checkbox" name="{{key}}.ab" data-placement="top-left" data-type="info" data-title="{{tooltip.ab.title}}" bs-tooltip />
</td>
</tr>
<tr class="deviderrow"><td colspan="4"></td></tr>
<tr ng-repeat="(key,val) in table.edit.ALL">
<td>{{table.bez[key]}}</td>
<td colspan="3">
<input ng-model="val" type="text" name="{{key}}" ng-change="table.editUpdateAll(val,'{{key}}')" />
</td>
</tr>
<tr>
<td>(Vorkasse)</td>
<td colspan="3">
<input ng-model="table.amount" type="text" name="table.amount" />
</td>
</tr>
</tbody>
</table>
<button type="button" ng-click="table.saveTable()" class="button-save">save</button> |
<button type="button" ng-click="table.cancelTable()" class="button-cancel">cancel</button>
</div>
<div style="float: left; margin-left: 20px; width: 400px;">
<table-price-helper></table-price-helper>
</div>
<div style="clear: both"></div>
<div class="debug" style="margin-top: 30px;">
{{ table.edit | json }}
</div>
</div>
\ No newline at end of file
<h2 style="margin-top: 0">Hilfsrechner</h2>
Zu verteilende Posten wählen: <span ng-click="resetty(table.io)">[reset]</span><br />
<br />
IN:
<ul style="list-style: none;">
<li ng-repeat="entry in table.io.in">
<input type="checkbox" ng-model="entry.neg" data-placement="top-left" data-type="info" data-title="negative" bs-tooltip />
<label><input type="checkbox" ng-model="entry.selected" /> {{entry.pos}} ({{entry.val || 0 | currency}})</label>
</li>
</ul>
OUT:
<ul style="list-style: none;">
<li ng-repeat="entry in table.io.out">
<input type="checkbox" ng-model="entry.neg" data-placement="top-left" data-type="info" data-title="negative" bs-tooltip />
<label><input type="checkbox" ng-model="entry.selected" /> {{entry.pos}} ({{entry.val || 0 | currency}})</label>
</li>
</ul>
<label>Sontiges: <input type="text" style="width: 30pt" ng-model="special" /></label><br />
<br />
Einschränken auf:<br />
<label><input type="radio" ng-model="cnt" value="{{table.cnt.geman}}"> gemeinsam hin</label>
<label><input type="radio" ng-model="cnt" value="{{table.cnt.gemab}}"> gemeinsam rück</label><br />
<label><input type="radio" ng-model="cnt" value="{{table.cnt.all}}" ng-selected="{{table.cnt.all}}"> none</label><br />
<br />
Gewählte Summe: {{summy(table.io) || 0 | currency}}<br />
Anzahl Personen: {{cnt}} <br />
Betrag pro Person: {{meaner(table.io) || 0 | currency}}<br />
<!--<label><input type="radio" ng-model="round" value="{{table.round.up}}"> Aufrunden</label>
<label><input type="radio" ng-model="round" value="{{table.round.dwn}}" ng-selected="{{table.round.dwn}}"> Abrunden</label>-->
\ No newline at end of file
<div ng-show="table.listmode" class="pages-cost-list">
<div class="pages-cost-list-topbar"><p ng-click="table.toggleListmode()">X</p></div>
<div class="pages-cost-list-content">
<button type="button" ng-click="toggleDetails()" class="button-magnify">Details</button><br />
<br />
<div ng-repeat="(key,col) in table.list" style="float: left; width: 460px; border-right: 1px dashed #d3d3d3; padding: 10px 15px">
<h1>{{key}}</h1>
<table >
<thead>
<tr>
<th style="width: 30%; text-align: left;">Name + ID</th>
<th style="width: 70%; text-align: left;">Details</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in col">
<td>{{row.name}} ({{row.id}})</td>
<td>
<strong>{{row.pay.val || 0 | currency}}</strong> ({{row.pay.rval || 0 | currency}})<br />
{{row.person.von}} <br />
({{row.person.antyp}})<br />
{{row.person.bis}}<br />
({{row.person.abtyp}})<br />
<br />
<ul ng-repeat="entry in row.pay.pos" ng-show="showdetails">
<li>{{entry.pos}}: {{entry.val || 0 | currency}}</li>
</ul>
</td>
</tr>
</tbody>
</table>
</div>
<div class="debug" style="margin-top: 30px;">
{{ otherDataService.getPaymentList() | json }}
</div>
</div>
</div>
\ No newline at end of file
<table class="cost-table">
<thead>
<tr>
<th>Position</th>
<th>Anzahl (normal)</th>
<th>Satz (est)</th>
<th>Summe</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in dataService.calc">
<td>{{row.pos}}</td>
<td class="cost-table-numeric">{{row.cnt()}}</td>
<td class="cost-table-numeric">{{row.val() | currency}}</td>
<td class="cost-table-numeric">{{row.sum() | currency}}</td>
</tr>
<tr>
<td>(Vorkasse)</td>
<td></td>
<td></td>
<td>{{table.amount || 0 | currency}}</td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="cost-table-invisible"></td>
<td class="cost-table-invisible"></td>
<td class="cost-table-invisible"></td>
<td>{{dataService.sum() | currency}}</td>
</tr>
</tfoot>
</table>
<button type="button" ng-click="table.editTable()" class="button-edit" ng-hide="table.editmode" >edit</button>
<table-price-edit></table-price-edit>
<button type="button" ng-click="table.listPay()" class="button-list" ng-hide="table.listmode">Liste</button>
<table-price-list></table-price-list>
<div class="debug" style="margin-top: 30px;">
{{ table.base || "&nbsp;" | json }}
</div>
<div class="debug" style="margin-top: 30px;">
{{ dataService.base || "&nbsp;" | json }}
</div>
\ No newline at end of file
<form editable-form name="tableform" onaftersave="saveTable()" oncancel="cancel()" onshow="prepareForm()">
<table class="cost-table" id="">
<thead>
<tr>
<th>Position</th>
<th>Menge</th>
<th>Anzahl</th>
<th>Satz</th>
<th>Summe</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in table.entries | filter:filterRow">
<td>
<span editable-text="row.pos" e-form="tableform" e-ng-change="chang($index, 'pos', $data)">
{{ row.pos || '&nbsp;' }}
</span>
</td>
<td class="cost-table-numeric" >
<span editable-text="row.cnt" e-form="tableform" e-style="width: 20pt" e-ng-change="chang($index, 'cnt', $data)">
{{ row.cnt || 1 }}
</span>
</td>
<td class="cost-table-numeric" >
<span editable-text="row.mul" e-form="tableform" e-style="width: 20pt" e-ng-change="chang($index, 'mul', $data)">
{{ row.mul || 1 }}
</span>
</td>
<td class="cost-table-numeric" >
<span editable-text="row.price" e-form="tableform" e-style="width: 30pt" e-ng-change="chang($index, 'price', $data)">
{{ row.price || 0 | currency}}
</span>
</td>
<td class="cost-table-numeric" >{{ dataService.rowSum(row) | currency}}</td>
<td><button type="button" ng-show="tableform.$visible" ng-click="deleteRow($index)" class="button-delete">del</button></td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="cost-table-invisible"></td>
<td class="cost-table-invisible"></td>
<td class="cost-table-invisible"></td>
<td class="cost-table-invisible"></td>
<td>{{dataService.sum() | currency}}</td>
<td></td>
</tr>
</tfoot>
</table>
<!-- buttons -->
<div class="btn-edit">
<button type="button" class="button-edit" ng-show="!tableform.$visible" ng-click="tableform.$show()">edit</button>
</div>
<div class="btn-form" ng-show="tableform.$visible">
<button type="button" ng-disabled="tableform.$waiting" ng-click="addRow()" class="button-add">add row</button> |
<button type="submit" ng-disabled="tableform.$waiting" class="button-save">save</button> |
<button type="button" ng-disabled="tableform.$waiting" ng-click="tableform.$cancel()" class="button-cancel">cancel</button>
</div>
</form>
<div class="debug" style="margin-top: 30px;">
{{ table.entries || "&nbsp;" | json }}
</div>
<div class="debug" style="margin-top: 30px;">
{{ dataService.entries || "&nbsp;" | json }}
</div>
\ No newline at end of file
<form editable-form name="tableform" onaftersave="saveTable()" oncancel="cancel()" onshow="prepareForm()">
<table class="cost-table">
<thead>
<tr>
<th>Position</th>
<th>Anzahl</th>
<th>Satz</th>
<th>Summe</th>
<th></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="row in table.entries | filter:filterRow">
<td>
<span editable-text="row.pos" e-form="tableform" e-ng-change="chang($index, 'pos', $data)">
{{ row.pos || '&nbsp;' }}
</span>
</td>
<td class="cost-table-numeric">
<span editable-text="row.cnt" e-form="tableform" e-style="width: 20pt" e-ng-change="chang($index, 'cnt', $data)">
{{ row.cnt || 1 }}
</span>
</td>
<td class="cost-table-numeric">
<span editable-text="row.price" e-form="tableform" e-style="width: 30pt" e-ng-change="chang($index, 'price', $data)">
{{row.price || 0 | currency}}
</span>
</td>
<td class="cost-table-numeric">{{dataService.rowSum(row) | currency}}</td>
<td><button type="button" ng-show="tableform.$visible" ng-click="deleteRow($index)" class="button-delete">del</button></td>
</tr>
</tbody>
<tfoot>
<tr>
<td class="cost-table-invisible"></td>
<td class="cost-table-invisible"></td>
<td class="cost-table-invisible"></td>
<td>{{dataService.sum() | currency}}</td>
<td></td>
</tr>
</tfoot>
</table>
<!-- buttons -->
<div class="btn-edit">
<button type="button" class="button-edit" ng-show="!tableform.$visible" ng-click="tableform.$show()">edit</button>
</div>
<div class="btn-form" ng-show="tableform.$visible">
<button type="button" ng-disabled="tableform.$waiting" ng-click="addRow()" class="button-add">add row</button> |
<button type="submit" ng-disabled="tableform.$waiting" class="button-save">save</button> |
<button type="button" ng-disabled="tableform.$waiting" ng-click="tableform.$cancel()" class="button-cancel">cancel</button>
</div>
</form>
<div class="debug" style="margin-top: 30px;">
{{ table.entries || "&nbsp;" | json }}
</div>
<div class="debug" style="margin-top: 30px;">
{{ dataService.entries || "&nbsp;" | json }}
</div>
\ No newline at end of file
<?php
class AdminExportPage extends AdminPage {
private $text = '';
private $headers = '';
private $header = '';
private $footer = '';
private static $ALLOWED_PAGES = ['refra', 'treff', 'konto', 'mord', 'room', 'unter'];
public function __construct($base) {
parent::__construct($base);
try {
if (!isset($_REQUEST['ex']) or array_search($_REQUEST['ex'], AdminExportPage::$ALLOWED_PAGES) === false)
throw new Exception('Invalide Seite!');
$exportFunction = 'export' . ucfirst($_REQUEST['ex']);
$this->$exportFunction();
$this->template = AdminPage::TEMPLATE_PRINT_FULL;
} catch (Exception $e) {
$this->exportDefault();
}
}
public function getHeaders() {
return $this->headers;
}
public function getHeader() {
return $this->header;
}
public function getFooter() {
return $this->footer;
}
public function getText() {
return $this->text;
}
public function getAjax() {
return '';
}
private function exportDefault() {
$k = [];
$k = array_keys($this->environment->oconfig['studitypen']);
array_unshift($k,'ALLE');
$this->text = '
<ul>
<li><a href="?page=export&ex=refra" target="_blank">RefRat-Liste</a> (<a href="http://www.refrat.hu-berlin.de/finanzen/TeilnehmerInnenlisteMitEinverstaendniserklaerung.pdf">orig</a>)</li>
<li><a href="?page=export&ex=treff" target="_blank">Treffpunktanwesenheitsliste</a></li>
<li><a href="?page=export&ex=konto" target="_blank">Kontodatenliste</a></li>
<li><a href="#" onClick="openMord()">Mörderspiel</a>
Erstis <input type="checkbox" checked id="e" value="Erstis"/>
Hörstis <input type="checkbox" checked id="h" value="Hoers"/>
Mentoren <input type="checkbox" checked id="m" value="Mento"/>
</li>
<li><a href="?page=export&ex=room" target="_blank">Zimmerliste</a></li>
<li><a href="?page=export&ex=unter" target="_blank">Anwesenheitsunterschriftsliste für Unterkunft</a></li>
<li><a href="http://www.refrat.de/docs/finanzen/FormularFSErstattung_sepa_form_2.pdf">Erstattungsformular</a></li>
</ul>
NOTE: No Chrome support! Webkit/Blink haven\'t implemented support for @media print... This feature is developed to support Firefox.
<script>
function openMord() {
var x = (document.querySelector("#e").checked)? "e":"-";
var y = (document.querySelector("#h").checked)? "h":"-";
var z = (document.querySelector("#m").checked)? "m":"-";
window.open("?page=export&ex=mord&studitypen="+x+y+z);
}
</script>
';
}
private function exportRefra() {
$people = $this->fahrt->getBachelors(['backstepped' => false, 'waiting' => false], ['forname'=> 'ASC']);
$data = $this->fahrt->getFahrtDetails();
$tabdata = [];
foreach ($people as $p) {
array_push($tabdata, [$p['forname'] . ' ' . $p['sirname'], '', '']);
}
// leerfelder (just in case)
for ($run = 0; $run < 8; $run++) {
array_push($tabdata, ['&nbsp;', '&nbsp;', '&nbsp;']);
}
$tabconf = ['colwidth' => ['20%', '55%', '25%'],
'cellheight' => '35pt'];
$this->text = $this->tableGenerator(['Name', 'Anschrift', 'Unterschrift'], $tabdata, $tabconf);
$this->header = '
<h1>TeilnehmerInnenliste und Einverständniserklärung</h1>
<h2>Fachschaftsfahrt</h2>
Fachschaft: <u>Informatik</u><br />
Ziel: <u>' . $data['ziel'] . '</u><br />
Datum der Fahrt: <u>' . $this->mysql2german($data['von']) . ' - ' . $this->mysql2german($data['bis']) . '</u><br />
Hiermit erklären wir uns mit unserer Unterschrift damit einverstanden, dass das von uns
ausgelegten Geld für die Fachschaftsfahrt auf das Konto des/der Finanzverantwortlichen/r,
<u>' . $data['leiter'] . '</u>, überwiesen wird.';
$this->footer = 'Einverstädniserklärung - ' . $data['titel'];
}
private function exportTreff() {
$data = $this->fahrt->getFahrtDetails();
$people = $this->fahrt->getBachelors(['antyp' => 'BUSBAHN', 'waiting' => false, 'backstepped' => false], ['forname'=> 'ASC']);
$ttabdata = [];
foreach ($people as $p) {
array_push($ttabdata, $p['forname'] . ' ' . $p['sirname']);
}
// leerfelder (just in case)
for ($run = 0; $run < 8; $run++) {
array_push($ttabdata, '&nbsp;');
}
$tabdata = [];
// transpose long list to have multiple columns
for ($run = 0; $run < count($ttabdata); $run++) {
$c1 = (isset($ttabdata[$run]) ? $ttabdata[$run] : '&nbsp;');
$run++;
$c2 = (isset($ttabdata[$run]) ? $ttabdata[$run] : '&nbsp;');
$run++;
$c3 = (isset($ttabdata[$run]) ? $ttabdata[$run] : '&nbsp;');
array_push($tabdata, [$c1, '&nbsp;', '', $c2, '&nbsp;', '', $c3, '&nbsp;']);
}
$tabconf = ['colwidth' => ['20%', '10pt', '1px; margin:0; padding:0; font-size:1pt', '20%', '10pt', '1px; margin:0; padding:0; font-size:1pt', '20%', '10pt'],
'cellheight' => '30pt'];
$this->text = $this->tableGenerator(['Name', 'X', '', 'Name', 'X', '', 'Name', 'X'], $tabdata, $tabconf);
$this->header = '
<h1>Anwesenheitsliste Treffpunkt</h1>
Liste aller Teilnehmer, die angegeben haben, gemeinsam mit Bus/Bahn anzureisen';
$this->footer = 'Anwesenheitsliste - ' . $data['titel'];
}
private function exportKonto() {
$data = $this->fahrt->getFahrtDetails();
$people = $this->fahrt->getBachelors(['waiting' => false, 'backstepped' => false], ['forname'=> 'ASC']);
$tabdata = [];
foreach ($people as $p) {
array_push($tabdata, [$p['forname'] . ' ' . $p['sirname'],
'<img src="iban.png" align="middle">',
'<img src="kontonr.png" align="middle">',
'&nbsp;', '&nbsp;']);
}
// leerfelder (just in case)
for ($run = 0; $run < 8; $run++) {
array_push($tabdata, ['&nbsp;', '&nbsp;', '&nbsp;', '&nbsp;', '&nbsp;']);
}
$tabconf = ['colwidth' => ['25%', '30%', '25%', '15%', '5%'],
'cellheight' => '30pt',
'class' => [3 => 'graycell', 4 => 'graycell']];
$this->text = $this->tableGenerator(['Name', 'Kontonummer/IBAN', 'Bankleitzahl/BIC', 'Betrag*', 'Erl*'], $tabdata, $tabconf);
$this->header = '
<h1>Kontodaten für Rücküberweisung</h1>
Diese Liste verbleibt bei dem/der Fahrtverantwortlichen <u>' . $data['leiter'] . '</u> und wird benötigt um die Förderung und den Differenzbetrag nach der Fahrt zurück zu überweisen.<br />
<b>Graue/mit Sternchen gekennzeichnete Fehler freilassen</b> (Trolle bekommen kein Geld!!)';
$this->footer = 'Kontodaten (Rücküberweisung) - ' . $data['titel'];
}
function cmp($a, $b) {
if(strcmp($a->forname,$b->forname)==0) {
if(strcmp($a->sirname==$b->sirname)==0) {
return 0;
}else{
return (strcmp($a->forname,$b->forname)<0) ? -1 : 1;
}
}
return (strcmp($a->forname,$b->forname)<0) ? -1 : 1;
}
private function exportMord() {
$preInstruction = '<u>Mordvorschlag:</u> ';
$instructions = ['Gib deinem Opfer in einem Moment des Verlusts der Aufmerksamkeit einen Gegenstand um es umzubringen und melde es dem Spielleiter.',
'Verrühre 2 Eier, 80g Mehl, 20g Zucker, 120ml Milch, 2 TL Backpulver; backe Waffeln daraus und gib eine davon deinem Opfer.',
'"Hast du schon ein Knicklicht..?"',
'Borge dir einen Stift von deinem Opfer und gib ihn zurück.',
'Kannst du mir Mal bitte kurz die Taschenlampe halten?',
'Verwechslungsgefahr: Deinem Opfer ein Rad geben zählt, einen Rat geben allerdings nicht.',
'Leih dir das Telefon deines Opfers um "mamamameine Mutter anzurufen" und gib es zurück.',
'Sammle die Wimper deines Opfers ein und händige sie über mit der Bitte sich etwas zu wünschen um dein Opfer zu ermorden. Wimper darf nicht ausgerissen werden. Andere pustbare Dinge auch erlaubt. ',
'Hilf deinem Opfer bei einer Übungsaufgabe und gib den Stift zurück um es umzubringen.',
'Das ist ein Testeintrag. Der dient nicht als echter Mordauftrag.'];
$postInstruction = ' <i>Das darf nicht erzwungen werden; keine Zeugen.</i>';
$data = $this->fahrt->getFahrtDetails();
if (false/*isset($_REQUEST['studitypen'])*/) {
$builder = '';
$people = [];
$people = $this->fahrt->getBachelors(['waiting' => false, 'backstepped' => false, 'mGame' => true], ['forname'=> 'ASC']);
/* if(strpos($_REQUEST['studitypen'], "e")!==false) {
$people = array_merge($people, $this->fahrt->getBachelors(['waiting' => false, 'backstepped' => false, 'mGame' => true, 'studityp' => 'ERSTI'], ['forname'=> 'ASC']));
}
if(strpos($_REQUEST['studitypen'], "h")!==false) {
$people = array_merge($people, $this->fahrt->getBachelors(['waiting' => false, 'backstepped' => false, 'mGame' => true, 'studityp' => 'HOERS'], ['forname'=> 'ASC']));
}
if(strpos($_REQUEST['studitypen'], "m")!==false) {
$people = array_merge($people, $this->fahrt->getBachelors(['waiting' => false, 'backstepped' => false, 'mGame' => true, 'studityp' => 'MENTO'], ['forname'=> 'ASC']));
}*/
// print_r($people);
usort($people, function ($a, $b) {
if(strcasecmp($a['forname'],$b['forname'])==0) {
if(strcasecmp($a['sirname'],$b['sirname'])==0) {
return 0;
}else{
return (strcasecmp($a['forname'],$b['forname'])<0) ? -1 : 1;
}
}
return (strcasecmp($a['forname'],$b['forname'])<0) ? -1 : 1;
});
}else{
$people = $this->fahrt->getBachelors(['waiting' => false, 'backstepped' => false, 'mGame' => true], ['forname'=> 'ASC']);
}
$tabdata = [];
foreach ($people as $p) {
array_push($tabdata, [$p['forname'] . " " . $p['sirname'], '&nbsp;', '&nbsp;', '&nbsp;']);
}
$tabconf = ['colwidth' => ['25%', '20%', '20%', '35%'], 'cellheight' => '30pt'];
$people = array_map(function ($piece) {
return $piece[0];
}, $tabdata);
shuffle($people);
$this->text = $this->tableGenerator(['Opfer', 'Zeitpunkt', 'Mörder', 'Tathergang'], $tabdata, $tabconf) .
'<div class="page-break"></div>
<div style="page-break-inside: avoid;"><h1>Cheatsheet</h1><p>' . implode('&nbsp;->&nbsp;', $people) .
'</p></div>';
for ($i = 1; $i <= count($people); $i++) {
$this->text .= '<div class="killbox">
<span role="killer">' . $people[$i - 1] . '</span>
<span role="victim">' . $people[$i % count($people)] . '</span>
<p role="instruction">'.
$preInstruction . $instructions[array_rand($instructions)] .
$postInstruction.
'</p></div>';
}
$this->header = '
<h1>Mordaufträge und Übersicht</h1>
Fröhliches Morden! Bitte keine tödlichen Gegenstände benutzen.';
$this->footer = 'Mörderspiel - ' . $data['titel'];
}
private function exportRoom() {
$this->text = '
<script type="text/javascript">
function updateRoomCnt(val) {
var table = document.getElementById("roomtab").getElementsByTagName("tbody")[0];
table.innerHTML = "";
for(var i = 0; i < val; i++) {
var row = table.insertRow(table.rows.length);
row.insertCell(0).style.height="30pt";
row.insertCell(1);
row.insertCell(2);
row.insertCell(3);
row.insertCell(4);
row.insertCell(5);
}
}
</script>
<p class="hide-print">Anzahl Zimmer: <input type="number" id="roomcnt" value="10" onchange="updateRoomCnt(this.value)" /><br>
Hint: Es kann sinnvoll sein ein paar mehr Spalten zu generieren als nötig.</p>';
$tabconf = [
'colwidth' => ['16%', '10%', '10%', '30%', '12%', '12%'],
'cellheight' => '30pt',
'id' => 'roomtab'
];
$this->text .= $this->tableGenerator(['Haus/ Etage/ Raum', '# Betten', '# Schlüssel', 'Verantwortlich', 'Erhalten', 'Zurück'], [], $tabconf);
$data = $this->fahrt->getFahrtDetails();
$this->header = '
<h1>Übersicht der Schlüssel</h1>
Mit der Unterschrift in der Spalte "Erhalten" bestätigt die Person, angegeben in der Spalte "Verantwortlich", den/die
Schlüssel zum entsprechenden Raum erhalten zu haben. Bei Verlust des Schlüssels oder Schäden im Zimmer wird diese
Person Rechenschaft tragen.
In der Spalte "Zurück" bestätigt der/die Organisator/in der Fahrt (' . $data['leiter'] . ') den Schlüssel wieder in Empfang genommen zu haben.<br>
Diese Liste ist gültig für die Fahrt "' . $data['titel'] . '" nach "' . $data['ziel'] . '" von ' . $data['von'] . ' bis ' . $data['bis'] . '.';
$this->footer = 'Schlüsselliste - ' . $data['titel'];
}
private function exportUnter() {
$data = $this->fahrt->getFahrtDetails();
$people = $this->fahrt->getBachelors(['backstepped' => false, 'waiting' => false], ['forname'=> 'ASC']);
$tabdata = [];
foreach ($people as $p) {
array_push($tabdata, [$p['forname'] . ' ' . $p['sirname'], '&nbsp;', '&nbsp;']);
}
// leerfelder (just in case)
for ($run = 0; $run < 8; $run++) {
array_push($tabdata, ['&nbsp;', '&nbsp;', '&nbsp;']);
}
$tabconf = ['colwidth' => ['20%', '25%', '55%'],
'cellheight' => '20pt'];
$this->text = $this->tableGenerator(['Name', 'Unterschrift', '&nbsp;'], $tabdata, $tabconf);
$this->header = '
<h1>TeilnehmerInnenliste</h1>
<h2>Fachschaftsfahrt</h2>
Fachschaft: <u>Informatik</u><br />
Datum der Fahrt: <u>' . $this->mysql2german($data['von']) . ' - ' . $this->mysql2german($data['bis']) . '</u><br />
Verantwortlicher: <u>' . $data['leiter'] . '</u><br />
Liste aller Teilnehmer der Fachschaftsfahrt in der Einrichtung <u>' . $data['ziel'] . '</u>';
$this->footer = 'TeilnehmerInnenliste - ' . $data['titel'];
}
private function tableGenerator($headers, $data, $tabconf = []) {
$thead = '';
foreach ($headers as $cell => $h) {
$thead .= '<th ' . $this->tableGeneratorCellStyle($tabconf, $cell) . '>' . $h . '</th>';
}
$tbody = '';
foreach ($data as $row) {
$tbody .= '<tr>';
foreach ($row as $cell => $dc) {
$tbody .= '<td' . $this->tableGeneratorCellStyle($tabconf, $cell) . '>' . $dc . '</td>';
}
$tbody .= '</tr>';
}
return '
<table class="dattable" '. (isset($tabconf['id']) ? 'id="'.$tabconf['id'].'"' : '') . '">
<thead>
<tr>' . $thead . '</tr>
</thead>
<tbody>' . $tbody . '</tbody>
</table>';
}
private function tableGeneratorCellStyle($tabconf, $cell) {
$ret = '';
if (isset($tabconf['cellheight']) || isset($tabconf['colwidth']) || isset($tabconf['class'])) {
$ret .= ' style="';
if (isset($tabconf['cellheight']))
$ret .= 'height:' . $tabconf['cellheight'] . ';';
if (isset($tabconf['colwidth']) && isset($tabconf['colwidth'][$cell]))
$ret .= 'width:' . $tabconf['colwidth'][$cell] . ';';
$ret .= '""';
if (isset($tabconf['class']) && isset($tabconf['class'][$cell]))
$ret .= ' class="' . $tabconf['class'][$cell] . '"';
}
return $ret;
}
}
<?php
class AdminInfosPage extends AdminPage {
public function __construct($base) {
parent::__construct($base);
if (isset($_POST['note-content'])) {
try {
$this->fahrt->set(['beschreibung' => $_REQUEST['note-content'],
'titel' => $_REQUEST['titel'],
'von' => $_REQUEST['von'],
'bis' => $_REQUEST['bis'],
'ziel' => $_REQUEST['ziel'],
'map_pin' => $_REQUEST['us2-lat'] . ' ' . $_REQUEST['us2-lon'],
'leiter' => $_REQUEST['leiter'],
'kontakt' => $_REQUEST['kontakt'],
'max_bachelor' => $_REQUEST['max_bachelor'],
'regopen' => isset($_REQUEST['regopen']) ? 1 : 0,
'wikilink' => $_REQUEST['wikilink'],
'paydeadline' => $_REQUEST['paydeadline'],
'payinfo' => $_REQUEST['payinfo'],
'opentime' => $_REQUEST['opentime'],
'disclaimlink' => $_REQUEST['disclaimlink'],
'isSummer' => isset($_REQUEST['isSummer']) ? 1 : 0
]);
$saveResult = $this->fahrt->save();
if (empty($saveResult)) {
$this->message_err = 'Speichern fehlgeschlagen...';
} else {
$this->message_succ = 'Gespeichert.';
}
} catch (Exception $e) {
$this->message_err = 'Fehler aufgetreten: ' . $e->getMessage();
}
}
}
public function getHeaders() {
global $config_use_openstreetmap;
return '<!-- wysihtml5 parser rules -->
<script src="../view/js/wysihtml5-0.3.0_rc2.min.js"></script>
<!-- Library -->
<script src="../view/js/wysihtml5-advanced.js"></script>
<script src="../view/js/jquery-1.11.1.min.js"></script>
<script src="../view/js/jquery-ui.min.js"></script>
<script src="../view/js/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="'.(
$config_use_openstreetmap
? 'https://openlayers.org/api/OpenLayers.js'
: 'https://maps.google.com/maps/api/js?sensor=false&libraries=places'
).'"></script>
<script src="../view/js/locationpicker.jquery.js"></script>
<link type="text/css" rel="stylesheet" href="../view/jquery-ui/jquery-ui.min.css" />
<link type="text/css" rel="stylesheet" href="../view/css/jquery.datetimepicker.css" />
<link type="text/css" rel="stylesheet" href="../view/css/wysihtml5/stylesheet.css" />
<style type="text/css">
body {
min-height: 100%;
padding-top: 40px !important;
padding-left: 10px !important;
}
section{
position: relative;
top: inherit;
bottom: inherit;
width: inherit;
}
.formlist li{
margin: 8px 10px;
clear: both;
height: 30px;
}
.formlist input, .formlist textarea {
float: right;
width: 300px;
}
.formlist label{
float:left;
}
</style> ';
}
public function getHeader() {
return '';
}
public function getFooter() {
return '';
}
public function getText() {
global $config_use_openstreetmap;
$data = $this->fahrt->getFahrtDetails();
if ($data['opentime'] == 0) $data['opentime'] = time();
$pin = explode(" ", $data["map_pin"]);
$summer = ($data["isSummer"] == 1) ? "checked" : "";
$regopen = ($data["regopen"] == 1) ? "checked" : "";
return $this->getMessage().<<<EOF
<h2>Informationen</h2>
<section>
<form method="POST" style="height:300px;">
<div style="float:left">
<input type="submit" name="submit" value="submit" class="submit-button" />
<p></p>
<ul class="formlist">
<li><label>Titel</label>
<input type="text" name="titel" id="titel" value="${data["titel"]}" /></li>
<li><label>Ziel</label>
<input type="text" name="ziel" id="ziel" value="${data["ziel"]}" /></li>
<li><label>Von</label>
<input type="text" name="von" id="von" value="${data["von"]}" /></li>
<li><label>Bis</label>
<input type="text" name="bis" id="bis" value="${data["bis"]}" /></li>
<li><label>Anmeldung ab</label>
<input type="text" name="opentime" id="opentime" value="${data["opentime"]}" /></li>
<li><label>Anm. offen</label>
<input type="checkbox" name="regopen" id="regopen" value="penis" $regopen /></li>
<li><label>Max TN</label>
<input type="number" name="max_bachelor" id="max_bachelor" value="${data["max_bachelor"]}" /></li>
<li><label>Leiter</label>
<input type="text" name="leiter" id="leiter" value="${data["leiter"]}" /></li>
<li><label>E-Mail</label>
<input type="text" name="kontakt" id="kontakt" value="${data["kontakt"]}" /></li>
<li><label>Wiki-Link</label>
<input type="text" name="wikilink" id="wikilink" value="${data["wikilink"]}" /></li>
<li><label>Disclaimer-Link</label>
<input type="text" name="disclaimlink" id="disclaimlink" value="${data["disclaimlink"]}" /></li>
<li><label>Zahlung bis</label>
<input type="text" name="paydeadline" id="paydeadline" value="${data["paydeadline"]}" /></li>
<li><label>Zahlungsdetails</label>
<textarea style="border:1px dotted grey;height: 6em; padding: 0 0 0 0.4em" rows="4" name="payinfo" id="payinfo">${data["payinfo"]}</textarea></li>
<li><br><label>Ist eine Sommerfahrt</label>
<input type="checkbox" name="isSummer" id="isSummer" value="penis" $summer /></li>
</ul>
</div>
<div style="float:left">
GPS Coords: <input type="text" id="us2-address" value="${pin[0]} ${pin[1]}" style="width: 350px"/>
<div id="us2" style="width: 500px; height: 353px;"></div>
<input type="hidden" id="us2-lat" name="us2-lat" value="${pin[0]}" />
<input type="hidden" id="us2-lon" name="us2-lon" value="${pin[1]}" />
<script>
EOF
.($config_use_openstreetmap
?<<<EOF
var map = new OpenLayers.Map("us2");
var maplayer = new OpenLayers.Layer.OSM();
map.addLayer(maplayer);
var zoom=10;
var target = new OpenLayers.LonLat(parseFloat(${pin[1]}), parseFloat(${pin[0]}))
.transform(
new OpenLayers.Projection("EPSG:4326"), // transform from WGS 1984
map.getProjectionObject() // to Spherical Mercator Projection
);
var markers = new OpenLayers.Layer.Markers("Markers");
map.addLayer(markers);
var marker = new OpenLayers.Marker(target);
markers.addMarker(marker);
map.setCenter(target, zoom);
map.events.register("click", map, function(e) {
// WORKAROUND: map.getLonLatFromPixel returns the wrong coordinates unless a zoom occurred
map.setCenter(void 0, map.zoom-1);
map.setCenter(void 0, map.zoom+1);
var position = map.getLonLatFromPixel(e.xy).transform(
map.getProjectionObject(), // to Spherical Mercator Projection,
new OpenLayers.Projection("EPSG:4326") // transform from WGS 1984
);
// WORKAROUND: moveTo fails if there is no map object assigned to the marker
marker.map = map;
marker.moveTo(e.xy);
$('#us2-address').val(position.lat+' '+position.lon);
$('#us2-lat').val(position.lat);
$('#us2-lon').val(position.lon);
});
EOF
:<<<EOF
$('#us2').locationpicker({
location: {latitude: ${pin[0]}, longitude: ${pin[1]}},
radius:0,
inputBinding: {
latitudeInput: $('#us2-lat'),
longitudeInput: $('#us2-lon'),
locationNameInput: $('#us2-address')
}
});
$(function() {
$( "#von" ).datepicker( { dateFormat: "yy-mm-dd"} );
$( "#bis" ).datepicker( { dateFormat: "yy-mm-dd"} );
$( "#opentime" ).datetimepicker( { format: "unixtime" } );
$( "#paydeadline" ).datepicker( { dateFormat: "yy-mm-dd"} );
});
EOF
).<<<EOF
</script>
</div>
<div style="clear:both"></div>
<br />
<div id="wysihtml5-editor-toolbar">
<header>
<ul class="commands">
<li data-wysihtml5-command="bold" title="Make text bold (CTRL + B)" class="command"></li>
<li data-wysihtml5-command="italic" title="Make text italic (CTRL + I)" class="command"></li>
<li data-wysihtml5-command="insertUnorderedList" title="Insert an unordered list" class="command"></li>
<li data-wysihtml5-command="insertOrderedList" title="Insert an ordered list" class="command"></li>
<li data-wysihtml5-command="createLink" title="Insert a link" class="command"></li>
<li data-wysihtml5-command="insertImage" title="Insert an image" class="command"></li>
<li data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1" title="Insert headline 1" class="command"></li>
<li data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h2" title="Insert headline 2" class="command"></li>
<li data-wysihtml5-command-group="foreColor" class="fore-color command" title="Color the selected text">
<ul>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="silver"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="gray"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="maroon"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="red"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="purple"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="green"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="olive"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="navy"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="blue"></li>
</ul>
</li>
<li data-wysihtml5-command="insertSpeech" title="Insert speech" class="command"></li>
<li data-wysihtml5-action="change_view" title="Show HTML" class="action"></li>
</ul>
</header>
<div data-wysihtml5-dialog="createLink" style="display: none;">
<label>
Link:
<input data-wysihtml5-dialog-field="href" value="http://">
</label>
<a data-wysihtml5-dialog-action="save">OK</a>&nbsp;<a data-wysihtml5-dialog-action="cancel">Cancel</a>
</div>
<div data-wysihtml5-dialog="insertImage" style="display: none;">
<label>
Image:
<input data-wysihtml5-dialog-field="src" value="http://">
</label>
<a data-wysihtml5-dialog-action="save">OK</a>&nbsp;<a data-wysihtml5-dialog-action="cancel">Cancel</a>
</div>
</div>
<textarea name="note-content" id="wysihtml5-editor" spellcheck="false" wrap="off" placeholder="Enter your text ...">${data["beschreibung"]}</textarea>
</form>
</section>
<script>
var editor = new wysihtml5.Editor("wysihtml5-editor", {
toolbar: "wysihtml5-editor-toolbar",
stylesheets: ["../view/css/wysihtml5/editor.css"],
parserRules: wysihtml5ParserRules
});
editor.on("load", function() {
var composer = editor.composer,
h1 = editor.composer.element.querySelector("h1");
if (h1) {
composer.selection.selectNode(h1);
}
});
</script>
EOF;
}
public function getAjax() {
return '';
}
}
<?php
class AdminJumpOfPage extends AdminPage {
public function __construct($base) {
parent::__construct($base);
if (isset($_REQUEST['change'])) {
try {
$bNew = Bachelor::makeFromForm(false, $this->fahrt, true, true);
$bNew->set(['bachelor_id' => $_REQUEST['change']]);
// print_r($bNew->getData());
$bOld = Bachelor::makeFromDB($this->fahrt, $_REQUEST['change']);
// print_r($bOld->getData());
$bOld->updateBachelor($bNew);
$saveResult = $bOld->save();
if ($saveResult !== Bachelor::SAVE_SUCCESS)
throw new Exception('Fehler beim Speichern mit code ' . $saveResult.'<br />'.implode('<br />', $b->getValidationErrors()));
else
$this->message_succ = 'Bachelor mit ID '.$_REQUEST['change'].' Erfolgreich gespeichert';
} catch (Exception $e) {
$this->message_err = $e->getMessage();
}
}
if (isset($_REQUEST['delete'])) {
$this->environment->database->delete('bachelor', ['AND' => ['bachelor_id' => $_REQUEST['delete'], 'fahrt_id'=>$_REQUEST['fahrt_id']]]);
}
}
public function getHeaders() {
return '<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>
<script type="text/javascript" src="../view/js/jquery.dataTables.1.10.12.min.js"></script>
<style type="text/css">
div.btn{
width: 18px;
height: 18px;
padding: 3px 5px;
background-image: url("../view/graphics/MyEbaySprite.png");
background-repeat: no-repeat;
float: left;
cursor: pointer;
}
.btn-paid-0{
background-position: -23px -90px;
}
.btn-paid-1{
background-position: -70px -90px;
}
.btn-repaid-0{
background-position: -148px -89px;
}
.btn-repaid-1{
background-position:-194px -89px;
}
.btn-backstepped-0{
background-position: -51px -169px;
}
.btn-backstepped-1{
background-position: -23px -169px;
}
#editForm{
display: none;
position: fixed;
top:100px;
left: 200px;
width: 700px;
height: 80%;
border: 1px solid #000000;
background-color: beige;
padding: 20px 10px 10px 10px;
}
#editForm>p{
display: block;
position:absolute;
height:auto;
bottom:0;
top:0;
left:0;
right:0;
overflow: auto;
padding: 10px;
margin: 20px 0 0 0;
}
#editFormTopbar{
background-color: #b0bed9;
height: 20px;
position: absolute;
top: 0;
left: 0;
right: 0;
padding: 0;
}
#editFormTopbar p{
position: absolute;
float: right;
top: 0;
padding: 0;
margin: 0;
right: 5px;
cursor: none;
height: 20px;
display: block;
}
</style>';
}
public function getHeader() {
return '';
}
public function getFooter() {
return '';
}
public function getText() {
$cols = ['Anmelde-ID','Anmeldung','Name','Anreisetyp','Abreisetyp', 'Anreisetag','Abreisetag', 'Studityp', 'PaidReBack', 'BackAt'];
$buttoncol = count($cols)-2;
$thead = '';
$toggle = 'Toggle Column:';
foreach ($cols as $tcnt => $col) {
$thead .= '<th>'.$col.'</th>';
$toggle .= '<a class="toggle-vis" data-column="' . $tcnt . '">' . $col . '</a> - ';
}
$people = $this->fahrt->getBachelors(['waiting'=>false]);
$tbody = '';
foreach ($people as $b) {
if(!$b['backstepped']) {
continue;
}
$tbody .= '
<tr>
<td><a href="#" style="color:black !important;" class="edit_bachelor">'.$b['bachelor_id'].'</a></td>
<td>'.$this->mysql2german($b['anm_time']).'</td>
<td><a href="mailto:'.$b['mehl'].'?subject=FS-Fahrt">' . $b['forname'] . ' ' . $b['sirname'] . ' (' . $b['pseudo'] . ')</a></td>
<td>'.$b['antyp'].'</td>
<td>'.$b['abtyp'].'</td>
<td>'.$this->mysql2german($b['anday']).'</td>
<td>'.$this->mysql2german($b['abday']).'</td>
<td>'.$b['studityp'].'</td>
<td>'.($b['paid'] ? $b['paid'] : '0') . ',' . ($b['repaid'] ? $b['repaid'] : '0') . ',' . ($b['backstepped'] ? $b['backstepped'] : '0').'</td>
<td>'.date('d.m.Y - G:i.s', $b['backstepped']).'</td>
<td>'.($b['backstepped'] ? 1 : '0').'</td>
</tr>';
}
return '<h1>Abspringer Liste</h1>' .
$this->getMessage().'<br />' .
$toggle.'<br />
<br />
<table id="mlist" class="compact hover">
<thead>
<tr>'.$thead.'<th></th></tr>
</thead>
<tbody>'.$tbody.'</tbody>
</table>
<div id="editForm">
<div id="editFormTopbar"><p>X</p></div>
<p></p>
</div>
<script type="text/javascript">
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"link-pre": function ( a ) {
return a.match(/<a [^>]+>([^<]+)<\/a>/)[1];
},
"prb-pre": function ( a ) {
var tmp = a.split(",");
return ((tmp[0]==0) ? "0" : "1") + ((tmp[1]==0) ? "0" : "1") + ((tmp[2]==0) ? "0" : "1");
},
"dedate-pre": function( a ) {
var tmp = a.split(".");
if(tmp.length>2)
return (tmp[2]+tmp[1]+tmp[0]);
return a;
}
});
var ltab;
$(document).ready(function(){
ltab = $("#mlist").DataTable({
"rowCallback": function (row, data, index) {
var spl = data['.$buttoncol.'].split(",");
if (spl[2] != 0) {
$("td", row).addClass("list-backstepped");
} else if (spl[0] != 0 && spl[1] != 0) {
$("td", row).addClass("list-repaid");
} else if (spl[0] != 0) {
$("td", row).addClass("list-paid");
} else if (spl[0] == 0) {
$("td", row).addClass("list-unpaid");
}
},
"columnDefs": [
{
"targets": ['.$buttoncol.'],
"render": function(data, type, row, meta) {
if (type === "display"){
var bid = row[0].match(/<a [^>]+>([^<]+)<\/a>/)[1];
var classes = ["paid", "repaid", "backstepped"];
var btns = "";
var parts = data.split(",");
for (var i = 0; i < parts.length; i++) {
var tmp = (parts[i] ==0) ? 0 : 1;
btns +="<div onclick=\\"btnclick(this, \'"+classes[i]+"\',\'"+bid+"\',"+tmp+");\\" class=\\"btn btn-"+classes[i]+"-"+tmp+"\\">&nbsp;</div>";
}
return btns;
}
return data;
}
},
{ type: "dedate", targets: [1,5,6]},
{ type: "link", targets: [0, 2] },
{ type: "prb", targets: ' . $buttoncol . ' },
{ targets: 10, visible: false, searchable: false }
],
"order": [[ 2, "asc" ]],
"paging": false,
"orderFixed": [ 8, "asc" ]
});
$("a.toggle-vis").click( function (e) {
e.preventDefault();
// Get the column API object
var column = ltab.column( $(this).attr("data-column") );
// Toggle the visibility
column.visible( ! column.visible() );
});
$(".moveToWaitlist").click( function(){
var bid = $(this).closest("tr").find("td:eq(0)").text();
$.get( "?page=jumpOf&ajax=ajax&toWaitlist=toWaitlist&hash="+bid, function( data ) {});
});
$(".edit_bachelor").click( function(){
var bid = $(this).text();
$.get( "?page=jumpOf&ajax=ajax&form=form&hash="+bid, function( data ) {
$("#editForm > p").html(data);
});
$("#editForm").show();
});
$("#editFormTopbar > p").click( function(){
$(this).parent().parent().hide();
});
});
function btnclick(that, type, hash, state){
var newstate = (((state-1)<0) ? 1 : 0);
$.get("index.php?page=jumpOf&ajax=ajax&update="+type+"&hash="+hash+"&nstate="+newstate ,"",
function(){
that.className="btn btn-"+type+"-"+newstate;
that.setAttribute("onclick", "btnclick(this, \'"+type+"\', \'"+hash+"\', "+newstate+")");
var p = $("div", $(that).parent())[0].className;
var r = $("div", $(that).parent())[1].className;
var b = $("div", $(that).parent())[2].className;
if (b == "btn btn-backstepped-1") {
updateClass(that, "list-backstepped");
} else if (p == "btn btn-paid-1" && r == "btn btn-repaid-1") {
updateClass(that, "list-repaid");
} else if (p == "btn btn-paid-1") {
updateClass(that, "list-paid");
} else if (p == "btn btn-paid-0") {
updateClass(that, "list-unpaid");
} else {
updateClass(that);
}
});
}
function updateClass(that, nClass = null) {
$("td", $(that).parent().parent()).removeClass("list-backstepped")
.removeClass("list-repaid")
.removeClass("list-paid")
.removeClass("list-unpaid");
if(nClass != null)
$("td", $(that).parent().parent()).addClass(nClass);
}
</script>';
}
public function getAjax() {
if (isset($_REQUEST['update']) && isset($_REQUEST['hash']) && isset($_REQUEST['nstate'])) {
$b = Bachelor::makeFromDB($this->fahrt, $_REQUEST['hash']);
$b->set([$_REQUEST['update'] => ($_REQUEST['nstate'] == 1) ? time() : null]);
return $b->save();
} elseif (isset($_REQUEST['form'])) {
return $this->getEditForm(Bachelor::makeFromDB($this->fahrt, $_REQUEST['hash']));
} elseif(isset($_REQUEST['toWaitlist'])) {
try {
$bachelor = Bachelor::makeFromDB($this->fahrt, $_REQUEST['hash']);
if (empty($bachelor))
throw new Exception('Person nicht vorhanden.');
$transferResult = $bachelor->registrationToWaitlist();
if ($transferResult == Bachelor::SAVE_SUCCESS) {
$this->message_succ = 'Person erfolgreich von Warteliste auf Anmeldeliste übertragen.';
return true;
} else {
throw new Exception('Hat nicht geklappt. Fehlercode '.$transferResult);
}
} catch (Exception $e) {
$this->message_err = $e->getMessage();
}
}
}
private function nulltime2german($time) {
if (empty($time)) return 'Nein';
return $this->mysql2german($time);
}
/**
* @param $bachelor Bachelor
* @return string
*/
private function getEditForm($bachelor) {
$data = $bachelor->getData();
$bid = $data['bachelor_id'];
$fid = $data['fahrt_id'];
$possibleDates = $this->fahrt->getPossibleDates();
return '
<b>Hash:</b> <a href="../status.php?fid='.$fid.'&hash='.$bid.'" target="_blank">' . $bid . '</a><br/>
<b>Fahrt:</b> ID ' . $fid . '<br/>
<b>Anmeldung:</b> ' . $this->mysql2german($data['anm_time']) . '<br/>
<b>Bezahlt:</b> ' . $this->nulltime2german($data['paid']) . '<br/>
<b>Rückgezahlt:</b> ' . $this->nulltime2german($data['repaid']) . '<br/>
<b>Zurückgetreten:</b> ' . $this->nulltime2german($data['backstepped']) . '<br/>
<br /><hr /> <br/>
<form method="POST" >
Note: Keine Nachfrage, löscht direkt und unwiederruflich!!<br />
<input type="submit" name="submit_del" value="DELETE" />
<input type="hidden" name="delete" value="' . $bid . '" />
<input type="hidden" name="bachelor_id" value="' . $bid . '" />
<input type="hidden" name="fahrt_id" value="' . $fid . '" />
</form>';
}
}
This diff is collapsed.
This diff is collapsed.
<?php
class AdminNotesPage extends AdminPage {
public function __construct($base) {
parent::__construct($base);
if (isset($_POST['note-content'])) {
$cont = $_REQUEST['note-content'];
if ($this->environment->database->has('notes', ['fahrt_id' => $this->fahrt->getID()]))
$this->environment->database->update('notes', ['note' => $cont], ['fahrt_id' => $this->fahrt->getID()]);
else
$this->environment->database->insert('notes', ['note' => $cont, 'fahrt_id' => $this->fahrt->getID()]);
}
$this->content = $this->environment->database->get('notes', 'note', ['fahrt_id' => $this->fahrt->getID()]);
}
public function getHeaders() {
return "<!-- wysihtml5 parser rules -->
<script src=\"../view/js/wysihtml5-0.3.0_rc2.min.js\"></script>
<!-- Library -->
<script src=\"../view/js/wysihtml5-advanced.js\"></script>
<link type='text/css' rel='stylesheet' href='../view/css/wysihtml5/editor.css' />
<link type='text/css' rel='stylesheet' href='../view/css/wysihtml5/stylesheet.css' />
<style type='text/css'>
body {
/*width: 810px;*/
min-height: 100%;
/*margin: 0 auto;*/
padding-top: 40px !important;
padding-left: 10px !important;
}
#admin-content{
height: 100% !important;
}
</style>";
}
public function getHeader() {
return '';
}
public function getFooter() {
return '';
}
public function getText() {
return '
<div id="wysihtml5-editor-toolbar">
<header>
<ul class="commands">
<li data-wysihtml5-command="bold" title="Make text bold (CTRL + B)" class="command"></li>
<li data-wysihtml5-command="italic" title="Make text italic (CTRL + I)" class="command"></li>
<li data-wysihtml5-command="insertUnorderedList" title="Insert an unordered list" class="command"></li>
<li data-wysihtml5-command="insertOrderedList" title="Insert an ordered list" class="command"></li>
<li data-wysihtml5-command="createLink" title="Insert a link" class="command"></li>
<li data-wysihtml5-command="insertImage" title="Insert an image" class="command"></li>
<li data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h1" title="Insert headline 1" class="command"></li>
<li data-wysihtml5-command="formatBlock" data-wysihtml5-command-value="h2" title="Insert headline 2" class="command"></li>
<li data-wysihtml5-command-group="foreColor" class="fore-color command" title="Color the selected text">
<ul>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="silver"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="gray"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="maroon"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="red"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="purple"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="green"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="olive"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="navy"></li>
<li data-wysihtml5-command="foreColor" data-wysihtml5-command-value="blue"></li>
</ul>
</li>
<li data-wysihtml5-command="insertSpeech" title="Insert speech" class="command"></li>
<li data-wysihtml5-action="change_view" title="Show HTML" class="action"></li>
</ul>
</header>
<div data-wysihtml5-dialog="createLink" style="display: none;">
<label>
Link:
<input data-wysihtml5-dialog-field="href" value="http://">
</label>
<a data-wysihtml5-dialog-action="save">OK</a>&nbsp;<a data-wysihtml5-dialog-action="cancel">Cancel</a>
</div>
<div data-wysihtml5-dialog="insertImage" style="display: none;">
<label>
Image:
<input data-wysihtml5-dialog-field="src" value="http://">
</label>
<a data-wysihtml5-dialog-action="save">OK</a>&nbsp;<a data-wysihtml5-dialog-action="cancel">Cancel</a>
</div>
</div>
<section><form method="POST" style="height:100%">
<input type="submit" name="submit" value="submit" class="submit-button" />
<textarea name="note-content" id="wysihtml5-editor" spellcheck="false" wrap="off" placeholder="Enter your text ...">' .
$this->content .
'</textarea></form></section>
<script>
var editor = new wysihtml5.Editor("wysihtml5-editor", {
toolbar: "wysihtml5-editor-toolbar",
stylesheets: ["../view/css/wysihtml5/editor.css"],
parserRules: wysihtml5ParserRules
});
editor.on("load", function() {
var composer = editor.composer,
h1 = editor.composer.element.querySelector("h1");
if (h1) {
composer.selection.selectNode(h1);
}
});
</script>';
}
public function getAjax() {
return '';
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
<?php
if (true) {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
}
$config_databse_debug = false;
// URL where site is hosted with trailing slash
$config_baseurl = "http://localhost/fsfahrt/registration-system/";
// absolute path to doc root withOUT trailing slash
$config_basepath = __DIR__;
$config_impressum = 'https://fachschaft.informatik.hu-berlin.de/index.php/Fachschaft_Informatik:Impressum';
// database config
$config_db = [
"name" => "fsfahrt", // name of DB
"user" => "fsfahrt", // username
"pass" => "9Lug*96q", // password
"host" => "localhost", // host
"type" => "mysql" // type of DB - only tested with mysql (so better not change)!!
];
$config_use_openstreetmap = true;
registration-system/favicon.ico

766 B

This diff is collapsed.