Passed
Pull Request — master (#8)
by
unknown
04:11
created

menu.php (12 issues)

1
<?php
2
session_start();
3
include 'config/koneksi.php';
4
5
    if ($_SESSION['role'] == 'SA') {
6
        $sql = mysql_query("select * from modul where aktif='Y' and status_menu = 'M' order by urutan");
0 ignored issues
show
Deprecated Code introduced by
The function mysql_query() has been deprecated: 5.5 Send a MySQL query ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

6
        $sql = /** @scrutinizer ignore-deprecated */ mysql_query("select * from modul where aktif='Y' and status_menu = 'M' order by urutan");

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
7
8
        $gjml = '1';
9
    } else {
10
        $sql = mysql_query("select distinct c.* from groupmodul b
0 ignored issues
show
Deprecated Code introduced by
The function mysql_query() has been deprecated: 5.5 Send a MySQL query ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

10
        $sql = /** @scrutinizer ignore-deprecated */ mysql_query("select distinct c.* from groupmodul b

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
11
                                                     inner join modul c
12
                                                     on b.id_modul = c.id_modul 
13
                                                     where b.id_groups = '$groups'  and c.aktif='Y' and status_menu='M'
14
                                                     order by c.urutan");
15
16
        $gsql = mysql_query("select * 
0 ignored issues
show
Deprecated Code introduced by
The function mysql_query() has been deprecated: 5.5 Send a MySQL query ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

16
        $gsql = /** @scrutinizer ignore-deprecated */ mysql_query("select * 

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
17
                                                      from modul a inner join groupmodul b
18
                                                      on a.id_modul = b.id_modul
19
                                                       where link = 'general_setting'
20
                                                       and b.id_groups = '$groups' 
21
                                                       ");
22
        $gjml = mysql_num_rows($gsql);
0 ignored issues
show
Deprecated Code introduced by
The function mysql_num_rows() has been deprecated: 5.5 ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

22
        $gjml = /** @scrutinizer ignore-deprecated */ mysql_num_rows($gsql);

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
23
    }
24
25
                                while ($r = mysql_fetch_array($sql)) {
0 ignored issues
show
Deprecated Code introduced by
The function mysql_fetch_array() has been deprecated: 5.5 Fetch a result row as an associative array, a numeric array, or both ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

25
                                while ($r = /** @scrutinizer ignore-deprecated */ mysql_fetch_array($sql)) {

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
26
                                    if ($r[status_menu] == 'M' and !empty($r[link])) {
0 ignored issues
show
The constant link was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
The constant status_menu was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
27
                                        echo "<li><a href='$r[link]&id_module=$r[id_modul]'><i class='$r[icon]'></i> $r[nama_modul]</a>";
28
                                    } elseif ($r[status_menu] == 'M' and empty($r[link])) {
29
                                        echo "<li><a href='#'><i class='$r[icon]'></i> $r[nama_modul] <span class='fa fa-chevron-down'></span></a>";
30
                                    }
31
32
                                    echo'<ul class="nav child_menu" style="display: none">';
33
34
                                    if ($_SESSION['role'] == 'SA') {
35
                                        $detil = mysql_query("select * from modul where aktif='Y' and status_menu = 'C' and parentid = '$r[id_modul]' order by urutan");
0 ignored issues
show
Deprecated Code introduced by
The function mysql_query() has been deprecated: 5.5 Send a MySQL query ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

35
                                        $detil = /** @scrutinizer ignore-deprecated */ mysql_query("select * from modul where aktif='Y' and status_menu = 'C' and parentid = '$r[id_modul]' order by urutan");

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
36
                                    } else {
37
                                        $detil = mysql_query("select distinct c.* 
0 ignored issues
show
Deprecated Code introduced by
The function mysql_query() has been deprecated: 5.5 Send a MySQL query ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

37
                                        $detil = /** @scrutinizer ignore-deprecated */ mysql_query("select distinct c.* 

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
38
                                                         from groupmodul b
39
                                                         inner join modul c
40
                                                         on b.id_modul = c.id_modul    
41
                                                         where b.id_groups = '$groups'
42
                                                         and c.aktif='Y'
43
                                                         and c.status_menu='C'
44
                                                         and c.parentid = '$r[id_modul]'
45
                                                         order by c.urutan");
46
                                    }
47
                                    while ($d = mysql_fetch_array($detil)) {
0 ignored issues
show
Deprecated Code introduced by
The function mysql_fetch_array() has been deprecated: 5.5 Fetch a result row as an associative array, a numeric array, or both ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

47
                                    while ($d = /** @scrutinizer ignore-deprecated */ mysql_fetch_array($detil)) {

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
48
                                        if ($d[is_form] == 'Y') {
0 ignored issues
show
The constant is_form was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
49
                                            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='$d[fa_icon]'></i>&nbsp&nbsp$d[nama_modul]</a></li>";
50
                                        } else {
51
                                            echo"<li><a href='$d[link]&id_module=$d[id_modul]'><i class='$d[fa_icon]'></i>&nbsp&nbsp$d[nama_modul]</a></li>";
52
                                        }
53
                                    }
54
55
                                    echo'</ul>';
56
                                }
57
58
?>
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...
59
60