1
This shouldn't be that complicated, but I can't figure it out. I have users with names like "Depaul", "UIC", "Loyola" and Depaul is in a group called "Depaul" and UIC is in a group called "UIC" and so on. I have an sql table with a column called 'team' that has values "Depaul", "UIC", etc with other info in the rows as well. I want a .php file to display the sql table information based on the user's group name matching the 'team' column. Here's the sudo code I have, am I not including something in the beginng of the file? Basically, I just need help getting the groupid number out of the array.
include '../../mainfile.php';
include_once XOOPS_ROOT_PATH . '/header.php';
?>
// if i know the useridgroup# ahead of time through php //myadmin, set the numbers equal to team names
$Depaul = 4;
$Loyola = 5;
// get userid (global variable...$xoopsUser??)
// get userid's groups (They are numbers in an array )
$groups = $xoopsUser->getGroups();
// select from the array the value of the groups, which im not sure how to do
$team = whatever value returns thats not admin or registered
if ($team == $Depaul) { // Display Depauls schedule
$query = 'SELECT * FROM game_schedule WHERE (team="Depaul") ORDER BY date ASC';
elseif ( $team == $Loyola) //Display Loyola schedule