Facebook
From m4, 2 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 173
  1. <!DOCTYPE html>
  2. &lt;html lang="tr"&gt;
  3. &lt;head&gt;
  4.     &lt;meta charset="UTF-8"&gt;
  5.     &lt;meta name="viewport" c initial-scale=1.0"&gt;
  6.     &lt;title&gt;Sepetim&lt;/title&gt;
  7.     &lt;style&gt;
  8.         body, html {
  9.             height: 100%;
  10.             margin: 0;
  11.             padding: 0;
  12.             font-family: Arial, sans-serif;
  13.             background-color: #f2f2f2;
  14.             color: #333;
  15.         }
  16.         .container {
  17.             display: flex;
  18.             justify-content: center;
  19.             align-items: center;
  20.             min-height: 100vh;
  21.             flex-direction: column;
  22.         }
  23.         .content {
  24.             max-width: 80%;
  25.             text-align: center;
  26.             border: 2px solid #333;
  27.             border-radius: 10px;
  28.             padding: 20px;
  29.             background-color: #fff;
  30.         }
  31.         table {
  32.             width: 100%;
  33.             max-width: 1000px;
  34.             margin: 20px auto;
  35.             border-collapse: collapse;
  36.             color: #333;
  37.             background-color: #fff;
  38.         }
  39.         th, td {
  40.             padding: 15px;
  41.             border-bottom: 1px solid #ddd;
  42.         }
  43.         th {
  44.             background-color: #333;
  45.             color: #fff;
  46.         }
  47.         tr:hover {
  48.             background-color: #f2f2f2;
  49.         }
  50.         .confirm-button {
  51.             background-color: #4CAF50;
  52.             border: none;
  53.             color: white;
  54.             padding: 10px 20px;
  55.             text-align: center;
  56.             text-decoration: none;
  57.             display: inline-block;
  58.             font-size: 16px;
  59.             border-radius: 5px;
  60.             cursor: pointer;
  61.             transition-duration: 0.4s;
  62.         }
  63.         .confirm-button:hover {
  64.             background-color: #45a049;
  65.         }
  66.         .success-message {
  67.             color: green;
  68.             font-weight: bold;
  69.             display: none;
  70.         }
  71.         .notification {
  72.             background-color: #333;
  73.             color: #fff;
  74.             padding: 10px;
  75.             margin-top: 20px;
  76.             border: 2px solid #fff;
  77.             border-radius: 5px;
  78.             margin-bottom: 20px;
  79.         }
  80.     &lt;/style&gt;
  81. &lt;/head&gt;
  82. &lt;body&gt;
  83.  
  84. <div class="container">
  85.     <div class="content">
  86.         <h   20px;">Sepetim</h1>
  87.        
  88.         &lt;?php
  89.         function createNotification($urun_kodu, $order_quantity_36, $order_quantity_38, $order_quantity_40, $order_quantity_42) {
  90.             $notification = "Ürün Kodu: " . $urun_kodu . "<br>";
  91.             $notification .= "36 Beden Adeti: " . $order_quantity_36 . "<br>";
  92.             $notification .= "38 Beden Adeti: " . $order_quantity_38 . "<br>";
  93.             $notification .= "40 Beden Adeti: " . $order_quantity_40 . "<br>";
  94.             $notification .= "42 Beden Adeti: " . $order_quantity_42 . "<br>";
  95.             $file = 'bildirimler.txt';
  96.             $current = file_get_contents&#40;$file&#41;;
  97.             $current .= $notification . "<br>"; // Her bildirim için 1 satır
  98.             file_put_contents($file, $current);
  99.         }
  100.  
  101.         if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['order_submit'])) {
  102.             $urun_kodu = $_POST['urun_kodu'];
  103.             $order_quantity_36 = $_POST['order_quantity_36'];
  104.             $order_quantity_38 = $_POST['order_quantity_38'];
  105.             $order_quantity_40 = $_POST['order_quantity_40'];
  106.             $order_quantity_42 = $_POST['order_quantity_42'];
  107.            
  108.             echo "<p>Sepetinizdeki ürün: $urun_kodu</p>";
  109.             echo "<p>36 Beden: $order_quantity_36 adet</p>";
  110.             echo "<p>38 Beden: $order_quantity_38 adet</p>";
  111.             echo "<p>40 Beden: $order_quantity_40 adet</p>";
  112.             echo "<p>42 Beden: $order_quantity_42 adet</p>";
  113.  
  114.             createNotification($urun_kodu, $order_quantity_36, $order_quantity_38, $order_quantity_40, $order_quantity_42);
  115.         } else {
  116.             echo "<p>Sepetinizde ürün bulunmamaktadır.</p>";
  117.         }
  118.         ?&gt;
  119.        
  120.         >" method="post">
  121.             &lt;input class="confirm-button" type="submit" name="order_submit" value="ONAYLA"&gt;
  122.         &lt;/form&gt;
  123.        
  124.         <p class="success-message" id="successMessage">Siparişiniz alındı.</p>
  125.     </div>
  126. </div>
  127.  
  128. <div class="notification">
  129.     &lt;?php
  130.     $file = 'bildirimler.txt';
  131.     if(file_exists($file)) {
  132.         $contents = file_get_contents&#40;$file&#41;;
  133.         $lines = explode("<br>", $contents);
  134.         $total_lines = count($lines);
  135.         $num_columns = ceil($total_lines / 8); // Toplam bildirimlerin sütun sayısını hesapla
  136.         for ($i = 0; $i < $num_columns; $i++) {
  137.             echo "<div class='notification'>";
  138.             for ($j = 0; $j < 8; $j++) {
  139.                 $index = $i * 8 + $j;
  140.                 if ($index < $total_lines) {
  141.                     echo $lines[$index] . "<br>";
  142.                 }
  143.             }
  144.             echo "</div>";
  145.         }
  146.     } else {
  147.         echo "Bildirim bulunmamaktadır.";
  148.     }
  149.     ?&gt;
  150. </div>
  151.  
  152. [removed]
  153.     document.getElementById('orderForm').addEventListener('submit', function(event) {
  154.         document.getElementById('successMessage').style.display = 'block';
  155.         document.querySelector('.confirm-button').style.display = 'none';
  156.     });
  157. [removed]
  158.  
  159. &lt;/body&gt;
  160. &lt;/html&gt;
  161.