diff options
Diffstat (limited to 'functions.php')
| -rw-r--r-- | functions.php | 48 |
1 files changed, 43 insertions, 5 deletions
diff --git a/functions.php b/functions.php index eba19f9..17c2ce3 100644 --- a/functions.php +++ b/functions.php @@ -146,10 +146,31 @@ function print_list($option = false){ lredirect("liste"); global $db; global $c; + global $moar; + + $moar->addHeader('<style>'.file_get_contents("static/tablesorter.min.css").'</style>'); + $moar->addFooter('<script src="/js/tablesorter.min.js" defer></script> + <script> +$(document).ready(function(){ + $(function(){ + $("table").tablesorter(); + }); + + var table = $("table"); + table.bind("sortEnd",function() { + var i = 1; + table.find("tr:gt(0)").each(function(){ + $(this).find("td:eq(0)").text(i); + i++; + }); + }); +}); + </script> + '); $result = $db->doQuery("SELECT * FROM " . DBPREFIX . "member;"); ?> - <h1>Adress Liste</h1> + <h1>Adressliste</h1> <?php if ( $option == "update"){ ?> @@ -191,9 +212,11 @@ function print_list($option = false){ <?php $count = 1; while ( $row = $result->fetch_array(MYSQLI_ASSOC) ){ + $surname = explode(" ", $row['name']); + $surname = $surname[ count($surname) - 1 ]; echo "<tr> <td>$count</td> - <td>".htmlentities($row['name'])."</td> + <td><span class=\"hidden\">".htmlentities($surname)."</span>".htmlentities($row['name'])."</td> <td>".htmlentities($row['adresse'])."</td> <td>".htmlentities($row['telefonnummer'])."</td> <td>".htmlentities($row['handynummer'])."</td> @@ -564,6 +587,9 @@ function print_account($option = false){ </form> <br> <p><strong>Mit * markierte Felder sind Pflichtfelder.</strong></p> +<h3>Log dich aus</h3> +<hr> +<a href="/?page=logout" class="btn btn-danger"><span class="glyphicon glyphicon-off"></span> Logout</a> </div> <?php } @@ -735,7 +761,8 @@ function show_gallery(){ <li><a href="#change" role="tab" onclick="$('#modal-edit-gallery').modal('show');"><span class="glyphicon glyphicon-cog"></span> Ändern</a></li> <li><a href="#new" role="tab" onclick="$('#modal-new-gallery').modal('show')"><span class="fa fa-plus"></span> Neu</a></li> <li><a href="#delete" role="tab" onclick="$('#modal-delete-gallery').modal('show')"><span class="glyphicon glyphicon-trash"></span> Löschen</a></li> - <li><a href="/?page=downloadGallery&gallery=<?php echo htmlentities($_GET["gallery"]); ?>" role="tab"><i class="fa fa-download"></i> + <li><a class="download" href="/?page=action&task=downloadGallery&gallery=<?php echo htmlentities($_GET["gallery"]); ?>" role="tab"><i class="fa fa-download"></i> + <?php if ( isset($row['name']) && ! $c->exists2(CACHEPREFIX . $_GET["gallery"]) ) $c->set2(CACHEPREFIX . $_GET["gallery"], $row['name']); ?> Download</a></li> </ul> <div class="tab-content"> @@ -745,7 +772,7 @@ function show_gallery(){ <!-- Start Tab 'Gallery' --> <div class="tab-pane active effect" id="galerie"> -<div id="blueimp-gallery" class="blueimp-gallery" data-use-bootstrap-modal="false"> +<div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-use-bootstrap-modal="false"> <!-- The container for the modal slides --> <div class="slides"></div> <!-- Controls for the borderless lightbox --> @@ -779,7 +806,7 @@ function show_gallery(){ </div> </div> <?php - if ( $c->exists( CACHEPREFIX . "gallery_imagelinks_" . $_SESSION["gallery"] ) ){ + if ( $c->exists2( CACHEPREFIX . "gallery_imagelinks_" . $_SESSION["gallery"] ) ){ echo $c->get2( CACHEPREFIX . "gallery_imagelinks_" . $_SESSION["gallery"] ); } else { ob_start(); @@ -794,6 +821,11 @@ function show_gallery(){ echo "</div>"; } else { echo "<h4>Keine Bilder in der aktuellen Gallerie vorhanden!</h4>"; + $c->set2(CACHEPREFIX . "gallery_no_download_" . $_SESSION["gallery"], 1); + $moar->addFooter('<script>$(".download").addClass("disabled"); + $("body").on("click", "a.disabled", function(event){ + event.preventDefault(); + });</script>'); } $c->set2( CACHEPREFIX . "gallery_imagelinks_" . $_SESSION["gallery"], ob_get_contents() ); ob_end_flush(); @@ -804,6 +836,12 @@ function show_gallery(){ <?php } elseif ( $_GET["mode"] == "upload" ){ $moar->addFooter('<script src="/js/upload.min.js" defer></script>'); + //$moar->addFooter('<script src="/js/upload.js" defer></script>'); + if ( $c->exists2(CACHEPREFIX . "gallery_no_download_" . $_SESSION["gallery"]) ) + $moar->addFooter('<script>$(".download").addClass("disabled"); + $("body").on("click", "a.disabled", function(event){ + event.preventDefault(); + });</script>'); ?> <!-- Start Tab 'Upload' --> <div class="tab-pane active effect" id="upload"> |
