Database forms

Here we present how to do forms.

We retreive data from the database and store it in a array

$record = array( 'person_uuid' => '02aba858-a194-11e7-b9ba-00215e4d70a1', 'name' => 'Nisse', 'phone' => '123 45 78', 'company' => 'Big buissines', 'address' => 'Megalway 3244', 'town' => 'Örebro' ... );

This data is sent to the form

Person edit

Sourcecode for form

source-highlight -n --input=form-template.php --output=src/form-template.php.html
01: <?php
02: //----------------------------------------------------------------------
03: // Copyright, Raditex Control AB, Göran Hasse, gorhas@raditex.nu
04: //----------------------------------------------------------------------
05: 
06: function person_form($person_uuid)
07: {
08: 
09: rbis_widget_edit_form_start();                                                                                            
10: rbis_widget_edit_table_start(_("Person edit"), "person_edit");
11: 
12: rbis_widget_table_form_newline();
13: 
14: rbis_widget_table_form_input_field(_("Name"),"name", $record['name'], "Name");
15: rbis_widget_table_form_input_field(_("Phone"),"phone", $record['phone'], "Name");
16: rbis_widget_table_form_input_field(_("Company"),"company", $record['company'], "Name");
17: 
18: rbis_widget_table_form_newline();
19: 
20: rbis_widget_table_form_input_field(_("Town"), "town", $record['town'], "Town");
21: rbis_widget_table_form_input_field(_("Address"), "adress", $record['address'], "Address");
22: rbis_widget_table_form_input_field(_("Country"),"country", $record['country'], "Country");
23: 
24: rbis_widget_table_form_submit_generic();
25: 
26: rbis_widget_edit_table_end();
27: rbis_widget_edit_form_end();
28: 
29: }
30: //----------------------------------------------------------------------
31: // EOF
32: //----------------------------------------------------------------------
33: ?>
34: 
35: