Issues (4542)

modul.php (4 issues)

1
<?php
2
session_start();
3
include 'config/koneksi.php';
4
5
if ($_SESSION[role] == 'dev') {
0 ignored issues
show
The constant role was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
6
    $sql = mysql_query("select * from modul where aktif='Y' order by urutan");
7
} elseif ($_SESSION[role] == 'admin') {
8
    $sql = mysql_query("select * from modul where status !='dev' and aktif='Y' order by urutan");
9
} elseif ($_SESSION[role] == 'user') {
10
    $sql = mysql_query("select * from modul where status='user' and aktif='Y' order by urutan");
11
} else {
12
    $sql = mysql_query("SELECT * FROM modul a inner join usermenu b on a.id_modul = b.id_modul where a.status='user' and a.aktif='Y'  and b.m_aktif='Y' and b.username='$_SESSION[id_user]' ORDER BY a.urutan");
13
}
14
15
while ($r = mysql_fetch_array($sql)) {
16
17
//$nt=mysql_query("select count from notice where (status = '1' and id_user2 = '$_SESSION[id_user]') or( status = '3' and id_user2 = '$_SESSION[id_user]')");
18
    //$cjml = mysql_num_rows($nt);
19
20
    //if ($cjml == '0') {
21
    //$njml ='';
22
    //} else {
23
    //$njml = '('.$cjml.')';
24
    //}
25
26
    if ($r[status_menu] == 'M' and !empty($r[link])) {
0 ignored issues
show
The constant status_menu was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant link was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
27
        if ($r[nama_modul] == 'Notice') {
0 ignored issues
show
The constant nama_modul was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
28
            echo "<a class='menuitem' href='$r[link]'>$r[nama_modul] $njml</a>";
29
        } else {
30
            echo "<a class='menuitem' href='$r[link]'>$r[nama_modul]</a>";
31
        }
32
    } elseif ($r[status_menu] == 'M' and empty($r[link])) {
33
        echo "<a class='menuitem submenuheader' href='$r[link]'>$r[nama_modul]</a>  ";
34
35
        if ($_SESSION[role] == 'dev' or $_SESSION[role] == 'admin') {
36
            $detil = mysql_query("select * from modul where id_submenu='$r[id_modul]' and status_menu='C' and aktif='Y' order by urutan");
37
        } else {
38
            $detil = mysql_query("select * from modul where id_submenu='$r[id_modul]' and status_menu='C' and aktif='Y' and (id_role = '5' or id_role	 = '$_SESSION[role]') and (id_group = '1' or id_group = '$_SESSION[group]')order by urutan");
39
        }
40
        echo"
41
  <div class='submenu'>
42
	";
43
        while ($d = mysql_fetch_array($detil)) {
44
            echo"<ul><li><a href='$d[link]'>$d[nama_modul]</a></li></ul>";
45
        }
46
        echo'
47
 </div>	
48
  ';
49
    } else {
50
        echo'';
51
    }
52
}
53
?>
54
55