BioTorrents.de’s version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

manage_artists.php 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. <?php
  2. declare(strict_types = 1);
  3. $CollageID = $_GET['collageid'];
  4. if (!is_number($CollageID)) {
  5. error(0);
  6. }
  7. $DB->query("
  8. SELECT Name, UserID, CategoryID
  9. FROM collages
  10. WHERE ID = '$CollageID'");
  11. list($Name, $UserID, $CategoryID) = $DB->next_record();
  12. if ($CategoryID === '0' && $UserID != $LoggedUser['ID'] && !check_perms('site_collages_delete')) {
  13. error(403);
  14. }
  15. if ($CategoryID != array_search(ARTIST_COLLAGE, $CollageCats)) {
  16. error(404);
  17. }
  18. $DB->query("
  19. SELECT
  20. ca.ArtistID,
  21. ag.Name,
  22. um.ID AS UserID,
  23. um.Username,
  24. ca.Sort
  25. FROM collages_artists AS ca
  26. JOIN artists_group AS ag ON ag.ArtistID = ca.ArtistID
  27. LEFT JOIN users_main AS um ON um.ID = ca.UserID
  28. WHERE ca.CollageID = '$CollageID'
  29. ORDER BY ca.Sort");
  30. $Artists = $DB->to_array('ArtistID', MYSQLI_ASSOC);
  31. View::show_header(
  32. "Manage collage $Name",
  33. 'vendor/jquery.tablesorter.min,sort'
  34. ); ?>
  35. <div>
  36. <h2 class="header">
  37. Manage collage
  38. <a href="collages.php?id=<?=$CollageID?>"><?=$Name?></a>
  39. </h2>
  40. <!-- Instructions -->
  41. <table width="100%" class="layout">
  42. <tr class="colhead">
  43. <td id="sorting_head">Sorting</td>
  44. </tr>
  45. <tr>
  46. <td id="drag_drop_textnote">
  47. <ul>
  48. <li>Click on the headings to organize columns automatically.</li>
  49. <li>Sort multiple columns simultaneously by holding down the shift key and clicking other column headers.</li>
  50. <li>Click and drag any row to change its order.</li>
  51. <li>Press "Save All Changes" when you are finished sorting.</li>
  52. <li>Press "Edit" or "Remove" to simply modify one entry.</li>
  53. </ul>
  54. </td>
  55. </tr>
  56. </table>
  57. <!-- Save All Changes -->
  58. <div class="drag_drop_save hidden">
  59. <input type="button" name="submit" value="Save All Changes" class="save_sortable_collage" />
  60. </div>
  61. <!-- Collage table headings -->
  62. <table id="manage_collage_table">
  63. <thead>
  64. <tr class="colhead">
  65. <th style="width: 7%;" data-sorter="false">
  66. Order
  67. </th>
  68. <th style="width: 1%;">
  69. <span><abbr class="tooltip" title="Current rank">#</abbr></span>
  70. </th>
  71. <th style="width: 1%;">
  72. <span><abbr class="tooltip" title="Accession number">#</abbr></span>
  73. </th>
  74. <th style="text-align: left;" data-sorter="ignoreArticles">
  75. <span>Creator</span>
  76. </th>
  77. <th style="width: 7%;" data-sorter="ignoreArticles">
  78. <span>User</span>
  79. </th>
  80. <th style="width: 7%; text-align: right;" class="nobr" data-sorter="false">
  81. <span><abbr class="tooltip" title="Modify an individual row.">Tweak</abbr></span>
  82. </th>
  83. </tr>
  84. </thead>
  85. <!-- Sortable collage table -->
  86. <tbody>
  87. <?php
  88. $Number = 0;
  89. foreach ($Artists as $Artist) {
  90. $Number++; ?>
  91. <tr class="drag row"
  92. id="li_<?=$Artist['ArtistID']?>">
  93. <form class="manage_form" name="collage" action="collages.php" method="post">
  94. <td>
  95. <input class="sort_numbers" type="text" name="sort"
  96. value="<?=$Artist['Sort']?>"
  97. id="sort_<?=$Artist['ArtistID']?>"
  98. size="4" />
  99. </td>
  100. <td><?=$Number?>
  101. </td>
  102. <td><?=(trim($Artist['Name']) ?: '&nbsp;')?>
  103. </td>
  104. <td class="nobr"><?=Users::format_username($Artist['UserID'], $$Artist['Username'], false, false, false)?>
  105. </td>
  106. <td class="nobr">
  107. <input type="hidden" name="action" value="manage_artists_handle" />
  108. <input type="hidden" name="auth"
  109. value="<?=$LoggedUser['AuthKey']?>" />
  110. <input type="hidden" name="collageid"
  111. value="<?=$CollageID?>" />
  112. <input type="hidden" name="artistid"
  113. value="<?=$Artist['ArtistID']?>" />
  114. <input type="submit" name="submit" value="Edit" />
  115. <input type="submit" name="submit" value="Remove" />
  116. </td>
  117. </form>
  118. </tr>
  119. <?php
  120. } ?>
  121. </tbody>
  122. </table>
  123. <div class="drag_drop_save hidden">
  124. <input type="button" name="submit" value="Save All Changes" class="save_sortable_collage" />
  125. </div>
  126. <form class="dragdrop_form hidden" name="collage" action="collages.php" method="post" id="drag_drop_collage_form">
  127. <div>
  128. <input type="hidden" name="action" value="manage_artists_handle" />
  129. <input type="hidden" name="auth"
  130. value="<?=$LoggedUser['AuthKey']?>" />
  131. <input type="hidden" name="collageid"
  132. value="<?=$CollageID?>" />
  133. <input type="hidden" name="artistid" value="1" />
  134. <input type="hidden" name="drag_drop_collage_sort_order" id="drag_drop_collage_sort_order" readonly="readonly"
  135. value="" />
  136. </div>
  137. </form>
  138. </div>
  139. <?php View::show_footer();