index.twig 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <ul class="nav nav-pills m-2">
  2. <li class="nav-item">
  3. <a class="nav-link" href="{{ url('/table/search', {'db': db, 'table': table, 'pos': 0}) }}">
  4. {{ get_icon('b_search', 'Table search'|trans, false, false, 'TabsMode') }}
  5. </a>
  6. </li>
  7. <li class="nav-item">
  8. <a class="nav-link active" href="{{ url('/table/zoom-search', {'db': db, 'table': table}) }}">
  9. {{ get_icon('b_select', 'Zoom search'|trans, false, false, 'TabsMode') }}
  10. </a>
  11. </li>
  12. <li class="nav-item">
  13. <a class="nav-link" href="{{ url('/table/find-replace', {'db': db, 'table': table}) }}">
  14. {{ get_icon('b_find_replace', 'Find and replace'|trans, false, false, 'TabsMode') }}
  15. </a>
  16. </li>
  17. </ul>
  18. <form method="post" action="{{ url('/table/zoom-search') }}" name="insertForm" id="zoom_search_form" class="ajax lock-page">
  19. {{ get_hidden_inputs(db, table) }}
  20. <input type="hidden" name="goto" value="{{ goto }}">
  21. <input type="hidden" name="back" value="{{ url('/table/zoom-search') }}">
  22. <fieldset id="fieldset_zoom_search">
  23. <fieldset id="inputSection">
  24. <legend>
  25. {% trans 'Do a "query by example" (wildcard: "%") for two different columns' %}
  26. </legend>
  27. <table class="table table-light table-striped table-hover table-sm w-auto" id="tableFieldsId">
  28. <thead class="thead-light">
  29. <tr>
  30. {% if geom_column_flag %}
  31. <th>{% trans 'Function' %}</th>
  32. {% endif %}
  33. <th>{% trans 'Column' %}</th>
  34. <th>{% trans 'Type' %}</th>
  35. <th>{% trans 'Collation' %}</th>
  36. <th>{% trans 'Operator' %}</th>
  37. <th>{% trans 'Value' %}</th>
  38. </tr>
  39. </thead>
  40. <tbody>
  41. {% set type = [] %}
  42. {% set collation = [] %}
  43. {% set func = [] %}
  44. {% set value = [] %}
  45. {% for i in 0..3 %}
  46. {# After X-Axis and Y-Axis column rows, display additional criteria option #}
  47. {% if i == 2 %}
  48. <tr>
  49. <th>
  50. {% trans 'Additional search criteria' %}
  51. </th>
  52. </tr>
  53. {% endif %}
  54. <tr class="noclick">
  55. <th>
  56. <select name="criteriaColumnNames[]" id="tableid_{{ i }}">
  57. <option value="pma_null">
  58. {% trans 'None' %}
  59. </option>
  60. {% for j in 0..column_names|length - 1 %}
  61. {% if criteria_column_names[i] is defined and criteria_column_names[i] == column_names[j] %}
  62. <option value="{{ column_names[j] }}" selected>
  63. {{ column_names[j] }}
  64. </option>
  65. {% else %}
  66. <option value="{{ column_names[j] }}">
  67. {{ column_names[j] }}
  68. </option>
  69. {% endif %}
  70. {% endfor %}
  71. </select>
  72. </th>
  73. {% if criteria_column_names[i] is defined and criteria_column_names[i] != 'pma_null' %}
  74. {% set key = keys[criteria_column_names[i]] %}
  75. {% set properties = self.getColumnProperties(i, key) %}
  76. {% set type = type|merge({(i): properties['type']}) %}
  77. {% set collation = collation|merge({(i): properties['collation']}) %}
  78. {% set func = func|merge({(i): properties['func']}) %}
  79. {% set value = value|merge({(i): properties['value']}) %}
  80. {% endif %}
  81. {# Column type #}
  82. <td dir="ltr">
  83. {{ type[i] is defined ? type[i] }}
  84. </td>
  85. {# Column Collation #}
  86. <td>
  87. {{ collation[i] is defined ? collation[i] }}
  88. </td>
  89. {# Select options for column operators #}
  90. <td>
  91. {{ func[i] is defined ? func[i]|raw }}
  92. </td>
  93. {# Inputbox for search criteria value #}
  94. <td>
  95. {{ value[i] is defined ? value[i]|raw }}
  96. </td>
  97. <td>
  98. {# Displays hidden fields #}
  99. <input type="hidden" name="criteriaColumnTypes[{{ i }}]" id="types_{{ i }}"
  100. {%- if criteria_column_types[i] is defined %} value="{{ criteria_column_types[i] }}"{% endif %}>
  101. <input type="hidden" name="criteriaColumnCollations[{{ i }}]" id="collations_{{ i }}">
  102. </td>
  103. </tr>
  104. {% endfor %}
  105. </tbody>
  106. </table>
  107. <table class="table table-borderless table-sm w-auto">
  108. <tr>
  109. <td>
  110. <label for="dataLabel">
  111. {% trans 'Use this column to label each point' %}
  112. </label>
  113. </td>
  114. <td>
  115. <select name="dataLabel" id="dataLabel">
  116. <option value="">
  117. {% trans 'None' %}
  118. </option>
  119. {% for i in 0..column_names|length - 1 %}
  120. {% if data_label is defined and data_label == column_names[i]|e %}
  121. <option value="{{ column_names[i] }}" selected>
  122. {{ column_names[i] }}
  123. </option>
  124. {% else %}
  125. <option value="{{ column_names[i] }}">
  126. {{ column_names[i] }}
  127. </option>
  128. {% endif %}
  129. {% endfor %}
  130. </select>
  131. </td>
  132. </tr>
  133. <tr>
  134. <td>
  135. <label for="maxRowPlotLimit">
  136. {% trans 'Maximum rows to plot' %}
  137. </label>
  138. </td>
  139. <td>
  140. <input type="number" name="maxPlotLimit" id="maxRowPlotLimit" required="required" value="{{ max_plot_limit }}">
  141. </td>
  142. </tr>
  143. </table>
  144. </fieldset>
  145. </fieldset>
  146. <fieldset class="tblFooters">
  147. <input class="btn btn-primary" type="submit" name="zoom_submit" id="inputFormSubmitId" value="{% trans 'Go' %}">
  148. </fieldset>
  149. </form>
  150. <div id="sqlqueryresultsouter"></div>