New general function for form confirmation pages.
[ycra.git] / public_html / includes / forms.php
1 <?php
2 require_once('includes/utils.php');
3 require_once('includes/fields.php');
4
5 function confirm_sent_form_data($data, $keys) {?>
6   <form method="post" action="">
7     <table style="width: max-content;"><?php
8       foreach ($keys as $key) {
9         if (!empty($data[$key])) {?>
10           <tr>
11             <th><?php esc(key_to_human_text($key));?>:</th>
12             <td><?php esc($data[$key]);?></td>
13           </tr><?php
14           hidden_field($key, $data[$key]);
15         }
16       }?>
17     </table>
18     <input type="submit" name="back" value="Back" />
19     <input type="submit" name="confirm" value="Confirm details are correct" />
20   </form><?php
21 }