Fix execute routine page not working when not in a modal
[phpmyadmin.git] / templates / database / routines / execute_form.twig
blob7b27c536e6702831dd42527967f60ebd3682e9ed
1 <form action="{{ url('/database/routines') }}" method="post" class="rte_form">
2   <input type="hidden" name="item_name" value="{{ routine['item_name'] }}">
3   <input type="hidden" name="item_type" value="{{ routine['item_type'] }}">
4   {{ get_hidden_inputs(db) }}
6   <div class="card">
7     <div class="card-header">{{ ajax ? 'Routine parameters'|trans : routine['item_name'] }}</div>
9     <div class="card-body">
10       <table class="table w-auto rte_table{{ not ajax ? ' caption-top' }}">
11         {% if not ajax %}
12           <caption class="tblHeaders">{% trans 'Routine parameters' %}</caption>
13         {% endif %}
14         <tr>
15           <th>{% trans 'Name' %}</th>
16           <th>{% trans 'Type' %}</th>
17           {% if show_function_fields %}
18             <th>{% trans 'Function' %}</th>
19           {% endif %}
20           <th>{% trans 'Value' %}</th>
21         </tr>
22         {% for i in 0..routine['item_num_params'] - 1 %}
23           <tr>
24             <td>{{ routine['item_param_name'][loop.index0] }}</td>
25             <td>{{ routine['item_param_type'][loop.index0] }}</td>
26             {% if show_function_fields %}
27               <td>
28                 {% if params[loop.index0]['generator'] is not null %}
29                   <select name="funcs[{{ routine['item_param_name'][loop.index0] }}]">
30                     {{ params[loop.index0]['generator']|raw }}</select>
31                 {% else %}
32                   --
33                 {% endif %}
34               </td>
35             {% endif %}
36             <td class="nowrap">
37               {% if routine['item_param_type'][loop.index0] in ['ENUM', 'SET'] %}
38                 {% for value in routine['item_param_length_arr'][loop.index0] %}
39                   <input name="params[{{ routine['item_param_name'][loop.parent.loop.index0] }}][]" value="{{ params[loop.parent.loop.index0]['htmlentities'][loop.index0] }}" type="{{ params[loop.parent.loop.index0]['input_type'] }}">
40                   {{ params[loop.parent.loop.index0]['htmlentities'][loop.index0] }}
41                   <br>
42                 {% endfor %}
43               {% elseif routine['item_param_type'][loop.index0]|lower in params['no_support_types'] %}
44               {% else %}
45                 <input class="{{ params[loop.index0]['class'] }}" type="text" name="params[{{ routine['item_param_name'][loop.index0] }}]">
46               {% endif %}
47             </td>
48           </tr>
49         {% endfor %}
50       </table>
51     </div>
53     {% if not ajax %}
54       <div class="card-footer">
55         <input class="btn btn-primary" type="submit" name="execute_routine" value="{% trans 'Go' %}">
56       </div>
57     {% else %}
58       <input type="hidden" name="execute_routine" value="true">
59       <input type="hidden" name="ajax_request" value="true">
60     {% endif %}
61   </div>
62 </form>