<?php
session_start();
require_once __DIR__ . '/config/config.php';

if (!isset($_SESSION['login'])) die("Akses ditolak");

if ($_SERVER['REQUEST_METHOD']=='POST'){
    $bulan = substr($_POST['bulan'],5,2);
    $tahun = substr($_POST['bulan'],0,4);
    header("Location: list_stokopname.php?bulan=$bulan&tahun=$tahun");
    exit;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Proses Stok Opname</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
<div class="container mt-4">
<div class="card shadow-sm">
<div class="card-header bg-primary text-white">Proses Stok Opname</div>
<div class="card-body">
<form method="post">
<label>Bulan</label>
<input type="month" name="bulan" class="form-control mb-3" required>
<button class="btn btn-success">Proses</button>
</form>
</div>
</div>
</div>
</body>
</html>
