Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="id">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>PEMUTAHIRAN DATA</title>
- <style>
- body {
- font-family: Arial, sans-serif;
- margin: 0;
- padding: 0;
- box-sizing: border-box;
- }
- .container {
- max-width: 800px;
- margin: 20px auto;
- padding: 20px;
- border: 1px solid #ccc;
- border-radius: 8px;
- background-color: #f9f9f9;
- }
- h2 {
- text-align: center;
- margin-bottom: 20px;
- }
- .form-group {
- margin-bottom: 15px;
- }
- label {
- display: block;
- margin-bottom: 5px;
- }
- input[type="text"], input[type="file"] {
- width: 100%;
- padding: 10px;
- border: 1px solid #ccc;
- border-radius: 4px;
- }
- .upload-btn {
- display: block;
- width: 100%;
- padding: 10px;
- margin-top: 10px;
- background-color: #007bff;
- color: white;
- text-align: center;
- border: none;
- border-radius: 4px;
- cursor: pointer;
- }
- .upload-btn:hover {
- background-color: #0056b3;
- }
- .form-section {
- margin-bottom: 20px;
- }
- .form-section h3 {
- margin-bottom: 10px;
- }
- .form-section .form-group {
- margin-bottom: 10px;
- }
- .print-btn {
- display: block;
- width: 100%;
- padding: 10px;
- background-color: #28a745;
- color: white;
- text-align: center;
- border: none;
- border-radius: 4px;
- cursor: pointer;
- }
- .print-btn:hover {
- background-color: #218838;
- }
- @media print {
- .print-btn {
- display: none;
- }
- }
- </style>
- </head>
- <body>
- <div class="container" id="capture">
- <h2>DOKUMENTASI PEMUTAHIRAN DATA</h2>
- <div class="form-group">
- <label for="nama">NAMA</label>
- <input type="text" id="nama" name="nama">
- </div>
- <div class="form-group">
- <label for="alamat">ALAMAT</label>
- <input type="text" id="alamat" name="alamat">
- </div>
- <div class="form-group">
- <label for="no_sambungan">NO. SAMBUNGAN</label>
- <input type="text" id="no_sambungan" name="no_sambungan">
- </div>
- <div class="form-section">
- <h3>FOTO RUMAH</h3>
- <div class="form-group">
- <input type="file" id="foto_rumah" name="foto_rumah">
- <button class="upload-btn">UPLOAD FOTO DISINI</button>
- </div>
- </div>
- <div class="form-section">
- <h3>FOTO METERAN BEKAS / BEKAS METERAN</h3>
- <div class="form-group">
- <input type="file" id="foto_meteran" name="foto_meteran">
- <button class="upload-btn">UPLOAD FOTO DISINI</button>
- </div>
- </div>
- <div class="form-section">
- <h3>FOTO PELANGGAN</h3>
- <div class="form-group">
- <input type="file" id="foto_pelanggan" name="foto_pelanggan">
- <button class="upload-btn">UPLOAD FOTO DISINI</button>
- </div>
- </div>
- <button class="print-btn" onclick="captureAndPrint()">CETAK HALAMAN</button>
- </div>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/0.4.1/html2canvas.min.js"></script>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/2.0.5/FileSaver.min.js"></script>
- <script>
- function captureAndPrint() {
- const nama = document.getElementById('nama').value || 'document';
- html2canvas(document.getElementById('capture')).then(canvas => {
- canvas.toBlob(function(blob) {
- saveAs(blob, `${nama}.jpg`);
- });
- });
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement