[e3d4e0a] | 1 | <?php
|
---|
| 2 | session_start();
|
---|
| 3 |
|
---|
| 4 | if(!isset($_SESSION['user_ID']) || !isset($_SESSION['is_admin']) || !$_SESSION['is_admin']) {
|
---|
| 5 | header("Location: ./Log In.php");
|
---|
| 6 | }
|
---|
| 7 | ?>
|
---|
| 8 | <!DOCTYPE html>
|
---|
| 9 | <html lang="en">
|
---|
| 10 | <head>
|
---|
| 11 | <meta charset="UTF-8">
|
---|
| 12 | <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
---|
| 13 | <title>Add Product</title>
|
---|
| 14 | <link rel="stylesheet" href="./CSS/AddProduct.css">
|
---|
| 15 | </head>
|
---|
| 16 | <body>
|
---|
| 17 |
|
---|
| 18 | <form method="POST" action="./verifyNewProduct.php" enctype="multipart/form-data">
|
---|
| 19 | <div class="container">
|
---|
| 20 | <div class="productinfo">
|
---|
| 21 | <label>Name</label>
|
---|
| 22 | <input type="text" name="name" required>
|
---|
| 23 | <label>Price</label>
|
---|
| 24 | <input type="number" name="price" required>
|
---|
| 25 | <label>Discount</label>
|
---|
| 26 | <input type="number" name="discount" min="0" max="70" required>
|
---|
| 27 | <label>inStock</label>
|
---|
| 28 | <select name="in_stock">
|
---|
| 29 | <option value="false">No</option>
|
---|
| 30 | <option value="true">Yes</option>
|
---|
| 31 | </select>
|
---|
| 32 | <label>Category</label>
|
---|
| 33 | <select name="category">
|
---|
| 34 | <option value="CPU">CPU</option>
|
---|
| 35 | <option value="GPU">GPU</option>
|
---|
| 36 | <option value="Motherboard">Motherboard</option>
|
---|
| 37 | <option value="Power-Supply">Power Supply</option>
|
---|
| 38 | <option value="Monitor">Monitor</option>
|
---|
| 39 | <option value="Peripherals">Peripherals</option>
|
---|
| 40 | <option value="Cases">Cases</option>
|
---|
| 41 | <option value="Data">Data</option>
|
---|
| 42 | </select>
|
---|
| 43 | <label>Description</label>
|
---|
| 44 | <textarea name="description" required></textarea>
|
---|
| 45 | <label>Images</label>
|
---|
| 46 | <input type="file" name="images[]" id="filechooser">
|
---|
| 47 | <input type="file" name="images[]" id="filechooser">
|
---|
| 48 | <input type="file" name="images[]" id="filechooser">
|
---|
| 49 | <input type="file" name="images[]" id="filechooser">
|
---|
| 50 | </div>
|
---|
| 51 |
|
---|
| 52 | <ul id="myUL">
|
---|
| 53 | <li><span class="opisList">Опис</span>
|
---|
| 54 | <ul class="nested">
|
---|
| 55 | <li>
|
---|
| 56 | <input type="checkbox" class="toggle-input" name="brand" checked>Бренд
|
---|
| 57 | <input type="text" class="text-field" name="brand-value">
|
---|
| 58 | </li>
|
---|
| 59 | <li>
|
---|
| 60 | <input type="checkbox" class="toggle-input" name="series" checked>Серија
|
---|
| 61 | <input type="text" class="text-field" name="series-value">
|
---|
| 62 | </li>
|
---|
| 63 | <li>
|
---|
| 64 | <input type="checkbox" class="toggle-input" name="model_number" checked>Број на модел
|
---|
| 65 | <input type="text" class="text-field" name="model_number-value">
|
---|
| 66 | </li>
|
---|
| 67 | <li>
|
---|
| 68 | <input type="checkbox" class="toggle-input" name="weight" checked>Тежина
|
---|
| 69 | <input type="text" class="text-field" name="weight-value">
|
---|
| 70 | </li>
|
---|
| 71 | <li>
|
---|
| 72 | <input type="checkbox" class="toggle-input" name="dimensions" checked>Димензии на производот
|
---|
| 73 | <input type="text" class="text-field" name="dimensions-value">
|
---|
| 74 | </li>
|
---|
| 75 | <li>
|
---|
| 76 | <input type="checkbox" class="toggle-input" name="color" checked>Боја
|
---|
| 77 | <input type="text" class="text-field" name="color-value">
|
---|
| 78 | </li>
|
---|
| 79 | <li>
|
---|
| 80 | <input type="checkbox" class="toggle-input" name="manufactuer" checked>Производител
|
---|
| 81 | <input type="text" class="text-field" name="manufactuer-value">
|
---|
| 82 | </li>
|
---|
| 83 | <li>
|
---|
| 84 | <input type="checkbox" class="toggle-input" name="origin" checked>Земја на потекло
|
---|
| 85 | <input type="text" class="text-field" name="origin-value">
|
---|
| 86 | </li>
|
---|
| 87 | <li>
|
---|
| 88 | <input type="checkbox" class="toggle-input" name="firstDate" checked>Прво достапен на датум
|
---|
| 89 | <input type="text" class="text-field" name="firstDate-value">
|
---|
| 90 | </li>
|
---|
| 91 | <li><span class="opisList">More</span>
|
---|
| 92 | <ul class="nested">
|
---|
| 93 | <li>
|
---|
| 94 | <input type="checkbox" class="toggle-input" name="energy">Извор на енергија
|
---|
| 95 | <input type="text" class="text-field" name="energy-value">
|
---|
| 96 | </li>
|
---|
| 97 | <li>
|
---|
| 98 | <input type="checkbox" class="toggle-input" name="volts">Волти
|
---|
| 99 | <input type="number" class="text-field" name="volts-value">
|
---|
| 100 | </li>
|
---|
| 101 | <li>
|
---|
| 102 | <input type="checkbox" class="toggle-input" name="memorySpeed">Брзина на меморија
|
---|
| 103 | <input type="text" class="text-field" name="memorySpeed-value">
|
---|
| 104 | </li>
|
---|
| 105 | <li>
|
---|
| 106 | <input type="checkbox" class="toggle-input" name="usb3">Број на USB 3.0 порти
|
---|
| 107 | <input type="number" class="text-field" name="usb3-value">
|
---|
| 108 | </li>
|
---|
| 109 | <li>
|
---|
| 110 | <input type="checkbox" class="toggle-input" name="usb2">Број на USB 2.0 порти
|
---|
| 111 | <input type="number" class="text-field" name="usb2-value">
|
---|
| 112 | </li>
|
---|
| 113 | <li><span class="opisList">Процесор</span>
|
---|
| 114 | <ul class="nested">
|
---|
| 115 | <li>
|
---|
| 116 | <input type="checkbox" class="toggle-input" name="processorBrand">Бренд на процесор
|
---|
| 117 | <input type="text" class="text-field" name="processorBrand-value">
|
---|
| 118 | </li>
|
---|
| 119 | <li>
|
---|
| 120 | <input type="checkbox" class="toggle-input" name="numProcess">Number of Processors
|
---|
| 121 | <input type="number" class="text-field" name="numProcess-value">
|
---|
| 122 | </li>
|
---|
| 123 | <li>
|
---|
| 124 | <input type="checkbox" class="toggle-input" name="typeMem">Тип на меморија на компјутер
|
---|
| 125 | <input type="text" class="text-field" name="typeMem-value">
|
---|
| 126 | </li>
|
---|
| 127 | </ul>
|
---|
| 128 | </li>
|
---|
| 129 | <li><span class="opisList">Disks</span>
|
---|
| 130 | <ul class="nested">
|
---|
| 131 | <li>
|
---|
| 132 | <input type="checkbox" class="toggle-input" name="HardDD">Hard Drive
|
---|
| 133 | <input type="text" class="text-field" name="HardDD-value">
|
---|
| 134 | </li>
|
---|
| 135 | <li>
|
---|
| 136 | <input type="checkbox" class="toggle-input" name="HardPlat">Hardware Platform
|
---|
| 137 | <input type="text" class="text-field" name="HardPlat-value">
|
---|
| 138 | </li>
|
---|
| 139 | <li>
|
---|
| 140 | <input type="checkbox" class="toggle-input" name="HardFlash">Flash Memory Size
|
---|
| 141 | <input type="text" class="text-field" name="HardFlash-value">
|
---|
| 142 | </li>
|
---|
| 143 | <li>
|
---|
| 144 | <input type="checkbox" class="toggle-input" name="HardInterface">Hard Drive Interface
|
---|
| 145 | <input type="text" class="text-field" name="HardInterface-value">
|
---|
| 146 | </li>
|
---|
| 147 | </ul>
|
---|
| 148 | <li><span class="opisList">GPU</span>
|
---|
| 149 | <ul class="nested">
|
---|
| 150 | <li>
|
---|
| 151 | <input type="checkbox" class="toggle-input" name="gpuRAM">Graphics Card Ram Size
|
---|
| 152 | <input type="number" class="text-field" name="gpuRAM-value">
|
---|
| 153 | </li>
|
---|
| 154 | </ul>
|
---|
| 155 | </li>
|
---|
| 156 | <li><span class="opisList">Motherboard</span>
|
---|
| 157 | <ul class="nested">
|
---|
| 158 | <li>
|
---|
| 159 | <input type="checkbox" class="toggle-input" name="motherboardRAM">RAM
|
---|
| 160 | <input type="number" class="text-field" name="motherboardRAM-value">
|
---|
| 161 | </li>
|
---|
| 162 | <li>
|
---|
| 163 | <input type="checkbox" class="toggle-input" name="motherboardTYPE">Wireless Type
|
---|
| 164 | <input type="text" class="text-field" name="motherboardTYPE-value">
|
---|
| 165 | </li>
|
---|
| 166 | </ul>
|
---|
| 167 | </li>
|
---|
| 168 | <li><span class="opisList">Monitor</span>
|
---|
| 169 | <ul class="nested">
|
---|
| 170 | <li>
|
---|
| 171 | <input type="checkbox" class="toggle-input" name="screenSize">Големина на екран
|
---|
| 172 | <input type="text" class="text-field" name="screenSize-value">
|
---|
| 173 | </li>
|
---|
| 174 | <li>
|
---|
| 175 | <input type="checkbox" class="toggle-input" name="screenRes">Резолуција на екранот
|
---|
| 176 | <input type="text" class="text-field" name="screenRes-value">
|
---|
| 177 | </li>
|
---|
| 178 | <li>
|
---|
| 179 | <input type="checkbox" class="toggle-input" name="screenMax">Максимална резолуција на екранот
|
---|
| 180 | <input type="text" class="text-field" name="screenMax-value">
|
---|
| 181 | </li>
|
---|
| 182 | </ul>
|
---|
| 183 | </li>
|
---|
| 184 | </ul>
|
---|
| 185 | </li>
|
---|
| 186 | </ul>
|
---|
| 187 | </li>
|
---|
| 188 | </ul>
|
---|
| 189 | <button type="submit" class="btn-new-product">Add New Product</button>
|
---|
| 190 | </div>
|
---|
| 191 | </form>
|
---|
| 192 |
|
---|
| 193 | <script>
|
---|
| 194 | var toggler = document.getElementsByClassName("opisList");
|
---|
| 195 | var i;
|
---|
| 196 |
|
---|
| 197 | for (i = 0; i < toggler.length; i++) {
|
---|
| 198 | toggler[i].addEventListener("click", function() {
|
---|
| 199 | this.parentElement.querySelector(".nested").classList.toggle("active");
|
---|
| 200 | this.classList.toggle("opisList-down");
|
---|
| 201 | });
|
---|
| 202 | }
|
---|
| 203 | </script>
|
---|
| 204 | </body>
|
---|
| 205 | </html> |
---|