Issues (4542)

modal.php (1 issue)

1
<?php
2
include 'config/koneksi.php';
3
?>
4
<!DOCTYPE html>
5
<html lang="en">
6
<head>
7
  <title>Bootstrap Example</title>
8
  <meta charset="utf-8">
9
  <meta name="viewport" content="width=device-width, initial-scale=1">
10
<!--   <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
11
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
12
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> -->
13
14
   <link href="css/bootstrap.min.css" rel="stylesheet">
15
16
    <link href="fonts/css/font-awesome.min.css" rel="stylesheet">
17
    <link href="css/animate.min.css" rel="stylesheet">
18
19
    <!-- Custom styling plus plugins -->
20
    <link href="css/custom.css" rel="stylesheet">
21
    <link href="css/icheck/flat/green.css" rel="stylesheet">
22
    <!-- editor -->
23
    
24
    <link href="css/editor/external/google-code-prettify/prettify.css" rel="stylesheet">
25
    <link href="css/editor/index.css" rel="stylesheet">
26
    <!-- select2 -->
27
    <link href="css/select/select2.min.css" rel="stylesheet">
28
    <!-- switchery -->
29
    <link rel="stylesheet" href="css/switchery/switchery.min.css" />
30
31
    <script src="js/jquery.min.js"></script>
32
    <script src="js/bootstrap.min.js"></script>
33
    <link href="config/css/tiny_table.css" rel="stylesheet" type="text/css" />
34
35
</head>
36
<body>
37
38
<div class="container">
39
  <h2>Modal Example</h2>
40
  <!-- Trigger the modal with a button -->
41
  <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
42
43
  <!-- Modal -->
44
  <div class="modal fade" id="myModal" role="dialog">
45
    <div class="modal-dialog modal-lg">
46
    
47
      <!-- Modal content-->
48
      <div class="modal-content">
49
        <div class="modal-header">
50
          <button type="button" class="close" data-dismiss="modal">&times;</button>
51
          <h4 class="modal-title">Modal Header</h4>
52
        </div>
53
        <div class="modal-body">
54
         <?// start grid ?>
0 ignored issues
show
Security Best Practice introduced by
It is not recommended to use PHP's short opening tag <?, better use <?php, or <?= in case of outputting.

Short opening tags are disabled in PHP?s default configuration. In such a case, all content of this file is output verbatim to the browser without being parsed, or executed.

As a precaution to avoid these problems better use the long opening tag <?php.

Loading history...
55
56
57
         <?php
58
59
60
        // $module = $_GET['module'];
61
        // $id_module = $_GET['id_module'];
62
        // $title = $_GET['title'];
63
64
        $prd = '2016-01'; //$_GET['prd'];
65
        $kode = 'PJ'; //$_GET['kode'];
66
67
        $id_outlet = '1'; //$_GET['id_outlet'];
68
        $outlet = ''; //$_GET['outlet'];
69
        $tanggal = 'A44-1601-0002'; //$_GET['tanggal'];
70
        $notrans = '2016-09-04'; //$_GET['notrans'];
71
        $customer = '3'; //$_GET['customer'];
72
73
        if ($_GET['ioutlet']) {
74
            $outlet = $_GET['ioutlet'];
75
        } else {
76
            $outlet = '1';
77
        }
78
79
        if ($_GET['itipe_barang']) {
80
            $tipe_barang = $_GET['itipe_barang'];
81
        } else {
82
            $tipe_barang = '1';
83
        }
84
85
        ?>
86
87
88
        <div  class="table-responsive">
89
                   
90
                <div class="row">
91
92
                        <div class="col-md-12 col-sm-12 col-xs-12">
93
                            <div class="x_panel">
94
                                <div class="x_title">
95
                                    <h2></h2>
96
                                        
97
                                     
98
                                         <form method=get action='<?php echo $_SERVER[PHP_SELF]?>' name='myform'>
99
                                         <input type="hidden" name="id_module" value="<?php echo $id_module?>" /> 
100
                                         <input type="hidden" name="module" value="<?php echo $module?>" /> 
101
                                         <input type="hidden" name="prd" value="<?php echo $prd?>" /> 
102
103
                                          <input type="hidden" name="kode" id="kode" value="<?php echo $kode; ?>">
104
                                          <input type="hidden" name="id_outlet" id="id_outlet" value="<?php echo $id_outlet; ?>">
105
                                          <input type="hidden" name="tanggal" id="tanggal" value="<?php echo $tanggal; ?>">
106
                                          <input type="hidden" name="customer" id="customer" value="<?php echo $customer; ?>">
107
                                          <input type="hidden" name="notrans" id="notrans" value="<?php echo $notrans; ?>">
108
                                                                  
109
                                         <p class="pull-right">
110
                                         <select name="itipe_barang" class="form-control" onChange="document.myform.submit();">
