</div> <div class="main-content site"> <div class="text-content"> <?php if ($_SESSION['auth'] != 'admin') { echo "Доступ запрещён"; } else { $form_action = 'roses_table.php'; $db_table = 'roses'; echo "\n\t\t\t\t\t\t<table>\n\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t<td>Цвет</td>\n\t\t\t\t\t\t\t\t<td>Высота</td>\n\t\t\t\t\t\t\t\t<td>Ширина</td>\n\t\t\t\t\t\t\t\t<td>Описание</td>\n\t\t\t\t\t\t\t\t<td>Цена</td>\n\t\t\t\t\t\t\t\t<td>Фото</td>\n\t\t\t\t\t\t\t\t<td>Доступность</td>\n\t\t\t\t\t\t\t\t<td>Поменять доступность</td>\n\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<form name='bd' enctype='multipart/form-data'>\n\t\t\t\t\t\t"; $i = 0; $rows = num_of_rows($db_table); $flower = new Flower(); while ($i <= $rows) { $flower->extract_from_db($db_table, $i + 1); echo "\n\t\t\t\t\t\t\t<tr>"; if ($i != $rows) { echo "\n\t\t\t\t\t\t\t\t<td><input type='text' id='color" . $i . "' name='color" . $i . "' value='" . $flower->color . "'></input></td>\n\t\t\t\t\t\t\t\t<td><input type='text' id='height" . $i . "' name='height" . $i . "' value='" . $flower->height . "'></input></td>\n\t\t\t\t\t\t\t\t<td><input type='text' id='width" . $i . "' name='width" . $i . "' value='" . $flower->width . "'></input></td>\n\t\t\t\t\t\t\t\t<td><textarea id='description" . $i . "' name='description" . $i . "'>{$flower->description}</textarea></td>\n\t\t\t\t\t\t\t\t<td><input type='text' id='price" . $i . "' name='price" . $i . "' value='" . $flower->price . "'></input></td>\n\t\t\t\t\t\t\t\t<td><input type='file' id='foto" . $i . "' name='foto" . $i . "' value=''>" . $flower->foto . "</input></td>"; if ($flower->availability == "да") { echo "<td><select id='availability" . $i . "' name='availability" . $i . "'>\n\t\t\t\t\t\t\t\t<option value='да' selected>yes</option>\n\t\t\t\t\t\t\t\t<option value='нет'>no</option>\n\t\t\t\t\t\t\t\t</select></td>"; } else { echo "<td><select id='availability" . $i . "' name='availability" . $i . "'>\n\t\t\t\t\t\t\t\t<option value='да'>yes</option>\n\t\t\t\t\t\t\t\t<option value='нет' selected>no</option>\n\t\t\t\t\t\t\t\t</select></td>"; } echo "\n\t\t\t\t\t\t\t\t<td><button id='alt" . $i . "' name='alt" . $i . "' class='button'>Изменить</button></td>\n\t\t\t\t\t\t\t\t<input type='hidden' id='" . $i . "' value='" . $i . "'></input>"; } else { echo "\n\t\t\t\t\t\t\t\t<td><input type='text' id='color" . $i . "' name='color" . $i . "' value=''></input></td>\n\t\t\t\t\t\t\t\t<td><input type='text' id='height" . $i . "' name='height" . $i . "' value=''></input></td>\n\t\t\t\t\t\t\t\t<td><input type='text' id='width" . $i . "' name='width" . $i . "' value=''></input></td>\n\t\t\t\t\t\t\t\t<td><textarea id='description" . $i . "' name='description" . $i . "'></textarea></td>\n\t\t\t\t\t\t\t\t<td><input type='text' id='price" . $i . "' name='price" . $i . "' value=''></input></td>\n\t\t\t\t\t\t\t\t<td><input type='file' id='foto" . $i . "' name='foto" . $i . "'></input></td>\n\t\t\t\t\t\t\t\t<td><select id='availability" . $i . "' name='availability" . $i . "'>\n\t\t\t\t\t\t\t\t<option value='да'>yes</option>\n\t\t\t\t\t\t\t\t<option value='нет'>no</option>\n\t\t\t\t\t\t\t\t</select></td>\n\t\t\t\t\t\t\t\t<td><button id='alt" . $i . "' name='alt" . $i . "' class='button'>Создать</button></td>\n\t\t\t\t\t\t\t\t<input type='hidden' id='alt" . $i . "' value='" . $i . "'></input>"; } echo "</tr>"; $i++; }
</div> <div class="main-content site"> <div class="text-content"><h2>Розы на продажу или обмен</h2> <?php $db_table = 'roses'; $form_action = 'rose.php'; $flower = new Flower(); $i = 0; $j = 0; $pages = 0; $items; $item[$pages] = ""; while ($i < num_of_rows($db_table)) { if (!$_REQUEST['filter'] and $flower->extract_from_db($db_table, $i + 1) or $_REQUEST['filter'] and $flower->extract_from_db($db_table, $i + 1, array($_REQUEST['min_cost'], $_REQUEST['max_cost']))) { echo $_POST['min_cost']; $items[$pages] = $items[$pages] . ' <div class="item"> <img src=' . 'foto/roses/' . $flower->foto . ' class="zoom" style="width: 300px;"></img> <div class="describe"> <ul> <li><b>Цвет:</b> ' . $flower->color . '</li> <li><b>Размеры:</b> ' . $flower->height . 'см в высоту, ' . $flower->width . 'см ширина</li> <li><b>Описание:</b> ' . $flower->description . '</li> <li><b>Цена:</b> ' . $flower->price . ' баксов</li> </ul> </div> </div> '; $j++;