<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Form Yazdırma</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
.form-container {
max-width: 400px;
margin: auto;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
}
.form-group input, .form-group textarea {
width: 100%;
padding: 8px;
box-sizing: border-box;
}
.print-button {
margin-top: 20px;
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}
.print-button:hover {
background-color: #45a049;
}
</style>
</head>
<body>

<div class="form-container">
<h2>Form</h2>
<div class="form-group">
<label for="tarih">Tarih:</label>
<input type="date" id="tarih">
</div>
<div class="form-group">
<label for="saat">Saat:</label>
<input type="time" id="saat">
</div>
<div class="form-group">
<label for="aciklama">Açıklama:</label>
<textarea id="aciklama" rows="3"></textarea>
</div>
<div class="form-group">
<label for="urunKodu">Ürün Kodu:</label>
<input type="text" id="urunKodu">
</div>
<button class="print-button" onclick="printForm()">Yazdır</button>
</div>

<script>
function printForm() {
var tarih = document.getElementById("tarih").value;
var saat = document.getElementById("saat").value;
var aciklama = document.getElementById("aciklama").value;
var urunKodu = document.getElementById("urunKodu").value;

var printWindow = window.open('', '', 'height=600,width=800');
printWindow.document.write('<html><head><title>For m Yazdırma</title>');
printWindow.document.write('</head><body>');
printWindow.document.write('<h2>Form Bilgileri</h2>');
printWindow.document.write('<p><strong>Tarih:</strong> ' + tarih + '</p>');
printWindow.document.write('<p><strong>Saat:</strong> ' + saat + '</p>');
printWindow.document.write('<p><strong>Açıklama:</strong> ' + aciklama + '</p>');
printWindow.document.write('<p><strong>Ürün Kodu:</strong> ' + urunKodu + '</p>');
printWindow.document.write('</body></html>');
printWindow.document.close();
printWindow.print();
}
</script>

</body>
</html>