Added group_page functions for the admin page

This commit is contained in:
Lars van Hijfte
2017-01-17 14:44:20 +01:00
parent faebda3368
commit 5812eb9b49
2 changed files with 63 additions and 9 deletions

View File

@@ -0,0 +1,54 @@
<?php
function selectGroupById($db, $groupID) {
return $db->query("
SELECT
`group_page`.`name`,
`group_page`.`picture`,
`group_page`.`description`,
`group_page`.`status`,
`group_page`.`creationdate`
FROM
`group_page`
WHERE
`group_page`.`groupID` = $groupID
");
}
function select20GroupsFromN($db, $n) {
return $db->query("
SELECT
`group_page`.`name`,
`group_page`.`picture`,
`group_page`.`description`,
`group_page`.`status`,
`group_page`.`creationdate`
FROM
`group_page`
LIMIT
$n, 20
ORDER BY
`group_page`.`name`
");
}
function select20GroupsByStatusFromN($db, $n, $status) {
return $db->query("
SELECT
`group_page`.`name`,
`group_page`.`picture`,
`group_page`.`description`,
`group_page`.`status`,
`group_page`.`creationdate`
FROM
`group_page`
WHERE
`group_page`.`status` = 1
ORDER BY
`group_page`.`name` ASC
LIMIT
0, 3
");
}
?>

View File

@@ -34,15 +34,15 @@
// Echo the friend. // Echo the friend.
echo " echo "
<a href='#' class='$extraItem'> <a href='#' class='$extraItem'>
<li class='friend-item'> <li class='friend-item'>
<div class='friend'> <div class='friend'>
<img alt='PF' class='profile-picture' src='$pf'/> <img alt='PF' class='profile-picture' src='$pf'/>
$username $username
</div> </div>
</li> </li>
</a> </a>
"; ";
} }
if ($i > 1) { if ($i > 1) {
$i -= 1; $i -= 1;