111
                                            <?php
112
                                                $query = mysql_query('SELECT * FROM tipe_barang ORDER BY id_tipe_barang');
113
                                                if ($query && mysql_num_rows($query) > 0) {
114
                                                    while ($row = mysql_fetch_object($query)) {
115
                                                        echo '<option value="'.$row->id_tipe_barang.'"';
116
                                                        if ($row->id_tipe_barang == $tipe_barang) {
117
                                                            echo ' selected';
118
                                                        }
119
                                                        echo '>'.$row->tipe_barang.'</option>';
120
                                                    }
121
                                                }
122
                                            ?>  
123
                                            </select>        
124
                                        </p>
125
126
                                         <p class="pull-right">
127
                                         <select name="ioutlet" class="form-control" onChange="document.myform.submit();">
128
                                            <?php
129
                                                $query = mysql_query('SELECT * FROM outlet ORDER BY id_outlet');
130
                                                if ($query && mysql_num_rows($query) > 0) {
131
                                                    while ($row = mysql_fetch_object($query)) {
132
                                                        echo '<option value="'.$row->id_outlet.'"';
133
                                                        if ($row->id_outlet == $outlet) {
134
                                                            echo ' selected';
135
                                                        }
136
                                                        echo '>'.$row->outlet.'</option>';
137
                                                    }
138
                                                }
139
                                            ?>  
140
                                            </select>        
141
                                        </p>
142
143
144
                                         </form>
145
                                    <div class="clearfix"></div>
146
                                </div>
147
                                <div class="x_content">
148
                   <div id="tablewrapper">
149
150
                    <div id="tableheader">
151
152
                        <div class="search">  <select id="columns" onchange="sorter.search('query')"></select>
153
                            <input type="text" id="query" onkeyup="sorter.search('query');" value="Search By ...."  onclick="this.value=''"/>
154
                        </div>
155
                        <span class="details">
156
                           <div>Records <span id="startrecord"></span>-<span id="endrecord"></span> of <span id="totalrecords"></span></div>
157
                            <!--<div><a href="javascript:sorter.reset()">reset</a></div>-->
158
                        </span>
159
                    </div> <div>
160
161
162
163
                        <table cellpadding="0" cellspacing="0" border="0" id="table" class="table table-striped responsive-utilities jambo_table" >
164
                        <thead>
165
                            <tr> 
166
                                <th ><h3 style='font-size:12px;' width='20px'></h3></th>  
167
                                <th><h3 style='font-size:12px;'>Jenis Barang</h3></th>
168
                                <th width="150px;"><h3 style='font-size:12px;'>Kode Barang</h3></th>                               
169
                                <th><h3 style='font-size:12px;'>Barang</h3></th>                              
170
                                <th><h3 style='font-size:12px;'>Satuan</h3></th>  
171
                                <th class='nosort' ><h3 style='font-size:12px;text-align: right;'>Harga</h3></th>    
172
                            </tr>
173
                        </thead>
174
                        <tbody>
175
                            
176
                         <?php
177
178
                            $SQL = "SELECT b.jenis_barang
179
                                    ,c.unit_barang
180
                                    ,a.kode as kode_barang
181
                                     ,a.id_barang
182
                                    ,a.barang   
183
                                    ,d.harga_jual   
184
                                    ,sum(saldo_akhir) as stok  
185
                                        FROM barang a INNER JOIN jenis_barang b
186
                                        ON a.id_jenis_barang = b.id_jenis_barang 
187
                                        AND b.aktif = 'Y'
188
                                        INNER JOIN unit_barang c 
189
                                        ON a.id_unit_barang = c.id_unit_barang  
190
                                        AND c.aktif = 'Y'
191
                                        LEFT JOIN harga_barang d
192
                                        ON a.id_barang = d.id_barang
193
                                        AND d.status = '0'
194
                                        AND d.id_outlet = '$outlet'
195
                                        LEFT JOIN stok e
196
                                        ON  '$prd' = e.prd
197
                                        AND a.id_barang = e.id_barang
198
                                        and '$outlet'   = e.id_outlet
199
                                        WHERE a.aktif = 'Y'
200
                                        AND a.id_tipe_barang = '$tipe_barang'     
201
                                        and d.harga_jual > 0  
202
                                        and e.saldo_akhir > 0
203
                                        group by b.jenis_barang
204
                                        ,c.unit_barang
205
                                         ,a.id_barang
206
                                         ,a.kode
207
                                        ,a.barang   
208
                                        ,d.harga_jual
209
                                      ORDER BY a.id_jenis_barang,a.kode";
210
211
                                $tampil = mysql_query($SQL);
212
213
                                $no = 1;
