updateListOrder.php 560 B

123456789101112131415161718192021222324
  1. <?php
  2. require "app.php";
  3. $type = "";
  4. if (isset($_GET['type']))
  5. $type = $_GET['type'];
  6. else
  7. die("No type specified.");
  8. if (!hasPermission("list.$type")) {
  9. die("Not enough permissions.");
  10. }
  11. $updateRecordsArray = $_POST['Item'];
  12. $listingCounter = 1;
  13. foreach ($updateRecordsArray as $recordIDValue) {
  14. $query = "UPDATE $type SET listId='$listingCounter' WHERE UID='$recordIDValue'";
  15. $conn->query($query) or die('Error, insert query failed');
  16. $listingCounter = $listingCounter + 1;
  17. }
  18. echo "Successfully saved order!";
  19. ?>