Issues (4542)

1
<?php
2
include 'config/koneksi.php';
3
4
    if ($_SESSION['role'] == 'SA') {
5
        $sql = mysql_query("select * from modul where aktif='Y' and status_menu = 'M' order by urutan");
6
7
        $gjml = '1';
8
    } else {
9
        $sql = mysql_query("select distinct c.* from groupmodul b
10
                                                     inner join modul c
11
                                                     on b.id_modul = c.id_modul 
12
                                                     where b.id_groups = '$groups'  and c.aktif='Y' and status_menu='M'
13
                                                     order by c.urutan");
14
15
        $gsql = mysql_query("select * 
16
                                                      from modul a inner join groupmodul b
17
                                                      on a.id_modul = b.id_modul
18
                                                       where link = 'general_setting'
19
                                                       and b.id_groups = '$groups' 
20
                                                       ");
21
        $gjml = mysql_num_rows($gsql);
22
    }
23
24
                                while ($r = mysql_fetch_array($sql)) {
25
                                    if ($r['status_menu'] == 'M' and !empty($r['link'])) {
26
                                        echo "<li><a href='$r[link]&id_module=$r[id_modul]'><i class='$r[icon]'></i> $r[nama_modul]</a>";
27
                                    } elseif ($r['status_menu'] == 'M' and empty($r['link'])) {
28
                                        echo "<li><a href='#'><i class='$r[icon]'></i> $r[nama_modul] <span class='fa fa-chevron-down'></span></a>";
29
                                    }
30
31
                                    echo'<ul class="nav child_menu" style="display: none">';
32
33
                                    if ($_SESSION['role'] == 'SA') {
34
                                        $detil = mysql_query("select * from modul where aktif='Y' and status_menu = 'C' and parentid = '$r[id_modul]' order by urutan");
35
                                    } else {
36
                                        $detil = mysql_query("select distinct c.* 
37
                                                         from groupmodul b
38
                                                         inner join modul c
39
                                                         on b.id_modul = c.id_modul    
40
                                                         where b.id_groups = '$groups'
41
                                                         and c.aktif='Y'
42
                                                         and c.status_menu='C'
43
                                                         and c.parentid = '$r[id_modul]'
44
                                                         order by c.urutan");
45
                                    }
46
                                    while ($d = mysql_fetch_array($detil)) {
47
                                        if ($d['is_form'] == 'Y') {
48
                                            $imenu = '';
49
                                            $isub = '';
50
                                            $fa_icon = (isset($d['fa_icon'])) ? $d['fa_icon'] : '';
51
                                            echo"<li><a href='modul/mod_$d[link]/form_$d[link].php?width=$d[f_width]&height=$d[f_height]&module=$d[link]&imodule=$imodule&id_module=$id&imenu=$imenu&isub=$isub&TB_iframe=true' title='$d[nama_modul]' class='thickbox' ><i class='$fa_icon'></i>&nbsp&nbsp$d[nama_modul]</a></li>";
52
                                        } else {
53
                                            $fa_icon = (isset($d['fa_icon'])) ? $d['fa_icon'] : '';
54
                                            echo"<li><a href='$d[link]&id_module=$d[id_modul]'><i class='$fa_icon'></i>&nbsp&nbsp$d[nama_modul]</a></li>";
55
                                        }
56
                                    }
57
58
                                    echo'</ul>';
59
                                }
60
61
?>
0 ignored issues
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...
62
63