I'm just trying to make this, but I don't even have any idea of how to do it, here's the case: I have 3 tables
**
- admin_users , admin_permissions & admin_modules
**
I'm passing the "iduser" via get to the page, and I'm generating a type of menu from the table "admin_modules"... Now I want to dissable the links that the user doesn't has permissions to access...... I think that I can make it via css, but I don't know in which place of my "menu generator" I have to place the code to do it...*
include ("connector.php");
$con = conectar();
$tbl = "admin_modules";
$i=0;
$query = "SELECT * FROM $tbl";
$resultado = mysqli_query($con,$query) or die(mysqli_error());
while($dato=mysqli_fetch_array($resultado)){
echo "<td width='25%'><a href=../" .
$dato['RootDirectory'] . "/" . $dato['InitialMenu'] . "><img src=./images/icons/" .
$dato['IconName'] . "></a><p>" . $dato['ModuleName'] . "</p></td>";
$i=$i+1;
if ($i==4) {
echo"</tr>";
echo"<tr>";
$i=0;
}
}
mysqli_close($con);//cerrar conexion
Extra info:
On the admin_permissions I have two columns "idadmin_users[FK]" and "idadmin_module[FK]" So, if a user has a registry on that table he has access to the module.
Example:
the user John has access to the rejects module and to the invoices module... So he has 2 entries in admin_permissions with his unique user id and with each of the unique module ids