Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- error_reporting(0);
- include 'dbconnect.php';
- if(!isset($_SESSION['email'])){
- echo "<script>alert('Silahkan login terlebih dahulu')</script>";
- echo "<meta http-equiv='refresh' content='0; url=../index.php'>";
- } else {
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
- <title>Admin - Sistem Inventori</title>
- <!-- Google Fonts -->
- <link href="https://fonts.googleapis.com/css?family=Roboto:400,700&subset=latin,cyrillic-ext" rel="stylesheet" type="text/css">
- <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" type="text/css">
- <!-- Bootstrap Core Css -->
- <link href="plugins/bootstrap/css/bootstrap.css" rel="stylesheet">
- <!-- Waves Effect Css -->
- <link href="plugins/node-waves/waves.css" rel="stylesheet" />
- <!-- Animation Css -->
- <link href="plugins/animate-css/animate.css" rel="stylesheet" />
- <!-- Bootstrap Material Datetime Picker Css -->
- <link href="plugins/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css" rel="stylesheet" />
- <!-- Bootstrap DatePicker Css -->
- <link href="plugins/bootstrap-datepicker/css/bootstrap-datepicker.css" rel="stylesheet" />
- <!-- Wait Me Css -->
- <link href="plugins/waitme/waitMe.css" rel="stylesheet" />
- <!-- Bootstrap Select Css -->
- <link href="plugins/bootstrap-select/css/bootstrap-select.css" rel="stylesheet" />
- <!-- Custom Css -->
- <link href="css/style.css" rel="stylesheet">
- <!-- AdminBSB Themes. You can choose a theme from css/themes instead of get all themes -->
- <link href="css/themes/all-themes.css" rel="stylesheet" />
- </head>
- <body class="theme-red">
- <?php include 'header-atas.php'; ?>
- <section>
- <?php include 'menu-kiri.php'; ?>
- </section>
- <section>
- <?php include 'warna-tema.php'; ?>
- </section>
- <section class="content">
- <div class="container-fluid">
- <div class="block-header">
- <h2>Laporan Stok Barang</h2>
- </div>
- <div class="body">
- <ol class="breadcrumb breadcrumb-col-pink">
- <li><a href="javascript:void(0);">Home</a></li>
- <li><a href="javascript:void(0);">Laporan</a></li>
- <li class="active">Laporan Stok Barang</li>
- </ol>
- </div>
- <!-- Input -->
- <div class="row clearfix">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card">
- <div class="header">
- <h2>Laporan Stok Barang</h2>
- </div>
- <div class="body">
- <form id="form_validation" method="get" action="#" >
- <label class="form-label">Dari</label>
- <div class="form-group form-float">
- <div class="form-line">
- <input type0="date" name="dari" class="form-control float-right datepicker" id="reservation">
- </div>
- </div>
- <label class="form-label">Sampai</label>
- <div class="form-group form-float">
- <div class="form-line">
- <input type0="date" name="sampai" class="form-control float-right datepicker" id="reservation">
- </div>
- </div>
- <button class="btn btn-primary waves-effect" type="submit">Cari</button>
- </form>
- </div>
- </div>
- </div>
- </div>
- <div class="row clearfix">
- <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
- <div class="card">
- <div class="header">
- <h2>Tabel Barang Masuk</h2>
- <ul class="header-dropdown m-r--5">
- <li class="dropdown">
- <a href="javascript:void(0);" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
- <i class="material-icons">more_vert</i>
- </a>
- <ul class="dropdown-menu pull-right">
- <li><a href="laporan-barang.php">All Data</a></li>
- <li><a target="_blank" href="laporan-stok-pdf.php"> Cetak PDF</a></li>
- </ul>
- </li>
- </ul>
- </div>
- <div class="body">
- <div class="table-responsive">
- <table class="table table-bordered table-striped table-hover js-basic-example dataTable">
- <thead>
- <tr>
- <th>No</th>
- <th>Tanggal</th>
- <th>Kode</th>
- <th>Material</th>
- <th>Stok</th>
- </tr>
- </thead>
- <tbody>
- <?php
- if(isset($_GET['dari']) && isset($_GET['sampai'])){
- $sql=""SELECT * FROM tbl_barang
- WHERE
- tanggal >='".$_GET['dari']."' and tanggal <= '".$_GET['sampai']."'";
- $data = mysqli_query($conn, $sql);
- }else{
- $data = mysqli_query($conn, "select * from tbl_barang");
- }
- $no = 1;
- while($d = mysqli_fetch_array($data)){
- ?>
- <tr>
- <td><?php echo $no++; ?></td>
- <td><?php echo date('d-m-Y',strtotime($d['tanggal'])); ?></td>
- <td><?php echo $d['kode']; ?></td>
- <td><?php echo $d['nama']; ?></td>
- <td><?php echo $d['stok']; ?></td>
- </tr>
- <?php } ?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </section>
- <!-- Jquery Core Js -->
- <script src="plugins/jquery/jquery.min.js"></script>
- <!-- Bootstrap Core Js -->
- <script src="plugins/bootstrap/js/bootstrap.js"></script>
- <!-- Select Plugin Js -->
- <script src="plugins/bootstrap-select/js/bootstrap-select.js"></script>
- <!-- Slimscroll Plugin Js -->
- <script src="plugins/jquery-slimscroll/jquery.slimscroll.js"></script>
- <!-- Waves Effect Plugin Js -->
- <script src="plugins/node-waves/waves.js"></script>
- <!-- Autosize Plugin Js -->
- <script src="plugins/autosize/autosize.js"></script>
- <!-- Moment Plugin Js -->
- <script src="plugins/momentjs/moment.js"></script>
- <!-- Bootstrap Material Datetime Picker Plugin Js -->
- <script src="plugins/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker.js"></script>
- <!-- Bootstrap Datepicker Plugin Js -->
- <script src="plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
- <!-- Custom Js -->
- <script src="js/admin.js"></script>
- <script src="js/pages/forms/basic-form-elements.js"></script>
- <!-- Demo Js -->
- <script src="js/demo.js"></script>
- <script>
- $(".datepicker").datepicker({
- format: "dd-mm-yyyy",
- });
- </script>
- </body>
- </html>
- <?php } ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement