Database lists

Here we present how to do lists.

Personer
NameEmailCell phoneCompany nameAddressTownCountry
Nisse Svenssonnisse@company-A.se123 45 11Big buissines AStorgatan 123ÖrebroSweden
Olle Karlssonnisse@company-A.se123 45 33Big buissines ASmågatan 345ÖrebroSweden
Maria Juthedenmaria@company-E.se123 45 55Big buissines EBrödgatan 432ÖrebroSweden

If you hit return you get a new query.

The query was: SELECT * FROM rbis.person_table_view  ORDER BY name LIMIT 1000 

Source code for list

source-highlight -n --input=list-template.php --output=src/list-template.php.html
01: <?php
02: //----------------------------------------------------------------------
03: // Copyright, Raditex Control AB, Göran Hasse, gorhas@raditex.nu
04: //----------------------------------------------------------------------
05: 
06: //------------------------------------------------------------------------------
07: // person_list
08: // A generic list and search form for the object
09: //------------------------------------------------------------------------------
10: function person_list($status)
11: {
12: 
13:     $fields = array( "name" => _("Name"), 
14:                      "email" => _("Email"), 
15:                      "cell_phone" => _("Cell phone"), 
16:                      "company_name" => _("Company name"), 
17:                      "address" => _("Address"), 
18:                      "town" => _("Town"), 
19:                      "category" => _("Category"), 
20:                      "status" => _("Status"),
21:                      "last_updated" => _("Last updated"));
22: 
23:     // Create the query 
24:     $query = rbis_widget_search_form_query_fields("rbis", "person_table_view", $fields, $status);
25: 
26:     //html_message_info("Query :" . $query );
27: 
28:     // Go to database and execute this query
29:     $records = rbis_db_query($query);
30: 
31:     // Start the form
32:     rbis_widget_table_list_form_start();
33:     rbis_widget_table_list_start($fields);
34: 
35:     // Set up filter header
36:     rbis_widget_table_list_filter($fields);
37: 
38:     // Process the records
39:     rbis_widget_table_list_row($records, "rbis-person-edit.php", "person_uuid", $fields);
40: 
41: 
42:     rbis_widget_table_list_end();
43:     rbis_widget_table_list_form_end();
44: }
45: //----------------------------------------------------------------------
46: //
47: //----------------------------------------------------------------------
48: ?>
49: