Skip to content

Commit

Permalink
Merge pull request #37 from TimRepke/reglistSorting
Browse files Browse the repository at this point in the history
Reglist sorting
  • Loading branch information
TimRepke committed Oct 17, 2015
2 parents 3649690 + a069c32 commit 7a1a6df
Show file tree
Hide file tree
Showing 8 changed files with 198 additions and 183 deletions.
3 changes: 2 additions & 1 deletion registration-system/admin/pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ function page_stuff()

function page_front(){
global $text, $config_baseurl, $config_current_fahrt_id;
$text .= '<style>#admin-content{padding:0}</style>';
$text .= '<a href="'.$config_baseurl.'?fid='.$config_current_fahrt_id.'">'.$config_baseurl.'?fid='.$config_current_fahrt_id.'</a><br />';
$text .= '<iframe src="'.$config_baseurl.'?fid='.$config_current_fahrt_id.'" style="height:100%; width:100%;"></iframe>';
$text .= '<iframe src="'.$config_baseurl.'?fid='.$config_current_fahrt_id.'" style="height:90vh; width:100%; position: absolute; border:0;"></iframe>';
}

function page_list(){
Expand Down
40 changes: 24 additions & 16 deletions registration-system/admin/pages_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
$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>
<script type="text/javascript" src="../view/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../view/js/jquery.dataTables.1.10.9.min.js"></script>
END;
$headers .= "
<style type='text/css'>
Expand Down Expand Up @@ -242,28 +242,24 @@
}
$text .= "<br />";

$text .=<<<END
$text .= '
<table id="mlist" class="compact hover">
<thead>
<tr>
END;
foreach($columnFunctions as $key => $value)
{
<tr>';
foreach($columnFunctions as $key => $value) {
$text .= "<th>".$key."</th>";
}
$text .=<<<END
</tr>
$text .="<th></th></tr>
</thead>
<tbody>
END;
<tbody>";

$people = $admin_db->select('bachelor',$columns, array("fahrt_id"=>$config_current_fahrt_id));
foreach($people as $person) {
$text .= "<tr>"; //".((explode(',',$columnFunctions['PaidReBack']($person))[2]==0) ? "" : "class='list-backstepped'")."
$text .= "<tr>\n"; //".((explode(',',$columnFunctions['PaidReBack']($person))[2]==0) ? "" : "class='list-backstepped'")."
foreach($columnFunctions as $key => $value) {
$text .= "<td class='".$key.((explode(',',$columnFunctions['PaidReBack']($person))[2]==0) ? '' :
' list-backstepped')."'>".$value($person)."</td>";
$text .= "<td class='".$key."'>".$value($person)."</td>\n";
}
$text .= "<td>".((explode(',',$columnFunctions['PaidReBack']($person))[2]==0) ? '0' : '1')."</td>";
$text .= "</tr>";
}

Expand All @@ -284,13 +280,11 @@
,
"prb-pre": function ( a ){
var tmp = a.split(",");
//alert();
return ((tmp[0]==0) ? '0' : '1') + ((tmp[1]==0) ? '0' : '1') + ((tmp[2]==0) ? '0' : '1');
}
,
"dedate-pre": function(a){
var tmp = a.split(".");
console.log(tmp[2]+tmp[1]+tmp[0]);
if(tmp.length>2)
return (tmp[2]+tmp[1]+tmp[0]);
return a;
Expand All @@ -299,6 +293,13 @@
var ltab;
$(document).ready(function(){
ltab = $('#mlist').DataTable({
"fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) {
var tmp = aData[$buttoncol].split(',');
if (tmp[2] > 0) {
$('td',nRow).addClass('list-backstepped');
}
return nRow;
},
"aoColumnDefs": [
{
"aTargets": [ $buttoncol ],
Expand Down Expand Up @@ -327,9 +328,11 @@
},
{ type: 'dedate', targets: [1,5,6]},
{ type: 'link', targets: [0, 2] },
{ type: 'prb', targets: $buttoncol }
{ type: 'prb', targets: $buttoncol },
{ targets: 12, visible: false, searchable: false },
],
"order": [[ 2, "asc" ]],
"orderFixed": [ 12, 'asc' ],
"paging": false
});
Expand Down Expand Up @@ -362,6 +365,11 @@ function btnclick(that, type, hash, state){
var newstate = (((state-1)<0) ? 1 : 0);
$.get("index.php?page=list&ajax=ajax&update="+type+"&hash="+hash+"&nstate="+newstate ,"",
function(){
if(newstate === 1) {
$('td',$(that).parent().parent()).addClass('list-backstepped');
} else {
$('td',$(that).parent().parent()).removeClass('list-backstepped');
}
that.className="btn btn-"+type+"-"+newstate;
that.setAttribute("onclick", "btnclick(this, '"+type+"', '"+hash+"', "+newstate+")");
});
Expand Down
4 changes: 2 additions & 2 deletions registration-system/admin/pages_mail.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@

$text .= '<textarea style="height:300px; width:800px" id="mails">'.$dsa;
foreach($mails as $mehl){
$text .= "\"".$mehl['forname']." ".$mehl['sirname']."\" ".$mehl['mehl']."; ";
$ajax .= "\"".$mehl['forname']." ".$mehl['sirname']."\" ".$mehl['mehl']."; ";
$text .= $mehl['forname']." ".$mehl['sirname']." <".$mehl['mehl'].">; ";
$ajax .= $mehl['forname']." ".$mehl['sirname']." <".$mehl['mehl'].">; ";
}
$text .= '</textarea>';

Expand Down
2 changes: 1 addition & 1 deletion registration-system/admin/pages_wl.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
$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>
<script type="text/javascript" src="../view/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../view/js/jquery.dataTables.1.10.9.min.js"></script>
END;

$text .= "<h1>Warteliste</h1>";
Expand Down
2 changes: 1 addition & 1 deletion registration-system/config.local.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
$config_admin_verbose_level = 0;

// URL where site is hosted with trailing slash
$config_baseurl = "localhost/fsfahrt"; //"http://fsfahrt.repke.eu/anmeldung/registration-system/";
$config_baseurl = "http://localhost/fsfahrt"; //"http://fsfahrt.repke.eu/anmeldung/registration-system/";

// absolute path to doc root withOUT trailing slash
$config_basepath = __DIR__; //"/var/www/vhosts/fsfahrt.repke.eu/httpdocs/anmeldung/registration-system";
Expand Down
12 changes: 5 additions & 7 deletions registration-system/view/admin_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ html,body {
height:100%
}
body{
margin-top: 40px;
height:100%;
}

Expand Down Expand Up @@ -42,15 +41,14 @@ table {
}

#admin-content{
left: 0;
right: 0;
bottom: 0;
height: auto;
position: relative;
/*width: 100%;*/
top: 0;
position: absolute;
width: auto;
left:0; right:0;
top: 40px; bottom: 0;
display: block;
margin: 0;
padding: 0 10px;
}
#logout{
float:right;
Expand Down
Loading

0 comments on commit 7a1a6df

Please sign in to comment.