Add a missing file sip_profile_copy.php to the dev branch.
This commit is contained in:
@@ -0,0 +1,369 @@
|
||||
<?php
|
||||
//application details
|
||||
$apps[$x]['name'] = "Virtual Tables";
|
||||
$apps[$x]['uuid'] = '8e98d409-8134-d33c-be70-fcee63d67a64';
|
||||
$apps[$x]['category'] = 'System';
|
||||
$apps[$x]['subcategory'] = '';
|
||||
$apps[$x]['version'] = '';
|
||||
$apps[$x]['license'] = 'Mozilla Public License 1.1';
|
||||
$apps[$x]['url'] = 'http://www.fusionpbx.com';
|
||||
$apps[$x]['description']['en'] = 'Provides the ability to quickly define information to store and dynamically makes tools available to view, add, edit, delete, and search.';
|
||||
|
||||
//menu details
|
||||
$apps[$x]['menu'][0]['title']['en'] = 'Virtual Tables';
|
||||
$apps[$x]['menu'][0]['uuid'] = '6be94b46-2126-947f-2365-0bea23651a6b';
|
||||
$apps[$x]['menu'][0]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
|
||||
$apps[$x]['menu'][0]['category'] = 'internal';
|
||||
$apps[$x]['menu'][0]['path'] = '/app/virtual_tables/v_virtual_tables.php';
|
||||
$apps[$x]['menu'][0]['groups'][] = 'admin';
|
||||
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
|
||||
|
||||
//permission details
|
||||
$apps[$x]['permissions'][0]['name'] = 'virtual_tables_view';
|
||||
$apps[$x]['permissions'][0]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][1]['name'] = 'virtual_tables_add';
|
||||
$apps[$x]['permissions'][1]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][2]['name'] = 'virtual_tables_edit';
|
||||
$apps[$x]['permissions'][2]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][3]['name'] = 'virtual_tables_delete';
|
||||
$apps[$x]['permissions'][3]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][4]['name'] = 'virtual_tables_data_view';
|
||||
$apps[$x]['permissions'][4]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][4]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][5]['name'] = 'virtual_tables_data_add';
|
||||
$apps[$x]['permissions'][5]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][5]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][6]['name'] = 'virtual_tables_data_edit';
|
||||
$apps[$x]['permissions'][6]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][6]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][7]['name'] = 'virtual_tables_data_delete';
|
||||
$apps[$x]['permissions'][7]['groups'][] = 'admin';
|
||||
$apps[$x]['permissions'][7]['groups'][] = 'superadmin';
|
||||
|
||||
//schema details
|
||||
$y = 0; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_virtual_table_data';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_data_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_data_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_tables';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_data_row_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_row_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_name';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_field_value';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_add_user';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_add_date';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_del_user';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_del_date';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_parent_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_parent_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_data_parent_row_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_parent_row_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
|
||||
$y = 1; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_virtual_table_data_types_name_value';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_data_types_name_value_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_data_types_name_value_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_tables';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_field_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_field_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_table_fields';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_field_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_types_name';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_types_value';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
|
||||
$y = 2; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_virtual_table_fields';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_field_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_field_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_tables';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_label';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_name';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_type';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_list_hidden';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_column';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_required';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_order';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_order_tab';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_field_description';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_desc';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_value';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
|
||||
$y = 3; //table array index
|
||||
$z = 0; //field array index
|
||||
$apps[$x]['db'][$y]['table'] = 'v_virtual_tables';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'primary';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_domains';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'domain_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'v_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_category';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_label';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_name';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_auth';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_captcha';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_parent_id';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_parent_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['type'] = 'foreign';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_tables';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_uuid';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
$z++;
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_table_description';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_desc';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
|
||||
$apps[$x]['db'][$y]['fields'][$z]['description']['en'] = '';
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
|
||||
// make sure the PATH_SEPARATOR is defined
|
||||
if (!defined("PATH_SEPARATOR")) {
|
||||
if ( strpos( $_ENV[ "OS" ], "Win" ) !== false ) { define("PATH_SEPARATOR", ";"); } else { define("PATH_SEPARATOR", ":"); }
|
||||
}
|
||||
|
||||
// make sure the document_root is set
|
||||
$_SERVER["SCRIPT_FILENAME"] = str_replace("\\", "/", $_SERVER["SCRIPT_FILENAME"]);
|
||||
$_SERVER["DOCUMENT_ROOT"] = str_replace($_SERVER["PHP_SELF"], "", $_SERVER["SCRIPT_FILENAME"]);
|
||||
$_SERVER["DOCUMENT_ROOT"] = realpath($_SERVER["DOCUMENT_ROOT"]);
|
||||
//echo "DOCUMENT_ROOT: ".$_SERVER["DOCUMENT_ROOT"]."<br />\n";
|
||||
//echo "PHP_SELF: ".$_SERVER["PHP_SELF"]."<br />\n";
|
||||
//echo "SCRIPT_FILENAME: ".$_SERVER["SCRIPT_FILENAME"]."<br />\n";
|
||||
|
||||
// if the project directory exists then add it to the include path otherwise add the document root to the include path
|
||||
if (is_dir($_SERVER["DOCUMENT_ROOT"].'/fusionpbx')){
|
||||
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', '/fusionpbx'); }
|
||||
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER["DOCUMENT_ROOT"].'/fusionpbx' );
|
||||
}
|
||||
else {
|
||||
if(!defined('PROJECT_PATH')) { define('PROJECT_PATH', ''); }
|
||||
set_include_path( get_include_path() . PATH_SEPARATOR . $_SERVER['DOCUMENT_ROOT'] );
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_data_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (count($_GET)>0) {
|
||||
|
||||
//declare variable(s)
|
||||
$virtual_table_parent_id = '';
|
||||
|
||||
//get the http get and set them as php variables
|
||||
$virtual_data_row_uuid = check_str($_GET["virtual_data_row_uuid"]);
|
||||
$virtual_data_parent_row_uuid = check_str($_GET["virtual_data_parent_row_uuid"]);
|
||||
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]);
|
||||
|
||||
//show the results and redirect
|
||||
require_once "includes/header.php";
|
||||
|
||||
//get the virtual_table_parent_id from the child table
|
||||
if (strlen($virtual_table_parent_id) == 0) {
|
||||
$sql = "select * from v_virtual_tables ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$virtual_table_parent_id = $row["virtual_table_parent_id"];
|
||||
}
|
||||
}
|
||||
|
||||
//delete the child data
|
||||
$sql = "delete from v_virtual_table_data ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_data_parent_row_uuid = '$virtual_data_row_uuid' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//delete the data
|
||||
$sql = "delete from v_virtual_table_data ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_data_row_uuid = '$virtual_data_row_uuid' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
//mark the the item as deleted and who deleted it
|
||||
//$sql = "update v_virtual_table_data set ";
|
||||
//$sql .= "virtual_data_del_date = now(), ";
|
||||
//$sql .= "virtual_data_del_user = '".$_SESSION["username"]."' ";
|
||||
//$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
//$sql .= "and virtual_data_row_uuid = '$virtual_data_row_uuid' ";
|
||||
//$db->exec(check_sql($sql));
|
||||
//$lastinsertid = $db->lastInsertId($id);
|
||||
//unset($sql);
|
||||
|
||||
//set the meta redirect
|
||||
if (strlen($virtual_data_parent_row_uuid) == 0) {
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_table_data_view.php?id=$virtual_table_uuid&virtual_data_row_uuid=$virtual_data_row_uuid\">\n";
|
||||
}
|
||||
else {
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_parent_id&virtual_data_row_uuid=$virtual_data_parent_row_uuid\">\n";
|
||||
}
|
||||
|
||||
//show a message to the user before the redirect
|
||||
echo "<div align='center'>\n";
|
||||
echo "Delete Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,982 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_data_add') || permission_exists('virtual_tables_data_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//set http get variables to php variables
|
||||
$search_all = check_str($_GET["search_all"]);
|
||||
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]);
|
||||
if (strlen($_GET["virtual_data_row_uuid"])>0) { //update
|
||||
$virtual_data_row_uuid = check_str($_GET["virtual_data_row_uuid"]);
|
||||
$action = "update";
|
||||
}
|
||||
else {
|
||||
if (strlen($search_all) > 0) {
|
||||
$action = "update";
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
}
|
||||
if (strlen($_GET["id"]) > 0) {
|
||||
$virtual_table_uuid = check_str($_GET["id"]);
|
||||
}
|
||||
if (strlen($_GET["virtual_data_parent_row_uuid"])>0) {
|
||||
$virtual_data_parent_row_uuid = check_str($_GET["virtual_data_parent_row_uuid"]);
|
||||
}
|
||||
|
||||
//get virtual table information
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_tables ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$virtual_table_category = $row["virtual_table_category"];
|
||||
$virtual_table_label = $row["virtual_table_label"];
|
||||
$virtual_table_name = $row["virtual_table_name"];
|
||||
$virtual_table_auth = $row["virtual_table_auth"];
|
||||
$virtual_table_captcha = $row["virtual_table_captcha"];
|
||||
$virtual_table_parent_id = $row["virtual_table_parent_id"];
|
||||
$virtual_table_description = $row["virtual_table_description"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//process the data submitted to by the html form
|
||||
if (count($_POST)>0) { //add
|
||||
$virtual_table_uuid = check_str($_POST["virtual_table_uuid"]);
|
||||
$virtual_table_name = check_str($_POST["virtual_table_name"]);
|
||||
$rcount = check_str($_POST["rcount"]);
|
||||
|
||||
//get the field information
|
||||
$db_field_name_array = array();
|
||||
$db_value_array = array();
|
||||
$db_names .= "<tr>\n";
|
||||
$sql = "select * from v_virtual_table_fields ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$sql .= "order by virtual_field_order asc ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$result_names = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
$result_count = count($result);
|
||||
foreach($result_names as $row) {
|
||||
$virtual_field_label = $row["virtual_field_label"];
|
||||
$virtual_field_name = $row["virtual_field_name"];
|
||||
$virtual_field_type = $row["virtual_field_type"];
|
||||
$virtual_field_value = $row["virtual_field_value"];
|
||||
$virtual_field_list_hidden = $row["virtual_field_list_hidden"];
|
||||
$virtual_field_column = $row["virtual_field_column"];
|
||||
$virtual_field_required = $row["virtual_field_required"];
|
||||
$virtual_field_order = $row["virtual_field_order"];
|
||||
$virtual_field_order_tab = $row["virtual_field_order_tab"];
|
||||
$virtual_field_description = $row["virtual_field_description"];
|
||||
|
||||
$name_array[$virtual_field_name]['virtual_field_label'] = $row["virtual_field_label"];
|
||||
$name_array[$virtual_field_name]['virtual_field_type'] = $row["virtual_field_type"];
|
||||
$name_array[$virtual_field_name]['virtual_field_list_hidden'] = $row["virtual_field_list_hidden"];
|
||||
$name_array[$virtual_field_name]['virtual_field_column'] = $row["virtual_field_column"];
|
||||
$name_array[$virtual_field_name]['virtual_field_required'] = $row["virtual_field_required"];
|
||||
$name_array[$virtual_field_name]['virtual_field_order'] = $row["virtual_field_order"];
|
||||
$name_array[$virtual_field_name]['virtual_field_order_tab'] = $row["virtual_field_order_tab"];
|
||||
$name_array[$virtual_field_name]['virtual_field_description'] = $row["virtual_field_description"];
|
||||
}
|
||||
unset($sql, $prep_statement, $row);
|
||||
$fieldcount = count($name_array);
|
||||
|
||||
$i = 1;
|
||||
while($i <= $rcount){
|
||||
$virtual_field_name = check_str($_POST[$i."field_name"]);
|
||||
$virtual_data_field_value = check_str($_POST[$i."field_value"]);
|
||||
if ($i==1) {
|
||||
$unique_temp_id = md5('7k3j2m'.date('r')); //used to find the first item
|
||||
$virtual_data_row_uuid = $unique_temp_id;
|
||||
}
|
||||
$sql = "select virtual_field_type, virtual_field_name from v_virtual_table_fields ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$sql .= "and virtual_field_name = '$virtual_field_name' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
while($row = $prep_statement->fetch()){
|
||||
$virtual_field_type = $row['virtual_field_type'];
|
||||
}
|
||||
|
||||
if ($virtual_field_type == "upload_file" || $virtual_field_type == "uploadimage") {
|
||||
//print_r($_FILES);
|
||||
$upload_temp_dir = $_ENV["TEMP"]."\\";
|
||||
ini_set('upload_tmp_dir', $upload_temp_dir);
|
||||
//$uploaddir = "";
|
||||
if ($virtual_field_type == "upload_file") {
|
||||
$upload_file = $filedir . $_FILES[$i.'field_value']['name'];
|
||||
}
|
||||
if ($virtual_field_type == "uploadimage") {
|
||||
$upload_file = $imagedir . $_FILES[$i.'field_value']['name'];
|
||||
}
|
||||
// $_POST[$i."field_name"]
|
||||
//print_r($_FILES);
|
||||
//echo "upload_file $upload_file<br>\n";
|
||||
//echo "upload_temp_dir $upload_temp_dir<br>\n";
|
||||
|
||||
$virtual_data_field_value = $_FILES[$i.'field_value']['name'];
|
||||
//echo "name $virtual_data_field_value<br>\n";
|
||||
//echo "virtual_field_name $virtual_field_name<br>\n";
|
||||
//$i."field_value"
|
||||
//echo "if (move_uploaded_file(\$_FILES[$i.'field_value']['tmp_name'], $upload_file)) ";
|
||||
//if (strlen($_FILES[$i.'field_value']['name'])>0) { //only do the following if there is a file name
|
||||
//foreach($_FILES as $file)
|
||||
//{
|
||||
//[$i.'field_value']
|
||||
//print_r($file);
|
||||
if($_FILES[$i.'field_value']['error'] == 0 && $_FILES[$i.'field_value']['size'] > 0) {
|
||||
if (move_uploaded_file($_FILES[$i.'field_value']['tmp_name'], $upload_file)) {
|
||||
//echo $_FILES['userfile']['name'] ." <br>";
|
||||
//echo "was successfully uploaded. ";
|
||||
//echo "<br><br>";
|
||||
//print "<pre>";
|
||||
//print_r($_FILES);
|
||||
//print "</pre>";
|
||||
}
|
||||
else {
|
||||
//echo "Upload Error. Here's some debugging info:\n";
|
||||
//print "<pre>\n";
|
||||
//print_r($_FILES);
|
||||
//print "</pre>\n";
|
||||
//exit;
|
||||
}
|
||||
}
|
||||
//}
|
||||
//}
|
||||
} //end if file or image
|
||||
|
||||
if ($action == "add" && permission_exists('virtual_tables_data_add')) {
|
||||
//get a unique id for the virtual_data_row_uuid
|
||||
if ($i==1) {
|
||||
$virtual_data_row_uuid = uuid();
|
||||
}
|
||||
|
||||
//insert the field data
|
||||
$sql = "insert into v_virtual_table_data ";
|
||||
$sql .= "(";
|
||||
$sql .= "virtual_table_data_uuid, ";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "virtual_data_row_uuid, ";
|
||||
if(strlen($virtual_data_parent_row_uuid)>0) {
|
||||
$sql .= "virtual_data_parent_row_uuid, ";
|
||||
}
|
||||
$sql .= "virtual_table_uuid, ";
|
||||
if (strlen($virtual_table_parent_id) > 0) {
|
||||
$sql .= "virtual_table_parent_id, ";
|
||||
}
|
||||
$sql .= "virtual_field_name, ";
|
||||
$sql .= "virtual_data_field_value, ";
|
||||
$sql .= "virtual_data_add_user, ";
|
||||
$sql .= "virtual_data_add_date ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$virtual_data_row_uuid', ";
|
||||
if(strlen($virtual_data_parent_row_uuid)>0) {
|
||||
$sql .= "'$virtual_data_parent_row_uuid', ";
|
||||
}
|
||||
$sql .= "'$virtual_table_uuid', ";
|
||||
if (strlen($virtual_table_parent_id) > 0) {
|
||||
$sql .= "'$virtual_table_parent_id', ";
|
||||
}
|
||||
$sql .= "'$virtual_field_name', ";
|
||||
switch ($name_array[$virtual_field_name]['virtual_field_type']) {
|
||||
case "phone":
|
||||
$tmp_phone = preg_replace('{\D}', '', $virtual_data_field_value);
|
||||
$sql .= "'$tmp_phone', ";
|
||||
break;
|
||||
case "add_user":
|
||||
$sql .= "'".$_SESSION["username"]."', ";
|
||||
break;
|
||||
case "add_date":
|
||||
$sql .= "now(), ";
|
||||
break;
|
||||
case "mod_user":
|
||||
$sql .= "'".$_SESSION["username"]."', ";
|
||||
break;
|
||||
case "mod_date":
|
||||
$sql .= "now(), ";
|
||||
break;
|
||||
default:
|
||||
$sql .= "'$virtual_data_field_value', ";
|
||||
}
|
||||
$sql .= "'".$_SESSION["username"]."', ";
|
||||
$sql .= "now() ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
$lastinsertid = $db->lastInsertId($id);
|
||||
unset($sql);
|
||||
} //end action add
|
||||
|
||||
if ($action == "update" && permission_exists('virtual_tables_data_edit')) {
|
||||
$virtual_data_row_uuid = $_POST["virtual_data_row_uuid"];
|
||||
|
||||
$sql_update = "update v_virtual_table_data set ";
|
||||
switch ($name_array[$virtual_field_name]['virtual_field_type']) {
|
||||
case "phone":
|
||||
$tmp_phone = preg_replace('{\D}', '', $virtual_data_field_value);
|
||||
$sql_update .= "virtual_data_field_value = '$tmp_phone' ";
|
||||
break;
|
||||
case "add_user":
|
||||
$sql_update .= "virtual_data_field_value = '".$_SESSION["username"]."' ";
|
||||
break;
|
||||
case "add_date":
|
||||
$sql_update .= "virtual_data_field_value = now() ";
|
||||
break;
|
||||
case "mod_user":
|
||||
$sql_update .= "virtual_data_field_value = '".$_SESSION["username"]."' ";
|
||||
break;
|
||||
case "mod_date":
|
||||
$sql_update .= "virtual_data_field_value = now() ";
|
||||
break;
|
||||
default:
|
||||
$sql_update .= "virtual_data_field_value = '$virtual_data_field_value' ";
|
||||
}
|
||||
$sql_update .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql_update .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
if (strlen($virtual_table_parent_id) > 0) {
|
||||
$sql_update .= "and virtual_table_parent_id = '$virtual_table_parent_id' ";
|
||||
}
|
||||
$sql_update .= "and virtual_data_row_uuid = '$virtual_data_row_uuid' ";
|
||||
if(strlen($virtual_data_parent_row_uuid)>0) {
|
||||
$sql_update .= "and virtual_data_parent_row_uuid = '$virtual_data_parent_row_uuid' ";
|
||||
}
|
||||
$sql_update .= "and virtual_field_name = '$virtual_field_name' ";
|
||||
$count = $db->exec(check_sql($sql_update));
|
||||
unset ($sql_update);
|
||||
if ($count > 0) {
|
||||
//do nothing the update was successfull
|
||||
}
|
||||
else {
|
||||
//no value to update so insert new value
|
||||
$sql = "insert into v_virtual_table_data ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "virtual_data_row_uuid, ";
|
||||
if(strlen($virtual_data_parent_row_uuid)>0) {
|
||||
$sql .= "virtual_data_parent_row_uuid, ";
|
||||
}
|
||||
$sql .= "virtual_table_uuid, ";
|
||||
$sql .= "virtual_table_parent_id, ";
|
||||
$sql .= "virtual_field_name, ";
|
||||
$sql .= "virtual_data_field_value, ";
|
||||
$sql .= "virtual_data_add_user, ";
|
||||
$sql .= "virtual_data_add_date ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$virtual_data_row_uuid', ";
|
||||
if(strlen($virtual_data_parent_row_uuid)>0) {
|
||||
$sql .= "'$virtual_data_parent_row_uuid', ";
|
||||
}
|
||||
$sql .= "'$virtual_table_uuid', ";
|
||||
$sql .= "'$virtual_table_parent_id', ";
|
||||
$sql .= "'$virtual_field_name', ";
|
||||
switch ($name_array[$virtual_field_name]['virtual_field_type']) {
|
||||
case "phone":
|
||||
$tmp_phone = preg_replace('{\D}', '', $virtual_data_field_value);
|
||||
$sql .= "'$tmp_phone', ";
|
||||
break;
|
||||
case "add_user":
|
||||
$sql .= "'".$_SESSION["username"]."', ";
|
||||
break;
|
||||
case "add_date":
|
||||
$sql .= "now(), ";
|
||||
break;
|
||||
case "mod_user":
|
||||
$sql .= "'".$_SESSION["username"]."', ";
|
||||
break;
|
||||
case "mod_date":
|
||||
$sql .= "now(), ";
|
||||
break;
|
||||
default:
|
||||
$sql .= "'$virtual_data_field_value', ";
|
||||
}
|
||||
$sql .= "'".$_SESSION["username"]."', ";
|
||||
$sql .= "now() ";
|
||||
$sql .= ")";
|
||||
|
||||
$db->exec(check_sql($sql));
|
||||
$lastinsertid = $db->lastInsertId($id);
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
//set the meta redirect
|
||||
if (strlen($virtual_data_parent_row_uuid) == 0) {
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_table_data_edit.php?id=$virtual_table_uuid&virtual_data_row_uuid=$virtual_data_row_uuid\">\n";
|
||||
}
|
||||
else {
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_parent_id&virtual_data_row_uuid=$virtual_data_parent_row_uuid\">\n";
|
||||
}
|
||||
|
||||
//show a message to the user before the redirect
|
||||
echo "<div align='center'>\n";
|
||||
if ($action == "add") { echo "Add Complete\n"; }
|
||||
if ($action == "update") { echo "Update Complete\n"; }
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
//pre-populate the form
|
||||
if ($action == "update") {
|
||||
//get the field values
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_table_data ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
if (strlen($search_all) == 0) {
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
if (strlen($virtual_data_parent_row_uuid) > 0) {
|
||||
$sql .= " and virtual_data_parent_row_uuid = '$virtual_data_parent_row_uuid' ";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= "and virtual_data_row_uuid in (";
|
||||
$sql .= "select virtual_data_row_uuid from v_virtual_table_data \n";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
if (strlen($virtual_data_parent_row_uuid) > 0) {
|
||||
$sql .= " and virtual_data_parent_row_uuid = '$virtual_data_parent_row_uuid' ";
|
||||
}
|
||||
else {
|
||||
//$sql .= "and virtual_data_field_value like '%$search_all%' )\n";
|
||||
$tmp_digits = preg_replace('{\D}', '', $search_all);
|
||||
if (is_numeric($tmp_digits) && strlen($tmp_digits) > 5) {
|
||||
if (strlen($tmp_digits) == '11' ) {
|
||||
$sql .= "and virtual_data_field_value like '%".substr($tmp_digits, -10)."%' )\n";
|
||||
}
|
||||
else {
|
||||
$sql .= "and virtual_data_field_value like '%$tmp_digits%' )\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= "and virtual_data_field_value like '%$search_all%' )\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql .= "order by virtual_data_row_uuid asc ";
|
||||
|
||||
$row_id = '';
|
||||
$row_id_found = false;
|
||||
$next_row_id_found = false;
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$x=0;
|
||||
while($row = $prep_statement->fetch()) {
|
||||
//set the last last row id
|
||||
if ($x==0) {
|
||||
if (strlen($virtual_data_row_uuid) == 0) {
|
||||
$virtual_data_row_uuid = $row['virtual_data_row_uuid'];
|
||||
}
|
||||
$first_virtual_data_row_uuid = $row['virtual_data_row_uuid'];
|
||||
}
|
||||
//get the data for the specific row id
|
||||
if ($virtual_data_row_uuid == $row['virtual_data_row_uuid']) {
|
||||
//set the data and save it to an array
|
||||
$data_row[$row['virtual_field_name']] = $row['virtual_data_field_value'];
|
||||
//set the previous row id
|
||||
if ($previous_row_id != $row['virtual_data_row_uuid']) {
|
||||
$previous_virtual_data_row_uuid = $previous_row_id;
|
||||
$row_id_found = true;
|
||||
}
|
||||
}
|
||||
//detect a new row id
|
||||
if ($previous_row_id != $row['virtual_data_row_uuid']) {
|
||||
if ($row_id_found) {
|
||||
if (!$next_row_id_found) {
|
||||
//make sure it is not the current row id
|
||||
if ($virtual_data_row_uuid != $row['virtual_data_row_uuid']) {
|
||||
$next_virtual_data_row_uuid = $row['virtual_data_row_uuid'];
|
||||
$next_row_id_found = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//set the last last row id
|
||||
$last_virtual_data_row_uuid = $row['virtual_data_row_uuid'];
|
||||
|
||||
//set the temporary previous row id
|
||||
$previous_row_id = $row['virtual_data_row_uuid'];
|
||||
|
||||
//set the record number array
|
||||
$record_number_array[$row['virtual_data_row_uuid']] = $x+1;
|
||||
|
||||
$x++;
|
||||
}
|
||||
}
|
||||
|
||||
//save the total number of records
|
||||
$total_records = $x;
|
||||
|
||||
//set record number
|
||||
if (strlen($_GET["n"]) == 0) {
|
||||
$n = 1;
|
||||
}
|
||||
else {
|
||||
$n = $_GET["n"];
|
||||
}
|
||||
unset($sql, $prep_statement, $row);
|
||||
}
|
||||
|
||||
//use this when the calendar is needed
|
||||
//echo "<script language='javascript' src=\"/includes/calendar_popcalendar.js\"></script>\n";
|
||||
//echo "<script language=\"javascript\" src=\"/includes/calendar_lw_layers.js\"></script>\n";
|
||||
//echo "<script language=\"javascript\" src=\"/includes/calendar_lw_menu.js\"></script>";
|
||||
|
||||
//begin creating the content
|
||||
echo "<br />";
|
||||
|
||||
//get the title and description of the virtual table
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='50%' valign='top' nowrap='nowrap'>\n";
|
||||
echo " <b>$virtual_table_label \n";
|
||||
if ($action == "add") {
|
||||
echo " Add\n";
|
||||
}
|
||||
else {
|
||||
echo "Edit\n";
|
||||
}
|
||||
echo " </b>\n";
|
||||
echo " \n";
|
||||
if ($action == "update" && permission_exists('virtual_tables_data_edit')) {
|
||||
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_uuid'\" value='Add'>\n";
|
||||
//echo " <input type='button' class='btn' name='' alt='delete' onclick=\"if (confirm('Do you really want to delete this?')){window.location='v_virtual_table_data_delete.php?id=".$virtual_table_uuid."&?virtual_data_row_uuid=".$virtual_data_row_uuid."&virtual_data_parent_row_uuid=$virtual_data_parent_row_uuid';}\" value='Delete'>\n";
|
||||
}
|
||||
echo " <br />\n";
|
||||
echo " $virtual_table_description\n";
|
||||
echo " <br />\n";
|
||||
echo " <br />\n";
|
||||
echo " </td>\n";
|
||||
|
||||
if (strlen($virtual_data_parent_row_uuid) == 0) {
|
||||
echo "<td align='center' valign='top' nowrap='nowrap'>\n";
|
||||
|
||||
if ($action == "update" && permission_exists('virtual_tables_data_edit')) {
|
||||
//echo " <input type='button' class='btn' name='' alt='first' onclick=\"window.location='v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_uuid&virtual_data_row_uuid=".$first_virtual_data_row_uuid."'\" value='First'>\n";
|
||||
if (strlen($previous_virtual_data_row_uuid) == 0) {
|
||||
echo " <input type='button' class='btn' name='' alt='prev' disabled='disabled' value='Prev'>\n";
|
||||
}
|
||||
else {
|
||||
echo " <input type='button' class='btn' name='' alt='prev' onclick=\"window.location='v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_uuid&virtual_data_row_uuid=".$previous_virtual_data_row_uuid."&search_all=$search_all&n=".($n-1)."'\" value='Prev ".$previous_record_id."'>\n";
|
||||
}
|
||||
echo " <input type='button' class='btn' name='' alt='prev' value='".$record_number_array[$virtual_data_row_uuid]." of $total_records'>\n";
|
||||
if (strlen($next_virtual_data_row_uuid) == 0) {
|
||||
echo " <input type='button' class='btn' name='' alt='next' disabled='disabled' value='Next'>\n";
|
||||
}
|
||||
else {
|
||||
echo " <input type='button' class='btn' name='' alt='next' onclick=\"window.location='v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_uuid&virtual_data_row_uuid=".$next_virtual_data_row_uuid."&search_all=$search_all&n=".($n+1)."'\" value='Next ".$next_record_id."'>\n";
|
||||
}
|
||||
//echo " <input type='button' class='btn' name='' alt='last' onclick=\"window.location='v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_uuid&virtual_data_row_uuid=".$last_virtual_data_row_uuid."'\" value='Last'>\n";
|
||||
}
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo " ";
|
||||
echo "</td>\n";
|
||||
|
||||
echo "<form method='GET' name='frm_search' action='v_virtual_table_data_edit.php'>\n";
|
||||
echo "<td width='45%' align='right' valign='top' nowrap='nowrap'>\n";
|
||||
echo " <input type='hidden' name='virtual_table_uuid' value='$virtual_table_uuid'>\n";
|
||||
//echo " <input type='hidden' name='id' value='$virtual_table_uuid'>\n";
|
||||
//echo " <input type='hidden' name='virtual_data_parent_row_uuid' value='$virtual_data_parent_row_uuid'>\n";
|
||||
//echo " <input type='hidden' name='virtual_data_row_uuid' value='$first_virtual_data_row_uuid'>\n";
|
||||
echo " <input class='formfld' type='text' name='search_all' value='$search_all'>\n";
|
||||
echo " <input class='btn' type='submit' name='submit' value='Search All'>\n";
|
||||
echo "</td>\n";
|
||||
echo "</form>\n";
|
||||
echo "<td width='5%' align='right' valign='top' nowrap='nowrap'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_virtual_table_data_view.php?id=$virtual_table_uuid'\" value='Back'>\n";
|
||||
echo "</td>\n";
|
||||
}
|
||||
else {
|
||||
echo " <td width='50%' align='right'>\n";
|
||||
//echo " <input type='button' class='btn' name='' alt='prev' onclick=\"window.location='v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_parent_id&virtual_data_row_uuid=$virtual_data_parent_row_uuid'\" value='Prev'>\n";
|
||||
//echo " <input type='button' class='btn' name='' alt='next' onclick=\"window.location='v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_parent_id&virtual_data_row_uuid=$virtual_data_parent_row_uuid'\" value='Next'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_parent_id&virtual_data_row_uuid=$virtual_data_parent_row_uuid'\" value='Back'>\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
//begin the div and table that will hold the html form
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='10'>\n";
|
||||
|
||||
//determine if a file should be uploaded
|
||||
$sql = "SELECT * FROM v_virtual_table_fields ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid ' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid ' ";
|
||||
$sql .= "and virtual_field_type = 'uploadimage' ";
|
||||
$sql .= "or domain_uuid = '$domain_uuid ' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid ' ";
|
||||
$sql .= "and virtual_field_type = 'upload_file' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
if (count($prep_statement->fetchAll(PDO::FETCH_NAMED)) > 0) {
|
||||
echo "<form method='post' name='frm' enctype='multipart/form-data' action=''>\n";
|
||||
echo "<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"104857600\" />\n";
|
||||
}
|
||||
else {
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
}
|
||||
|
||||
//get the table fields and then display them
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_table_fields ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$sql .= "order by virtual_field_column asc, virtual_field_order asc ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
|
||||
echo "<input type='hidden' name='rcount' value='$result_count'>\n";
|
||||
echo "<input type='hidden' name='virtual_table_uuid' value='$virtual_table_uuid'>\n";
|
||||
|
||||
if ($result_count == 0) { //no results
|
||||
echo "<tr><td class='vncell'> </td></tr>\n";
|
||||
}
|
||||
else { //received results
|
||||
$x=1;
|
||||
$virtual_field_column_previous = '';
|
||||
$column_table_cell_status = '';
|
||||
foreach($result as $row) {
|
||||
//handle more than one column
|
||||
$virtual_field_column = $row[virtual_field_column];
|
||||
//echo "<!--[column: $virtual_field_column]-->\n";
|
||||
if ($virtual_field_column != $virtual_field_column_previous) {
|
||||
$column_table_cell_status = 'open';
|
||||
//do the following except for the first time through the loop
|
||||
if ($x != 1) {
|
||||
//close the table
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
//close the row
|
||||
echo "</td>\n";
|
||||
}
|
||||
//open a new row
|
||||
echo "<td valign='top'>\n";
|
||||
//start a table in the new row
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
}
|
||||
|
||||
//display the fields
|
||||
if ($row['virtual_field_type'] != "hidden"){
|
||||
switch ($row['virtual_field_type']) {
|
||||
case "add_user":
|
||||
break;
|
||||
case "add_date":
|
||||
break;
|
||||
case "mod_user":
|
||||
break;
|
||||
case "mod_date":
|
||||
break;
|
||||
default:
|
||||
echo "<tr>\n";
|
||||
if ($row['virtual_field_type'] == "label") {
|
||||
echo "<td valign='bottom' align='left' class='' style='padding-top:10px;padding-bottom:7px;padding-right:5px;padding-left:0px;' nowrap='nowrap'>\n";
|
||||
echo " <strong>".$row['virtual_field_label']."</strong>\n";
|
||||
echo "</td>\n";
|
||||
}
|
||||
else {
|
||||
if ($row['virtual_field_required'] == "yes") {
|
||||
echo "<td valign='top' align='left' class='vncellreq' style='padding-top:3px;' nowrap='nowrap'>\n";
|
||||
}
|
||||
else {
|
||||
echo "<td valign='top' align='left' class='vncell' style='padding-top:3px;' nowrap='nowrap'>\n";
|
||||
}
|
||||
echo "".$row['virtual_field_label'].": \n";
|
||||
echo "</td>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
switch ($row['virtual_field_type']) {
|
||||
case "checkbox":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
if (strlen($data_row[$row['virtual_field_name']])>0) {
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='' type='checkbox' name='".$x."field_value' maxlength='50' value=\"".$row['virtual_field_value']."\" checked='checked'/>\n";
|
||||
}
|
||||
else {
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='' type='checkbox' name='".$x."field_value' maxlength='50' value=\"".$row['virtual_field_value']."\" />\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "text":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name='".$x."field_value' maxlength='50' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "email":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name='".$x."field_value' maxlength='50' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "label":
|
||||
break;
|
||||
case "password":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='password' name='".$x."field_value' maxlength='50' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "pin_number":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value=\"".$row['virtual_field_name']."\">\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='password' name='".$x."field_value' maxlength='50' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "hidden":
|
||||
echo "<input type='hidden' name='".$x."field_name' value=\"".$row['virtual_field_name']."\">\n";
|
||||
echo "<input type='hidden' name='".$x."field_value' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
break;
|
||||
case "url":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value=\"".$row['virtual_field_name']."\">\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name='".$x."field_value' maxlength='50' value='".$data_row[$row['virtual_field_name']]."'>\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "date":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value=\"".$row['virtual_field_name']."\">\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name='".$x."field_value' maxlength='50' value='".$data_row[$row['virtual_field_name']]."'>\n";
|
||||
|
||||
//echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
//echo "<table border='0' width='100%' cellpadding='0' cellspacing='0'>";
|
||||
//echo "<tr>";
|
||||
//echo "<td valign='top'><input tabindex='".$row['virtual_field_order_tab']."' name='".$x."field_value' readonly class='formfld' style='width:90%' value='".$data_row[$row['virtual_field_name']]."' type='text' class='frm' onclick='popUpCalendar(this, this, \"mm/dd/yyyy\");'></td>\n";
|
||||
//echo "<td valign='middle' width='20' align='right'><img src='/images/icon_calendar.gif' onclick='popUpCalendar(this, frm.".$x."field_value, \"mm/dd/yyyy\");'></td> \n";
|
||||
//echo "</tr>";
|
||||
//echo "</table>";
|
||||
//echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name='".$x."field_value' maxlength='50' value='".$data_row[$row['virtual_field_name']]."'>\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "truefalse":
|
||||
//checkbox
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value=\"".$row['virtual_field_name']."\">\n";
|
||||
echo "<table border='0'>\n";
|
||||
echo "<tr>\n";
|
||||
switch ($row['virtual_field_name']) {
|
||||
case "true":
|
||||
echo "<td>True</td><td width='50'><input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' checked='checked' value='true' /></td>\n";
|
||||
echo "<td>False</td><td><input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='false'></td>\n";
|
||||
break;
|
||||
case "false":
|
||||
echo "<td>True</td><td width='50'><input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='true' /></td>\n";
|
||||
echo "<td>False</td><td><input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' checked='checked' value='false' /></td>\n";
|
||||
break;
|
||||
default:
|
||||
echo "<td>True</td><td width='50'><input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='true' /></td>\n";
|
||||
echo "<td>False</td><td><input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='false' /></td>\n";
|
||||
}
|
||||
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "textarea":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<textarea tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' name='".$x."field_value' rows='4'>".$data_row[$row['virtual_field_name']]."</textarea>\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "radiobutton":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name=\"".$x."field_name\" value=\"".$row['virtual_field_name']."\">\n";
|
||||
|
||||
$sqlselect = "SELECT virtual_data_types_name, virtual_data_types_value ";
|
||||
$sqlselect .= "FROM v_virtual_table_data_types_name_value ";
|
||||
$sqlselect .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sqlselect .= "and virtual_table_field_uuid = '".$row[virtual_table_field_uuid]."' ";
|
||||
$prep_statement_2 = $db->prepare($sqlselect);
|
||||
$prep_statement_2->execute();
|
||||
$result2 = $prep_statement_2->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count2 = count($result2);
|
||||
|
||||
echo "<table>";
|
||||
if ($result_count > 0) {
|
||||
foreach($result2 as $row2) {
|
||||
echo "<tr><td>".$row2["virtual_data_types_name"]."</td><td><input tabindex='".$row['virtual_field_order_tab']."' type='radio' name='".$x."field_value' value='".$row2["virtual_data_types_select_value"]."'";
|
||||
if ($row2["virtual_data_types_value"] == $data_row[$row['virtual_field_name']]) { echo " checked>"; } else { echo ">"; }
|
||||
echo "</td></tr>";
|
||||
} //end foreach
|
||||
} //end if results
|
||||
unset($sqlselect, $result2, $result_count2);
|
||||
echo "</table>";
|
||||
//echo "</select>\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "select":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
|
||||
$sqlselect = "SELECT virtual_data_types_name, virtual_data_types_value ";
|
||||
$sqlselect .= "FROM v_virtual_table_data_types_name_value ";
|
||||
$sqlselect .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sqlselect .= "and virtual_table_field_uuid = '".$row[virtual_table_field_uuid]."' ";
|
||||
$prep_statement_2 = $db->prepare($sqlselect);
|
||||
$prep_statement_2->execute();
|
||||
$result2 = $prep_statement_2->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count2 = count($result2);
|
||||
|
||||
echo "<select tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' name='".$x."field_value'>\n";
|
||||
echo "<option value=''></option>\n";
|
||||
if ($result_count > 0) {
|
||||
foreach($result2 as $row2) {
|
||||
echo "<option value=\"" . $row2["virtual_data_types_value"] . "\"";
|
||||
if (strtolower($row2["virtual_data_types_value"]) == strtolower($data_row[$row['virtual_field_name']])) { echo " selected='selected' "; }
|
||||
echo ">" . $row2["virtual_data_types_name"] . "</option>\n";
|
||||
} //end foreach
|
||||
} //end if results
|
||||
unset($sqlselect, $result2, $result_count2);
|
||||
echo "</select>\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "ipv4":
|
||||
//max 15
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name='".$x."field_value' maxlength='15' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "ipv6":
|
||||
//maximum number of characters 39
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name='".$x."field_value' maxlength='39' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "phone":
|
||||
$tmp_phone = $data_row[$row['virtual_field_name']];
|
||||
$tmp_phone = format_phone($tmp_phone);
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name='".$x."field_value' maxlength='20' value=\"".$tmp_phone."\">\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "money":
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' name=".$x."field_value' maxlength='255' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
break;
|
||||
case "add_user":
|
||||
//echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_value' maxlength='255' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
//echo "</td>\n";
|
||||
break;
|
||||
case "add_date":
|
||||
//echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_value' maxlength='255' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
//echo "</td>\n";
|
||||
break;
|
||||
case "mod_user":
|
||||
//echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_value' maxlength='255' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
//echo "</td>\n";
|
||||
break;
|
||||
case "mod_date":
|
||||
//echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_value' maxlength='255' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
//echo "</td>\n";
|
||||
break;
|
||||
case "uploadimage":
|
||||
if (strlen($data_row[$row['virtual_field_name']]) > 0) {
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<script type=\"text/javascript\">\n";
|
||||
echo $row['virtual_field_name']." = \"\<input type=\'hidden\' name=\'".$x."field_name\' value=\'".$row['virtual_field_name']."\'>\\n\";\n";
|
||||
echo $row['virtual_field_name']." += \"\<input tabindex='".$row['virtual_field_order_tab']."' class=\'txt\' type=\'file\' name='".$x."field_value\' value=\'".$data_row[$row['virtual_field_name']]."\'>\\n\";\n";
|
||||
echo "</script>\n";
|
||||
|
||||
echo "<div id='".$row['virtual_field_name']."id'>";
|
||||
echo "<table border='0' width='100%'>";
|
||||
echo "<tr>";
|
||||
echo "<td align='left'>";
|
||||
echo "".$data_row[$row['virtual_field_name']]."";
|
||||
echo "</td>";
|
||||
echo "<td align='right'>";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' type='button' class='btn' title='delete' onclick=\"document.getElementById('".$row['virtual_field_name']."id').innerHTML=".$row['virtual_field_name']."\" value='x'>\n";
|
||||
//echo "<input type='button' class='btn' title='delete' onclick=\"addField('".$row['virtual_field_name']."id','".$x."field_name', 'hidden', '".$row['virtual_field_name']."',1);addField('".$row['virtual_field_name']."id','".$x."field_value', 'file', '',1);//'".$row['virtual_field_name']."'\" value='x'>\n";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td colspan='2' align='center'>";
|
||||
if (file_exists($imagetempdir.$data_row[$row['virtual_field_name']])) {
|
||||
echo "<img src='/images/cache/".$data_row[$row['virtual_field_name']]."'>";
|
||||
}
|
||||
else {
|
||||
echo "<img src='imagelo.php?max=125&img=".$data_row[$row['virtual_field_name']]."'>";
|
||||
}
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
|
||||
echo "</table>";
|
||||
echo "<div>";
|
||||
echo "</td>\n";
|
||||
}
|
||||
else {
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='file' name='".$x."field_value' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
}
|
||||
break;
|
||||
case "upload_file":
|
||||
if (strlen($data_row[$row['virtual_field_name']]) > 0) {
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<script type=\"text/javascript\">\n";
|
||||
echo $row['virtual_field_name']." = \"<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\";\n";
|
||||
echo $row['virtual_field_name']." += \"<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='file' name='".$x."field_value' value='".$data_row[$row['virtual_field_name']]."'>\";\n";
|
||||
echo "</script>\n";
|
||||
|
||||
echo "<span id='".$row['virtual_field_name']."'>";
|
||||
echo "<table width='100%'>";
|
||||
echo "<tr>";
|
||||
echo "<td>";
|
||||
echo "<a href='download.php?f=".$data_row[$row['virtual_field_name']]."'>".$data_row[$row['virtual_field_name']]."</a>";
|
||||
echo "</td>";
|
||||
echo "<td align='right'>";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' type='button' class='btn' title='delete' onclick=\"document.getElementById('".$row['virtual_field_name']."').innerHTML=".$row['virtual_field_name']."\" value='x'>\n";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "<span>";
|
||||
echo "</td>\n";
|
||||
}
|
||||
else {
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='file' name='".$x."field_value' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
echo "<td valign='top' align='left' class='vtable'>\n";
|
||||
echo "<input type='hidden' name='".$x."field_name' value='".$row['virtual_field_name']."'>\n";
|
||||
echo "<input tabindex='".$row['virtual_field_order_tab']."' class='formfld' style='width:90%' type='text' style='' name='".$x."field_value' maxlength='255' value=\"".$data_row[$row['virtual_field_name']]."\">\n";
|
||||
echo "</td>\n";
|
||||
}
|
||||
if ($row['virtual_field_type'] != "hidden"){
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
//set the current value to the previous value
|
||||
$virtual_field_column_previous = $virtual_field_column;
|
||||
|
||||
$x++;
|
||||
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
|
||||
if ($column_table_cell_status == 'open') {
|
||||
$column_table_cell_status = 'closed';
|
||||
}
|
||||
} //end if results
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='999' align='right'>\n";
|
||||
if ($action == "add" && permission_exists('virtual_tables_data_add')) {
|
||||
echo " <input type='submit' class='btn' name='submit' value='save'>\n";
|
||||
}
|
||||
if ($action == "update" && permission_exists('virtual_tables_data_edit')) {
|
||||
echo " <input type='hidden' name='virtual_data_row_uuid' value='$virtual_data_row_uuid'>\n";
|
||||
echo " <input type='submit' tabindex='9999999' class='btn' name='submit' value='Save'>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</form>\n";
|
||||
|
||||
if ($action == "update" && permission_exists('virtual_tables_data_edit')) {
|
||||
//get the child virtual_table_uuid and use it to show the list of data
|
||||
$sql = "select * from v_virtual_tables ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_parent_id = '$virtual_table_uuid' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td colspan='999' align=\"left\">\n";
|
||||
echo " <br>";
|
||||
$_GET["id"] = $row["virtual_table_uuid"];
|
||||
$virtual_table_label = $row["virtual_table_label"];
|
||||
$_GET["virtual_data_parent_row_uuid"] = $virtual_data_row_uuid;
|
||||
|
||||
//show button
|
||||
//echo "<input type='button' class='btn' name='' alt='".$virtual_table_label."' onclick=\"window.location='v_virtual_table_data_view.php?id=".$row["virtual_table_uuid"]."&virtual_data_parent_row_uuid=".$virtual_data_row_uuid."'\" value='".$virtual_table_label."'>\n";
|
||||
|
||||
//show list
|
||||
require_once "v_virtual_table_data_view.php";
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
}
|
||||
}
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
require_once "includes/footer.php";
|
||||
?>
|
||||
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/paging.php";
|
||||
|
||||
//get the http values
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"center\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td width='50%' align=\"left\" nowrap=\"nowrap\"><b>Virtual Table Data Types Name Value List</b></td>\n";
|
||||
echo "<td width='50%' align=\"right\"> </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align=\"left\" nowrap=\"nowrap\" colspan='2'>\n";
|
||||
echo "Stores the name and value pairs.<br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</tr></table>\n";
|
||||
|
||||
//$sql = "";
|
||||
//$sql .= " select * from v_virtual_table_data_types_name_value ";
|
||||
//$sql .= " where domain_uuid = '$domain_uuid' ";
|
||||
//$sql .= " and virtual_table_field_uuid = '$virtual_table_field_uuid' ";
|
||||
//if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
//$prep_statement = $db->prepare(check_sql($sql));
|
||||
//$prep_statement->execute();
|
||||
//$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
//$num_rows = count($result);
|
||||
//unset ($prep_statement, $result, $sql);
|
||||
//$rows_per_page = 10;
|
||||
//$param = "";
|
||||
//$page = $_GET['page'];
|
||||
//if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
//list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
//$offset = $rows_per_page * $page;
|
||||
|
||||
$sql = "";
|
||||
$sql .= " select * from v_virtual_table_data_types_name_value ";
|
||||
$sql .= " where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= " and virtual_table_field_uuid = '$virtual_table_field_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
//$sql .= " limit $rows_per_page offset $offset ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('virtual_data_types_name', 'Name', $order_by, $order);
|
||||
echo th_order_by('virtual_data_types_value', 'Value', $order_by, $order);
|
||||
echo "<td align='right' width='42'>\n";
|
||||
echo " <a href='v_virtual_table_data_types_name_value_edit.php?virtual_table_uuid=".$row[virtual_table_uuid]."&virtual_table_field_uuid=".$row[virtual_table_field_uuid]."' alt='add'>$v_link_label_add</a>\n";
|
||||
echo "</td>\n";
|
||||
echo "<tr>\n";
|
||||
|
||||
if ($result_count > 0) {
|
||||
foreach($result as $row) {
|
||||
echo "<tr >\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row[virtual_data_types_name]."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row[virtual_data_types_value]."</td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
echo " <a href='v_virtual_table_data_types_name_value_edit.php?virtual_table_uuid=".$row[virtual_table_uuid]."&virtual_table_field_uuid=".$row[virtual_table_field_uuid]."&id=".$row[virtual_table_data_types_name_value_uuid]."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
echo " <a href='v_virtual_table_data_types_name_value_delete.php?virtual_table_uuid=".$row[virtual_table_uuid]."&virtual_table_field_uuid=".$row[virtual_table_field_uuid]."&id=".$row[virtual_table_data_types_name_value_uuid]."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
//echo " <input type='button' class='btn' name='' alt='edit' onclick=\"window.location='v_virtual_table_data_types_name_value_edit.php?id=".$row[virtual_table_data_types_name_value_uuid]."'\" value='e'>\n";
|
||||
//echo " <input type='button' class='btn' name='' alt='delete' onclick=\"if (confirm('Are you sure you want to delete this?')) { window.location='v_virtual_table_data_types_name_value_delete.php?id=".$row[virtual_table_data_types_name_value_uuid]."' }\" value='x'>\n";
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='3' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
//echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
echo " <a href='v_virtual_table_data_types_name_value_edit.php?virtual_table_uuid=".$row[virtual_table_uuid]."&virtual_table_field_uuid=".$row[virtual_table_field_uuid]."' alt='add'>$v_link_label_add</a>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
|
||||
//show the footer
|
||||
require_once "includes/footer.php";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//get the http values
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]);
|
||||
$virtual_table_field_uuid = check_str($_GET["virtual_table_field_uuid"]);
|
||||
}
|
||||
|
||||
//delete the data
|
||||
if (strlen($id)>0) {
|
||||
$sql = "";
|
||||
$sql .= "delete from v_virtual_table_data_types_name_value ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_data_types_name_value_uuid = '$id' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//redirect the user
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_table_fields_edit.php?virtual_table_uuid=$virtual_table_uuid&id=$virtual_table_field_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Delete Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,232 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//action add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$virtual_table_data_types_name_value_uuid = check_str($_REQUEST["id"]);
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
if (strlen($_GET["virtual_table_field_uuid"]) > 0) {
|
||||
$virtual_table_field_uuid = check_str($_GET["virtual_table_field_uuid"]);
|
||||
}
|
||||
|
||||
//POST to PHP variables
|
||||
if (count($_POST)>0) {
|
||||
//$domain_uuid = check_str($_POST["domain_uuid"]);
|
||||
$virtual_data_types_name = check_str($_POST["virtual_data_types_name"]);
|
||||
$virtual_data_types_value = check_str($_POST["virtual_data_types_value"]);
|
||||
$virtual_table_uuid = $_REQUEST["virtual_table_uuid"];
|
||||
$virtual_table_field_uuid = $_REQUEST["virtual_table_field_uuid"];
|
||||
}
|
||||
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
if ($action == "update") {
|
||||
$virtual_table_data_types_name_value_uuid = check_str($_POST["virtual_table_data_types_name_value_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
|
||||
if (strlen($virtual_table_uuid) == 0) { $msg .= "Please provide: virtual_table_uuid<br>\n"; }
|
||||
if (strlen($virtual_table_field_uuid) == 0) { $msg .= "Please provide: virtual_table_field_uuid<br>\n"; }
|
||||
if (strlen($virtual_data_types_name) == 0) { $msg .= "Please provide: Name<br>\n"; }
|
||||
if (strlen($virtual_data_types_value) == 0) { $msg .= "Please provide: Value<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/persistformvar.php";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table><tr><td>\n";
|
||||
echo $msg."<br />";
|
||||
echo "</td></tr></table>\n";
|
||||
persistformvar($_POST);
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add") {
|
||||
$sql = "insert into v_virtual_table_data_types_name_value ";
|
||||
$sql .= "(";
|
||||
$sql .= "virtual_table_data_types_name_value_uuid, ";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "virtual_table_uuid, ";
|
||||
$sql .= "virtual_table_field_uuid, ";
|
||||
$sql .= "virtual_data_types_name, ";
|
||||
$sql .= "virtual_data_types_value ";
|
||||
$sql .= ") ";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".uuid()."', ";
|
||||
$sql .= "'".$_SESSION['domain_uuid']."', ";
|
||||
$sql .= "'$virtual_table_uuid', ";
|
||||
$sql .= "'$virtual_table_field_uuid', ";
|
||||
$sql .= "'$virtual_data_types_name', ";
|
||||
$sql .= "'$virtual_data_types_value' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_table_fields_edit.php?virtual_table_uuid=$virtual_table_uuid&id=$virtual_table_field_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Add Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update") {
|
||||
$sql = "update v_virtual_table_data_types_name_value set ";
|
||||
$sql .= "virtual_data_types_name = '$virtual_data_types_name', ";
|
||||
$sql .= "virtual_data_types_value = '$virtual_data_types_value' ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$sql .= "and virtual_table_field_uuid = '$virtual_table_field_uuid' ";
|
||||
$sql .= "and virtual_table_data_types_name_value_uuid = '$virtual_table_data_types_name_value_uuid' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_table_fields_edit.php?virtual_table_uuid=$virtual_table_uuid&id=$virtual_table_field_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Update Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
|
||||
$virtual_table_uuid = $_GET["virtual_table_uuid"];
|
||||
$virtual_table_field_uuid = $_GET["virtual_table_field_uuid"];
|
||||
$virtual_table_data_types_name_value_uuid = $_GET["id"];
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_table_data_types_name_value ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
//$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$sql .= "and virtual_table_field_uuid = '$virtual_table_field_uuid' ";
|
||||
$sql .= "and virtual_table_data_types_name_value_uuid = '$virtual_table_data_types_name_value_uuid' ";
|
||||
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$virtual_data_types_name = $row["virtual_data_types_name"];
|
||||
$virtual_data_types_value = $row["virtual_data_types_value"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"left\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
if ($action == "add") {
|
||||
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Virtual Table Data Types Name Value Add</b></td>\n";
|
||||
}
|
||||
if ($action == "update") {
|
||||
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Virtual Table Data Types Name Value Edit</b></td>\n";
|
||||
}
|
||||
echo "<td width='70%' align=\"right\"><input type='button' class='btn' name='' alt='back' onclick=\"history.go(-1);return true;\" value='Back'></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align=\"left\" colspan='2'>\n";
|
||||
echo "Stores the name and value pairs.<br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Name:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_data_types_name' maxlength='255' value=\"$virtual_data_types_name\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the name.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Value:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_data_types_value' maxlength='255' value=\"$virtual_data_types_value\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the value.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
echo " <input type='hidden' name='virtual_table_uuid' value='$virtual_table_uuid'>\n";
|
||||
echo " <input type='hidden' name='virtual_table_field_uuid' value='$virtual_table_field_uuid'>\n";
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='virtual_table_data_types_name_value_uuid' value='$virtual_table_data_types_name_value_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
|
||||
require_once "includes/footer.php";
|
||||
?>
|
||||
@@ -0,0 +1,399 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_data_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (strlen($_GET["id"]) > 0) {
|
||||
$virtual_table_uuid = check_str($_GET["id"]);
|
||||
if (strlen($_GET["virtual_data_parent_row_uuid"])>0) {
|
||||
$virtual_data_parent_row_uuid = $_GET["virtual_data_parent_row_uuid"];
|
||||
}
|
||||
$search_all = check_str($_GET["search_all"]);
|
||||
}
|
||||
|
||||
//used for changing the order
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//used to alternate colors when paging
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
//get the information about the virtual table by using the id
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_tables ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach ($result as &$row) {
|
||||
$virtual_table_category = $row["virtual_table_category"];
|
||||
$virtual_table_label = $row["virtual_table_label"];
|
||||
$virtual_table_name = $row["virtual_table_name"];
|
||||
$virtual_table_auth = $row["virtual_table_auth"];
|
||||
$virtual_table_captcha = $row["virtual_table_captcha"];
|
||||
$virtual_table_parent_uuid = $row["virtual_table_parent_uuid"];
|
||||
$virtual_table_description = $row["virtual_table_description"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
|
||||
//get the field information
|
||||
$db_field_name_array = array();
|
||||
$db_value_array = array();
|
||||
$db_names .= "<tr>\n";
|
||||
$sql = "select * from v_virtual_table_fields ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$sql .= "order by virtual_field_order asc ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$result_names = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
$result_count = count($result);
|
||||
foreach($result_names as $row) {
|
||||
$virtual_field_label = $row["virtual_field_label"];
|
||||
$virtual_field_name = $row["virtual_field_name"];
|
||||
$virtual_field_type = $row["virtual_field_type"];
|
||||
$virtual_field_value = $row["virtual_field_value"];
|
||||
$virtual_field_list_hidden = $row["virtual_field_list_hidden"];
|
||||
$virtual_field_column = $row["virtual_field_column"];
|
||||
$virtual_field_required = $row["virtual_field_required"];
|
||||
$virtual_field_order = $row["virtual_field_order"];
|
||||
$virtual_field_order_tab = $row["virtual_field_order_tab"];
|
||||
$virtual_field_description = $row["virtual_field_description"];
|
||||
|
||||
$name_array[$virtual_field_name]['virtual_field_label'] = $row["virtual_field_label"];
|
||||
$name_array[$virtual_field_name]['virtual_field_type'] = $row["virtual_field_type"];
|
||||
$name_array[$virtual_field_name]['virtual_field_list_hidden'] = $row["virtual_field_list_hidden"];
|
||||
$name_array[$virtual_field_name]['virtual_field_column'] = $row["virtual_field_column"];
|
||||
$name_array[$virtual_field_name]['virtual_field_required'] = $row["virtual_field_required"];
|
||||
$name_array[$virtual_field_name]['virtual_field_order'] = $row["virtual_field_order"];
|
||||
$name_array[$virtual_field_name]['virtual_field_order_tab'] = $row["virtual_field_order_tab"];
|
||||
$name_array[$virtual_field_name]['virtual_field_description'] = $row["virtual_field_description"];
|
||||
}
|
||||
unset($sql, $prep_statement, $row);
|
||||
$fieldcount = count($name_array);
|
||||
|
||||
//get the data
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_table_data ";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
if (strlen($search_all) == 0) {
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
if (strlen($virtual_data_parent_row_uuid) > 0) {
|
||||
$sql .= " and virtual_data_parent_row_uuid = '$virtual_data_parent_row_uuid' ";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= "and virtual_data_row_uuid in (";
|
||||
$sql .= "select virtual_data_row_uuid from v_virtual_table_data \n";
|
||||
$sql .= "where domain_uuid = '".$domain_uuid."' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
if (strlen($virtual_data_parent_row_uuid) == 0) {
|
||||
$tmp_digits = preg_replace('{\D}', '', $search_all);
|
||||
if (is_numeric($tmp_digits) && strlen($tmp_digits) > 5) {
|
||||
if (strlen($tmp_digits) == '11' ) {
|
||||
$sql .= "and virtual_data_field_value like '%".substr($tmp_digits, -10)."%' \n";
|
||||
}
|
||||
else {
|
||||
$sql .= "and virtual_data_field_value like '%$tmp_digits%' \n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= "and virtual_data_field_value like '%$search_all%' \n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
$sql .= "and virtual_data_parent_row_uuid = '$virtual_data_parent_row_uuid' ";
|
||||
}
|
||||
$sql .= ")\n";
|
||||
}
|
||||
$sql .= "limit 20000\n";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$result_values = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
foreach($result_values as $row) {
|
||||
//set a php variable
|
||||
$virtual_field_name = $row[virtual_field_name];
|
||||
$virtual_data_row_uuid = $row[virtual_data_row_uuid];
|
||||
|
||||
//restructure the data by setting it the value_array
|
||||
$value_array[$virtual_data_row_uuid][$virtual_field_name] = $row[virtual_data_field_value];
|
||||
$value_array[$virtual_data_row_uuid]['virtual_table_uuid'] = $row[virtual_table_uuid];
|
||||
$value_array[$virtual_data_row_uuid]['virtual_data_row_uuid'] = $row[virtual_data_row_uuid];
|
||||
$value_array[$virtual_data_row_uuid]['virtual_table_parent_uuid'] = $row[virtual_table_parent_uuid];
|
||||
$value_array[$virtual_data_row_uuid]['virtual_data_parent_row_uuid'] = $row[virtual_data_parent_row_uuid];
|
||||
}
|
||||
$num_rows = count($value_array);
|
||||
|
||||
//create the connection to the memory dbase_add_record
|
||||
try {
|
||||
$db_memory = new PDO('sqlite::memory:'); //sqlite 3
|
||||
}
|
||||
catch (PDOException $error) {
|
||||
print "error: " . $error->getMessage() . "<br/>";
|
||||
die();
|
||||
}
|
||||
|
||||
//create a memory database and add the fields to the table
|
||||
$sql = "CREATE TABLE memory_table ";
|
||||
$sql .= "(";
|
||||
$sql .= "'id' INTEGER PRIMARY KEY, ";
|
||||
$sql .= "'virtual_table_uuid' TEXT, ";
|
||||
$sql .= "'virtual_data_row_uuid' TEXT, ";
|
||||
$sql .= "'virtual_table_parent_uuid' TEXT, ";
|
||||
$sql .= "'virtual_data_parent_row_uuid' TEXT, ";
|
||||
foreach($result_names as $row) {
|
||||
if ($row["virtual_field_type"] != "label") {
|
||||
if ($row["virtual_field_name"] != "domain_uuid") {
|
||||
//$row["virtual_field_label"];
|
||||
//$row["virtual_field_name"]
|
||||
//$row["virtual_field_type"];
|
||||
if ($row["virtual_field_name"] == "number") {
|
||||
$sql .= "'".$row["virtual_field_name"]."' NUMERIC, ";
|
||||
}
|
||||
else {
|
||||
$sql .= "'".$row["virtual_field_name"]."' TEXT, ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql .= "'domain_uuid' TEXT ";
|
||||
$sql .= ");";
|
||||
//echo "$sql<br /><br />\n";
|
||||
$prep_statement = $db_memory->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
//list the values from the array
|
||||
$x = 0;
|
||||
foreach($value_array as $array) {
|
||||
//insert the data into the memory table
|
||||
$sql = "insert into memory_table ";
|
||||
$sql .= "(";
|
||||
$sql .= "'virtual_table_uuid', ";
|
||||
$sql .= "'virtual_data_row_uuid', ";
|
||||
$sql .= "'virtual_table_parent_uuid', ";
|
||||
$sql .= "'virtual_data_parent_row_uuid', ";
|
||||
//foreach($array as $key => $value) {
|
||||
// $sql .= "'$key', ";
|
||||
foreach($result_names as $row) {
|
||||
$virtual_field_name = $row["virtual_field_name"];
|
||||
$sql .= "'$virtual_field_name', ";
|
||||
}
|
||||
$sql .= "'domain_uuid' ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'".$array['virtual_table_uuid']."', ";
|
||||
$sql .= "'".$array['virtual_data_row_uuid']."', ";
|
||||
$sql .= "'".$array['virtual_table_parent_uuid']."', ";
|
||||
$sql .= "'".$array['virtual_data_parent_row_uuid']."', ";
|
||||
//foreach($array as $key => $value) {
|
||||
// $sql .= "'$value', ";
|
||||
foreach($result_names as $row) {
|
||||
$virtual_field_name = $row["virtual_field_name"];
|
||||
$sql .= "'".check_str($array[$virtual_field_name])."', ";
|
||||
}
|
||||
$sql .= "'$domain_uuid' ";
|
||||
$sql .= ");";
|
||||
//echo "$sql <br /><br />\n";
|
||||
$db_memory->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
unset($array);
|
||||
//unset the row of data
|
||||
unset($value_array[$x]);
|
||||
//increment the value
|
||||
$x++;
|
||||
}
|
||||
|
||||
//set the title and description of the virtual table
|
||||
echo "<br />\n";
|
||||
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td align='left' valign='top'><strong>$virtual_table_label</strong><br>\n";
|
||||
echo " $virtual_table_description\n";
|
||||
echo " </td>\n";
|
||||
echo " <td align='right' valign='top'>\n";
|
||||
if (strlen($virtual_data_parent_row_uuid) == 0) {
|
||||
$search_all = str_replace("''", "'", $search_all);
|
||||
echo "<form method='GET' name='frm_search' action=''>\n";
|
||||
echo " <input class='formfld' type='text' name='search_all' value=\"$search_all\">\n";
|
||||
echo " <input type='hidden' name='id' value='$virtual_table_uuid'>\n";
|
||||
echo " <input type='hidden' name='virtual_data_parent_row_uuid' value='$virtual_data_parent_row_uuid'>\n";
|
||||
echo " <input class='btn' type='submit' name='submit' value='Search All'>\n";
|
||||
echo "</form>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />";
|
||||
|
||||
//prepare for paging the results
|
||||
require_once "includes/paging.php";
|
||||
$rows_per_page = 100;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
if (strlen($virtual_table_parent_uuid) > 0) {
|
||||
$param = "&id=$virtual_table_parent_uuid&virtual_data_row_uuid=$virtual_data_row_uuid";
|
||||
}
|
||||
else {
|
||||
$param = "&id=$virtual_table_uuid&virtual_data_row_uuid=$virtual_data_row_uuid";
|
||||
}
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
//list the data in the database
|
||||
$sql = "select * from memory_table \n";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' \n";
|
||||
$sql .= "limit $rows_per_page offset $offset \n";
|
||||
//$sql .= "order by virtual_field_order asc \n";
|
||||
//echo "<pre>\n";
|
||||
//echo $sql;
|
||||
//echo "</pre>\n";
|
||||
$prep_statement = $db_memory->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
//begin the list
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
foreach($result_names as $row) {
|
||||
if ($row['virtual_field_list_hidden'] != "hide") {
|
||||
echo "<th valign='top' nowrap> ".$row['virtual_field_label']." </th>\n";
|
||||
}
|
||||
}
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('virtual_tables_data_add')) {
|
||||
echo " <a href='v_virtual_table_data_edit.php?virtual_table_uuid=".$virtual_table_uuid."&virtual_data_parent_row_uuid=$virtual_data_parent_row_uuid' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$db_values = '';
|
||||
$x = 0;
|
||||
foreach ($result as &$row) {
|
||||
echo "<tr>\n";
|
||||
foreach($result_names as $row2) {
|
||||
$virtual_field_name = $row2[virtual_field_name];
|
||||
|
||||
//get the values from the array and set as php variables
|
||||
$virtual_field_label = $name_array[$virtual_field_name]['virtual_field_label'];
|
||||
$virtual_field_type = $name_array[$virtual_field_name]['virtual_field_type'];
|
||||
$virtual_field_list_hidden = $name_array[$virtual_field_name]['virtual_field_list_hidden'];
|
||||
$virtual_field_column = $name_array[$virtual_field_name]['virtual_field_column'];
|
||||
$virtual_field_required = $name_array[$virtual_field_name]['virtual_field_required'];
|
||||
$virtual_field_order = $name_array[$virtual_field_name]['virtual_field_order'];
|
||||
$virtual_field_order_tab = $name_array[$virtual_field_name]['virtual_field_order_tab'];
|
||||
$virtual_field_description = $name_array[$virtual_field_name]['virtual_field_description'];
|
||||
|
||||
if ($virtual_field_list_hidden != "hide") {
|
||||
switch ($virtual_field_type) {
|
||||
case "textarea":
|
||||
$tmp_value = str_replace("\n", "<br />\n", $row[$virtual_field_name]);
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".$tmp_value." </td>\n";
|
||||
unset($tmp_value);
|
||||
break;
|
||||
case "email":
|
||||
echo "<td valign='top' class='".$row_style[$c]."'><a href='mailto:".$row[$virtual_field_name]."'>".$row[$virtual_field_name]."</a> </td>\n";
|
||||
break;
|
||||
case "phone":
|
||||
$tmp_phone = $row[$virtual_field_name];
|
||||
$tmp_phone = format_phone($tmp_phone);
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".$tmp_phone." </td>\n";
|
||||
break;
|
||||
case "url":
|
||||
$url = $row[$virtual_field_name];
|
||||
if (substr($url,0,4) != "http") {
|
||||
$url = 'http://'.$url;
|
||||
}
|
||||
echo "<td valign='top' class='".$row_style[$c]."'><a href='".$url."' target='_blank'>".$row[$virtual_field_name]."</a> </td>\n";
|
||||
break;
|
||||
default:
|
||||
echo "<td valign='top' class='".$row_style[$c]."'>".$row[$virtual_field_name]." </td>\n";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
echo "<td valign='top' align='right' nowrap='nowrap'>\n";
|
||||
if (permission_exists('virtual_tables_data_edit')) {
|
||||
if (strlen($virtual_data_parent_row_uuid) == 0) {
|
||||
echo " <a href='v_virtual_table_data_edit.php?virtual_table_uuid=".$row[virtual_table_uuid]."&virtual_data_parent_row_uuid=$virtual_data_parent_row_uuid&virtual_data_row_uuid=".$row['virtual_data_row_uuid']."&search_all=$search_all' alt='edit'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
else {
|
||||
echo " <a href='v_virtual_table_data_edit.php?virtual_table_uuid=".$row[virtual_table_uuid]."&virtual_data_parent_row_uuid=$virtual_data_parent_row_uuid&virtual_data_row_uuid=".$row['virtual_data_row_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
}
|
||||
if (permission_exists('virtual_tables_data_delete')) {
|
||||
echo" <a href='v_virtual_table_data_delete.php?virtual_data_row_uuid=".$row['virtual_data_row_uuid']."&virtual_data_parent_row_uuid=$virtual_data_parent_row_uuid&virtual_table_uuid=".$virtual_table_uuid."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
}
|
||||
|
||||
//show the paging tools and final add button
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='999' align='left'>\n";
|
||||
echo " <table border='0' width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('virtual_tables_data_add')) {
|
||||
echo " <a href='v_virtual_table_data_edit.php?virtual_table_uuid=".$virtual_table_uuid."&virtual_data_parent_row_uuid=$virtual_data_parent_row_uuid' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>\n";
|
||||
echo "<br><br>\n";
|
||||
echo "</div>";
|
||||
|
||||
//show the header
|
||||
echo "<br><br>";
|
||||
require_once "includes/footer.php";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,158 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/paging.php";
|
||||
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"center\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td width='50%' align=\"left\" nowrap=\"nowrap\"><b>Virtual Table Field List</b></td>\n";
|
||||
echo "<td width='50%' align=\"right\"> </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align=\"left\" colspan=\"2\">\n";
|
||||
echo "Lists the fields in the virtual database.<br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</tr></table>\n";
|
||||
|
||||
if (strlen($order_by) == 0) {
|
||||
$order_by = 'virtual_field_order';
|
||||
$order = 'asc';
|
||||
}
|
||||
|
||||
$sql = "";
|
||||
$sql .= " select * from v_virtual_table_fields ";
|
||||
$sql .= " where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= " and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('virtual_field_label', 'Label', $order_by, $order);
|
||||
echo th_order_by('virtual_field_name', 'Name', $order_by, $order);
|
||||
echo th_order_by('virtual_field_type', 'Type', $order_by, $order);
|
||||
echo th_order_by('virtual_field_column', 'Column', $order_by, $order);
|
||||
echo th_order_by('virtual_field_required', 'Required', $order_by, $order);
|
||||
echo th_order_by('virtual_field_order', 'Field Order', $order_by, $order);
|
||||
echo th_order_by('virtual_field_order_tab', 'Tab Order', $order_by, $order);
|
||||
echo th_order_by('virtual_field_description', 'Description', $order_by, $order);
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('virtual_tables_view')) {
|
||||
echo " <a href='v_virtual_table_fields_edit.php?virtual_table_uuid=".$virtual_table_uuid."' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "<tr>\n";
|
||||
|
||||
if ($result_count == 0) {
|
||||
//no results
|
||||
}
|
||||
else { //received results
|
||||
foreach($result as $row) {
|
||||
echo "<tr >\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_label']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_name']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_type']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_column']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_required']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_order']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_order_tab']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_description']." </td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('virtual_tables_edit')) {
|
||||
echo " <a href='v_virtual_table_fields_edit.php?virtual_table_uuid=".$row['virtual_table_uuid']."&id=".$row['virtual_table_field_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('virtual_tables_delete')) {
|
||||
echo " <a href='v_virtual_table_fields_delete.php?virtual_table_uuid=".$row['virtual_table_uuid']."&id=".$row['virtual_table_field_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='9' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('virtual_tables_add')) {
|
||||
echo " <a href='v_virtual_table_fields_edit.php?virtual_table_uuid=".$virtual_table_uuid."' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
|
||||
//include the footer
|
||||
require_once "includes/footer.php";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//get the http values
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]);
|
||||
}
|
||||
|
||||
//delete the data
|
||||
if (strlen($id)>0) {
|
||||
$sql = "";
|
||||
$sql .= "delete from v_virtual_table_fields ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_field_uuid = '$id' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//redirect the user
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_tables_edit.php?id=$virtual_table_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Delete Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,545 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_add') || permission_exists('virtual_tables_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//set the action as an add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$virtual_table_field_uuid = check_str($_REQUEST["id"]);
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//get the http variables
|
||||
if (strlen($_GET["virtual_table_uuid"]) > 0) {
|
||||
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]);
|
||||
}
|
||||
|
||||
//get the http post variables
|
||||
if (count($_POST)>0) {
|
||||
$virtual_field_label = check_str($_POST["virtual_field_label"]);
|
||||
$virtual_field_name = check_str($_POST["virtual_field_name"]);
|
||||
$virtual_field_type = check_str($_POST["virtual_field_type"]);
|
||||
$virtual_field_value = check_str($_POST["virtual_field_value"]);
|
||||
$virtual_field_list_hidden = check_str($_POST["virtual_field_list_hidden"]);
|
||||
$virtual_field_column = check_str($_POST["virtual_field_column"]);
|
||||
$virtual_field_required = check_str($_POST["virtual_field_required"]);
|
||||
$virtual_field_order = check_str($_POST["virtual_field_order"]);
|
||||
$virtual_field_order_tab = check_str($_POST["virtual_field_order_tab"]);
|
||||
$virtual_field_description = check_str($_POST["virtual_field_description"]);
|
||||
}
|
||||
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
if ($action == "update") {
|
||||
$virtual_table_field_uuid = check_str($_POST["virtual_table_field_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
|
||||
//if (strlen($virtual_field_label) == 0) { $msg .= "Please provide: Label<br>\n"; }
|
||||
if (strlen($virtual_field_name) == 0 && $virtual_field_type != "label") { $msg .= "Please provide: Name<br>\n"; }
|
||||
if (strlen($virtual_field_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
|
||||
//if (strlen($virtual_field_value) == 0) { $msg .= "Please provide: Value<br>\n"; }
|
||||
if (strlen($virtual_field_list_hidden) == 0) { $msg .= "Please provide: List Visibility<br>\n"; }
|
||||
if (strlen($virtual_field_column) == 0) { $msg .= "Please provide: Column<br>\n"; }
|
||||
if (strlen($virtual_field_required) == 0) { $msg .= "Please provide: Required<br>\n"; }
|
||||
if (strlen($virtual_field_order) == 0) { $msg .= "Please provide: Field Order<br>\n"; }
|
||||
if (strlen($virtual_field_order_tab) == 0) { $msg .= "Please provide: Tab Order<br>\n"; }
|
||||
//if (strlen($virtual_field_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/persistformvar.php";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table><tr><td>\n";
|
||||
echo $msg."<br />";
|
||||
echo "</td></tr></table>\n";
|
||||
persistformvar($_POST);
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add" && permission_exists('virtual_tables_add')) {
|
||||
$virtual_table_field_uuid = uuid();
|
||||
$sql = "insert into v_virtual_table_fields ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "virtual_table_uuid, ";
|
||||
$sql .= "virtual_table_field_uuid, ";
|
||||
$sql .= "virtual_field_label, ";
|
||||
$sql .= "virtual_field_name, ";
|
||||
$sql .= "virtual_field_type, ";
|
||||
$sql .= "virtual_field_value, ";
|
||||
$sql .= "virtual_field_list_hidden, ";
|
||||
$sql .= "virtual_field_column, ";
|
||||
$sql .= "virtual_field_required, ";
|
||||
$sql .= "virtual_field_order, ";
|
||||
$sql .= "virtual_field_order_tab, ";
|
||||
$sql .= "virtual_field_description ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$virtual_table_uuid', ";
|
||||
$sql .= "'$virtual_table_field_uuid', ";
|
||||
$sql .= "'$virtual_field_label', ";
|
||||
$sql .= "'$virtual_field_name', ";
|
||||
$sql .= "'$virtual_field_type', ";
|
||||
$sql .= "'$virtual_field_value', ";
|
||||
$sql .= "'$virtual_field_list_hidden', ";
|
||||
$sql .= "'$virtual_field_column', ";
|
||||
$sql .= "'$virtual_field_required', ";
|
||||
$sql .= "'$virtual_field_order', ";
|
||||
$sql .= "'$virtual_field_order_tab', ";
|
||||
$sql .= "'$virtual_field_description' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_tables_edit.php?id=$virtual_table_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Add Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update" && permission_exists('virtual_tables_edit')) {
|
||||
$sql = "update v_virtual_table_fields set ";
|
||||
$sql .= "virtual_field_label = '$virtual_field_label', ";
|
||||
$sql .= "virtual_field_name = '$virtual_field_name', ";
|
||||
$sql .= "virtual_field_type = '$virtual_field_type', ";
|
||||
$sql .= "virtual_field_value = '$virtual_field_value', ";
|
||||
$sql .= "virtual_field_list_hidden = '$virtual_field_list_hidden', ";
|
||||
$sql .= "virtual_field_column = '$virtual_field_column', ";
|
||||
$sql .= "virtual_field_required = '$virtual_field_required', ";
|
||||
$sql .= "virtual_field_order = '$virtual_field_order', ";
|
||||
$sql .= "virtual_field_order_tab = '$virtual_field_order_tab', ";
|
||||
$sql .= "virtual_field_description = '$virtual_field_description' ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid'";
|
||||
$sql .= "and virtual_table_field_uuid = '$virtual_table_field_uuid' ";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_tables_edit.php?id=$virtual_table_uuid\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Update Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
|
||||
$virtual_table_uuid = $_GET["virtual_table_uuid"];
|
||||
$virtual_table_field_uuid = $_GET["id"];
|
||||
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_table_fields ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$sql .= "and virtual_table_field_uuid = '$virtual_table_field_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$virtual_field_label = $row["virtual_field_label"];
|
||||
$virtual_field_name = $row["virtual_field_name"];
|
||||
$virtual_field_type = $row["virtual_field_type"];
|
||||
$virtual_field_value = $row["virtual_field_value"];
|
||||
$virtual_field_list_hidden = $row["virtual_field_list_hidden"];
|
||||
$virtual_field_column = $row["virtual_field_column"];
|
||||
$virtual_field_required = $row["virtual_field_required"];
|
||||
$virtual_field_order = $row["virtual_field_order"];
|
||||
$virtual_field_order_tab = $row["virtual_field_order_tab"];
|
||||
$virtual_field_description = $row["virtual_field_description"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
//begin the content
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"left\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
if ($action == "add") {
|
||||
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Virtual Table Field Add</b></td>\n";
|
||||
}
|
||||
if ($action == "update") {
|
||||
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Virtual Table Field Edit</b></td>\n";
|
||||
}
|
||||
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_virtual_tables_edit.php?id=$virtual_table_uuid'\" value='Back'></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align=\"left\" colspan=\"2\">\n";
|
||||
echo "Lists the fields in the virtual database.<br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Label:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_field_label' maxlength='255' value=\"$virtual_field_label\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the field label.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Name:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_field_name' maxlength='255' value=\"$virtual_field_name\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter field name.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Type:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='virtual_field_type'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($virtual_field_type == "text") {
|
||||
echo " <option value='text' selected='selected'>Text</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='text'>Text</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "number") {
|
||||
echo " <option value='number' selected='selected'>Number</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='number'>Number</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "date") {
|
||||
echo " <option value='date' selected='selected'>Date</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='date'>Date</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "email") {
|
||||
echo " <option value='email' selected='selected'>Email</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='email'>Email</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "label") {
|
||||
echo " <option value='label' selected='selected'>Label</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='label'>Label</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "phone") {
|
||||
echo " <option value='phone' selected='selected'>Phone</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='phone'>Phone</option>\n";
|
||||
}
|
||||
//if ($virtual_field_type == "truefalse") {
|
||||
// echo " <option value='truefalse' selected='selected'>True or False</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='truefalse'>True or False</option>\n";
|
||||
//}
|
||||
if ($virtual_field_type == "checkbox") {
|
||||
echo " <option value='checkbox' selected='selected'>Check Box</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='checkbox'>Check Box</option>\n";
|
||||
}
|
||||
//if ($virtual_field_type == "radiobutton") {
|
||||
// echo " <option value='radiobutton' selected='selected' >Radio Button</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='radiobutton'>Radio Button</option>\n";
|
||||
//}
|
||||
if ($virtual_field_type == "textarea") {
|
||||
echo " <option value='textarea' selected='selected'>Textarea</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='textarea'>Textarea</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "select") {
|
||||
echo " <option value='select' selected='selected'>Select</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='select'>Select</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "hidden") {
|
||||
echo " <option value='hidden' selected='selected'>Hidden</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='hidden'>Hidden</option>\n";
|
||||
}
|
||||
//if ($virtual_field_type == "ipv4") {
|
||||
// echo " <option value='ipv4' selected='selected'>IP version 4</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='ipv4'>IP version 4</option>\n";
|
||||
//}
|
||||
//if ($virtual_field_type == "ipv6") {
|
||||
// echo " <option value='ipv6' selected='selected'>IP version 6</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='ipv6'>IP version 6</option>\n";
|
||||
//}
|
||||
//if ($virtual_field_type == "money") {
|
||||
// echo " <option value='money' selected='selected'>Money</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='money'>Money</option>\n";
|
||||
//}
|
||||
if ($virtual_field_type == "password") {
|
||||
echo " <option value='password' selected='selected'>Password</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='password'>Password</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "pin_number") {
|
||||
echo " <option value='pin_number' selected='selected'>PIN Number</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='pin_number'>PIN Number</option>\n";
|
||||
}
|
||||
//if ($virtual_field_type == "upload_image") {
|
||||
// echo " <option value='upload_image' selected='selected'>Upload Image</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='upload_image'>Upload Image</option>\n";
|
||||
//}
|
||||
//if ($virtual_field_type == "upload_file") {
|
||||
// echo " <option value='upload_file' selected='selected'>Upload File</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='upload_file'>Upload File</option>\n";
|
||||
//}
|
||||
//if ($virtual_field_type == "yesno") {
|
||||
// echo " <option value='yesno' selected='selected'>Yes or No</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='yesno'>Yes or No</option>\n";
|
||||
//}
|
||||
if ($virtual_field_type == "url") {
|
||||
echo " <option value='url' selected='selected'>URL</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='url'>URL</option>\n";
|
||||
}
|
||||
//if ($virtual_field_type == "add_date") {
|
||||
// echo " <option value='add_date' selected='selected'>Add Date</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='add_date'>Add Date</option>\n";
|
||||
//}
|
||||
//if ($virtual_field_type == "add_user") {
|
||||
// echo " <option value='add_user' selected='selected'>Add User</option>\n";
|
||||
//}
|
||||
//else {
|
||||
// echo " <option value='add_user'>Add User</option>\n";
|
||||
//}
|
||||
if ($virtual_field_type == "mod_date") {
|
||||
echo " <option value='mod_date' selected='selected'>Modified Date</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='mod_date'>Modified Date</option>\n";
|
||||
}
|
||||
if ($virtual_field_type == "mod_user") {
|
||||
echo " <option value='mod_user' selected='selected'>Modified User</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='mod_user'>Modified User</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Select the field type.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Value:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_field_value' maxlength='255' value=\"$virtual_field_value\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the default value.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " List Visibility:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='virtual_field_list_hidden'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($virtual_field_list_hidden == "show") {
|
||||
echo " <option value='show' selected='selected'>show</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='show'>show</option>\n";
|
||||
}
|
||||
if ($virtual_field_list_hidden == "hide") {
|
||||
echo " <option value='hide' selected='selected'>hide</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='hide'>hide</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose whether the field is hidden from the list.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Column:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_field_column' maxlength='255' value=\"$virtual_field_column\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Determines which column to show the field in.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Required:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='virtual_field_required'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($virtual_field_required == "yes") {
|
||||
echo " <option value='yes' selected='selected'>yes</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='yes'>yes</option>\n";
|
||||
}
|
||||
if ($virtual_field_required == "no") {
|
||||
echo " <option value='no' selected='selected'>no</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='no'>no</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose whether the field is required.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Field Order:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_field_order' maxlength='255' value='$virtual_field_order'>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the order of the field.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Tab Order:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_field_order_tab' maxlength='255' value='$virtual_field_order_tab'>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the HTML Tab Order.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap=\"nowrap\">\n";
|
||||
echo " Description:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_field_description' maxlength='255' value=\"$virtual_field_description\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the description.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
echo " <input type='hidden' name='virtual_table_uuid' value='$virtual_table_uuid'>\n";
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='virtual_table_field_uuid' value='$virtual_table_field_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
if ($action == "update") {
|
||||
if ($virtual_field_type == "select") {
|
||||
require "v_virtual_table_data_types_name_value.php";
|
||||
}
|
||||
}
|
||||
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
|
||||
//show the footer
|
||||
require_once "includes/footer.php";
|
||||
?>
|
||||
@@ -0,0 +1,161 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/paging.php";
|
||||
|
||||
//get the http get variables
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"center\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<table width='100%' border='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td width='50%' align='left' nowrap='nowrap'><b>Virtual Tables</b></td>\n";
|
||||
echo "<td width='50%' align='right'> </td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left' colspan='2'>\n";
|
||||
echo "Provides the ability to quickly define information to store and dynamically makes tools available to view, add, edit, delete, and search.\n";
|
||||
echo "<br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</tr></table>\n";
|
||||
|
||||
$sql = " select * from v_virtual_tables ";
|
||||
$sql .= " where domain_uuid = '$domain_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$num_rows = count($result);
|
||||
unset ($prep_statement, $result, $sql);
|
||||
$rows_per_page = 100;
|
||||
$param = "";
|
||||
$page = $_GET['page'];
|
||||
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
|
||||
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
|
||||
$offset = $rows_per_page * $page;
|
||||
|
||||
$sql = " select * from v_virtual_tables ";
|
||||
$sql .= " where domain_uuid = '$domain_uuid' ";
|
||||
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
||||
$sql .= " limit $rows_per_page offset $offset ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
$result_count = count($result);
|
||||
unset ($prep_statement, $sql);
|
||||
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
echo "<tr>\n";
|
||||
echo th_order_by('virtual_table_label', 'Label', $order_by, $order);
|
||||
echo th_order_by('virtual_table_name', 'Table Name', $order_by, $order);
|
||||
echo th_order_by('virtual_table_auth', 'Authentication', $order_by, $order);
|
||||
echo th_order_by('virtual_table_description', 'Description', $order_by, $order);
|
||||
//echo "<th align='center'>View</th>\n";
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('virtual_tables_add')) {
|
||||
echo " <a href='v_virtual_tables_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "<tr>\n";
|
||||
|
||||
if ($result_count == 0) {
|
||||
//no results
|
||||
}
|
||||
else { //received results
|
||||
foreach($result as $row) {
|
||||
echo "<tr >\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_table_label']." </td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_table_name']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_table_auth']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_table_description']." </td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('virtual_tables_edit')) {
|
||||
echo " <a href='v_virtual_tables_edit.php?id=".$row['virtual_table_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('virtual_tables_delete')) {
|
||||
echo " <a href='v_virtual_tables_delete.php?id=".$row['virtual_table_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo "</tr>\n";
|
||||
if ($c==0) { $c=1; } else { $c=0; }
|
||||
} //end foreach
|
||||
unset($sql, $result, $row_count);
|
||||
} //end if results
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='6' align='left'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('virtual_tables_add')) {
|
||||
echo " <a href='v_virtual_tables_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
echo "<br><br>";
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
echo "<br><br>";
|
||||
|
||||
//show the footer
|
||||
require_once "includes/footer.php";
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//get the http get variable
|
||||
if (count($_GET)>0) {
|
||||
$id = check_str($_GET["id"]);
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
if (strlen($id)>0) {
|
||||
$sql = "";
|
||||
$sql .= "delete from v_virtual_tables ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$id' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
//redirect the user
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_tables.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Delete Complete\n";
|
||||
echo "</div>\n";
|
||||
|
||||
//show the footer
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,355 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
require_once "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_add') || permission_exists('virtual_tables_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
//action add or update
|
||||
if (isset($_REQUEST["id"])) {
|
||||
$action = "update";
|
||||
$virtual_table_uuid = check_str($_REQUEST["id"]);
|
||||
}
|
||||
else {
|
||||
$action = "add";
|
||||
}
|
||||
|
||||
//get the http post variables
|
||||
if (count($_POST)>0) {
|
||||
$virtual_table_category = check_str($_POST["virtual_table_category"]);
|
||||
$virtual_table_label = check_str($_POST["virtual_table_label"]);
|
||||
$virtual_table_name = check_str($_POST["virtual_table_name"]);
|
||||
$virtual_table_auth = check_str($_POST["virtual_table_auth"]);
|
||||
$virtual_table_captcha = check_str($_POST["virtual_table_captcha"]);
|
||||
$virtual_table_parent_id = check_str($_POST["virtual_table_parent_id"]);
|
||||
$virtual_table_description = check_str($_POST["virtual_table_description"]);
|
||||
}
|
||||
|
||||
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
$msg = '';
|
||||
if ($action == "update") {
|
||||
$virtual_table_uuid = check_str($_POST["virtual_table_uuid"]);
|
||||
}
|
||||
|
||||
//check for all required data
|
||||
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
|
||||
//if (strlen($virtual_table_category) == 0) { $msg .= "Please provide: Table Category<br>\n"; }
|
||||
//if (strlen($virtual_table_label) == 0) { $msg .= "Please provide: Label<br>\n"; }
|
||||
if (strlen($virtual_table_name) == 0) { $msg .= "Please provide: Table Name<br>\n"; }
|
||||
//if (strlen($virtual_table_auth) == 0) { $msg .= "Please provide: Authentication<br>\n"; }
|
||||
//if (strlen($virtual_table_captcha) == 0) { $msg .= "Please provide: Captcha<br>\n"; }
|
||||
//if (strlen($virtual_table_parent_id) == 0) { $msg .= "Please provide: Parent Table<br>\n"; }
|
||||
//if (strlen($virtual_table_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
|
||||
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
require_once "includes/header.php";
|
||||
require_once "includes/persistformvar.php";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table><tr><td>\n";
|
||||
echo $msg."<br />";
|
||||
echo "</td></tr></table>\n";
|
||||
persistformvar($_POST);
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
}
|
||||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add") {
|
||||
$virtual_table_uuid = uuid();
|
||||
$sql = "insert into v_virtual_tables ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "virtual_table_uuid, ";
|
||||
$sql .= "virtual_table_category, ";
|
||||
$sql .= "virtual_table_label, ";
|
||||
$sql .= "virtual_table_name, ";
|
||||
$sql .= "virtual_table_auth, ";
|
||||
$sql .= "virtual_table_captcha, ";
|
||||
$sql .= "virtual_table_parent_id, ";
|
||||
$sql .= "virtual_table_description ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$domain_uuid', ";
|
||||
$sql .= "'$virtual_table_uuid', ";
|
||||
$sql .= "'$virtual_table_category', ";
|
||||
$sql .= "'$virtual_table_label', ";
|
||||
$sql .= "'$virtual_table_name', ";
|
||||
$sql .= "'$virtual_table_auth', ";
|
||||
$sql .= "'$virtual_table_captcha', ";
|
||||
$sql .= "'$virtual_table_parent_id', ";
|
||||
$sql .= "'$virtual_table_description' ";
|
||||
$sql .= ")";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_tables.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Add Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update") {
|
||||
$sql = "update v_virtual_tables set ";
|
||||
$sql .= "domain_uuid = '$domain_uuid', ";
|
||||
$sql .= "virtual_table_category = '$virtual_table_category', ";
|
||||
$sql .= "virtual_table_label = '$virtual_table_label', ";
|
||||
$sql .= "virtual_table_name = '$virtual_table_name', ";
|
||||
$sql .= "virtual_table_auth = '$virtual_table_auth', ";
|
||||
$sql .= "virtual_table_captcha = '$virtual_table_captcha', ";
|
||||
$sql .= "virtual_table_parent_id = '$virtual_table_parent_id', ";
|
||||
$sql .= "virtual_table_description = '$virtual_table_description' ";
|
||||
$sql .= "where virtual_table_uuid = '$virtual_table_uuid'";
|
||||
$db->exec(check_sql($sql));
|
||||
unset($sql);
|
||||
|
||||
require_once "includes/header.php";
|
||||
echo "<meta http-equiv=\"refresh\" content=\"2;url=v_virtual_tables.php\">\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "Update Complete\n";
|
||||
echo "</div>\n";
|
||||
require_once "includes/footer.php";
|
||||
return;
|
||||
} //if ($action == "update")
|
||||
} //if ($_POST["persistformvar"] != "true")
|
||||
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
|
||||
|
||||
//pre-populate the form
|
||||
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
|
||||
$virtual_table_uuid = $_GET["id"];
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_tables ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
$virtual_table_category = $row["virtual_table_category"];
|
||||
$virtual_table_label = $row["virtual_table_label"];
|
||||
$virtual_table_name = $row["virtual_table_name"];
|
||||
$virtual_table_auth = $row["virtual_table_auth"];
|
||||
$virtual_table_captcha = $row["virtual_table_captcha"];
|
||||
$virtual_table_parent_id = $row["virtual_table_parent_id"];
|
||||
$virtual_table_description = $row["virtual_table_description"];
|
||||
break; //limit to 1 row
|
||||
}
|
||||
unset ($prep_statement);
|
||||
}
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"left\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
if ($action == "add") {
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>Virtual Table Add</b></td>\n";
|
||||
}
|
||||
if ($action == "update") {
|
||||
echo "<td align='left' width='30%' nowrap='nowrap'><b>Virtual Table Edit</b></td>\n";
|
||||
}
|
||||
echo "<td width='70%' align='right'>\n";
|
||||
if (strlen($row[virtual_table_uuid]) > 0) {
|
||||
echo " <input type='button' class='btn' name='' alt='view' onclick=\"window.location='v_virtual_table_data_view.php?id=".$row[virtual_table_uuid]."'\" value='view'> \n";
|
||||
echo " <input type='button' class='btn' name='' alt='import' onclick=\"window.location='v_virtual_tables_import.php?id=".$row[virtual_table_uuid]."'\" value='import'> \n";
|
||||
}
|
||||
include "export/index.php";
|
||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_virtual_tables.php'\" value='Back'>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td align=\"left\" colspan='2'>\n";
|
||||
echo "Provides the ability to quickly define information to store and dynamically makes tools available to view, add, edit, delete, and search. <br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Table Category:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_table_category' maxlength='255' value=\"$virtual_table_category\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the category.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Label:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_table_label' maxlength='255' value=\"$virtual_table_label\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the label.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Table Name:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='virtual_table_name' maxlength='255' value=\"$virtual_table_name\">\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter the table name.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Authentication:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='virtual_table_auth'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($virtual_table_auth == "yes") {
|
||||
echo " <option value='yes' SELECTED >yes</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='yes'>yes</option>\n";
|
||||
}
|
||||
if ($virtual_table_auth == "no") {
|
||||
echo " <option value='no' SELECTED >no</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='no'>no</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose whether to require authentication.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Captcha:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' name='virtual_table_captcha'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
if ($virtual_table_captcha == "yes") {
|
||||
echo " <option value='yes' SELECTED >yes</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='yes'>yes</option>\n";
|
||||
}
|
||||
if ($virtual_table_captcha == "no") {
|
||||
echo " <option value='no' SELECTED >no</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='no'>no</option>\n";
|
||||
}
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Choose whether to require captcha.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Parent Table:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
|
||||
echo " <select name='virtual_table_parent_id' class='formfld'>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
$sql = "";
|
||||
$sql .= "select * from v_virtual_tables ";
|
||||
$sql .= "where domain_uuid = '$domain_uuid' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
foreach ($result as &$row) {
|
||||
if ($row["virtual_table_uuid"] == $virtual_table_parent_id) {
|
||||
echo " <option value='".$row["virtual_table_uuid"]."' selected>".$row["virtual_table_name"]."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$row["virtual_table_uuid"]."'>".$row["virtual_table_name"]."</option>\n";
|
||||
}
|
||||
}
|
||||
echo " </select>\n";
|
||||
|
||||
echo "<br />\n";
|
||||
echo "Select a parent table.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
|
||||
echo " Description:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <textarea class='formfld' name='virtual_table_description' rows='4'>$virtual_table_description</textarea>\n";
|
||||
echo "<br />\n";
|
||||
echo "Enter a description.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
if ($action == "update") {
|
||||
echo " <input type='hidden' name='virtual_table_uuid' value='$virtual_table_uuid'>\n";
|
||||
}
|
||||
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
|
||||
if ($action == "update") {
|
||||
require "v_virtual_table_fields.php";
|
||||
}
|
||||
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
|
||||
//show the footer
|
||||
require_once "includes/footer.php";
|
||||
?>
|
||||
@@ -0,0 +1,373 @@
|
||||
<?php
|
||||
/*
|
||||
FusionPBX
|
||||
Version: MPL 1.1
|
||||
|
||||
The contents of this file are subject to the Mozilla Public License Version
|
||||
1.1 (the "License"); you may not use this file except in compliance with
|
||||
the License. You may obtain a copy of the License at
|
||||
http://www.mozilla.org/MPL/
|
||||
|
||||
Software distributed under the License is distributed on an "AS IS" basis,
|
||||
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
for the specific language governing rights and limitations under the
|
||||
License.
|
||||
|
||||
The Original Code is FusionPBX
|
||||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
*/
|
||||
include "root.php";
|
||||
require_once "includes/require.php";
|
||||
require_once "includes/checkauth.php";
|
||||
if (permission_exists('virtual_tables_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
echo "access denied";
|
||||
exit;
|
||||
}
|
||||
|
||||
if (count($_POST)>0) {
|
||||
$virtual_table_uuid = trim($_REQUEST["id"]);
|
||||
$data = trim($_POST["data"]);
|
||||
$data_delimiter = trim($_POST["data_delimiter"]);
|
||||
$data_enclosure = trim($_POST["data_enclosure"]);
|
||||
}
|
||||
|
||||
//define the php class
|
||||
class v_virtual_table_fields {
|
||||
var $domain_uuid;
|
||||
var $virtual_table_uuid;
|
||||
var $virtual_field_label;
|
||||
var $virtual_field_name;
|
||||
var $virtual_field_type;
|
||||
var $virtual_field_value;
|
||||
var $virtual_field_list_hidden;
|
||||
var $virtual_field_column;
|
||||
var $virtual_field_required;
|
||||
var $virtual_field_order;
|
||||
var $virtual_field_order_tab;
|
||||
var $virtual_field_description;
|
||||
|
||||
function db_field_exists() {
|
||||
global $db;
|
||||
$sql = "select * from v_virtual_table_fields ";
|
||||
$sql .= "where domain_uuid = '$this->domain_uuid' ";
|
||||
$sql .= "and virtual_table_uuid ='$this->virtual_table_uuid' ";
|
||||
$sql .= "and virtual_field_name = '$this->virtual_field_name' ";
|
||||
$row = $db->query($sql)->fetch(PDO::FETCH_ASSOC);
|
||||
if (is_array($row)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function db_insert() {
|
||||
global $db;
|
||||
$sql = "insert into v_virtual_table_fields ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "virtual_table_uuid, ";
|
||||
$sql .= "virtual_field_label, ";
|
||||
$sql .= "virtual_field_name, ";
|
||||
$sql .= "virtual_field_type, ";
|
||||
$sql .= "virtual_field_value, ";
|
||||
$sql .= "virtual_field_list_hidden, ";
|
||||
$sql .= "virtual_field_column, ";
|
||||
$sql .= "virtual_field_required, ";
|
||||
$sql .= "virtual_field_order, ";
|
||||
$sql .= "virtual_field_order_tab, ";
|
||||
$sql .= "virtual_field_description ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$this->domain_uuid', ";
|
||||
$sql .= "'$this->virtual_table_uuid', ";
|
||||
$sql .= "'$this->virtual_field_label', ";
|
||||
$sql .= "'$this->virtual_field_name', ";
|
||||
$sql .= "'$this->virtual_field_type', ";
|
||||
$sql .= "'$this->virtual_field_value', ";
|
||||
$sql .= "'$this->virtual_field_list_hidden', ";
|
||||
$sql .= "'$this->virtual_field_column', ";
|
||||
$sql .= "'$this->virtual_field_required', ";
|
||||
$sql .= "'$this->virtual_field_order', ";
|
||||
$sql .= "'$this->virtual_field_order_tab', ";
|
||||
$sql .= "'$this->virtual_field_description' ";
|
||||
$sql .= ")";
|
||||
if (!$this->db_field_exists()) {
|
||||
$db->exec(check_sql($sql));
|
||||
}
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
|
||||
class v_virtual_table_data {
|
||||
var $domain_uuid;
|
||||
var $virtual_table_uuid;
|
||||
var $virtual_data_row_id;
|
||||
var $virtual_field_name;
|
||||
var $virtual_data_field_value;
|
||||
var $last_insert_id;
|
||||
var $virtual_table_data_uuid;
|
||||
|
||||
function db_unique_id() {
|
||||
global $db;
|
||||
$sql = "insert into v_virtual_table_data_row_id ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$this->domain_uuid' ";
|
||||
$sql .= ")";
|
||||
$db->exec($sql);
|
||||
unset($sql);
|
||||
return $db->lastInsertId($id);
|
||||
}
|
||||
|
||||
function db_insert() {
|
||||
global $db;
|
||||
$sql = "insert into v_virtual_table_data ";
|
||||
$sql .= "(";
|
||||
$sql .= "domain_uuid, ";
|
||||
$sql .= "virtual_data_row_id, ";
|
||||
$sql .= "virtual_table_uuid, ";
|
||||
$sql .= "virtual_field_name, ";
|
||||
$sql .= "virtual_data_field_value, ";
|
||||
$sql .= "virtual_data_add_user, ";
|
||||
$sql .= "virtual_data_add_date ";
|
||||
$sql .= ")";
|
||||
$sql .= "values ";
|
||||
$sql .= "(";
|
||||
$sql .= "'$this->domain_uuid', ";
|
||||
$sql .= "'$this->virtual_data_row_id', ";
|
||||
$sql .= "'$this->virtual_table_uuid', ";
|
||||
$sql .= "'$this->virtual_field_name', ";
|
||||
$sql .= "'$this->virtual_data_field_value', ";
|
||||
$sql .= "'".$_SESSION["username"]."', ";
|
||||
$sql .= "now() ";
|
||||
$sql .= ")";
|
||||
$db->exec($sql);
|
||||
$this->last_insert_id = $db->lastInsertId($id);
|
||||
unset($sql);
|
||||
}
|
||||
|
||||
function db_update() {
|
||||
global $db;
|
||||
$sql = "update v_virtual_table_data set ";
|
||||
$sql .= "virtual_data_row_id = '$this->virtual_data_row_id', ";
|
||||
$sql .= "virtual_field_name = '$this->virtual_field_name', ";
|
||||
$sql .= "virtual_data_field_value = '$this->virtual_data_field_value', ";
|
||||
$sql .= "virtual_data_add_user = '".$_SESSION["username"]."', ";
|
||||
$sql .= "virtual_data_add_date = now() ";
|
||||
$sql .= "where domain_uuid = '$this->domain_uuid' ";
|
||||
$sql .= "and virtual_table_data_uuid = '$this->virtual_table_data_uuid' ";
|
||||
$db->exec($sql);
|
||||
$this->last_insert_id = $db->lastInsertId($id);
|
||||
unset($sql);
|
||||
}
|
||||
}
|
||||
|
||||
//built in str_getcsv requires PHP 5.3 or higher, this function can be used to reproduct the functionality but requirs PHP 5.1.0 or higher
|
||||
if(!function_exists('str_getcsv')) {
|
||||
function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\") {
|
||||
$fp = fopen("php://memory", 'r+');
|
||||
fputs($fp, $input);
|
||||
rewind($fp);
|
||||
$data = fgetcsv($fp, null, $delimiter, $enclosure); // $escape only got added in 5.3.0
|
||||
fclose($fp);
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
|
||||
//POST to PHP variables
|
||||
if (count($_POST)>0) {
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' nowrap align='left' valign='top'><b>Import Results</b></td>\n";
|
||||
echo "<td width='70%' align='right' valign='top'>\n";
|
||||
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_virtual_tables_import.php?id=$virtual_table_uuid'\" value='Back'>\n";
|
||||
echo " <br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='left'>\n";
|
||||
|
||||
//import data
|
||||
if (strlen($data) > 0) {
|
||||
$line_array = explode("\n",$data);
|
||||
$name_array = explode(",",$line_array[0]);
|
||||
$x = 0;
|
||||
$db->beginTransaction();
|
||||
foreach($name_array as $key => $val) {
|
||||
$virtual_field_label = trim($val);
|
||||
$virtual_field_name = trim($val);
|
||||
$virtual_field_name = str_replace(" ", "_", $virtual_field_name);
|
||||
$virtual_field_name = str_replace("-", "_", $virtual_field_name);
|
||||
$virtual_field_name = strtolower($virtual_field_name);
|
||||
|
||||
$fields = new v_virtual_table_fields;
|
||||
$fields->domain_uuid = $domain_uuid;
|
||||
$fields->virtual_table_uuid = $virtual_table_uuid;
|
||||
$fields->virtual_field_label = $virtual_field_label;
|
||||
$fields->virtual_field_name = $virtual_field_name;
|
||||
$fields->virtual_field_type = 'text';
|
||||
$fields->virtual_field_value = '';
|
||||
$fields->virtual_field_list_hidden = 'show';
|
||||
$fields->virtual_field_column = '1';
|
||||
$fields->virtual_field_required = 'yes';
|
||||
$fields->virtual_field_order = $x;
|
||||
$fields->virtual_field_order_tab = $x;
|
||||
$fields->virtual_field_description = $virtual_field_label;
|
||||
$fields->db_insert();
|
||||
unset($fields);
|
||||
$x++;
|
||||
}
|
||||
|
||||
foreach($line_array as $key => $line) {
|
||||
if ($key > 0) {
|
||||
$value_array = str_getcsv($line, $data_delimiter, $data_enclosure);
|
||||
$x=0;
|
||||
foreach($value_array as $key => $val) {
|
||||
|
||||
$virtual_field_label = trim($name_array[$x]);
|
||||
$virtual_field_name = trim($name_array[$x]);
|
||||
$virtual_field_name = str_replace(" ", "_", $virtual_field_name);
|
||||
$virtual_field_name = str_replace("-", "_", $virtual_field_name);
|
||||
$virtual_field_name = strtolower($virtual_field_name);
|
||||
|
||||
$virtual_field_value = $val;
|
||||
|
||||
$data = new v_virtual_table_data;
|
||||
$data->domain_uuid = $domain_uuid;
|
||||
$data->virtual_table_uuid = $virtual_table_uuid;
|
||||
if ($x == 0) {
|
||||
$virtual_data_row_id = $data->db_unique_id();
|
||||
// echo "id: ".$virtual_data_row_id."<br />\n";
|
||||
}
|
||||
$data->virtual_data_row_id = $virtual_data_row_id;
|
||||
$data->virtual_field_name = $virtual_field_name;
|
||||
$data->virtual_data_field_value = $virtual_field_value;
|
||||
$data->db_insert();
|
||||
unset($data);
|
||||
|
||||
echo "<strong>$virtual_field_name:</strong> $virtual_field_value<br/>\n";
|
||||
$x++;
|
||||
}
|
||||
echo "<hr size='1' />\n";
|
||||
}
|
||||
}
|
||||
$db->commit();
|
||||
} //if (strlen($data) > 0)
|
||||
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
echo " </table>";
|
||||
echo "</div>\n";
|
||||
|
||||
//show the footer
|
||||
require_once "includes/footer.php";
|
||||
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
//show the header
|
||||
require_once "includes/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<div align='center'>";
|
||||
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td width='30%' nowrap align='left' valign='top'><b>Import</b></td>\n";
|
||||
echo "<td width='70%' align='right' valign='top'>\n";
|
||||
//echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='v_virtual_tables_import.php?id=$virtual_table_uuid'\" value='Back'>\n";
|
||||
echo " <br /><br />\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
echo "<tr class='border'>\n";
|
||||
echo " <td align=\"left\">\n";
|
||||
echo " <br>";
|
||||
|
||||
echo "<form method='post' name='frm' action=''>\n";
|
||||
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Data:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <textarea name='data' id='data' rows='7' class='txt' wrap='off'>$data</textarea\n";
|
||||
echo "<br />\n";
|
||||
echo "Copy and paste the comma delimitted data into the text area to begin the import.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Delimiter:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' style='width:40px;' name='data_delimiter'>\n";
|
||||
echo " <option value=','>,</option>\n";
|
||||
echo " <option value='|'>|</option>\n";
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Select the delimiter.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td class='vncell' valign='top' align='left' nowrap>\n";
|
||||
echo " Enclosure:\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <select class='formfld' style='width:40px;' name='data_enclosure'>\n";
|
||||
echo " <option value='\"'>\"</option>\n";
|
||||
echo " <option value=''></option>\n";
|
||||
echo " </select>\n";
|
||||
echo "<br />\n";
|
||||
echo "Select the enclosure.\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
|
||||
echo " <tr>\n";
|
||||
echo " <td colspan='2' align='right'>\n";
|
||||
echo " <input type='submit' name='import' class='btn' value='Import'>\n";
|
||||
echo " </td>\n";
|
||||
echo " </tr>";
|
||||
|
||||
echo "</table>";
|
||||
|
||||
echo " </td>";
|
||||
echo " </tr>";
|
||||
echo "</table>";
|
||||
echo "</div>";
|
||||
|
||||
echo "</form>";
|
||||
|
||||
|
||||
require_once "includes/footer.php";
|
||||
?>
|
||||
Reference in New Issue
Block a user