214
215
                                while ($r = mysql_fetch_array($tampil)) {
216
                                    $id_barang = $r['id_barang'];
217
                                    $kode_barang = $r['kode_barang'];
218
219
                                    $dsql = mysql_query("SELECT sum(qty) as reserve
220
                                                      FROM stok_reserved
221
                                                      WHERE id_barang_promosi = '$id_barang'
222
                                                      AND id_outlet = '$outlet'
223
                                                      AND tipe = 'B'
224
                                                       and prd = '$prd'
225
                                                      ");
226
227
                                    $d = mysql_fetch_array($dsql);
228
229
                                    if ($d['reserve']) {
230
                                        $reserve = $d['reserve'];
231
                                    } else {
232
                                        $reserve = 0;
233
                                    }
234
235
                                    $sisa_stok = $r['stok'] - $reserve;
236
237
                                    if ($sisa_stok == '0') {
238
                                        echo '';
239
                                    } else {
240
                                        echo'<tr>';
241
                                        echo" <td  style='text-align:center;'>";
242
                                        echo"<a href='../../modul/mod_$module/aksi_$module.php?module=$module&act=add&barcode=$kode_barang&prd=$prd&notrans=$notrans&kode=$kode&tanggal=$tanggal&customer=$customer&outlet=$outlet&id_outlet=$id_outlet&id_module=$id_module&look=1'  title=''><span class='icon'><i class='fa fa-check'></i></span></a>";
243
244
                                        echo'</td>';
245
                                        echo'<td>'.$r['jenis_barang'].'</td>';
246
                                        echo'<td>'.$r['kode_barang'].'</td>';
247
                                        echo'<td>'.$r['barang'].'</td>';
248
                                        echo'<td>'.$r['unit_barang'].'</td>';
249
                                        echo"<td style='text-align:right;'>".number_format($r['harga_jual'], 0, '.', ',').'</td>';
250
251
                                        echo'</tr>';
252
                                    }
253
254
                                    $no++;
255
                                }
256
                                ?>
257
                         </tbody>
258
                    </table>
259
           
260
                  </div>
261
                    <div id="tablefooter">
262
                      <div id="tablenav">
263
                            <div>
264
                                <span class="glyphicon glyphicon-fast-backward" onclick="sorter.move(-1,true)" /></span>
265
                                <span class="glyphicon glyphicon-step-backward" onclick="sorter.move(-1)" /></span>
266
                                <span class="glyphicon glyphicon-step-forward" onclick="sorter.move(1)" /></span>
267
                                 <span  class="glyphicon glyphicon-fast-forward" onclick="sorter.move(1,true)" /></span>
268
                            </div>
269
                            <div>
270
                                <select id="pagedropdown" style="width:40px;"></select>
271
                            </div>
272
                           <!-- <div>
273
                                <a href="javascript:sorter.showall()">view all</a>
274
                            </div> -->
275
                        </div>
276
                       
277
                        <div id="tablelocation">
278
                            <div>
279
                                <select onchange="sorter.size(this.value)" style="width:50px;">
280
                                <option value="5">5</option>
281
                                    <option value="10" selected="selected">10</option>
282
                                    <option value="20">20</option>
283
                                    <option value="50">50</option>
284
                                    <option value="100">100</option>
285
                                </select>
286
                                <span>Entries Per Page</span> </div> <div>| Page <span id="currentpage"></span> of <span id="totalpages"></span> | &nbsp  </div>
287
                        </div>  
288
                    </div>
289
                </div>
290
                                </div>
291
                            </div>
292
                        </div>
293
294
                        <br />
295
                        <br />
296
                        <br />
297
               </div>
298
        </div>
299
300
         <?//end frif ?>
301
        </div>
302
        <div class="modal-footer">
303
          <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
304
        </div>
305
      </div>
306
      
307
    </div>
308
  </div>
309
  
310
</div>
311
312
</body>
313
</html>
314
315
316
317
           <script type="text/javascript" src="config/js/script.js"></script>
318
    <script type="text/javascript">
319
    var sorter = new TINY.table.sorter('sorter','table',{
320
        headclass:'head',
321
        ascclass:'asc',
322
        descclass:'desc',
323
        evenclass:'evenrow',
324
        oddclass:'oddrow',
325
        evenselclass:'evenselected',
326
        oddselclass:'oddselected',
327
        paginate:true,
328
        size:1,
329
        colddid:'columns',
330
        currentid:'currentpage',
331
        totalid:'totalpages',
332
        startingrecid:'startrecord',
333
        endingrecid:'endrecord',
334
        totalrecid:'totalrecords',
335
        hoverid:'selectedrow',
336
        pageddid:'pagedropdown',
337
        navid:'tablenav',
338
        <!--sortcolumn:1,-->
339
        sortdir:1,
340
        /*sum:[8],
341
        avg:[6,7,8,9],
342
        columns:[{index:7, format:'%', decimals:1},{index:8, format:'$', decimals:0}],*/
343
        init:true
344
    });
345
  </script>
346