- <!DOCTYPE html>
- <html lang="tr">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" c initial-scale=1.0">
- <title>Sepetim</title>
- <style>
- body, html {
- height: 100%;
- margin: 0;
- padding: 0;
- font-family: Arial, sans-serif;
- background-color: #f2f2f2;
- color: #333;
- }
- .container {
- display: flex;
- justify-content: center;
- align-items: center;
- min-height: 100vh;
- flex-direction: column;
- }
- .content {
- max-width: 80%;
- text-align: center;
- border: 2px solid #333;
- border-radius: 10px;
- padding: 20px;
- background-color: #fff;
- }
- table {
- width: 100%;
- max-width: 1000px;
- margin: 20px auto;
- border-collapse: collapse;
- color: #333;
- background-color: #fff;
- }
- th, td {
- padding: 15px;
- border-bottom: 1px solid #ddd;
- }
- th {
- background-color: #333;
- color: #fff;
- }
- tr:hover {
- background-color: #f2f2f2;
- }
- .confirm-button {
- background-color: #4CAF50;
- border: none;
- color: white;
- padding: 10px 20px;
- text-align: center;
- text-decoration: none;
- display: inline-block;
- font-size: 16px;
- border-radius: 5px;
- cursor: pointer;
- transition-duration: 0.4s;
- }
- .confirm-button:hover {
- background-color: #45a049;
- }
- .success-message {
- color: green;
- font-weight: bold;
- display: none;
- }
- .notification {
- background-color: #333;
- color: #fff;
- padding: 10px;
- margin-top: 20px;
- border: 2px solid #fff;
- border-radius: 5px;
- margin-bottom: 20px;
- }
- </style>
- </head>
- <body>
- <div class="container">
- <div class="content">
- <h 20px;">Sepetim</h1>
- <?php
- function createNotification($urun_kodu, $order_quantity_36, $order_quantity_38, $order_quantity_40, $order_quantity_42) {
- $notification = "Ürün Kodu: " . $urun_kodu . "<br>";
- $notification .= "36 Beden Adeti: " . $order_quantity_36 . "<br>";
- $notification .= "38 Beden Adeti: " . $order_quantity_38 . "<br>";
- $notification .= "40 Beden Adeti: " . $order_quantity_40 . "<br>";
- $notification .= "42 Beden Adeti: " . $order_quantity_42 . "<br>";
- $file = 'bildirimler.txt';
- $current = file_get_contents($file);
- $current .= $notification . "<br>"; // Her bildirim için 1 satır
- file_put_contents($file, $current);
- }
- if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['order_submit'])) {
- $urun_kodu = $_POST['urun_kodu'];
- $order_quantity_36 = $_POST['order_quantity_36'];
- $order_quantity_38 = $_POST['order_quantity_38'];
- $order_quantity_40 = $_POST['order_quantity_40'];
- $order_quantity_42 = $_POST['order_quantity_42'];
- echo "<p>Sepetinizdeki ürün: $urun_kodu</p>";
- echo "<p>36 Beden: $order_quantity_36 adet</p>";
- echo "<p>38 Beden: $order_quantity_38 adet</p>";
- echo "<p>40 Beden: $order_quantity_40 adet</p>";
- echo "<p>42 Beden: $order_quantity_42 adet</p>";
- createNotification($urun_kodu, $order_quantity_36, $order_quantity_38, $order_quantity_40, $order_quantity_42);
- } else {
- echo "<p>Sepetinizde ürün bulunmamaktadır.</p>";
- }
- ?>
- >" method="post">
- <input class="confirm-button" type="submit" name="order_submit" value="ONAYLA">
- </form>
- <p class="success-message" id="successMessage">Siparişiniz alındı.</p>
- </div>
- </div>
- <div class="notification">
- <?php
- $file = 'bildirimler.txt';
- if(file_exists($file)) {
- $contents = file_get_contents($file);
- $lines = explode("<br>", $contents);
- $total_lines = count($lines);
- $num_columns = ceil($total_lines / 8); // Toplam bildirimlerin sütun sayısını hesapla
- for ($i = 0; $i < $num_columns; $i++) {
- echo "<div class='notification'>";
- for ($j = 0; $j < 8; $j++) {
- $index = $i * 8 + $j;
- if ($index < $total_lines) {
- echo $lines[$index] . "<br>";
- }
- }
- echo "</div>";
- }
- } else {
- echo "Bildirim bulunmamaktadır.";
- }
- ?>
- </div>
- [removed]
- document.getElementById('orderForm').addEventListener('submit', function(event) {
- document.getElementById('successMessage').style.display = 'block';
- document.querySelector('.confirm-button').style.display = 'none';
- });
- [removed]
- </body>
- </html>