SHOW:
|
|
- or go back to the newest paste.
1 | <?php | |
2 | session_start(); | |
3 | error_reporting(0); | |
4 | include 'dbconnect.php'; | |
5 | if(!isset($_SESSION['email'])){ | |
6 | echo "<script>alert('Silahkan login terlebih dahulu')</script>"; | |
7 | echo "<meta http-equiv='refresh' content='0; url=../index.php'>"; | |
8 | } else { | |
9 | ?> | |
10 | <!DOCTYPE html> | |
11 | <html> | |
12 | <head> | |
13 | <meta charset="UTF-8"> | |
14 | <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> | |
15 | <title>Admin - Sistem Inventori</title> | |
16 | <!-- Google Fonts --> | |
17 | <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css"> | |
18 | <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css"> | |
19 | <!-- Bootstrap Core Css --> | |
20 | <link href="plugins/bootstrap/css/bootstrap.css" rel="stylesheet"> | |
21 | <!-- Waves Effect Css --> | |
22 | <link href="plugins/node-waves/waves.css" rel="stylesheet" /> | |
23 | <!-- Animation Css --> | |
24 | <link href="plugins/animate-css/animate.css" rel="stylesheet" /> | |
25 | <!-- Bootstrap Material Datetime Picker Css --> | |
26 | <link href="plugins/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css" rel="stylesheet" /> | |
27 | <!-- Bootstrap DatePicker Css --> | |
28 | <link href="plugins/bootstrap-datepicker/css/bootstrap-datepicker.css" rel="stylesheet" /> | |
29 | <!-- Wait Me Css --> | |
30 | <link href="plugins/waitme/waitMe.css" rel="stylesheet" /> | |
31 | <!-- Bootstrap Select Css --> | |
32 | <link href="plugins/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" /> | |
33 | <!-- Custom Css --> | |
34 | <link href="css/style.css" rel="stylesheet"> | |
35 | <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes --> | |
36 | <link href="css/themes/all-themes.css" rel="stylesheet" /> | |
37 | </head> | |
38 | <body class="theme-red"> | |
39 | <?php include 'header-atas.php'; ?> | |
40 | <section> | |
41 | <?php include 'menu-kiri.php'; ?> | |
42 | </section> | |
43 | <section> | |
44 | <?php include 'warna-tema.php'; ?> | |
45 | </section> | |
46 | <section class="content"> | |
47 | <div class="container-fluid"> | |
48 | <div class="block-header"> | |
49 | <h2>Laporan Stok Barang</h2> | |
50 | </div> | |
51 | <div class="body"> | |
52 | <ol class="breadcrumb breadcrumb-col-pink"> | |
53 | <li><a href="javascript:void(0);">Home</a></li> | |
54 | <li><a href="javascript:void(0);">Laporan</a></li> | |
55 | <li class="active">Laporan Stok Barang</li> | |
56 | </ol> | |
57 | </div> | |
58 | <!-- Input --> | |
59 | <div class="row clearfix"> | |
60 | <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> | |
61 | <div class="card"> | |
62 | <div class="header"> | |
63 | <h2>Laporan Stok Barang</h2> | |
64 | </div> | |
65 | <div class="body"> | |
66 | <form id="form_validation" method="get" action="#" > | |
67 | <label class="form-label">Dari</label> | |
68 | <div class="form-group form-float"> | |
69 | <div class="form-line"> | |
70 | - | <input type="date" name="dari" class="form-control float-right" id="reservation"> |
70 | + | <input type0="date" name="dari" class="form-control float-right datepicker" id="reservation"> |
71 | </div> | |
72 | </div> | |
73 | <label class="form-label">Sampai</label> | |
74 | <div class="form-group form-float"> | |
75 | <div class="form-line"> | |
76 | - | <input type="date" name="sampai" class="form-control float-right" id="reservation"> |
76 | + | <input type0="date" name="sampai" class="form-control float-right datepicker" id="reservation"> |
77 | </div> | |
78 | </div> | |
79 | <button class="btn btn-primary waves-effect" type="submit">Cari</button> | |
80 | </form> | |
81 | </div> | |
82 | </div> | |
83 | </div> | |
84 | </div> | |
85 | ||
86 | ||
87 | <div class="row clearfix"> | |
88 | <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12"> | |
89 | <div class="card"> | |
90 | <div class="header"> | |
91 | <h2>Tabel Barang Masuk</h2> | |
92 | <ul class="header-dropdown m-r--5"> | |
93 | <li class="dropdown"> | |
94 | <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"> | |
95 | <i class="material-icons">more_vert</i> | |
96 | </a> | |
97 | <ul class="dropdown-menu pull-right"> | |
98 | <li><a href="laporan-barang.php">All Data</a></li> | |
99 | <li><a target="_blank" href="laporan-stok-pdf.php"> Cetak PDF</a></li> | |
100 | </ul> | |
101 | </li> | |
102 | </ul> | |
103 | </div> | |
104 | <div class="body"> | |
105 | <div class="table-responsive"> | |
106 | <table class="table table-bordered table-striped table-hover js-basic-example dataTable"> | |
107 | <thead> | |
108 | <tr> | |
109 | <th>No</th> | |
110 | <th>Tanggal</th> | |
111 | <th>Kode</th> | |
112 | <th>Material</th> | |
113 | <th>Stok</th> | |
114 | </tr> | |
115 | </thead> | |
116 | <tbody> | |
117 | <?php | |
118 | if(isset($_GET['dari']) && isset($_GET['sampai'])){ | |
119 | - | $data = mysqli_query($conn, "SELECT * FROM tbl_barang |
119 | + | $sql=""SELECT * FROM tbl_barang |
120 | - | WHERE tanggal BETWEEN '".$_GET['dari']."' and '".$_GET['sampai']."'"); |
120 | + | WHERE |
121 | tanggal >='".$_GET['dari']."' and tanggal <= '".$_GET['sampai']."'"; | |
122 | $data = mysqli_query($conn, $sql); | |
123 | }else{ | |
124 | $data = mysqli_query($conn, "select * from tbl_barang"); | |
125 | } | |
126 | $no = 1; | |
127 | ||
128 | while($d = mysqli_fetch_array($data)){ | |
129 | ?> | |
130 | <tr> | |
131 | <td><?php echo $no++; ?></td> | |
132 | <td><?php echo date('d-m-Y',strtotime($d['tanggal'])); ?></td> | |
133 | <td><?php echo $d['kode']; ?></td> | |
134 | <td><?php echo $d['nama']; ?></td> | |
135 | <td><?php echo $d['stok']; ?></td> | |
136 | </tr> | |
137 | <?php } ?> | |
138 | </tbody> | |
139 | </table> | |
140 | </div> | |
141 | </div> | |
142 | </div> | |
143 | </div> | |
144 | </div> | |
145 | </div> | |
146 | </section> | |
147 | <!-- Jquery Core Js --> | |
148 | <script src="plugins/jquery/jquery.min.js"></script> | |
149 | <!-- Bootstrap Core Js --> | |
150 | <script src="plugins/bootstrap/js/bootstrap.js"></script> | |
151 | <!-- Select Plugin Js --> | |
152 | <script src="plugins/bootstrap-select/js/bootstrap-select.js"></script> | |
153 | <!-- Slimscroll Plugin Js --> | |
154 | <script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script> | |
155 | <!-- Waves Effect Plugin Js --> | |
156 | <script src="plugins/node-waves/waves.js"></script> | |
157 | <!-- Autosize Plugin Js --> | |
158 | <script src="plugins/autosize/autosize.js"></script> | |
159 | <!-- Moment Plugin Js --> | |
160 | <script src="plugins/momentjs/moment.js"></script> | |
161 | <!-- Bootstrap Material Datetime Picker Plugin Js --> | |
162 | <script src="plugins/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js"></script> | |
163 | <!-- Bootstrap Datepicker Plugin Js --> | |
164 | <script src="plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script> | |
165 | <!-- Custom Js --> | |
166 | <script src="js/admin.js"></script> | |
167 | <script src="js/pages/forms/basic-form-elements.js"></script> | |
168 | <!-- Demo Js --> | |
169 | <script src="js/demo.js"></script> | |
170 | <script> | |
171 | $(".datepicker").datepicker({ | |
172 | format: "dd-mm-yyyy", | |
173 | }); | |
174 | </script> | |
175 | </body> | |
176 | </html> | |
177 | <?php } ?> |