/new/administrator/links.asp

https://github.com/akabeko/fusionexcel · ASP · 112 lines · 105 code · 7 blank · 0 comment · 13 complexity · 18e698591595b046864a6b307bbca80e MD5 · raw file

  1. <!--#include file="../libraries.asp" -->
  2. <%
  3. Dim page_title
  4. page_title = "Fusion Excel Content Management System "
  5. Dim RecordSet, sql, link_type
  6. link_type = 1
  7. if Request("link_type") <> "" then
  8. if IsNumeric(Request("link_type")) then
  9. link_type = CInt(Request("link_type"))
  10. End if
  11. End if
  12. if link_type = 1 then
  13. page_title = "[VIP QP Wearers] " & page_title
  14. elseif link_type = 2 then
  15. page_title = "[Videos] " & page_title
  16. end if
  17. %>
  18. <!--#include file="header.asp" -->
  19. <%
  20. if Request.ServerVariables("REQUEST_METHOD") = "POST" then
  21. if Request("delete") = 1 then
  22. call SetConnection(GetLinksDbPath())
  23. call OpenDatabase()
  24. sql = "DELETE FROM links WHERE link_id IN (" & Request("action_link_id") & ")"
  25. call ExecuteQuery(sql)
  26. call ReindexLinks()
  27. Response.Redirect("links.asp")
  28. end if
  29. end if
  30. %>
  31. <script type="text/javascript">
  32. function deleteConfirm() {
  33. var checkedVal = $("#id_links_list input:checked");
  34. if(checkedVal.length > 0) {
  35. if(confirm("Delete " + checkedVal.length + " record(s)?")) {
  36. $("#id_links_list").submit();
  37. }
  38. }
  39. }
  40. </script>
  41. <div style="float: left; margin-top: 15px;">
  42. <form method="post" action="links.asp?search=title">
  43. <label for="id_search_text">Search: </label><input type="text" name="search_query" id="id_search_text" value="" size="50" style="border-radius: 5px; border: 1px solid #CCC;" />
  44. </form>
  45. </div>
  46. <div id="button_navigator">
  47. <a href="javascript::void(0)" onclick="deleteConfirm()" class="delete-btn" title="Delete Selected"></a>
  48. <a href="link-edit.asp?action=add" class="new-btn" title="New VIP QP Wearers"></a>
  49. </div>
  50. <br />
  51. <%
  52. sql = "SELECT link_id, article_id, article_name, link_title, publish, modified, modified_by, link_type, external_url, order_index FROM links"'
  53. if Request("search") = "title" and Request("search_query") <> "" then
  54. sql = sql & " WHERE link_title LIKE '%" & Replace(Request("search_query"), " ", "%") & "%' "
  55. sql = sql & " OR article_name LIKE '%" & Replace(Request("search_query"), " ", "%") & "%' "
  56. sql = sql & " AND link_type = " & link_type
  57. end if
  58. sql = sql & " ORDER BY order_index DESC"
  59. call SetConnection(GetLinksDbPath())
  60. call OpenDatabase()
  61. call CreateRecordSet(RecordSet, sql)
  62. %>
  63. <form method="post" id="id_links_list" action="links.asp?delete=1">
  64. <table width="100%" border="0" cellspacing="0" cellpadding="0" class="link_list listing">
  65. <thead>
  66. <tr>
  67. <td>&nbsp;</td>
  68. <td>ID</td>
  69. <td>Article Title/ External URL</td>
  70. <td>Link Title</td>
  71. <td>Publish</td>
  72. <td>Last Modified</td>
  73. <td>Last Modified By</td>
  74. <td>Order</td>
  75. </tr>
  76. </thead>
  77. <tbody>
  78. <% Do While not RecordSet.EOF %>
  79. <tr>
  80. <td><input type="checkbox" name="action_link_id" value="<%= RecordSet("link_id") %>" /></td>
  81. <td><%= RecordSet("link_id") %></td>
  82. <td>
  83. <% if RecordSet("link_type") = 1 then %>
  84. <a href="article-edit.asp?action=edit&amp;id=<%= RecordSet("article_id") %>" target="_blank"><%= RecordSet("article_name") %></a>
  85. <% elseif RecordSet("link_type") = 2 then %>
  86. <a href="<%= RecordSet("external_url") %>" target="_blank"><%= RecordSet("external_url") %></a>
  87. <% end if %>
  88. </td>
  89. <td><a href="link-edit.asp?action=edit&amp;id=<%= RecordSet("link_id") %>"><%= RecordSet("link_title") %></a></td>
  90. <% if RecordSet("publish") then %>
  91. <td style="background: green; color: white;">Yes</td>
  92. <% else %>
  93. <td style="background: red; color: white;">No</td>
  94. <% end if %>
  95. <td><%= RecordSet("modified") %></td>
  96. <td><%= RecordSet("modified_by") %></td>
  97. <td><%= RecordSet("order_index") %></td>
  98. </tr>
  99. <% RecordSet.MoveNext %>
  100. <% Loop %>
  101. </tbody>
  102. </table>
  103. </form>
  104. <% call CloseRecordSet(RecordSet) %>
  105. <!--#include file="footer.asp" -->