<% local form, viewlibrary, page_info, session = ... %> <% htmlviewfunctions = require("htmlviewfunctions") %> <% html = require("acf.html") %> <% if form.value.tables and #form.value.tables.value>0 then %> <% end %> <% htmlviewfunctions.displaycommandresults({"createdatabase"}, session) %> <% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %> <% if form.value.connection and next(form.value.connection.value) ~= nil then htmlviewfunctions.displayformstart(form, page_info) htmlviewfunctions.displayitem(form.value.connection, page_info, htmlviewfunctions.incrementheader(header_level), "connection") form.option = "Update" htmlviewfunctions.displayformend(form, htmlviewfunctions.incrementheader(header_level)) end %> <% if form.value.tables and #form.value.tables.value>0 then %> <% -- We will reuse the form connection structure to pass key values to viewtable local formvalues = {} if form.value.connection then formvalues.connection = form.value.connection for n,v in pairs(form.value.connection.value) do v.type="hidden" end end formvalues.table = cfe({ type="hidden" }) %> <% for i,tab in ipairs(form.value.tables.value) do %> <% formvalues.table.value = tab %> <% end %>
Action Table
<% if viewlibrary.check_permission("viewtable") then %> <% htmlviewfunctions.displayitem(cfe({type="link", value=formvalues, label="", option="View", action="viewtable"}), page_info, -1) %> <% end %> <%= html.html_escape(tab) %>
<% elseif viewlibrary.check_permission("createdatabase") then %> <% htmlviewfunctions.displayitem(cfe({type="form", value={}, label="Create Database", option="Create", action="createdatabase" }), page_info, 0) %> <% else %>

No tables found

<% end %> <% htmlviewfunctions.displaysectionend(header_level) %>