printirder
<!DOCTYPE html>
<html lang="he" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>הזמנת יהלומים</title>
<style>
body {
font-family: Arial, sans-serif;
direction: rtl;
text-align: right;
margin: 20px;
}
.form-container {
max-width: 600px;
margin: auto;
background-color: #f9f9f9;
padding: 20px;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table, th, td {
border: 1px solid black;
}
th, td {
padding: 10px;
text-align: center;
}
.buttons-row {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 20px;
}
button {
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
flex: 1;
text-align: center;
}
button:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="form-container">
<h1>הזמנת יהלומים</h1>
<form id="order-form">
<label for="full-name">שם פרטי ושם משפחה:</label>
<input type="text" id="full-name" placeholder="הזן שם פרטי ושם משפחה">
<label for="phone-number">מספר פלאפון:</label>
<input type="text" id="phone-number" placeholder="הזן מספר פלאפון">
<label for="note">הערות:</label>
<input type="text" id="note" placeholder="הזן הערות נוספות">
</form>
<h2>עגלת קניות</h2>
<table id="cart-items">
<thead>
<tr>
<th>מספר הזמנה</th>
<th>צורה</th>
<th>גודל</th>
<th>כמות</th>
<th>הערות</th>
</tr>
</thead>
<tbody>
<!-- כאן יתווספו המוצרים -->
</tbody>
</table>
<div class="buttons-row">
<button type="button" id="add-to-cart">הוסף לעגלה</button>
<button type="button" id="print-order">הדפס הזמנה</button>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const cartTable = document.querySelector("#cart-items tbody");
document.getElementById("add-to-cart").addEventListener("click", function () {
const name = document.getElementById("full-name").value;
const phone = document.getElementById("phone-number").value;
const note = document.getElementById("note").value;
if (!name || !phone) {
alert("יש למלא שם ומספר פלאפון.");
return;
}
const row = document.createElement("tr");
row.innerHTML = `
<td>${cartTable.children.length + 1}</td>
<td>צורה לדוגמה</td>
<td>גודל לדוגמה</td>
<td>כמות לדוגמה</td>
<td>${note || "אין הערות"}</td>
`;
cartTable.appendChild(row);
});
document.getElementById("print-order").addEventListener("click", function () {
let printContent = `
<h1>הזמנת יהלומים</h1>
<h2>פרטי ההזמנה:</h2>
<p><b>שם:</b> ${document.getElementById("full-name").value}</p>
<p><b>טלפון:</b> ${document.getElementById("phone-number").value}</p>
<p><b>הערות:</b> ${document.getElementById("note").value || "אין הערות"}</p>
<h2>עגלת קניות:</h2>
<table style="width: 100%; border-collapse: collapse; text-align: center;">
<thead>
<tr>
<th style="border: 1px solid black; padding: 8px;">מספר הזמנה</th>
<th style="border: 1px solid black; padding: 8px;">צורה</th>
<th style="border: 1px solid black; padding: 8px;">גודל</th>
<th style="border: 1px solid black; padding: 8px;">כמות</th>
<th style="border: 1px solid black; padding: 8px;">הערות</th>
</tr>
</thead>
<tbody>
`;
const rows = cartTable.querySelectorAll("tr");
rows.forEach(row => {
const columns = row.querySelectorAll("td");
printContent += `
<tr>
<td style="border: 1px solid black; padding: 8px;">${columns[0].textContent}</td>
<td style="border: 1px solid black; padding: 8px;">${columns[1].textContent}</td>
<td style="border: 1px solid black; padding: 8px;">${columns[2].textContent}</td>
<td style="border: 1px solid black; padding: 8px;">${columns[3].textContent}</td>
<td style="border: 1px solid black; padding: 8px;">${columns[4].textContent}</td>
</tr>
`;
});
printContent += `
</tbody>
</table>
`;
const printWindow = window.open("", "_blank");
printWindow.document.write(`
<html>
<head><title>הדפס הזמנה</title></head>
<body>${printContent}</body>
</html>
`);
printWindow.document.close();
printWindow.print();
});
});
</script>
</body>
</html>
<html lang="he" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>הזמנת יהלומים</title>
<style>
body {
font-family: Arial, sans-serif;
direction: rtl;
text-align: right;
margin: 20px;
}
.form-container {
max-width: 600px;
margin: auto;
background-color: #f9f9f9;
padding: 20px;
border: 1px solid #ddd;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table, th, td {
border: 1px solid black;
}
th, td {
padding: 10px;
text-align: center;
}
.buttons-row {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 20px;
}
button {
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
flex: 1;
text-align: center;
}
button:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="form-container">
<h1>הזמנת יהלומים</h1>
<form id="order-form">
<label for="full-name">שם פרטי ושם משפחה:</label>
<input type="text" id="full-name" placeholder="הזן שם פרטי ושם משפחה">
<label for="phone-number">מספר פלאפון:</label>
<input type="text" id="phone-number" placeholder="הזן מספר פלאפון">
<label for="note">הערות:</label>
<input type="text" id="note" placeholder="הזן הערות נוספות">
</form>
<h2>עגלת קניות</h2>
<table id="cart-items">
<thead>
<tr>
<th>מספר הזמנה</th>
<th>צורה</th>
<th>גודל</th>
<th>כמות</th>
<th>הערות</th>
</tr>
</thead>
<tbody>
<!-- כאן יתווספו המוצרים -->
</tbody>
</table>
<div class="buttons-row">
<button type="button" id="add-to-cart">הוסף לעגלה</button>
<button type="button" id="print-order">הדפס הזמנה</button>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const cartTable = document.querySelector("#cart-items tbody");
document.getElementById("add-to-cart").addEventListener("click", function () {
const name = document.getElementById("full-name").value;
const phone = document.getElementById("phone-number").value;
const note = document.getElementById("note").value;
if (!name || !phone) {
alert("יש למלא שם ומספר פלאפון.");
return;
}
const row = document.createElement("tr");
row.innerHTML = `
<td>${cartTable.children.length + 1}</td>
<td>צורה לדוגמה</td>
<td>גודל לדוגמה</td>
<td>כמות לדוגמה</td>
<td>${note || "אין הערות"}</td>
`;
cartTable.appendChild(row);
});
document.getElementById("print-order").addEventListener("click", function () {
let printContent = `
<h1>הזמנת יהלומים</h1>
<h2>פרטי ההזמנה:</h2>
<p><b>שם:</b> ${document.getElementById("full-name").value}</p>
<p><b>טלפון:</b> ${document.getElementById("phone-number").value}</p>
<p><b>הערות:</b> ${document.getElementById("note").value || "אין הערות"}</p>
<h2>עגלת קניות:</h2>
<table style="width: 100%; border-collapse: collapse; text-align: center;">
<thead>
<tr>
<th style="border: 1px solid black; padding: 8px;">מספר הזמנה</th>
<th style="border: 1px solid black; padding: 8px;">צורה</th>
<th style="border: 1px solid black; padding: 8px;">גודל</th>
<th style="border: 1px solid black; padding: 8px;">כמות</th>
<th style="border: 1px solid black; padding: 8px;">הערות</th>
</tr>
</thead>
<tbody>
`;
const rows = cartTable.querySelectorAll("tr");
rows.forEach(row => {
const columns = row.querySelectorAll("td");
printContent += `
<tr>
<td style="border: 1px solid black; padding: 8px;">${columns[0].textContent}</td>
<td style="border: 1px solid black; padding: 8px;">${columns[1].textContent}</td>
<td style="border: 1px solid black; padding: 8px;">${columns[2].textContent}</td>
<td style="border: 1px solid black; padding: 8px;">${columns[3].textContent}</td>
<td style="border: 1px solid black; padding: 8px;">${columns[4].textContent}</td>
</tr>
`;
});
printContent += `
</tbody>
</table>
`;
const printWindow = window.open("", "_blank");
printWindow.document.write(`
<html>
<head><title>הדפס הזמנה</title></head>
<body>${printContent}</body>
</html>
`);
printWindow.document.close();
printWindow.print();
});
});
</script>
</body>
</html>