Added group_page functions for the admin page
This commit is contained in:
54
website/queries/group_page.php
Normal file
54
website/queries/group_page.php
Normal 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
|
||||
");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -34,15 +34,15 @@
|
||||
|
||||
// Echo the friend.
|
||||
echo "
|
||||
<a href='#' class='$extraItem'>
|
||||
<li class='friend-item'>
|
||||
<div class='friend'>
|
||||
<img alt='PF' class='profile-picture' src='$pf'/>
|
||||
$username
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
";
|
||||
<a href='#' class='$extraItem'>
|
||||
<li class='friend-item'>
|
||||
<div class='friend'>
|
||||
<img alt='PF' class='profile-picture' src='$pf'/>
|
||||
$username
|
||||
</div>
|
||||
</li>
|
||||
</a>
|
||||
";
|
||||
}
|
||||
if ($i > 1) {
|
||||
$i -= 1;
|
||||
|
||||
Reference in New Issue
Block a user