index.twig 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <ul class="nav nav-pills m-2">
  2. <li class="nav-item">
  3. <a class="nav-link active" 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" 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/search') }}" name="insertForm" id="tbl_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/search') }}">
  22. <fieldset id="fieldset_table_search">
  23. <fieldset id="fieldset_table_qbe">
  24. <legend>
  25. {% trans 'Do a "query by example" (wildcard: "%")' %}
  26. </legend>
  27. <div class="table-responsive-md jsresponsive">
  28. <table class="table table-light table-striped table-hover table-sm w-auto">
  29. <thead class="thead-light">
  30. <tr>
  31. {% if geom_column_flag %}
  32. <th>{% trans 'Function' %}</th>
  33. {% endif %}
  34. <th>{% trans 'Column' %}</th>
  35. <th>{% trans 'Type' %}</th>
  36. <th>{% trans 'Collation' %}</th>
  37. <th>{% trans 'Operator' %}</th>
  38. <th>{% trans 'Value' %}</th>
  39. </tr>
  40. </thead>
  41. <tbody>
  42. {% for column_index in 0..column_names|length - 1 %}
  43. <tr class="noclick">
  44. {# If 'Function' column is present trying to change comment #}
  45. {% if geom_column_flag %}
  46. {# Displays 'Function' column if it is present #}
  47. <td>
  48. {% set geom_types = get_gis_datatypes() %}
  49. {% if column_types[column_index] in geom_types %}
  50. <select class="geom_func" name="geom_func[{{ column_index }}]">
  51. {# get the relevant list of GIS functions #}
  52. {% set funcs = get_gis_functions(column_types[column_index], true, true) %}
  53. {% for func_name, func in funcs %}
  54. {% set name = func['display'] is defined ? func['display'] : func_name %}
  55. <option value="{{ name }}">
  56. {{ name }}
  57. </option>
  58. {% endfor %}
  59. </select>
  60. {% endif %}
  61. </td>
  62. {% endif %}
  63. {# Displays column's name, type, collation and value #}
  64. <th>
  65. {#- Keep this without extra spaces because it is used for a request to build the BETWEEN modal -#}
  66. {{- column_names[column_index] -}}
  67. </th>
  68. {% set properties = self.getColumnProperties(column_index, column_index) %}
  69. <td dir="ltr">
  70. {{ properties['type'] }}
  71. </td>
  72. <td>
  73. {{ properties['collation'] }}
  74. </td>
  75. <td>
  76. {{ properties['func']|raw }}
  77. </td>
  78. {# here, the data-type attribute is needed for a date/time picker #}
  79. <td data-type="{{ properties['type'] }}">
  80. {{ properties['value']|raw }}
  81. {# Displays hidden fields #}
  82. <input type="hidden" name="criteriaColumnNames[{{ column_index }}]" value="{{ column_names[column_index] }}">
  83. <input type="hidden" name="criteriaColumnTypes[{{ column_index }}]" value="{{ column_types[column_index] }}">
  84. <input type="hidden" name="criteriaColumnCollations[{{ column_index }}]" value="{{ column_collations[column_index] }}">
  85. </td>
  86. </tr>
  87. {% endfor %}
  88. </tbody>
  89. </table>
  90. </div>
  91. <div id="gis_editor"></div>
  92. <div id="popup_background"></div>
  93. </fieldset>
  94. <div id="searchoptions"{% if default_sliders_state != 'disabled' -%}
  95. {{- default_sliders_state == 'closed' ? ' style="display: none; overflow:auto;"' }} class="pma_auto_slider" title="{% trans 'Options' %}"
  96. {%- endif %}>
  97. {# Displays columns select list for selecting distinct columns in the search #}
  98. <fieldset id="fieldset_select_fields">
  99. <legend>
  100. {% trans 'Select columns (at least one):' %}
  101. </legend>
  102. <select name="columnsToDisplay[]" size="{{ min(column_names|length, 10) }}" multiple>
  103. {% for each_field in column_names %}
  104. <option value="{{ each_field }}" selected>
  105. {{ each_field }}
  106. </option>
  107. {% endfor %}
  108. </select>
  109. <input type="checkbox" name="distinct" value="DISTINCT" id="oDistinct">
  110. <label for="oDistinct">DISTINCT</label>
  111. </fieldset>
  112. {# Displays input box for custom 'Where' clause to be used in the search #}
  113. <fieldset id="fieldset_search_conditions">
  114. <legend>
  115. <em>{% trans 'Or' %}</em>
  116. {% trans 'Add search conditions (body of the "where" clause):' %}
  117. </legend>
  118. {{ show_mysql_docu('Functions') }}
  119. <input type="text" name="customWhereClause" class="textfield" size="64">
  120. </fieldset>
  121. {# Displays option of changing default number of rows displayed per page #}
  122. <fieldset id="fieldset_limit_rows">
  123. <legend>{% trans 'Number of rows per page' %}</legend>
  124. <input type="number" name="session_max_rows" min="1" value="{{ max_rows }}" class="textfield" required>
  125. </fieldset>
  126. {# Displays option for ordering search results by a column value (Asc or Desc) #}
  127. <fieldset id="fieldset_display_order">
  128. <legend>{% trans 'Display order:' %}</legend>
  129. <select name="orderByColumn"><option value="--nil--"></option>
  130. {% for each_field in column_names %}
  131. <option value="{{ each_field }}">
  132. {{ each_field }}
  133. </option>
  134. {% endfor %}
  135. </select>
  136. <div class="formelement">
  137. <input type="radio" name="order" id="orderByAscRadio" value="ASC" checked>
  138. <label for="orderByAscRadio">{% trans 'Ascending' %}</label>
  139. </div>
  140. <div class="formelement">
  141. <input type="radio" name="order" id="orderByDescRadio" value="DESC">
  142. <label for="orderByDescRadio">{% trans 'Descending' %}</label>
  143. </div>
  144. </fieldset>
  145. <div class="clearfloat"></div>
  146. </div>
  147. </fieldset>
  148. <fieldset class="tblFooters">
  149. <input class="btn btn-primary" type="submit" name="submit" value="{% trans 'Go' %}">
  150. </fieldset>
  151. </form>
  152. <div id="sqlqueryresultsouter"></div>