[% PROCESS elements.html; PROCESS report_base.html; %]
[% DIV_ID = 'search-contact'; IF !entity_class; title = text('Contact Search'); #' ELSIF entity_class == 1; title = text('Vendor Search'); #' ELSIF entity_class == 2; title = text('Customer Search'); #' ELSIF entity_class == 3; DIV_ID = 'search-employee'; title = text('Employee Search'); #' ELSE; title = text('Unsupported. Expect errors'); #' END -%] [% IF entity_class.defined %] [% END %]

[% title %]
[% IF NOT entity_class == 3; PROCESS entity_class; END; %]
[% text('Name') %] | [% INCLUDE input element_data={ size = '32', name = 'name_part' } %]
[% text('Control Code') %] | [% PROCESS input element_data = { size = 32 name = "control_code" type = "text" value = control_code } %]
[% text('E-mail') %] | [% INCLUDE input element_data={size = '32', name = 'email'} %]
[% text('Phone') %] | [% INCLUDE input element_data={size = '20', name = 'phone'} %]
[% text('Contact') %] | [% INCLUDE input element_data={size = '20', name = 'contact'} %]
[% IF entity_type == 'Customer' -%] [% text('Salesperson') %] | [% INCLUDE input element_data={size = '32', name = 'employee'} %] [% ELSIF entity_type == 'Vendor' -%] | [% text('Employee') %] | [% INCLUDE input element_data={size = '32', name = 'employee'} %] [% END -%]
[% text('Only Users') %] | [% PROCESS input element_data = { type = 'checkbox', name = 'users', value = '1' } %] ([% text('Only for Employees') %])
[% text('Notes') %] | [% INCLUDE textarea element_data={ rows = '3', cols = '32', name = 'notes'} %]
| [% IF NOT entity_class == 3; %]
[% text("Account Number") %] | [% INCLUDE input element_data={ size = '32', name = "meta_number"} %]
[% END %]
[% text('Address') %] | [% INCLUDE input element_data={ size = '32', name = 'address'} %]
[% text('City') %] | [% INCLUDE input element_data={ size = '32', name = 'city'} %]
[% text('State/Province') %] | [% INCLUDE input element_data={ size = '32', name = 'state'} %]
[% text('Zip/Postal Code') %] | [% INCLUDE input element_data={ size = '10', name = 'mail_code'} %]
[% text('Country') %] | [% INCLUDE input element_data={ size = '32', name = 'country'} %]
[% text('Active') %] | [% text('From'); ' '; INCLUDE input element_data={ size = '11', name = 'active_date_from', class = 'date', title = user.dateformat }; text('Date to'); ' '; INCLUDE input element_data={ size = '11', name = 'active_date_to', class = 'date', title = user.dateformat} %]

[% IF entity_class == 3; search_action = "employee_search"; ELSE; search_action = "search"; END; INCLUDE button element_data = { text = text('Search') name = "__action" value = search_action class = "submit" type = "submit" } %]