Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <tbody>
- <?php
- while ($row = mysqli_fetch_assoc($query)) { ?>
- <form method="post" action="save-supplier-status.php" class="supplierStatusF">
- <tr <?php if ($row['hotel_overview'] == 0 || $row['room_text'] == 0 || $row['facilities_overview'] == 0 || $row['location_overview'] == 0 || $row['additional_info'] == 0 || $row['added_values'] == 0) {echo 'class="info supplierRow"';} else if ($row['general_images'] == 0 || $row['general_images'] == 0) {echo 'class="danger"';} ?>>
- <td><input type="text" name="supplier" class="supplierC" value="<?php echo $row['supplierName'];?>" hidden><?php echo $row['supplierName'];?></td>
- <td class="supplierStatusTd"><input type="checkbox" name="live" class="live" value="1" <?php echo ($row['live'] == 1 ? 'checked' : '');?>></td>
- <td class="supplierStatusTd"><input type="hidden" name="overviewText" value="0"><input type="checkbox" class="overviewText" name="overviewText" value="1" <?php echo ($row['hotel_overview'] == 1 ? 'checked' : '');?>></td>
- <td class="supplierStatusTd"><input type="hidden" name="generalImages" value="0"><input type="checkbox" class="generalImages" name="generalImages" value="1" <?php echo ($row['general_images'] == 1 ? 'checked' : '');?>></td>
- <td class="supplierStatusTd"><input type="hidden" name="roomText" value="0"><input type="checkbox" class="roomText" name="roomText" value="1" <?php echo ($row['room_text'] == 1 ? 'checked' : '');?>></td>
- <td class="supplierStatusTd"><input type="hidden" name="roomImages" value="0"><input type="checkbox" class="roomImages" name="roomImages" value="1" <?php echo ($row['room_images'] == 1 ? 'checked' : '');?>></td>
- <td class="supplierStatusTd"><input type="hidden" name="facilities" value="0"><input type="checkbox" class="facilities" name="facilities" value="1" <?php echo ($row['facilities_overview'] == 1 ? 'checked' : '');?>></td>
- <td class="supplierStatusTd"><input type="hidden" name="location" value="0"><input type="checkbox" class="location" name="location" value="1" <?php echo ($row['location_overview'] == 1 ? 'checked' : '');?>></td>
- <td class="supplierStatusTd"><input type="hidden" name="additionalInfo" value="0"><input type="checkbox" class="additionalInfo" name="additionalInfo" value="1" <?php echo ($row['additional_info'] == 1 ? 'checked' : '');?>></td>
- <td class="supplierStatusTd"><input type="hidden" name="addedValues" value="0"><input type="checkbox" class="addedValues" name="addedValues" value="1" <?php echo ($row['added_values'] == 1 ? 'checked' : '');?>></td>
- <td><button type="submit" class="btn btn-success btn-xs" class="supplierCheckB" name="supplierCheckB">UPDATE</button></td>
- </tr>
- </form>
- <?php } ?>
- </tbody>
- if (empty($_POST) === false && empty($errors)) {
- $supplier = $_POST['supplier'];
- $live = $_POST['live'];
- $overviewText = $_POST['overviewText'];
- $generalImages = $_POST['generalImages'];
- $roomText = $_POST['roomText'];
- $roomImages = $_POST['roomImages'];
- $facilities = $_POST['facilities'];
- $location = $_POST['location'];
- $additionalInfo = $_POST['additionalInfo'];
- $addedValues = $_POST['addedValues']; --execute SQL update using prepared statements-- }
Add Comment
Please, Sign In to add comment