Issues (4542)

modul/mod_kasir/getbarang.php (2 issues)

Severity
1
<?php
2
3
    error_reporting(0);session_start();
4
5
    include '../../config/koneksi.php';
6
7
    $prd = $_GET['prd'];
8
9
    $notrans = $_GET['notrans'];
10
11
    $kode = $_GET['kode'];
12
13
    $q = '%'.trim($_REQUEST['term']).'%';
14
15
        $sql = "select   concat(a.kode,' - ',a.barang) as barang
16
17
                ,   a.id_barang
18
19
                ,   a.id_jenis_barang as jenis_barang
20
21
                ,   a.id_unit_barang as unit_barang
22
23
                ,   m.id_merk
24
25
            from barang a inner join jenis_barang b
26
27
            on a.id_jenis_barang = b.id_jenis_barang
28
29
            inner join unit_barang c
30
31
            on a.id_unit_barang = c.id_unit_barang
32
33
            left join merk m
34
35
            on a.id_merk = m.id_merk
36
37
            WHERE a.barang like '$q'
38
39
            and a.id_barang not in 
40
41
                (select id_barang from permintaan_barang_detail where prd = '$prd' and notrans = '$notrans' and kode = '$kode' and status !='4')
42
43
            ORDER BY a.barang asc
44
45
            limit 0,10
46
47
            ";
48
49
        $tampil = mysql_query($sql);
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

49
        $tampil = /** @scrutinizer ignore-deprecated */ mysql_query($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...
50
51
        $data = [];
52
53
        while ($r = mysql_fetch_array($tampil)) {
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

53
        while ($r = /** @scrutinizer ignore-deprecated */ mysql_fetch_array($tampil)) {

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...
54
            $data[] = [
55
56
                    'value' => $r['barang'],
57
58
                    'id_barang' => $r['id_barang'],
59
60
                    'merk' => $r['id_merk'],
61
62
                    'jenis_barang' => $r['jenis_barang'],
63
64
                    'unit_barang' => $r['unit_barang'],
65
66
                ];
67
        }
68
69
    echo json_encode($data);
70
71
    flush();
72