Version 2
This commit is contained in:
112
pagecontent/list.php
Normal file
112
pagecontent/list.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<div class="fixed-title">
|
||||
<h2>
|
||||
|
||||
<?php
|
||||
|
||||
$sql = "SELECT
|
||||
`value`
|
||||
FROM
|
||||
`VokabelBox2Content`
|
||||
WHERE
|
||||
`id` = '$list'";
|
||||
$result_articles = $conn->query($sql);
|
||||
while ($articleDb = mysqli_fetch_object($result_articles))
|
||||
{
|
||||
echo $articleDb->value;
|
||||
}
|
||||
|
||||
$sql = "SELECT
|
||||
`value`
|
||||
FROM
|
||||
`VokabelBox2Content`
|
||||
WHERE
|
||||
`id` = '$lang'";
|
||||
$result_articles = $conn->query($sql);
|
||||
while ($articleDb = mysqli_fetch_object($result_articles))
|
||||
{
|
||||
$language = $articleDb->value;
|
||||
}
|
||||
|
||||
|
||||
$conn->query("UPDATE `VokabelBox2Content` SET `lastedit`=now() WHERE `id` = '$list' AND `type` = 'list'");
|
||||
|
||||
|
||||
?>
|
||||
|
||||
</h2>
|
||||
<button onclick="getContent('learn','start','scrollRight')">Lernen <i class="fas fa-caret-right"></i></button>
|
||||
</div>
|
||||
<div class="fixed-title-spacer">
|
||||
<div class="folder-view-wrapper">
|
||||
<div class="view-settings">
|
||||
<div class="sorting">
|
||||
<button onclick="$('.sorting>div').css({'opacity':'1','pointer-events':'all'});">Sortieren nach: <?php if($_SESSION["orderBy"] == 'name') { print("Name"); }if($_SESSION["orderBy"] == 'lastAccess' || $_SESSION["orderBy"] == '') { print("Zuletzt bearbeitet"); }if($_SESSION["orderBy"] == 'lastCreated') { print("Zuletzt hinzugefügt"); } ?> <i class="fas fa-sort"></i></button>
|
||||
<div>
|
||||
<div onclick="getContent('action:orderBy','lastAccess','',function() { getContent('list','','fade'); });">Zuletzt bearbeitet (standard) <i class="fas fa-sort-amount-down"></i></div>
|
||||
<div onclick="getContent('action:orderBy','name','',function() { getContent('list','','fade'); });">Name <i class="fas fa-sort-alpha-down"></i></div>
|
||||
<div onclick="getContent('action:orderBy','lastCreated','',function() { getContent('list','','fade'); });">Zuletzt hinzugefügt <i class="fas fa-sort-numeric-down"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="voklist default">
|
||||
<div class="head">
|
||||
<div>Deutsch</div>
|
||||
<div><?php if(isset($language)) {echo $language;} else {echo "Sprache 2";} ?></div>
|
||||
</div>
|
||||
<?php
|
||||
|
||||
if($_SESSION["orderBy"] == 'name') {
|
||||
|
||||
$sql = "SELECT
|
||||
`value`
|
||||
FROM
|
||||
`VokabelBox2Content`
|
||||
WHERE
|
||||
`type` = 'voc' AND `path` LIKE '$userid/lang/$list/' ORDER BY `value` ASC";
|
||||
|
||||
}
|
||||
|
||||
if($_SESSION["orderBy"] == 'lastAccess' || $_SESSION["orderBy"] == '') {
|
||||
|
||||
$sql = "SELECT
|
||||
`value`
|
||||
FROM
|
||||
`VokabelBox2Content`
|
||||
WHERE
|
||||
`type` = 'voc' AND `path` LIKE '$userid/lang/$list/' ORDER BY `lastedit` DESC";
|
||||
|
||||
}
|
||||
|
||||
if($_SESSION["orderBy"] == 'lastCreated') {
|
||||
|
||||
$sql = "SELECT
|
||||
`value`
|
||||
FROM
|
||||
`VokabelBox2Content`
|
||||
WHERE
|
||||
`type` = 'voc' AND `path`LIKE '$userid/lang/$list/' ORDER BY `create_timestamp` DESC";
|
||||
|
||||
}
|
||||
|
||||
$result_articles = $conn->query($sql);
|
||||
while ($articleDb = mysqli_fetch_object($result_articles))
|
||||
{
|
||||
|
||||
$voc = json_decode($articleDb->value, true);
|
||||
|
||||
$n = intval($voc[0]['progress']) + 1;
|
||||
?>
|
||||
<div>
|
||||
<div><?php echo $voc[0]['1']; ?></div>
|
||||
<div class="progress-indicator _<?php echo $n; ?>"></div>
|
||||
<div><?php echo $voc[0]['2']; ?></div></div>
|
||||
<?php
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user