Remove virtual name from the virtual tables tool to make it more generic.

This commit is contained in:
Mark Crane
2013-03-25 19:15:27 +00:00
parent efa2d36018
commit 64a81dec16
14 changed files with 990 additions and 942 deletions
+113 -65
View File
@@ -19,7 +19,7 @@
$apps[$x]['description']['pt-br'] = ''; $apps[$x]['description']['pt-br'] = '';
//menu details //menu details
$apps[$x]['menu'][0]['title']['en-us'] = 'Virtual Tables'; $apps[$x]['menu'][0]['title']['en-us'] = 'Tables';
$apps[$x]['menu'][0]['title']['es-mx'] = ''; $apps[$x]['menu'][0]['title']['es-mx'] = '';
$apps[$x]['menu'][0]['title']['de'] = ''; $apps[$x]['menu'][0]['title']['de'] = '';
$apps[$x]['menu'][0]['title']['de-ch'] = ''; $apps[$x]['menu'][0]['title']['de-ch'] = '';
@@ -27,52 +27,54 @@
$apps[$x]['menu'][0]['title']['fr'] = ''; $apps[$x]['menu'][0]['title']['fr'] = '';
$apps[$x]['menu'][0]['title']['fr-ca'] = ''; $apps[$x]['menu'][0]['title']['fr-ca'] = '';
$apps[$x]['menu'][0]['title']['fr-ch'] = ''; $apps[$x]['menu'][0]['title']['fr-ch'] = '';
$apps[$x]['menu'][0]['title']['pt-pt'] = 'Tabelas Virtuais'; $apps[$x]['menu'][0]['title']['pt-pt'] = 'Tabelas';
$apps[$x]['menu'][0]['title']['pt-br'] = ''; $apps[$x]['menu'][0]['title']['pt-br'] = '';
$apps[$x]['menu'][0]['uuid'] = '6be94b46-2126-947f-2365-0bea23651a6b'; $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]['parent_uuid'] = 'fd29e39c-c936-f5fc-8e2b-611681b266b5';
$apps[$x]['menu'][0]['category'] = 'internal'; $apps[$x]['menu'][0]['category'] = 'internal';
$apps[$x]['menu'][0]['path'] = '/app/virtual_tables/virtual_tables.php'; $apps[$x]['menu'][0]['path'] = '/app/tables/tables.php';
$apps[$x]['menu'][0]['groups'][] = 'admin'; $apps[$x]['menu'][0]['groups'][] = 'admin';
$apps[$x]['menu'][0]['groups'][] = 'superadmin'; $apps[$x]['menu'][0]['groups'][] = 'superadmin';
//permission details //permission details
$apps[$x]['permissions'][0]['name'] = 'virtual_tables_view'; $apps[$x]['permissions'][0]['name'] = 'table_view';
$apps[$x]['permissions'][0]['groups'][] = 'admin'; $apps[$x]['permissions'][0]['groups'][] = 'admin';
$apps[$x]['permissions'][0]['groups'][] = 'superadmin'; $apps[$x]['permissions'][0]['groups'][] = 'superadmin';
$apps[$x]['permissions'][1]['name'] = 'virtual_tables_add'; $apps[$x]['permissions'][1]['name'] = 'table_add';
$apps[$x]['permissions'][1]['groups'][] = 'admin'; $apps[$x]['permissions'][1]['groups'][] = 'admin';
$apps[$x]['permissions'][1]['groups'][] = 'superadmin'; $apps[$x]['permissions'][1]['groups'][] = 'superadmin';
$apps[$x]['permissions'][2]['name'] = 'virtual_tables_edit'; $apps[$x]['permissions'][2]['name'] = 'table_edit';
$apps[$x]['permissions'][2]['groups'][] = 'admin'; $apps[$x]['permissions'][2]['groups'][] = 'admin';
$apps[$x]['permissions'][2]['groups'][] = 'superadmin'; $apps[$x]['permissions'][2]['groups'][] = 'superadmin';
$apps[$x]['permissions'][3]['name'] = 'virtual_tables_delete'; $apps[$x]['permissions'][3]['name'] = 'table_delete';
$apps[$x]['permissions'][3]['groups'][] = 'admin'; $apps[$x]['permissions'][3]['groups'][] = 'admin';
$apps[$x]['permissions'][3]['groups'][] = 'superadmin'; $apps[$x]['permissions'][3]['groups'][] = 'superadmin';
$apps[$x]['permissions'][4]['name'] = 'virtual_tables_data_view'; $apps[$x]['permissions'][4]['name'] = 'table_data_view';
$apps[$x]['permissions'][4]['groups'][] = 'admin'; $apps[$x]['permissions'][4]['groups'][] = 'admin';
$apps[$x]['permissions'][4]['groups'][] = 'superadmin'; $apps[$x]['permissions'][4]['groups'][] = 'superadmin';
$apps[$x]['permissions'][5]['name'] = 'virtual_tables_data_add'; $apps[$x]['permissions'][5]['name'] = 'table_data_add';
$apps[$x]['permissions'][5]['groups'][] = 'admin'; $apps[$x]['permissions'][5]['groups'][] = 'admin';
$apps[$x]['permissions'][5]['groups'][] = 'superadmin'; $apps[$x]['permissions'][5]['groups'][] = 'superadmin';
$apps[$x]['permissions'][6]['name'] = 'virtual_tables_data_edit'; $apps[$x]['permissions'][6]['name'] = 'table_data_edit';
$apps[$x]['permissions'][6]['groups'][] = 'admin'; $apps[$x]['permissions'][6]['groups'][] = 'admin';
$apps[$x]['permissions'][6]['groups'][] = 'superadmin'; $apps[$x]['permissions'][6]['groups'][] = 'superadmin';
$apps[$x]['permissions'][7]['name'] = 'virtual_tables_data_delete'; $apps[$x]['permissions'][7]['name'] = 'table_data_delete';
$apps[$x]['permissions'][7]['groups'][] = 'admin'; $apps[$x]['permissions'][7]['groups'][] = 'admin';
$apps[$x]['permissions'][7]['groups'][] = 'superadmin'; $apps[$x]['permissions'][7]['groups'][] = 'superadmin';
//schema details //schema details
$y = 0; //table array index $y = 0; //table array index
$z = 0; //field array index $z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_virtual_table_data'; $apps[$x]['db'][$y]['table']['text'] = 'v_table_data';
$apps[$x]['db'][$y]['table']['deprecated'] = 'v_virtual_table_data';
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'id'; $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]['name']['deprecated'] = 'virtual_table_data_id';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial'; $apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial';
@@ -81,7 +83,8 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_data_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_data_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_data_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
@@ -107,63 +110,76 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $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']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_tables'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_tables';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_uuid'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_data_row_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_row_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_row_id'; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_row_id';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_row_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_name'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_name';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_field_value'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_field_value';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_field_value';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_add_user'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_add_user';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_add_user';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_add_date'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_add_date';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_add_date';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_del_user'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_del_user';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_del_user';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_del_date'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_del_date';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_del_date';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'table_parent_id';
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_parent_id'; $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]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_parent_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_parent_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_parent_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_data_parent_row_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_parent_row_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_parent_row_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_parent_row_id'; $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]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$y = 1; //table array index $y = 1; //table array index
$z = 0; //field array index $z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_virtual_table_name_values'; $apps[$x]['db'][$y]['table']['text'] = 'v_table_name_values';
$apps[$x]['db'][$y]['table']['deprecated'] = 'v_virtual_table_name_values';
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_data_types_name_value_id'; $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']['pgsql'] = 'serial';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer'; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
@@ -171,7 +187,8 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_table_name_value_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_name_value_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_name_value_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_data_types_name_value_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_data_types_name_value_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
@@ -198,48 +215,57 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $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']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_tables'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_tables';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_uuid'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_field_id'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_field_id';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_field_id';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_field_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_field_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_field_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $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']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_table_fields'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_table_fields';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_field_uuid'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'table_field_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_types_name'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_types_name';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_types_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_data_types_value'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'data_types_value';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_data_types_value';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$y = 2; //table array index $y = 2; //table array index
$z = 0; //field array index $z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_virtual_table_fields'; $apps[$x]['db'][$y]['table']['text'] = 'v_table_fields';
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_field_id'; $apps[$x]['db'][$y]['table']['deprecated'] = 'v_virtual_table_fields';
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_field_id';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_field_id';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = 'serial'; $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']['sqlite'] = 'integer';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT'; $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'INT NOT NULL AUTO_INCREMENT';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_field_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_field_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_field_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
@@ -265,63 +291,77 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $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']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_tables'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_tables';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_uuid'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_label'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_label';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_label';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_name'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_name';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_type'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_type';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_type';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_list_hidden'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_list_hidden';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_list_hidden';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_search_by'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_search_by';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_search_by';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_column'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_column';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_column';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_required'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_required';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_required';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_order'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_order';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_order';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_order_tab'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_order_tab';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_order_tab';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'numeric';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_field_value'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_value';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_value';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_field_description'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'field_description';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_desc'; $apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'field_desc';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_field_description';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$y = 3; //table array index $y = 3; //table array index
$z = 0; //field array index $z = 0; //field array index
$apps[$x]['db'][$y]['table'] = 'v_virtual_tables'; $apps[$x]['db'][$y]['table']['text'] = 'v_tables';
$apps[$x]['db'][$y]['table']['deprecated'] = 'v_virtual_tables';
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_id'; $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']['pgsql'] = 'serial';
$apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer'; $apps[$x]['db'][$y]['fields'][$z]['type']['sqlite'] = 'integer';
@@ -329,7 +369,8 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)';
@@ -350,23 +391,28 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_category'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_category';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_category';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_label'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_label';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_label';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_name'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_name';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_name';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_auth'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_auth';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_auth';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_captcha'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_captcha';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_captcha';
$apps[$x]['db'][$y]['fields'][$z]['type'] = 'text'; $apps[$x]['db'][$y]['fields'][$z]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
@@ -375,16 +421,18 @@
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true'; $apps[$x]['db'][$y]['fields'][$z]['deprecated'] = 'true';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name'] = 'virtual_table_parent_uuid'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_parent_uuid';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_parent_uuid';
$apps[$x]['db'][$y]['fields'][$z]['type']['pgsql'] = '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']['sqlite'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['type']['mysql'] = 'char(36)'; $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']['type'] = 'foreign';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_virtual_tables'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['table'] = 'v_tables';
$apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'virtual_table_uuid'; $apps[$x]['db'][$y]['fields'][$z]['key']['reference']['field'] = 'table_uuid';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
$z++; $z++;
$apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'virtual_table_description'; $apps[$x]['db'][$y]['fields'][$z]['name']['text'] = 'table_description';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_description';
$apps[$x]['db'][$y]['fields'][$z]['name']['deprecated'] = 'virtual_table_desc'; $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]['type'] = 'text';
$apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = ''; $apps[$x]['db'][$y]['fields'][$z]['description']['en-us'] = '';
+21 -21
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_data_delete')) { if (permission_exists('table_data_delete')) {
//access granted //access granted
} }
else { else {
@@ -37,59 +37,59 @@ else {
if (count($_GET)>0) { if (count($_GET)>0) {
//declare variable(s) //declare variable(s)
$virtual_table_parent_id = ''; $table_parent_id = '';
//get the http get and set them as php variables //get the http get and set them as php variables
$virtual_data_row_uuid = check_str($_GET["virtual_data_row_uuid"]); $data_row_uuid = check_str($_GET["data_row_uuid"]);
$virtual_data_parent_row_uuid = check_str($_GET["virtual_data_parent_row_uuid"]); $data_parent_row_uuid = check_str($_GET["data_parent_row_uuid"]);
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]); $table_uuid = check_str($_GET["table_uuid"]);
//show the results and redirect //show the results and redirect
require_once "includes/header.php"; require_once "includes/header.php";
//get the virtual_table_parent_id from the child table //get the table_parent_id from the child table
if (strlen($virtual_table_parent_id) == 0) { if (strlen($table_parent_id) == 0) {
$sql = "select * from v_virtual_tables "; $sql = "select * from v_tables ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
$prep_statement = $db->prepare($sql); $prep_statement = $db->prepare($sql);
$prep_statement->execute(); $prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) { foreach ($result as &$row) {
$virtual_table_parent_id = $row["virtual_table_parent_id"]; $table_parent_id = $row["table_parent_id"];
} }
} }
//delete the child data //delete the child data
$sql = "delete from v_virtual_table_data "; $sql = "delete from v_table_data ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_data_parent_row_uuid = '$virtual_data_row_uuid' "; $sql .= "and data_parent_row_uuid = '$data_row_uuid' ";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
//delete the data //delete the data
$sql = "delete from v_virtual_table_data "; $sql = "delete from v_table_data ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_data_row_uuid = '$virtual_data_row_uuid' "; $sql .= "and data_row_uuid = '$data_row_uuid' ";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
//mark the the item as deleted and who deleted it //mark the the item as deleted and who deleted it
//$sql = "update v_virtual_table_data set "; //$sql = "update v_table_data set ";
//$sql .= "virtual_data_del_date = now(), "; //$sql .= "data_del_date = now(), ";
//$sql .= "virtual_data_del_user = '".$_SESSION["username"]."' "; //$sql .= "data_del_user = '".$_SESSION["username"]."' ";
//$sql .= "where domain_uuid = '$domain_uuid' "; //$sql .= "where domain_uuid = '$domain_uuid' ";
//$sql .= "and virtual_data_row_uuid = '$virtual_data_row_uuid' "; //$sql .= "and data_row_uuid = '$data_row_uuid' ";
//$db->exec(check_sql($sql)); //$db->exec(check_sql($sql));
//$lastinsertid = $db->lastInsertId($id); //$lastinsertid = $db->lastInsertId($id);
//unset($sql); //unset($sql);
//set the meta redirect //set the meta redirect
if (strlen($virtual_data_parent_row_uuid) == 0) { if (strlen($data_parent_row_uuid) == 0) {
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_table_data_view.php?id=$virtual_table_uuid&virtual_data_row_uuid=$virtual_data_row_uuid\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=table_data_view.php?id=$table_uuid&data_row_uuid=$data_row_uuid\">\n";
} }
else { else {
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_table_data_edit.php?virtual_table_uuid=$virtual_table_parent_id&virtual_data_row_uuid=$virtual_data_parent_row_uuid\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=table_data_edit.php?table_uuid=$table_parent_id&data_row_uuid=$data_parent_row_uuid\">\n";
} }
//show a message to the user before the redirect //show a message to the user before the redirect
File diff suppressed because it is too large Load Diff
+117 -117
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_data_view')) { if (permission_exists('table_data_view')) {
//access granted //access granted
} }
else { else {
@@ -35,9 +35,9 @@ else {
} }
if (strlen($_GET["id"]) > 0) { if (strlen($_GET["id"]) > 0) {
$virtual_table_uuid = check_str($_GET["id"]); $table_uuid = check_str($_GET["id"]);
if (strlen($_GET["virtual_data_parent_row_uuid"])>0) { if (strlen($_GET["data_parent_row_uuid"])>0) {
$virtual_data_parent_row_uuid = $_GET["virtual_data_parent_row_uuid"]; $data_parent_row_uuid = $_GET["data_parent_row_uuid"];
} }
$search_all = check_str($_GET["search_all"]); $search_all = check_str($_GET["search_all"]);
} }
@@ -54,22 +54,22 @@ if (strlen($_GET["id"]) > 0) {
//show the header //show the header
require_once "includes/header.php"; require_once "includes/header.php";
//get the information about the virtual table by using the id //get the information about the table by using the id
$sql = ""; $sql = "";
$sql .= "select * from v_virtual_tables "; $sql .= "select * from v_tables ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute(); $prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
foreach ($result as &$row) { foreach ($result as &$row) {
$virtual_table_category = $row["virtual_table_category"]; $table_category = $row["table_category"];
$virtual_table_label = $row["virtual_table_label"]; $table_label = $row["table_label"];
$virtual_table_name = $row["virtual_table_name"]; $table_name = $row["table_name"];
$virtual_table_auth = $row["virtual_table_auth"]; $table_auth = $row["table_auth"];
$virtual_table_captcha = $row["virtual_table_captcha"]; $table_captcha = $row["table_captcha"];
$virtual_table_parent_uuid = $row["virtual_table_parent_uuid"]; $table_parent_uuid = $row["table_parent_uuid"];
$virtual_table_description = $row["virtual_table_description"]; $table_description = $row["table_description"];
break; //limit to 1 row break; //limit to 1 row
} }
unset ($prep_statement); unset ($prep_statement);
@@ -78,69 +78,69 @@ if (strlen($_GET["id"]) > 0) {
$db_field_name_array = array(); $db_field_name_array = array();
$db_value_array = array(); $db_value_array = array();
$db_names .= "<tr>\n"; $db_names .= "<tr>\n";
$sql = "select * from v_virtual_table_fields "; $sql = "select * from v_table_fields ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
$sql .= "order by virtual_field_order asc "; $sql .= "order by field_order asc ";
$prep_statement = $db->prepare($sql); $prep_statement = $db->prepare($sql);
$prep_statement->execute(); $prep_statement->execute();
$result_names = $prep_statement->fetchAll(PDO::FETCH_ASSOC); $result_names = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
$result_count = count($result); $result_count = count($result);
foreach($result_names as $row) { foreach($result_names as $row) {
$virtual_field_label = $row["virtual_field_label"]; $field_label = $row["field_label"];
$virtual_field_name = $row["virtual_field_name"]; $field_name = $row["field_name"];
$virtual_field_type = $row["virtual_field_type"]; $field_type = $row["field_type"];
$virtual_field_value = $row["virtual_field_value"]; $field_value = $row["field_value"];
$virtual_field_list_hidden = $row["virtual_field_list_hidden"]; $field_list_hidden = $row["field_list_hidden"];
$virtual_field_column = $row["virtual_field_column"]; $field_column = $row["field_column"];
$virtual_field_required = $row["virtual_field_required"]; $field_required = $row["field_required"];
$virtual_field_order = $row["virtual_field_order"]; $field_order = $row["field_order"];
$virtual_field_order_tab = $row["virtual_field_order_tab"]; $field_order_tab = $row["field_order_tab"];
$virtual_field_description = $row["virtual_field_description"]; $field_description = $row["field_description"];
$name_array[$virtual_field_name]['virtual_field_label'] = $row["virtual_field_label"]; $name_array[$field_name]['field_label'] = $row["field_label"];
$name_array[$virtual_field_name]['virtual_field_type'] = $row["virtual_field_type"]; $name_array[$field_name]['field_type'] = $row["field_type"];
$name_array[$virtual_field_name]['virtual_field_list_hidden'] = $row["virtual_field_list_hidden"]; $name_array[$field_name]['field_list_hidden'] = $row["field_list_hidden"];
$name_array[$virtual_field_name]['virtual_field_column'] = $row["virtual_field_column"]; $name_array[$field_name]['field_column'] = $row["field_column"];
$name_array[$virtual_field_name]['virtual_field_required'] = $row["virtual_field_required"]; $name_array[$field_name]['field_required'] = $row["field_required"];
$name_array[$virtual_field_name]['virtual_field_order'] = $row["virtual_field_order"]; $name_array[$field_name]['field_order'] = $row["field_order"];
$name_array[$virtual_field_name]['virtual_field_order_tab'] = $row["virtual_field_order_tab"]; $name_array[$field_name]['field_order_tab'] = $row["field_order_tab"];
$name_array[$virtual_field_name]['virtual_field_description'] = $row["virtual_field_description"]; $name_array[$field_name]['field_description'] = $row["field_description"];
} }
unset($sql, $prep_statement, $row); unset($sql, $prep_statement, $row);
$fieldcount = count($name_array); $fieldcount = count($name_array);
//get the data //get the data
$sql = ""; $sql = "";
$sql .= "select * from v_virtual_table_data "; $sql .= "select * from v_table_data ";
$sql .= "where domain_uuid = '".$domain_uuid."' "; $sql .= "where domain_uuid = '".$domain_uuid."' ";
if (strlen($search_all) == 0) { if (strlen($search_all) == 0) {
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
if (strlen($virtual_data_parent_row_uuid) > 0) { if (strlen($data_parent_row_uuid) > 0) {
$sql .= " and virtual_data_parent_row_uuid = '$virtual_data_parent_row_uuid' "; $sql .= " and data_parent_row_uuid = '$data_parent_row_uuid' ";
} }
} }
else { else {
$sql .= "and virtual_data_row_uuid in ("; $sql .= "and data_row_uuid in (";
$sql .= "select virtual_data_row_uuid from v_virtual_table_data \n"; $sql .= "select data_row_uuid from v_table_data \n";
$sql .= "where domain_uuid = '".$domain_uuid."' "; $sql .= "where domain_uuid = '".$domain_uuid."' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
if (strlen($virtual_data_parent_row_uuid) == 0) { if (strlen($data_parent_row_uuid) == 0) {
$tmp_digits = preg_replace('{\D}', '', $search_all); $tmp_digits = preg_replace('{\D}', '', $search_all);
if (is_numeric($tmp_digits) && strlen($tmp_digits) > 5) { if (is_numeric($tmp_digits) && strlen($tmp_digits) > 5) {
if (strlen($tmp_digits) == '11' ) { if (strlen($tmp_digits) == '11' ) {
$sql .= "and virtual_data_field_value like '%".substr($tmp_digits, -10)."%' \n"; $sql .= "and data_field_value like '%".substr($tmp_digits, -10)."%' \n";
} }
else { else {
$sql .= "and virtual_data_field_value like '%$tmp_digits%' \n"; $sql .= "and data_field_value like '%$tmp_digits%' \n";
} }
} }
else { else {
$sql .= "and virtual_data_field_value like '%$search_all%' \n"; $sql .= "and data_field_value like '%$search_all%' \n";
} }
} }
else { else {
$sql .= "and virtual_data_parent_row_uuid = '$virtual_data_parent_row_uuid' "; $sql .= "and data_parent_row_uuid = '$data_parent_row_uuid' ";
} }
$sql .= ")\n"; $sql .= ")\n";
} }
@@ -150,15 +150,15 @@ if (strlen($_GET["id"]) > 0) {
$result_values = $prep_statement->fetchAll(PDO::FETCH_ASSOC); $result_values = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
foreach($result_values as $row) { foreach($result_values as $row) {
//set a php variable //set a php variable
$virtual_field_name = $row[virtual_field_name]; $field_name = $row[field_name];
$virtual_data_row_uuid = $row[virtual_data_row_uuid]; $data_row_uuid = $row[data_row_uuid];
//restructure the data by setting it the value_array //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[$data_row_uuid][$field_name] = $row[data_field_value];
$value_array[$virtual_data_row_uuid]['virtual_table_uuid'] = $row[virtual_table_uuid]; $value_array[$data_row_uuid]['table_uuid'] = $row[table_uuid];
$value_array[$virtual_data_row_uuid]['virtual_data_row_uuid'] = $row[virtual_data_row_uuid]; $value_array[$data_row_uuid]['data_row_uuid'] = $row[data_row_uuid];
$value_array[$virtual_data_row_uuid]['virtual_table_parent_uuid'] = $row[virtual_table_parent_uuid]; $value_array[$data_row_uuid]['table_parent_uuid'] = $row[table_parent_uuid];
$value_array[$virtual_data_row_uuid]['virtual_data_parent_row_uuid'] = $row[virtual_data_parent_row_uuid]; $value_array[$data_row_uuid]['data_parent_row_uuid'] = $row[data_parent_row_uuid];
} }
$num_rows = count($value_array); $num_rows = count($value_array);
@@ -175,21 +175,21 @@ if (strlen($_GET["id"]) > 0) {
$sql = "CREATE TABLE memory_table "; $sql = "CREATE TABLE memory_table ";
$sql .= "("; $sql .= "(";
$sql .= "'id' INTEGER PRIMARY KEY, "; $sql .= "'id' INTEGER PRIMARY KEY, ";
$sql .= "'virtual_table_uuid' TEXT, "; $sql .= "'table_uuid' TEXT, ";
$sql .= "'virtual_data_row_uuid' TEXT, "; $sql .= "'data_row_uuid' TEXT, ";
$sql .= "'virtual_table_parent_uuid' TEXT, "; $sql .= "'table_parent_uuid' TEXT, ";
$sql .= "'virtual_data_parent_row_uuid' TEXT, "; $sql .= "'data_parent_row_uuid' TEXT, ";
foreach($result_names as $row) { foreach($result_names as $row) {
if ($row["virtual_field_type"] != "label") { if ($row["field_type"] != "label") {
if ($row["virtual_field_name"] != "domain_uuid") { if ($row["field_name"] != "domain_uuid") {
//$row["virtual_field_label"]; //$row["field_label"];
//$row["virtual_field_name"] //$row["field_name"]
//$row["virtual_field_type"]; //$row["field_type"];
if ($row["virtual_field_name"] == "number") { if ($row["field_name"] == "number") {
$sql .= "'".$row["virtual_field_name"]."' NUMERIC, "; $sql .= "'".$row["field_name"]."' NUMERIC, ";
} }
else { else {
$sql .= "'".$row["virtual_field_name"]."' TEXT, "; $sql .= "'".$row["field_name"]."' TEXT, ";
} }
} }
} }
@@ -207,29 +207,29 @@ if (strlen($_GET["id"]) > 0) {
//insert the data into the memory table //insert the data into the memory table
$sql = "insert into memory_table "; $sql = "insert into memory_table ";
$sql .= "("; $sql .= "(";
$sql .= "'virtual_table_uuid', "; $sql .= "'table_uuid', ";
$sql .= "'virtual_data_row_uuid', "; $sql .= "'data_row_uuid', ";
$sql .= "'virtual_table_parent_uuid', "; $sql .= "'table_parent_uuid', ";
$sql .= "'virtual_data_parent_row_uuid', "; $sql .= "'data_parent_row_uuid', ";
//foreach($array as $key => $value) { //foreach($array as $key => $value) {
// $sql .= "'$key', "; // $sql .= "'$key', ";
foreach($result_names as $row) { foreach($result_names as $row) {
$virtual_field_name = $row["virtual_field_name"]; $field_name = $row["field_name"];
$sql .= "'$virtual_field_name', "; $sql .= "'$field_name', ";
} }
$sql .= "'domain_uuid' "; $sql .= "'domain_uuid' ";
$sql .= ")"; $sql .= ")";
$sql .= "values "; $sql .= "values ";
$sql .= "("; $sql .= "(";
$sql .= "'".$array['virtual_table_uuid']."', "; $sql .= "'".$array['table_uuid']."', ";
$sql .= "'".$array['virtual_data_row_uuid']."', "; $sql .= "'".$array['data_row_uuid']."', ";
$sql .= "'".$array['virtual_table_parent_uuid']."', "; $sql .= "'".$array['table_parent_uuid']."', ";
$sql .= "'".$array['virtual_data_parent_row_uuid']."', "; $sql .= "'".$array['data_parent_row_uuid']."', ";
//foreach($array as $key => $value) { //foreach($array as $key => $value) {
// $sql .= "'$value', "; // $sql .= "'$value', ";
foreach($result_names as $row) { foreach($result_names as $row) {
$virtual_field_name = $row["virtual_field_name"]; $field_name = $row["field_name"];
$sql .= "'".check_str($array[$virtual_field_name])."', "; $sql .= "'".check_str($array[$field_name])."', ";
} }
$sql .= "'$domain_uuid' "; $sql .= "'$domain_uuid' ";
$sql .= ");"; $sql .= ");";
@@ -243,20 +243,20 @@ if (strlen($_GET["id"]) > 0) {
$x++; $x++;
} }
//set the title and description of the virtual table //set the title and description of the table
echo "<br />\n"; echo "<br />\n";
echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n"; echo "<table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
echo " <tr>\n"; echo " <tr>\n";
echo " <td align='left' valign='top'><strong>$virtual_table_label</strong><br>\n"; echo " <td align='left' valign='top'><strong>$table_label</strong><br>\n";
echo " $virtual_table_description\n"; echo " $table_description\n";
echo " </td>\n"; echo " </td>\n";
echo " <td align='right' valign='top'>\n"; echo " <td align='right' valign='top'>\n";
if (strlen($virtual_data_parent_row_uuid) == 0) { if (strlen($data_parent_row_uuid) == 0) {
$search_all = str_replace("''", "'", $search_all); $search_all = str_replace("''", "'", $search_all);
echo "<form method='GET' name='frm_search' action=''>\n"; echo "<form method='GET' name='frm_search' action=''>\n";
echo " <input class='formfld' type='text' name='search_all' value=\"$search_all\">\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='id' value='$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='data_parent_row_uuid' value='$data_parent_row_uuid'>\n";
echo " <input class='btn' type='submit' name='submit' value='Search All'>\n"; echo " <input class='btn' type='submit' name='submit' value='Search All'>\n";
echo "</form>\n"; echo "</form>\n";
} }
@@ -271,11 +271,11 @@ if (strlen($_GET["id"]) > 0) {
$param = ""; $param = "";
$page = $_GET['page']; $page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; } if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
if (strlen($virtual_table_parent_uuid) > 0) { if (strlen($table_parent_uuid) > 0) {
$param = "&id=$virtual_table_parent_uuid&virtual_data_row_uuid=$virtual_data_row_uuid"; $param = "&id=$table_parent_uuid&data_row_uuid=$data_row_uuid";
} }
else { else {
$param = "&id=$virtual_table_uuid&virtual_data_row_uuid=$virtual_data_row_uuid"; $param = "&id=$table_uuid&data_row_uuid=$data_row_uuid";
} }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
@@ -284,7 +284,7 @@ if (strlen($_GET["id"]) > 0) {
$sql = "select * from memory_table \n"; $sql = "select * from memory_table \n";
$sql .= "where domain_uuid = '$domain_uuid' \n"; $sql .= "where domain_uuid = '$domain_uuid' \n";
$sql .= "limit $rows_per_page offset $offset \n"; $sql .= "limit $rows_per_page offset $offset \n";
//$sql .= "order by virtual_field_order asc \n"; //$sql .= "order by field_order asc \n";
//echo "<pre>\n"; //echo "<pre>\n";
//echo $sql; //echo $sql;
//echo "</pre>\n"; //echo "</pre>\n";
@@ -296,13 +296,13 @@ if (strlen($_GET["id"]) > 0) {
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n"; echo "<tr>\n";
foreach($result_names as $row) { foreach($result_names as $row) {
if ($row['virtual_field_list_hidden'] != "hide") { if ($row['field_list_hidden'] != "hide") {
echo "<th valign='top' nowrap>&nbsp; ".$row['virtual_field_label']." &nbsp;</th>\n"; echo "<th valign='top' nowrap>&nbsp; ".$row['field_label']." &nbsp;</th>\n";
} }
} }
echo "<td align='right' width='42'>\n"; echo "<td align='right' width='42'>\n";
if (permission_exists('virtual_tables_data_add')) { if (permission_exists('table_data_add')) {
echo " <a href='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 " <a href='table_data_edit.php?table_uuid=".$table_uuid."&data_parent_row_uuid=$data_parent_row_uuid' alt='add'>$v_link_label_add</a>\n";
} }
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -312,58 +312,58 @@ if (strlen($_GET["id"]) > 0) {
foreach ($result as &$row) { foreach ($result as &$row) {
echo "<tr>\n"; echo "<tr>\n";
foreach($result_names as $row2) { foreach($result_names as $row2) {
$virtual_field_name = $row2[virtual_field_name]; $field_name = $row2[field_name];
//get the values from the array and set as php variables //get the values from the array and set as php variables
$virtual_field_label = $name_array[$virtual_field_name]['virtual_field_label']; $field_label = $name_array[$field_name]['field_label'];
$virtual_field_type = $name_array[$virtual_field_name]['virtual_field_type']; $field_type = $name_array[$field_name]['field_type'];
$virtual_field_list_hidden = $name_array[$virtual_field_name]['virtual_field_list_hidden']; $field_list_hidden = $name_array[$field_name]['field_list_hidden'];
$virtual_field_column = $name_array[$virtual_field_name]['virtual_field_column']; $field_column = $name_array[$field_name]['field_column'];
$virtual_field_required = $name_array[$virtual_field_name]['virtual_field_required']; $field_required = $name_array[$field_name]['field_required'];
$virtual_field_order = $name_array[$virtual_field_name]['virtual_field_order']; $field_order = $name_array[$field_name]['field_order'];
$virtual_field_order_tab = $name_array[$virtual_field_name]['virtual_field_order_tab']; $field_order_tab = $name_array[$field_name]['field_order_tab'];
$virtual_field_description = $name_array[$virtual_field_name]['virtual_field_description']; $field_description = $name_array[$field_name]['field_description'];
if ($virtual_field_list_hidden != "hide") { if ($field_list_hidden != "hide") {
switch ($virtual_field_type) { switch ($field_type) {
case "textarea": case "textarea":
$tmp_value = str_replace("\n", "<br />\n", $row[$virtual_field_name]); $tmp_value = str_replace("\n", "<br />\n", $row[$field_name]);
echo "<td valign='top' class='".$row_style[$c]."'>".$tmp_value."&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'>".$tmp_value."&nbsp;</td>\n";
unset($tmp_value); unset($tmp_value);
break; break;
case "email": case "email":
echo "<td valign='top' class='".$row_style[$c]."'><a href='mailto:".$row[$virtual_field_name]."'>".$row[$virtual_field_name]."</a>&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'><a href='mailto:".$row[$field_name]."'>".$row[$field_name]."</a>&nbsp;</td>\n";
break; break;
case "phone": case "phone":
$tmp_phone = $row[$virtual_field_name]; $tmp_phone = $row[$field_name];
$tmp_phone = format_phone($tmp_phone); $tmp_phone = format_phone($tmp_phone);
echo "<td valign='top' class='".$row_style[$c]."'>".$tmp_phone."&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'>".$tmp_phone."&nbsp;</td>\n";
break; break;
case "url": case "url":
$url = $row[$virtual_field_name]; $url = $row[$field_name];
if (substr($url,0,4) != "http") { if (substr($url,0,4) != "http") {
$url = 'http://'.$url; $url = 'http://'.$url;
} }
echo "<td valign='top' class='".$row_style[$c]."'><a href='".$url."' target='_blank'>".$row[$virtual_field_name]."</a>&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'><a href='".$url."' target='_blank'>".$row[$field_name]."</a>&nbsp;</td>\n";
break; break;
default: default:
echo "<td valign='top' class='".$row_style[$c]."'>".$row[$virtual_field_name]."&nbsp;</td>\n"; echo "<td valign='top' class='".$row_style[$c]."'>".$row[$field_name]."&nbsp;</td>\n";
break; break;
} }
} }
} }
echo "<td valign='top' align='right' nowrap='nowrap'>\n"; echo "<td valign='top' align='right' nowrap='nowrap'>\n";
if (permission_exists('virtual_tables_data_edit')) { if (permission_exists('tables_data_edit')) {
if (strlen($virtual_data_parent_row_uuid) == 0) { if (strlen($data_parent_row_uuid) == 0) {
echo " <a href='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"; echo " <a href='table_data_edit.php?table_uuid=".$row[table_uuid]."&data_parent_row_uuid=$data_parent_row_uuid&data_row_uuid=".$row['data_row_uuid']."&search_all=$search_all' alt='edit'>$v_link_label_edit</a>\n";
} }
else { else {
echo " <a href='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"; echo " <a href='table_data_edit.php?table_uuid=".$row[table_uuid]."&data_parent_row_uuid=$data_parent_row_uuid&data_row_uuid=".$row['data_row_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
} }
} }
if (permission_exists('virtual_tables_data_delete')) { if (permission_exists('table_data_delete')) {
echo" <a href='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" <a href='table_data_delete.php?data_row_uuid=".$row['data_row_uuid']."&data_parent_row_uuid=$data_parent_row_uuid&table_uuid=".$table_uuid."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
} }
echo "</td>\n"; echo "</td>\n";
@@ -379,8 +379,8 @@ if (strlen($_GET["id"]) > 0) {
echo " <td width='33.3%' nowrap>&nbsp;</td>\n"; echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n"; echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n"; echo " <td width='33.3%' align='right'>\n";
if (permission_exists('virtual_tables_data_add')) { if (permission_exists('table_data_add')) {
echo " <a href='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 " <a href='table_data_edit.php?table_uuid=".$table_uuid."&data_parent_row_uuid=$data_parent_row_uuid' alt='add'>$v_link_label_add</a>\n";
} }
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";
+4 -4
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_delete')) { if (permission_exists('table_delete')) {
//access granted //access granted
} }
else { else {
@@ -44,16 +44,16 @@ else {
if (strlen($id)>0) { if (strlen($id)>0) {
$sql = ""; $sql = "";
$sql .= "delete from v_virtual_tables "; $sql .= "delete from v_tables ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$id' "; $sql .= "and table_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute(); $prep_statement->execute();
unset($sql); unset($sql);
} }
//redirect the user //redirect the user
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_tables.php\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=tables.php\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Delete Complete\n"; echo "Delete Complete\n";
echo "</div>\n"; echo "</div>\n";
+83 -83
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_add') || permission_exists('virtual_tables_edit')) { if (permission_exists('tables_add') || permission_exists('table_edit')) {
//access granted //access granted
} }
else { else {
@@ -37,7 +37,7 @@ else {
//action add or update //action add or update
if (isset($_REQUEST["id"])) { if (isset($_REQUEST["id"])) {
$action = "update"; $action = "update";
$virtual_table_uuid = check_str($_REQUEST["id"]); $table_uuid = check_str($_REQUEST["id"]);
} }
else { else {
$action = "add"; $action = "add";
@@ -45,33 +45,33 @@ else {
//get the http post variables //get the http post variables
if (count($_POST)>0) { if (count($_POST)>0) {
$virtual_table_category = check_str($_POST["virtual_table_category"]); $table_category = check_str($_POST["table_category"]);
$virtual_table_category_other = check_str($_POST["virtual_table_category_other"]); $table_category_other = check_str($_POST["table_category_other"]);
if (strlen($virtual_table_category_other) > 0) { $virtual_table_category = $virtual_table_category_other; } if (strlen($table_category_other) > 0) { $table_category = $table_category_other; }
$virtual_table_label = check_str($_POST["virtual_table_label"]); $table_label = check_str($_POST["table_label"]);
$virtual_table_name = check_str($_POST["virtual_table_name"]); $table_name = check_str($_POST["table_name"]);
$virtual_table_auth = check_str($_POST["virtual_table_auth"]); $table_auth = check_str($_POST["table_auth"]);
$virtual_table_captcha = check_str($_POST["virtual_table_captcha"]); $table_captcha = check_str($_POST["table_captcha"]);
$virtual_table_parent_uuid = check_str($_POST["virtual_table_parent_uuid"]); $table_parent_uuid = check_str($_POST["table_parent_uuid"]);
$virtual_table_description = check_str($_POST["virtual_table_description"]); $table_description = check_str($_POST["table_description"]);
} }
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = ''; $msg = '';
if ($action == "update") { if ($action == "update") {
$virtual_table_uuid = check_str($_POST["virtual_table_uuid"]); $table_uuid = check_str($_POST["table_uuid"]);
} }
//check for all required data //check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; } 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($table_category) == 0) { $msg .= "Please provide: Table Category<br>\n"; }
//if (strlen($virtual_table_label) == 0) { $msg .= "Please provide: Label<br>\n"; } //if (strlen($table_label) == 0) { $msg .= "Please provide: Label<br>\n"; }
if (strlen($virtual_table_name) == 0) { $msg .= "Please provide: Table Name<br>\n"; } if (strlen($table_name) == 0) { $msg .= "Please provide: Table Name<br>\n"; }
//if (strlen($virtual_table_auth) == 0) { $msg .= "Please provide: Authentication<br>\n"; } //if (strlen($table_auth) == 0) { $msg .= "Please provide: Authentication<br>\n"; }
//if (strlen($virtual_table_captcha) == 0) { $msg .= "Please provide: Captcha<br>\n"; } //if (strlen($table_captcha) == 0) { $msg .= "Please provide: Captcha<br>\n"; }
//if (strlen($virtual_table_parent_uuid) == 0) { $msg .= "Please provide: Parent Table<br>\n"; } //if (strlen($table_parent_uuid) == 0) { $msg .= "Please provide: Parent Table<br>\n"; }
//if (strlen($virtual_table_description) == 0) { $msg .= "Please provide: Description<br>\n"; } //if (strlen($table_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php"; require_once "includes/header.php";
require_once "includes/persistformvar.php"; require_once "includes/persistformvar.php";
@@ -88,41 +88,41 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//add or update the database //add or update the database
if ($_POST["persistformvar"] != "true") { if ($_POST["persistformvar"] != "true") {
if ($action == "add") { if ($action == "add") {
$virtual_table_uuid = uuid(); $table_uuid = uuid();
$sql = "insert into v_virtual_tables "; $sql = "insert into v_tables ";
$sql .= "("; $sql .= "(";
$sql .= "domain_uuid, "; $sql .= "domain_uuid, ";
$sql .= "virtual_table_uuid, "; $sql .= "table_uuid, ";
$sql .= "virtual_table_category, "; $sql .= "table_category, ";
$sql .= "virtual_table_label, "; $sql .= "table_label, ";
$sql .= "virtual_table_name, "; $sql .= "table_name, ";
$sql .= "virtual_table_auth, "; $sql .= "table_auth, ";
$sql .= "virtual_table_captcha, "; $sql .= "table_captcha, ";
$sql .= "virtual_table_parent_uuid, "; $sql .= "table_parent_uuid, ";
$sql .= "virtual_table_description "; $sql .= "table_description ";
$sql .= ")"; $sql .= ")";
$sql .= "values "; $sql .= "values ";
$sql .= "("; $sql .= "(";
$sql .= "'$domain_uuid', "; $sql .= "'$domain_uuid', ";
$sql .= "'$virtual_table_uuid', "; $sql .= "'$table_uuid', ";
$sql .= "'$virtual_table_category', "; $sql .= "'$table_category', ";
$sql .= "'$virtual_table_label', "; $sql .= "'$table_label', ";
$sql .= "'$virtual_table_name', "; $sql .= "'$table_name', ";
$sql .= "'$virtual_table_auth', "; $sql .= "'$table_auth', ";
$sql .= "'$virtual_table_captcha', "; $sql .= "'$table_captcha', ";
if (strlen($virtual_table_parent_uuid) == 0) { if (strlen($table_parent_uuid) == 0) {
$sql .= "null, "; $sql .= "null, ";
} }
else { else {
$sql .= "'$virtual_table_parent_uuid', "; $sql .= "'$table_parent_uuid', ";
} }
$sql .= "'$virtual_table_description' "; $sql .= "'$table_description' ";
$sql .= ")"; $sql .= ")";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "includes/header.php"; require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_tables.php\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=tables.php\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Add Complete\n"; echo "Add Complete\n";
echo "</div>\n"; echo "</div>\n";
@@ -131,26 +131,26 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
} //if ($action == "add") } //if ($action == "add")
if ($action == "update") { if ($action == "update") {
$sql = "update v_virtual_tables set "; $sql = "update v_tables set ";
$sql .= "domain_uuid = '$domain_uuid', "; $sql .= "domain_uuid = '$domain_uuid', ";
$sql .= "virtual_table_category = '$virtual_table_category', "; $sql .= "table_category = '$table_category', ";
$sql .= "virtual_table_label = '$virtual_table_label', "; $sql .= "table_label = '$table_label', ";
$sql .= "virtual_table_name = '$virtual_table_name', "; $sql .= "table_name = '$table_name', ";
$sql .= "virtual_table_auth = '$virtual_table_auth', "; $sql .= "table_auth = '$table_auth', ";
$sql .= "virtual_table_captcha = '$virtual_table_captcha', "; $sql .= "table_captcha = '$table_captcha', ";
if (strlen($virtual_table_parent_uuid) == 0) { if (strlen($table_parent_uuid) == 0) {
$sql .= "virtual_table_parent_uuid = null, "; $sql .= "table_parent_uuid = null, ";
} }
else { else {
$sql .= "virtual_table_parent_uuid = '$virtual_table_parent_uuid', "; $sql .= "table_parent_uuid = '$table_parent_uuid', ";
} }
$sql .= "virtual_table_description = '$virtual_table_description' "; $sql .= "table_description = '$table_description' ";
$sql .= "where virtual_table_uuid = '$virtual_table_uuid'"; $sql .= "where table_uuid = '$table_uuid'";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "includes/header.php"; require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_tables.php\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=tables.php\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Update Complete\n"; echo "Update Complete\n";
echo "</div>\n"; echo "</div>\n";
@@ -162,21 +162,21 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//pre-populate the form //pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") { if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$virtual_table_uuid = $_GET["id"]; $table_uuid = $_GET["id"];
$sql = "select * from v_virtual_tables "; $sql = "select * from v_tables ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute(); $prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) { foreach ($result as &$row) {
$virtual_table_category = $row["virtual_table_category"]; $table_category = $row["table_category"];
$virtual_table_label = $row["virtual_table_label"]; $table_label = $row["table_label"];
$virtual_table_name = $row["virtual_table_name"]; $table_name = $row["table_name"];
$virtual_table_auth = $row["virtual_table_auth"]; $table_auth = $row["table_auth"];
$virtual_table_captcha = $row["virtual_table_captcha"]; $table_captcha = $row["table_captcha"];
$virtual_table_parent_uuid = $row["virtual_table_parent_uuid"]; $table_parent_uuid = $row["table_parent_uuid"];
$virtual_table_description = $row["virtual_table_description"]; $table_description = $row["table_description"];
break; //limit to 1 row break; //limit to 1 row
} }
unset ($prep_statement); unset ($prep_statement);
@@ -203,12 +203,12 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<td align='left' width='30%' nowrap='nowrap'><b>Virtual Table Edit</b></td>\n"; echo "<td align='left' width='30%' nowrap='nowrap'><b>Virtual Table Edit</b></td>\n";
} }
echo "<td width='70%' align='right'>\n"; echo "<td width='70%' align='right'>\n";
if (strlen($virtual_table_uuid) > 0) { if (strlen($table_uuid) > 0) {
echo " <input type='button' class='btn' name='' alt='view' onclick=\"window.location='virtual_table_data_view.php?id=".$row[virtual_table_uuid]."'\" value='View'>&nbsp;&nbsp;\n"; echo " <input type='button' class='btn' name='' alt='view' onclick=\"window.location='table_data_view.php?id=".$row[table_uuid]."'\" value='View'>&nbsp;&nbsp;\n";
echo " <input type='button' class='btn' name='' alt='import' onclick=\"window.location='virtual_tables_import.php?id=".$row[virtual_table_uuid]."'\" value='Import'>&nbsp;&nbsp;\n"; echo " <input type='button' class='btn' name='' alt='import' onclick=\"window.location='tables_import.php?id=".$row[table_uuid]."'\" value='Import'>&nbsp;&nbsp;\n";
} }
include "export/index.php"; include "export/index.php";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='virtual_tables.php'\" value='Back'>\n"; echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='tables.php'\" value='Back'>\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -223,7 +223,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Table Category:\n"; echo " Table Category:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
$table_name = 'v_virtual_tables';$field_name = 'virtual_table_category';$sql_where_optional = "";$field_current_value = $virtual_table_category; $table_name = 'v_tables';$field_name = 'table_category';$sql_where_optional = "";$field_current_value = $table_category;
echo html_select_other($db, $table_name, $field_name, $sql_where_optional, $field_current_value); echo html_select_other($db, $table_name, $field_name, $sql_where_optional, $field_current_value);
echo "Select the category.\n"; echo "Select the category.\n";
echo "</td>\n"; echo "</td>\n";
@@ -234,7 +234,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Label:\n"; echo " Label:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='table_label' maxlength='255' value=\"$table_label\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the label.\n"; echo "Enter the label.\n";
echo "</td>\n"; echo "</td>\n";
@@ -245,7 +245,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Table Name:\n"; echo " Table Name:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='table_name' maxlength='255' value=\"$table_name\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the table name.\n"; echo "Enter the table name.\n";
echo "</td>\n"; echo "</td>\n";
@@ -256,15 +256,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Authentication:\n"; echo " Authentication:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='virtual_table_auth'>\n"; echo " <select class='formfld' name='table_auth'>\n";
echo " <option value=''></option>\n"; echo " <option value=''></option>\n";
if ($virtual_table_auth == "yes") { if ($table_auth == "yes") {
echo " <option value='yes' SELECTED >yes</option>\n"; echo " <option value='yes' SELECTED >yes</option>\n";
} }
else { else {
echo " <option value='yes'>yes</option>\n"; echo " <option value='yes'>yes</option>\n";
} }
if ($virtual_table_auth == "no") { if ($table_auth == "no") {
echo " <option value='no' SELECTED >no</option>\n"; echo " <option value='no' SELECTED >no</option>\n";
} }
else { else {
@@ -281,15 +281,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//echo " Captcha:\n"; //echo " Captcha:\n";
//echo "</td>\n"; //echo "</td>\n";
//echo "<td class='vtable' align='left'>\n"; //echo "<td class='vtable' align='left'>\n";
//echo " <select class='formfld' name='virtual_table_captcha'>\n"; //echo " <select class='formfld' name='table_captcha'>\n";
//echo " <option value=''></option>\n"; //echo " <option value=''></option>\n";
//if ($virtual_table_captcha == "yes") { //if ($table_captcha == "yes") {
// echo " <option value='yes' SELECTED >yes</option>\n"; // echo " <option value='yes' SELECTED >yes</option>\n";
//} //}
//else { //else {
// echo " <option value='yes'>yes</option>\n"; // echo " <option value='yes'>yes</option>\n";
//} //}
//if ($virtual_table_captcha == "no") { //if ($table_captcha == "no") {
// echo " <option value='no' SELECTED >no</option>\n"; // echo " <option value='no' SELECTED >no</option>\n";
//} //}
//else { //else {
@@ -307,19 +307,19 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select name='virtual_table_parent_uuid' class='formfld'>\n"; echo " <select name='table_parent_uuid' class='formfld'>\n";
echo " <option value=''></option>\n"; echo " <option value=''></option>\n";
$sql = "select * from v_virtual_tables "; $sql = "select * from v_tables ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$prep_statement = $db->prepare($sql); $prep_statement = $db->prepare($sql);
$prep_statement->execute(); $prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) { foreach ($result as &$row) {
if ($row["virtual_table_uuid"] == $virtual_table_parent_uuid) { if ($row["table_uuid"] == $table_parent_uuid) {
echo " <option value='".$row["virtual_table_uuid"]."' selected>".$row["virtual_table_name"]."</option>\n"; echo " <option value='".$row["table_uuid"]."' selected>".$row["table_name"]."</option>\n";
} }
else { else {
echo " <option value='".$row["virtual_table_uuid"]."'>".$row["virtual_table_name"]."</option>\n"; echo " <option value='".$row["table_uuid"]."'>".$row["table_name"]."</option>\n";
} }
} }
echo " </select>\n"; echo " </select>\n";
@@ -334,7 +334,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Description:\n"; echo " Description:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <textarea class='formfld' name='virtual_table_description' rows='4'>$virtual_table_description</textarea>\n"; echo " <textarea class='formfld' name='table_description' rows='4'>$table_description</textarea>\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter a description.\n"; echo "Enter a description.\n";
echo "</td>\n"; echo "</td>\n";
@@ -342,9 +342,9 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <tr>\n"; echo " <tr>\n";
echo " <td colspan='2' align='right'>\n"; echo " <td colspan='2' align='right'>\n";
if ($action == "update") { if ($action == "update") {
echo " <input type='hidden' name='virtual_table_uuid' value='$virtual_table_uuid'>\n"; echo " <input type='hidden' name='table_uuid' value='$table_uuid'>\n";
} }
echo " <input type='hidden' name='virtual_table_captcha' value='$virtual_table_captcha'>\n"; echo " <input type='hidden' name='table_captcha' value='$table_captcha'>\n";
echo " <input type='submit' name='submit' class='btn' value='Save'>\n"; echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " </td>\n"; echo " </td>\n";
echo " </tr>"; echo " </tr>";
@@ -352,7 +352,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</form>"; echo "</form>";
if ($action == "update") { if ($action == "update") {
require "virtual_table_fields.php"; require "table_fields.php";
} }
echo " </td>"; echo " </td>";
+5 -5
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_delete')) { if (permission_exists('table_delete')) {
//access granted //access granted
} }
else { else {
@@ -37,15 +37,15 @@ else {
//get the http values //get the http values
if (count($_GET)>0) { if (count($_GET)>0) {
$id = check_str($_GET["id"]); $id = check_str($_GET["id"]);
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]); $table_uuid = check_str($_GET["table_uuid"]);
} }
//delete the data //delete the data
if (strlen($id)>0) { if (strlen($id)>0) {
$sql = ""; $sql = "";
$sql .= "delete from v_virtual_table_fields "; $sql .= "delete from v_table_fields ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_field_uuid = '$id' "; $sql .= "and table_field_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute(); $prep_statement->execute();
unset($sql); unset($sql);
@@ -53,7 +53,7 @@ else {
//redirect the user //redirect the user
require_once "includes/header.php"; require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_tables_edit.php?id=$virtual_table_uuid\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=table_edit.php?id=$table_uuid\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Delete Complete\n"; echo "Delete Complete\n";
echo "</div>\n"; echo "</div>\n";
+138 -138
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_add') || permission_exists('virtual_tables_edit')) { if (permission_exists('tables_add') || permission_exists('table_edit')) {
//access granted //access granted
} }
else { else {
@@ -37,52 +37,52 @@ else {
//set the action as an add or update //set the action as an add or update
if (isset($_REQUEST["id"])) { if (isset($_REQUEST["id"])) {
$action = "update"; $action = "update";
$virtual_table_field_uuid = check_str($_REQUEST["id"]); $table_field_uuid = check_str($_REQUEST["id"]);
} }
else { else {
$action = "add"; $action = "add";
} }
//get the http variables //get the http variables
if (strlen($_GET["virtual_table_uuid"]) > 0) { if (strlen($_GET["table_uuid"]) > 0) {
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]); $table_uuid = check_str($_GET["table_uuid"]);
} }
//get the http post variables //get the http post variables
if (count($_POST)>0) { if (count($_POST)>0) {
$virtual_field_label = check_str($_POST["virtual_field_label"]); $field_label = check_str($_POST["field_label"]);
$virtual_field_name = check_str($_POST["virtual_field_name"]); $field_name = check_str($_POST["field_name"]);
$virtual_field_type = check_str($_POST["virtual_field_type"]); $field_type = check_str($_POST["field_type"]);
$virtual_field_value = check_str($_POST["virtual_field_value"]); $field_value = check_str($_POST["field_value"]);
$virtual_field_list_hidden = check_str($_POST["virtual_field_list_hidden"]); $field_list_hidden = check_str($_POST["field_list_hidden"]);
$virtual_field_search_by = check_str($_POST["virtual_field_search_by"]); $field_search_by = check_str($_POST["field_search_by"]);
$virtual_field_column = check_str($_POST["virtual_field_column"]); $field_column = check_str($_POST["field_column"]);
$virtual_field_required = check_str($_POST["virtual_field_required"]); $field_required = check_str($_POST["field_required"]);
$virtual_field_order = check_str($_POST["virtual_field_order"]); $field_order = check_str($_POST["field_order"]);
$virtual_field_order_tab = check_str($_POST["virtual_field_order_tab"]); $field_order_tab = check_str($_POST["field_order_tab"]);
$virtual_field_description = check_str($_POST["virtual_field_description"]); $field_description = check_str($_POST["field_description"]);
} }
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = ''; $msg = '';
if ($action == "update") { if ($action == "update") {
$virtual_table_field_uuid = check_str($_POST["virtual_table_field_uuid"]); $table_field_uuid = check_str($_POST["table_field_uuid"]);
} }
//check for all required data //check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; } 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($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($field_name) == 0 && $field_type != "label") { $msg .= "Please provide: Name<br>\n"; }
if (strlen($virtual_field_type) == 0) { $msg .= "Please provide: Type<br>\n"; } if (strlen($field_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
//if (strlen($virtual_field_value) == 0) { $msg .= "Please provide: Value<br>\n"; } //if (strlen($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($field_list_hidden) == 0) { $msg .= "Please provide: List Visibility<br>\n"; }
//if (strlen($virtual_field_search_by) == 0) { $msg .= "Please provide: Search By<br>\n"; } //if (strlen($field_search_by) == 0) { $msg .= "Please provide: Search By<br>\n"; }
if (strlen($virtual_field_column) == 0) { $msg .= "Please provide: Column<br>\n"; } if (strlen($field_column) == 0) { $msg .= "Please provide: Column<br>\n"; }
if (strlen($virtual_field_required) == 0) { $msg .= "Please provide: Required<br>\n"; } if (strlen($field_required) == 0) { $msg .= "Please provide: Required<br>\n"; }
if (strlen($virtual_field_order) == 0) { $msg .= "Please provide: Field Order<br>\n"; } if (strlen($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($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($field_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php"; require_once "includes/header.php";
require_once "includes/persistformvar.php"; require_once "includes/persistformvar.php";
@@ -98,47 +98,47 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//add or update the database //add or update the database
if ($_POST["persistformvar"] != "true") { if ($_POST["persistformvar"] != "true") {
if ($action == "add" && permission_exists('virtual_tables_add')) { if ($action == "add" && permission_exists('tables_add')) {
$virtual_table_field_uuid = uuid(); $table_field_uuid = uuid();
$sql = "insert into v_virtual_table_fields "; $sql = "insert into v_table_fields ";
$sql .= "("; $sql .= "(";
$sql .= "domain_uuid, "; $sql .= "domain_uuid, ";
$sql .= "virtual_table_uuid, "; $sql .= "table_uuid, ";
$sql .= "virtual_table_field_uuid, "; $sql .= "table_field_uuid, ";
$sql .= "virtual_field_label, "; $sql .= "field_label, ";
$sql .= "virtual_field_name, "; $sql .= "field_name, ";
$sql .= "virtual_field_type, "; $sql .= "field_type, ";
$sql .= "virtual_field_value, "; $sql .= "field_value, ";
$sql .= "virtual_field_list_hidden, "; $sql .= "field_list_hidden, ";
$sql .= "virtual_field_search_by, "; $sql .= "field_search_by, ";
$sql .= "virtual_field_column, "; $sql .= "field_column, ";
$sql .= "virtual_field_required, "; $sql .= "field_required, ";
$sql .= "virtual_field_order, "; $sql .= "field_order, ";
$sql .= "virtual_field_order_tab, "; $sql .= "field_order_tab, ";
$sql .= "virtual_field_description "; $sql .= "field_description ";
$sql .= ")"; $sql .= ")";
$sql .= "values "; $sql .= "values ";
$sql .= "("; $sql .= "(";
$sql .= "'$domain_uuid', "; $sql .= "'$domain_uuid', ";
$sql .= "'$virtual_table_uuid', "; $sql .= "'$table_uuid', ";
$sql .= "'$virtual_table_field_uuid', "; $sql .= "'$table_field_uuid', ";
$sql .= "'$virtual_field_label', "; $sql .= "'$field_label', ";
$sql .= "'$virtual_field_name', "; $sql .= "'$field_name', ";
$sql .= "'$virtual_field_type', "; $sql .= "'$field_type', ";
$sql .= "'$virtual_field_value', "; $sql .= "'$field_value', ";
$sql .= "'$virtual_field_list_hidden', "; $sql .= "'$field_list_hidden', ";
$sql .= "'$virtual_field_search_by', "; $sql .= "'$field_search_by', ";
$sql .= "'$virtual_field_column', "; $sql .= "'$field_column', ";
$sql .= "'$virtual_field_required', "; $sql .= "'$field_required', ";
$sql .= "'$virtual_field_order', "; $sql .= "'$field_order', ";
$sql .= "'$virtual_field_order_tab', "; $sql .= "'$field_order_tab', ";
$sql .= "'$virtual_field_description' "; $sql .= "'$field_description' ";
$sql .= ")"; $sql .= ")";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "includes/header.php"; require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_tables_edit.php?id=$virtual_table_uuid\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=table_edit.php?id=$table_uuid\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Add Complete\n"; echo "Add Complete\n";
echo "</div>\n"; echo "</div>\n";
@@ -146,27 +146,27 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
return; return;
} //if ($action == "add") } //if ($action == "add")
if ($action == "update" && permission_exists('virtual_tables_edit')) { if ($action == "update" && permission_exists('table_edit')) {
$sql = "update v_virtual_table_fields set "; $sql = "update v_table_fields set ";
$sql .= "virtual_field_label = '$virtual_field_label', "; $sql .= "field_label = '$field_label', ";
$sql .= "virtual_field_name = '$virtual_field_name', "; $sql .= "field_name = '$field_name', ";
$sql .= "virtual_field_type = '$virtual_field_type', "; $sql .= "field_type = '$field_type', ";
$sql .= "virtual_field_value = '$virtual_field_value', "; $sql .= "field_value = '$field_value', ";
$sql .= "virtual_field_list_hidden = '$virtual_field_list_hidden', "; $sql .= "field_list_hidden = '$field_list_hidden', ";
$sql .= "virtual_field_search_by = '$virtual_field_search_by', "; $sql .= "field_search_by = '$field_search_by', ";
$sql .= "virtual_field_column = '$virtual_field_column', "; $sql .= "field_column = '$field_column', ";
$sql .= "virtual_field_required = '$virtual_field_required', "; $sql .= "field_required = '$field_required', ";
$sql .= "virtual_field_order = '$virtual_field_order', "; $sql .= "field_order = '$field_order', ";
$sql .= "virtual_field_order_tab = '$virtual_field_order_tab', "; $sql .= "field_order_tab = '$field_order_tab', ";
$sql .= "virtual_field_description = '$virtual_field_description' "; $sql .= "field_description = '$field_description' ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid'"; $sql .= "and table_uuid = '$table_uuid'";
$sql .= "and virtual_table_field_uuid = '$virtual_table_field_uuid' "; $sql .= "and table_field_uuid = '$table_field_uuid' ";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "includes/header.php"; require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_tables_edit.php?id=$virtual_table_uuid\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=table_edit.php?id=$table_uuid\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Update Complete\n"; echo "Update Complete\n";
echo "</div>\n"; echo "</div>\n";
@@ -178,28 +178,28 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//pre-populate the form //pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") { if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$virtual_table_uuid = $_GET["virtual_table_uuid"]; $table_uuid = $_GET["table_uuid"];
$virtual_table_field_uuid = $_GET["id"]; $table_field_uuid = $_GET["id"];
$sql = "select * from v_virtual_table_fields "; $sql = "select * from v_table_fields ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
$sql .= "and virtual_table_field_uuid = '$virtual_table_field_uuid' "; $sql .= "and table_field_uuid = '$table_field_uuid' ";
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute(); $prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) { foreach ($result as &$row) {
$virtual_field_label = $row["virtual_field_label"]; $field_label = $row["field_label"];
$virtual_field_name = $row["virtual_field_name"]; $field_name = $row["field_name"];
$virtual_field_type = $row["virtual_field_type"]; $field_type = $row["field_type"];
$virtual_field_value = $row["virtual_field_value"]; $field_value = $row["field_value"];
$virtual_field_list_hidden = $row["virtual_field_list_hidden"]; $field_list_hidden = $row["field_list_hidden"];
$virtual_field_search_by = $row["virtual_field_search_by"]; $field_search_by = $row["field_search_by"];
$virtual_field_column = $row["virtual_field_column"]; $field_column = $row["field_column"];
$virtual_field_required = $row["virtual_field_required"]; $field_required = $row["field_required"];
$virtual_field_order = $row["virtual_field_order"]; $field_order = $row["field_order"];
$virtual_field_order_tab = $row["virtual_field_order_tab"]; $field_order_tab = $row["field_order_tab"];
$virtual_field_description = $row["virtual_field_description"]; $field_description = $row["field_description"];
break; //limit to 1 row break; //limit to 1 row
} }
unset ($prep_statement); unset ($prep_statement);
@@ -225,11 +225,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") { if ($action == "update") {
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Virtual Table Field Edit</b></td>\n"; 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='virtual_tables_edit.php?id=$virtual_table_uuid'\" value='Back'></td>\n"; echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='table_edit.php?id=$table_uuid'\" value='Back'></td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo "<tr>\n"; echo "<tr>\n";
echo "<td align=\"left\" colspan=\"2\">\n"; echo "<td align=\"left\" colspan=\"2\">\n";
echo "Lists the fields in the virtual database.<br /><br />\n"; echo "Lists the fields in the database.<br /><br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -238,7 +238,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Label:\n"; echo " Label:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='field_label' maxlength='255' value=\"$field_label\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the field label.\n"; echo "Enter the field label.\n";
echo "</td>\n"; echo "</td>\n";
@@ -249,7 +249,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Name:\n"; echo " Name:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='field_name' maxlength='255' value=\"$field_name\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter field name.\n"; echo "Enter field name.\n";
echo "</td>\n"; echo "</td>\n";
@@ -260,159 +260,159 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Type:\n"; echo " Type:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='virtual_field_type'>\n"; echo " <select class='formfld' name='field_type'>\n";
echo " <option value=''></option>\n"; echo " <option value=''></option>\n";
if ($virtual_field_type == "text") { if ($field_type == "text") {
echo " <option value='text' selected='selected'>Text</option>\n"; echo " <option value='text' selected='selected'>Text</option>\n";
} }
else { else {
echo " <option value='text'>Text</option>\n"; echo " <option value='text'>Text</option>\n";
} }
if ($virtual_field_type == "number") { if ($field_type == "number") {
echo " <option value='number' selected='selected'>Number</option>\n"; echo " <option value='number' selected='selected'>Number</option>\n";
} }
else { else {
echo " <option value='number'>Number</option>\n"; echo " <option value='number'>Number</option>\n";
} }
if ($virtual_field_type == "date") { if ($field_type == "date") {
echo " <option value='date' selected='selected'>Date</option>\n"; echo " <option value='date' selected='selected'>Date</option>\n";
} }
else { else {
echo " <option value='date'>Date</option>\n"; echo " <option value='date'>Date</option>\n";
} }
if ($virtual_field_type == "email") { if ($field_type == "email") {
echo " <option value='email' selected='selected'>Email</option>\n"; echo " <option value='email' selected='selected'>Email</option>\n";
} }
else { else {
echo " <option value='email'>Email</option>\n"; echo " <option value='email'>Email</option>\n";
} }
if ($virtual_field_type == "label") { if ($field_type == "label") {
echo " <option value='label' selected='selected'>Label</option>\n"; echo " <option value='label' selected='selected'>Label</option>\n";
} }
else { else {
echo " <option value='label'>Label</option>\n"; echo " <option value='label'>Label</option>\n";
} }
if ($virtual_field_type == "phone") { if ($field_type == "phone") {
echo " <option value='phone' selected='selected'>Phone</option>\n"; echo " <option value='phone' selected='selected'>Phone</option>\n";
} }
else { else {
echo " <option value='phone'>Phone</option>\n"; echo " <option value='phone'>Phone</option>\n";
} }
//if ($virtual_field_type == "truefalse") { //if ($field_type == "truefalse") {
// echo " <option value='truefalse' selected='selected'>True or False</option>\n"; // echo " <option value='truefalse' selected='selected'>True or False</option>\n";
//} //}
//else { //else {
// echo " <option value='truefalse'>True or False</option>\n"; // echo " <option value='truefalse'>True or False</option>\n";
//} //}
if ($virtual_field_type == "checkbox") { if ($field_type == "checkbox") {
echo " <option value='checkbox' selected='selected'>Check Box</option>\n"; echo " <option value='checkbox' selected='selected'>Check Box</option>\n";
} }
else { else {
echo " <option value='checkbox'>Check Box</option>\n"; echo " <option value='checkbox'>Check Box</option>\n";
} }
//if ($virtual_field_type == "radiobutton") { //if ($field_type == "radiobutton") {
// echo " <option value='radiobutton' selected='selected' >Radio Button</option>\n"; // echo " <option value='radiobutton' selected='selected' >Radio Button</option>\n";
//} //}
//else { //else {
// echo " <option value='radiobutton'>Radio Button</option>\n"; // echo " <option value='radiobutton'>Radio Button</option>\n";
//} //}
if ($virtual_field_type == "textarea") { if ($field_type == "textarea") {
echo " <option value='textarea' selected='selected'>Textarea</option>\n"; echo " <option value='textarea' selected='selected'>Textarea</option>\n";
} }
else { else {
echo " <option value='textarea'>Textarea</option>\n"; echo " <option value='textarea'>Textarea</option>\n";
} }
if ($virtual_field_type == "select") { if ($field_type == "select") {
echo " <option value='select' selected='selected'>Select</option>\n"; echo " <option value='select' selected='selected'>Select</option>\n";
} }
else { else {
echo " <option value='select'>Select</option>\n"; echo " <option value='select'>Select</option>\n";
} }
if ($virtual_field_type == "hidden") { if ($field_type == "hidden") {
echo " <option value='hidden' selected='selected'>Hidden</option>\n"; echo " <option value='hidden' selected='selected'>Hidden</option>\n";
} }
else { else {
echo " <option value='hidden'>Hidden</option>\n"; echo " <option value='hidden'>Hidden</option>\n";
} }
if ($virtual_field_type == "uuid") { if ($field_type == "uuid") {
echo " <option value='uuid' selected='selected'>UUID</option>\n"; echo " <option value='uuid' selected='selected'>UUID</option>\n";
} }
else { else {
echo " <option value='uuid'>UUID</option>\n"; echo " <option value='uuid'>UUID</option>\n";
} }
//if ($virtual_field_type == "ipv4") { //if ($field_type == "ipv4") {
// echo " <option value='ipv4' selected='selected'>IP version 4</option>\n"; // echo " <option value='ipv4' selected='selected'>IP version 4</option>\n";
//} //}
//else { //else {
// echo " <option value='ipv4'>IP version 4</option>\n"; // echo " <option value='ipv4'>IP version 4</option>\n";
//} //}
//if ($virtual_field_type == "ipv6") { //if ($field_type == "ipv6") {
// echo " <option value='ipv6' selected='selected'>IP version 6</option>\n"; // echo " <option value='ipv6' selected='selected'>IP version 6</option>\n";
//} //}
//else { //else {
// echo " <option value='ipv6'>IP version 6</option>\n"; // echo " <option value='ipv6'>IP version 6</option>\n";
//} //}
//if ($virtual_field_type == "money") { //if ($field_type == "money") {
// echo " <option value='money' selected='selected'>Money</option>\n"; // echo " <option value='money' selected='selected'>Money</option>\n";
//} //}
//else { //else {
// echo " <option value='money'>Money</option>\n"; // echo " <option value='money'>Money</option>\n";
//} //}
if ($virtual_field_type == "password") { if ($field_type == "password") {
echo " <option value='password' selected='selected'>Password</option>\n"; echo " <option value='password' selected='selected'>Password</option>\n";
} }
else { else {
echo " <option value='password'>Password</option>\n"; echo " <option value='password'>Password</option>\n";
} }
if ($virtual_field_type == "pin_number") { if ($field_type == "pin_number") {
echo " <option value='pin_number' selected='selected'>PIN Number</option>\n"; echo " <option value='pin_number' selected='selected'>PIN Number</option>\n";
} }
else { else {
echo " <option value='pin_number'>PIN Number</option>\n"; echo " <option value='pin_number'>PIN Number</option>\n";
} }
if ($virtual_field_type == "image") { if ($field_type == "image") {
echo " <option value='image' selected='selected'>Upload Image</option>\n"; echo " <option value='image' selected='selected'>Upload Image</option>\n";
} }
else { else {
echo " <option value='image'>Upload Image</option>\n"; echo " <option value='image'>Upload Image</option>\n";
} }
if ($virtual_field_type == "file") { if ($field_type == "file") {
echo " <option value='upload_file' selected='selected'>Upload File</option>\n"; echo " <option value='upload_file' selected='selected'>Upload File</option>\n";
} }
else { else {
echo " <option value='file'>Upload File</option>\n"; echo " <option value='file'>Upload File</option>\n";
} }
//if ($virtual_field_type == "yesno") { //if ($field_type == "yesno") {
// echo " <option value='yesno' selected='selected'>Yes or No</option>\n"; // echo " <option value='yesno' selected='selected'>Yes or No</option>\n";
//} //}
//else { //else {
// echo " <option value='yesno'>Yes or No</option>\n"; // echo " <option value='yesno'>Yes or No</option>\n";
//} //}
if ($virtual_field_type == "url") { if ($field_type == "url") {
echo " <option value='url' selected='selected'>URL</option>\n"; echo " <option value='url' selected='selected'>URL</option>\n";
} }
else { else {
echo " <option value='url'>URL</option>\n"; echo " <option value='url'>URL</option>\n";
} }
//if ($virtual_field_type == "add_date") { //if ($field_type == "add_date") {
// echo " <option value='add_date' selected='selected'>Add Date</option>\n"; // echo " <option value='add_date' selected='selected'>Add Date</option>\n";
//} //}
//else { //else {
// echo " <option value='add_date'>Add Date</option>\n"; // echo " <option value='add_date'>Add Date</option>\n";
//} //}
//if ($virtual_field_type == "add_user") { //if ($field_type == "add_user") {
// echo " <option value='add_user' selected='selected'>Add User</option>\n"; // echo " <option value='add_user' selected='selected'>Add User</option>\n";
//} //}
//else { //else {
// echo " <option value='add_user'>Add User</option>\n"; // echo " <option value='add_user'>Add User</option>\n";
//} //}
if ($virtual_field_type == "mod_date") { if ($field_type == "mod_date") {
echo " <option value='mod_date' selected='selected'>Modified Date</option>\n"; echo " <option value='mod_date' selected='selected'>Modified Date</option>\n";
} }
else { else {
echo " <option value='mod_date'>Modified Date</option>\n"; echo " <option value='mod_date'>Modified Date</option>\n";
} }
if ($virtual_field_type == "mod_user") { if ($field_type == "mod_user") {
echo " <option value='mod_user' selected='selected'>Modified User</option>\n"; echo " <option value='mod_user' selected='selected'>Modified User</option>\n";
} }
else { else {
@@ -429,7 +429,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Value:\n"; echo " Value:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='field_value' maxlength='255' value=\"$field_value\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the default value.\n"; echo "Enter the default value.\n";
echo "</td>\n"; echo "</td>\n";
@@ -440,15 +440,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " List Visibility:\n"; echo " List Visibility:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='virtual_field_list_hidden'>\n"; echo " <select class='formfld' name='field_list_hidden'>\n";
echo " <option value=''></option>\n"; echo " <option value=''></option>\n";
if ($virtual_field_list_hidden == "show") { if ($field_list_hidden == "show") {
echo " <option value='show' selected='selected'>show</option>\n"; echo " <option value='show' selected='selected'>show</option>\n";
} }
else { else {
echo " <option value='show'>show</option>\n"; echo " <option value='show'>show</option>\n";
} }
if ($virtual_field_list_hidden == "hide") { if ($field_list_hidden == "hide") {
echo " <option value='hide' selected='selected'>hide</option>\n"; echo " <option value='hide' selected='selected'>hide</option>\n";
} }
else { else {
@@ -465,15 +465,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Search By:\n"; echo " Search By:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='virtual_field_search_by'>\n"; echo " <select class='formfld' name='field_search_by'>\n";
echo " <option value=''></option>\n"; echo " <option value=''></option>\n";
if ($virtual_field_search_by == "yes") { if ($field_search_by == "yes") {
echo " <option value='yes' selected='selected'>yes</option>\n"; echo " <option value='yes' selected='selected'>yes</option>\n";
} }
else { else {
echo " <option value='yes'>yes</option>\n"; echo " <option value='yes'>yes</option>\n";
} }
if ($virtual_field_search_by == "no") { if ($field_search_by == "no") {
echo " <option value='no' selected='selected'>no</option>\n"; echo " <option value='no' selected='selected'>no</option>\n";
} }
else { else {
@@ -490,7 +490,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Column:\n"; echo " Column:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='field_column' maxlength='255' value=\"$field_column\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Determines which column to show the field in.\n"; echo "Determines which column to show the field in.\n";
echo "</td>\n"; echo "</td>\n";
@@ -501,15 +501,15 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Required:\n"; echo " Required:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\n"; echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='virtual_field_required'>\n"; echo " <select class='formfld' name='field_required'>\n";
echo " <option value=''></option>\n"; echo " <option value=''></option>\n";
if ($virtual_field_required == "yes") { if ($field_required == "yes") {
echo " <option value='yes' selected='selected'>yes</option>\n"; echo " <option value='yes' selected='selected'>yes</option>\n";
} }
else { else {
echo " <option value='yes'>yes</option>\n"; echo " <option value='yes'>yes</option>\n";
} }
if ($virtual_field_required == "no") { if ($field_required == "no") {
echo " <option value='no' selected='selected'>no</option>\n"; echo " <option value='no' selected='selected'>no</option>\n";
} }
else { else {
@@ -526,7 +526,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Field Order:\n"; echo " Field Order:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='field_order' maxlength='255' value='$field_order'>\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the order of the field.\n"; echo "Enter the order of the field.\n";
echo "</td>\n"; echo "</td>\n";
@@ -537,7 +537,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Tab Order:\n"; echo " Tab Order:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='field_order_tab' maxlength='255' value='$field_order_tab'>\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the HTML Tab Order.\n"; echo "Enter the HTML Tab Order.\n";
echo "</td>\n"; echo "</td>\n";
@@ -548,16 +548,16 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Description:\n"; echo " Description:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='field_description' maxlength='255' value=\"$field_description\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the description.\n"; echo "Enter the description.\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo " <tr>\n"; echo " <tr>\n";
echo " <td colspan='2' align='right'>\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='table_uuid' value='$table_uuid'>\n";
if ($action == "update") { if ($action == "update") {
echo " <input type='hidden' name='virtual_table_field_uuid' value='$virtual_table_field_uuid'>\n"; echo " <input type='hidden' name='table_field_uuid' value='$table_field_uuid'>\n";
} }
echo " <input type='submit' name='submit' class='btn' value='Save'>\n"; echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " </td>\n"; echo " </td>\n";
@@ -566,8 +566,8 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "</form>"; echo "</form>";
if ($action == "update") { if ($action == "update") {
if ($virtual_field_type == "select") { if ($field_type == "select") {
require "virtual_table_data_types_name_value.php"; require "table_data_types_name_value.php";
} }
} }
+34 -34
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_view')) { if (permission_exists('table_view')) {
//access granted //access granted
} }
else { else {
@@ -48,24 +48,24 @@ $order = $_GET["order"];
echo "<table width='100%' border='0'>\n"; echo "<table width='100%' border='0'>\n";
echo "<tr>\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=\"left\" nowrap=\"nowrap\"><b>Table Fields</b></td>\n";
echo "<td width='50%' align=\"right\">&nbsp;</td>\n"; echo "<td width='50%' align=\"right\">&nbsp;</td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo "<tr>\n"; echo "<tr>\n";
echo "<td align=\"left\" colspan=\"2\">\n"; echo "<td align=\"left\" colspan=\"2\">\n";
echo "Lists the fields in the virtual database.<br /><br />\n"; echo "Lists the fields in the database.<br /><br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo "</tr></table>\n"; echo "</tr></table>\n";
if (strlen($order_by) == 0) { if (strlen($order_by) == 0) {
$order_by = 'virtual_field_order'; $order_by = 'field_order';
$order = 'asc'; $order = 'asc';
} }
$sql = "select * from v_virtual_table_fields "; $sql = "select * from v_table_fields ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute(); $prep_statement->execute();
@@ -80,19 +80,19 @@ $order = $_GET["order"];
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n"; echo "<tr>\n";
echo th_order_by('virtual_field_label', 'Label', $order_by, $order); echo th_order_by('field_label', 'Label', $order_by, $order);
echo th_order_by('virtual_field_name', 'Name', $order_by, $order); echo th_order_by('field_name', 'Name', $order_by, $order);
echo th_order_by('virtual_field_type', 'Type', $order_by, $order); echo th_order_by('field_type', 'Type', $order_by, $order);
echo th_order_by('virtual_field_column', 'Column', $order_by, $order); echo th_order_by('field_column', 'Column', $order_by, $order);
echo th_order_by('virtual_field_required', 'Required', $order_by, $order); echo th_order_by('field_required', 'Required', $order_by, $order);
echo th_order_by('virtual_field_list_hidden', 'Visible', $order_by, $order); echo th_order_by('field_list_hidden', 'Visible', $order_by, $order);
echo th_order_by('virtual_field_search_by', 'Search By', $order_by, $order); echo th_order_by('field_search_by', 'Search By', $order_by, $order);
echo th_order_by('virtual_field_order', 'Field Order', $order_by, $order); echo th_order_by('field_order', 'Field Order', $order_by, $order);
echo th_order_by('virtual_field_order_tab', 'Tab Order', $order_by, $order); echo th_order_by('field_order_tab', 'Tab Order', $order_by, $order);
echo th_order_by('virtual_field_description', 'Description', $order_by, $order); echo th_order_by('field_description', 'Description', $order_by, $order);
echo "<td align='right' width='42'>\n"; echo "<td align='right' width='42'>\n";
if (permission_exists('virtual_tables_view')) { if (permission_exists('table_view')) {
echo " <a href='virtual_table_fields_edit.php?virtual_table_uuid=".$virtual_table_uuid."' alt='add'>$v_link_label_add</a>\n"; echo " <a href='table_field_edit.php?table_uuid=".$table_uuid."' alt='add'>$v_link_label_add</a>\n";
} }
echo "</td>\n"; echo "</td>\n";
echo "<tr>\n"; echo "<tr>\n";
@@ -100,22 +100,22 @@ $order = $_GET["order"];
if ($result_count > 0) { if ($result_count > 0) {
foreach($result as $row) { foreach($result as $row) {
echo "<tr >\n"; echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_label']."&nbsp;</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_label']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_name']."&nbsp;</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_name']."&nbsp;</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['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['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['field_required']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_list_hidden']."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_list_hidden']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_search_by']."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_search_by']."</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['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['field_order_tab']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_field_description']."&nbsp;</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n"; echo " <td valign='top' align='right'>\n";
if (permission_exists('virtual_tables_edit')) { if (permission_exists('table_edit')) {
echo " <a href='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"; echo " <a href='table_field_edit.php?table_uuid=".$row['table_uuid']."&id=".$row['table_field_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
} }
if (permission_exists('virtual_tables_delete')) { if (permission_exists('table_delete')) {
echo " <a href='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 " <a href='table_field_delete.php?table_uuid=".$row['table_uuid']."&id=".$row['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 " </td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -131,8 +131,8 @@ $order = $_GET["order"];
echo " <td width='33.3%' nowrap>&nbsp;</td>\n"; echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>&nbsp;</td>\n"; echo " <td width='33.3%' align='center' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='right'>\n"; echo " <td width='33.3%' align='right'>\n";
if (permission_exists('virtual_tables_add')) { if (permission_exists('tables_add')) {
echo " <a href='virtual_table_fields_edit.php?virtual_table_uuid=".$virtual_table_uuid."' alt='add'>$v_link_label_add</a>\n"; echo " <a href='table_field_edit.php?table_uuid=".$table_uuid."' alt='add'>$v_link_label_add</a>\n";
} }
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";
+101 -101
View File
@@ -26,7 +26,7 @@
include "root.php"; include "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_edit')) { if (permission_exists('table_edit')) {
//access granted //access granted
} }
else { else {
@@ -35,33 +35,33 @@ else {
} }
if (count($_POST)>0) { if (count($_POST)>0) {
$virtual_table_uuid = trim($_REQUEST["id"]); $table_uuid = trim($_REQUEST["id"]);
$data = trim($_POST["data"]); $data = trim($_POST["data"]);
$data_delimiter = trim($_POST["data_delimiter"]); $data_delimiter = trim($_POST["data_delimiter"]);
$data_enclosure = trim($_POST["data_enclosure"]); $data_enclosure = trim($_POST["data_enclosure"]);
} }
//define the php class //define the php class
class v_virtual_table_fields { class v_table_fields {
var $domain_uuid; var $domain_uuid;
var $virtual_table_uuid; var $table_uuid;
var $virtual_field_label; var $field_label;
var $virtual_field_name; var $field_name;
var $virtual_field_type; var $field_type;
var $virtual_field_value; var $field_value;
var $virtual_field_list_hidden; var $field_list_hidden;
var $virtual_field_column; var $field_column;
var $virtual_field_required; var $field_required;
var $virtual_field_order; var $field_order;
var $virtual_field_order_tab; var $field_order_tab;
var $virtual_field_description; var $field_description;
function db_field_exists() { function db_field_exists() {
global $db; global $db;
$sql = "select count(*) as num_rows from v_virtual_table_fields "; $sql = "select count(*) as num_rows from v_table_fields ";
$sql .= "where domain_uuid = '$this->domain_uuid' "; $sql .= "where domain_uuid = '$this->domain_uuid' ";
$sql .= "and virtual_table_uuid ='$this->virtual_table_uuid' "; $sql .= "and table_uuid ='$this->table_uuid' ";
$sql .= "and virtual_field_name = '$this->virtual_field_name' "; $sql .= "and field_name = '$this->field_name' ";
$prep_statement = $db->prepare($sql); $prep_statement = $db->prepare($sql);
if ($prep_statement) { if ($prep_statement) {
$prep_statement->execute(); $prep_statement->execute();
@@ -77,39 +77,39 @@ if (count($_POST)>0) {
function db_insert() { function db_insert() {
global $db; global $db;
$sql = "insert into v_virtual_table_fields "; $sql = "insert into v_table_fields ";
$sql .= "("; $sql .= "(";
$sql .= "virtual_table_field_uuid, "; $sql .= "table_field_uuid, ";
$sql .= "domain_uuid, "; $sql .= "domain_uuid, ";
$sql .= "virtual_table_uuid, "; $sql .= "table_uuid, ";
$sql .= "virtual_field_label, "; $sql .= "field_label, ";
$sql .= "virtual_field_name, "; $sql .= "field_name, ";
$sql .= "virtual_field_type, "; $sql .= "field_type, ";
$sql .= "virtual_field_value, "; $sql .= "field_value, ";
$sql .= "virtual_field_list_hidden, "; $sql .= "field_list_hidden, ";
$sql .= "virtual_field_search_by, "; $sql .= "field_search_by, ";
$sql .= "virtual_field_column, "; $sql .= "field_column, ";
$sql .= "virtual_field_required, "; $sql .= "field_required, ";
$sql .= "virtual_field_order, "; $sql .= "field_order, ";
$sql .= "virtual_field_order_tab, "; $sql .= "field_order_tab, ";
$sql .= "virtual_field_description "; $sql .= "field_description ";
$sql .= ")"; $sql .= ")";
$sql .= "values "; $sql .= "values ";
$sql .= "("; $sql .= "(";
$sql .= "'".uuid()."', "; $sql .= "'".uuid()."', ";
$sql .= "'$this->domain_uuid', "; $sql .= "'$this->domain_uuid', ";
$sql .= "'$this->virtual_table_uuid', "; $sql .= "'$this->table_uuid', ";
$sql .= "'$this->virtual_field_label', "; $sql .= "'$this->field_label', ";
$sql .= "'$this->virtual_field_name', "; $sql .= "'$this->field_name', ";
$sql .= "'$this->virtual_field_type', "; $sql .= "'$this->field_type', ";
$sql .= "'$this->virtual_field_value', "; $sql .= "'$this->field_value', ";
$sql .= "'$this->virtual_field_list_hidden', "; $sql .= "'$this->field_list_hidden', ";
$sql .= "'no', "; $sql .= "'no', ";
$sql .= "'$this->virtual_field_column', "; $sql .= "'$this->field_column', ";
$sql .= "'$this->virtual_field_required', "; $sql .= "'$this->field_required', ";
$sql .= "'$this->virtual_field_order', "; $sql .= "'$this->field_order', ";
$sql .= "'$this->virtual_field_order_tab', "; $sql .= "'$this->field_order_tab', ";
$sql .= "'$this->virtual_field_description' "; $sql .= "'$this->field_description' ";
$sql .= ")"; $sql .= ")";
if (!$this->db_field_exists()) { if (!$this->db_field_exists()) {
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
@@ -118,18 +118,18 @@ if (count($_POST)>0) {
} }
} }
class v_virtual_table_data { class v_table_data {
var $domain_uuid; var $domain_uuid;
var $virtual_table_uuid; var $table_uuid;
var $virtual_data_row_uuid; var $data_row_uuid;
var $virtual_field_name; var $field_name;
var $virtual_data_field_value; var $data_field_value;
var $last_insert_id; var $last_insert_id;
var $virtual_table_data_uuid; var $table_data_uuid;
function db_unique_id() { function db_unique_id() {
global $db; global $db;
$sql = "insert into v_virtual_table_data_row_id "; $sql = "insert into v_table_data_row_id ";
$sql .= "("; $sql .= "(";
$sql .= "domain_uuid "; $sql .= "domain_uuid ";
$sql .= ")"; $sql .= ")";
@@ -144,25 +144,25 @@ if (count($_POST)>0) {
function db_insert() { function db_insert() {
global $db; global $db;
$sql = "insert into v_virtual_table_data "; $sql = "insert into v_table_data ";
$sql .= "("; $sql .= "(";
$sql .= "virtual_table_data_uuid, "; $sql .= "table_data_uuid, ";
$sql .= "domain_uuid, "; $sql .= "domain_uuid, ";
$sql .= "virtual_data_row_uuid, "; $sql .= "data_row_uuid, ";
$sql .= "virtual_table_uuid, "; $sql .= "table_uuid, ";
$sql .= "virtual_field_name, "; $sql .= "field_name, ";
$sql .= "virtual_data_field_value, "; $sql .= "data_field_value, ";
$sql .= "virtual_data_add_user, "; $sql .= "data_add_user, ";
$sql .= "virtual_data_add_date "; $sql .= "data_add_date ";
$sql .= ")"; $sql .= ")";
$sql .= "values "; $sql .= "values ";
$sql .= "("; $sql .= "(";
$sql .= "'".uuid()."', "; $sql .= "'".uuid()."', ";
$sql .= "'$this->domain_uuid', "; $sql .= "'$this->domain_uuid', ";
$sql .= "'$this->virtual_data_row_uuid', "; $sql .= "'$this->data_row_uuid', ";
$sql .= "'$this->virtual_table_uuid', "; $sql .= "'$this->table_uuid', ";
$sql .= "'$this->virtual_field_name', "; $sql .= "'$this->field_name', ";
$sql .= "'$this->virtual_data_field_value', "; $sql .= "'$this->data_field_value', ";
$sql .= "'".$_SESSION["username"]."', "; $sql .= "'".$_SESSION["username"]."', ";
$sql .= "now() "; $sql .= "now() ";
$sql .= ")"; $sql .= ")";
@@ -173,14 +173,14 @@ if (count($_POST)>0) {
function db_update() { function db_update() {
global $db; global $db;
$sql = "update v_virtual_table_data set "; $sql = "update v_table_data set ";
$sql .= "virtual_data_row_uuid = '$this->virtual_data_row_uuid', "; $sql .= "data_row_uuid = '$this->data_row_uuid', ";
$sql .= "virtual_field_name = '$this->virtual_field_name', "; $sql .= "field_name = '$this->field_name', ";
$sql .= "virtual_data_field_value = '$this->virtual_data_field_value', "; $sql .= "data_field_value = '$this->data_field_value', ";
$sql .= "virtual_data_add_user = '".$_SESSION["username"]."', "; $sql .= "data_add_user = '".$_SESSION["username"]."', ";
$sql .= "virtual_data_add_date = now() "; $sql .= "data_add_date = now() ";
$sql .= "where domain_uuid = '$this->domain_uuid' "; $sql .= "where domain_uuid = '$this->domain_uuid' ";
$sql .= "and virtual_table_data_uuid = '$this->virtual_table_data_uuid' "; $sql .= "and table_data_uuid = '$this->table_data_uuid' ";
$db->exec($sql); $db->exec($sql);
unset($sql); unset($sql);
} }
@@ -209,7 +209,7 @@ if (count($_POST)>0) {
echo "<tr>\n"; echo "<tr>\n";
echo "<td width='30%' nowrap='nowrap' align='left' valign='top'><b>Import Results</b></td>\n"; echo "<td width='30%' nowrap='nowrap' align='left' valign='top'><b>Import Results</b></td>\n";
echo "<td width='70%' align='right' valign='top'>\n"; echo "<td width='70%' align='right' valign='top'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='virtual_tables_import.php?id=$virtual_table_uuid'\" value='Back'>\n"; echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='tables_import.php?id=$table_uuid'\" value='Back'>\n";
echo " <br /><br />\n"; echo " <br /><br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -224,25 +224,25 @@ if (count($_POST)>0) {
$x = 0; $x = 0;
$db->beginTransaction(); $db->beginTransaction();
foreach($name_array as $key => $val) { foreach($name_array as $key => $val) {
$virtual_field_label = trim($val); $field_label = trim($val);
$virtual_field_name = trim($val); $field_name = trim($val);
$virtual_field_name = str_replace(" ", "_", $virtual_field_name); $field_name = str_replace(" ", "_", $field_name);
$virtual_field_name = str_replace("-", "_", $virtual_field_name); $field_name = str_replace("-", "_", $field_name);
$virtual_field_name = strtolower($virtual_field_name); $field_name = strtolower($field_name);
$fields = new v_virtual_table_fields; $fields = new v_table_fields;
$fields->domain_uuid = $domain_uuid; $fields->domain_uuid = $domain_uuid;
$fields->virtual_table_uuid = $virtual_table_uuid; $fields->table_uuid = $table_uuid;
$fields->virtual_field_label = $virtual_field_label; $fields->field_label = $field_label;
$fields->virtual_field_name = $virtual_field_name; $fields->field_name = $field_name;
$fields->virtual_field_type = 'text'; $fields->field_type = 'text';
$fields->virtual_field_value = ''; $fields->field_value = '';
$fields->virtual_field_list_hidden = 'show'; $fields->field_list_hidden = 'show';
$fields->virtual_field_column = '1'; $fields->field_column = '1';
$fields->virtual_field_required = 'yes'; $fields->field_required = 'yes';
$fields->virtual_field_order = $x; $fields->field_order = $x;
$fields->virtual_field_order_tab = $x; $fields->field_order_tab = $x;
$fields->virtual_field_description = $virtual_field_label; $fields->field_description = $field_label;
$fields->db_insert(); $fields->db_insert();
unset($fields); unset($fields);
$x++; $x++;
@@ -254,28 +254,28 @@ if (count($_POST)>0) {
$x=0; $x=0;
foreach($value_array as $key => $val) { foreach($value_array as $key => $val) {
$virtual_field_label = trim($name_array[$x]); $field_label = trim($name_array[$x]);
$virtual_field_name = trim($name_array[$x]); $field_name = trim($name_array[$x]);
$virtual_field_name = str_replace(" ", "_", $virtual_field_name); $field_name = str_replace(" ", "_", $field_name);
$virtual_field_name = str_replace("-", "_", $virtual_field_name); $field_name = str_replace("-", "_", $field_name);
$virtual_field_name = strtolower($virtual_field_name); $field_name = strtolower($field_name);
$virtual_field_value = trim($val); $field_value = trim($val);
$data = new v_virtual_table_data; $data = new v_table_data;
$data->domain_uuid = $domain_uuid; $data->domain_uuid = $domain_uuid;
$data->virtual_table_uuid = $virtual_table_uuid; $data->table_uuid = $table_uuid;
if ($x == 0) { if ($x == 0) {
$virtual_data_row_uuid = uuid(); $data_row_uuid = uuid();
//echo "id: ".$virtual_data_row_uuid."<br />\n"; //echo "id: ".$data_row_uuid."<br />\n";
} }
$data->virtual_data_row_uuid = $virtual_data_row_uuid; $data->data_row_uuid = $data_row_uuid;
$data->virtual_field_name = $virtual_field_name; $data->field_name = $field_name;
$data->virtual_data_field_value = $virtual_field_value; $data->data_field_value = $field_value;
$data->db_insert(); $data->db_insert();
unset($data); unset($data);
echo "<strong>$virtual_field_name:</strong> $virtual_field_value<br/>\n"; echo "<strong>$field_name:</strong> $field_value<br/>\n";
$x++; $x++;
} }
echo "<hr size='1' />\n"; echo "<hr size='1' />\n";
@@ -305,7 +305,7 @@ if (count($_POST)>0) {
echo "<tr>\n"; echo "<tr>\n";
echo "<td width='30%' nowrap='nowrap' align='left' valign='top'><b>Import</b></td>\n"; echo "<td width='30%' nowrap='nowrap' align='left' valign='top'><b>Import</b></td>\n";
echo "<td width='70%' align='right' valign='top'>\n"; echo "<td width='70%' align='right' valign='top'>\n";
//echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='virtual_tables_import.php?id=$virtual_table_uuid'\" value='Back'>\n"; //echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='tables_import.php?id=$table_uuid'\" value='Back'>\n";
echo " <br /><br />\n"; echo " <br /><br />\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
+6 -6
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_delete')) { if (permission_exists('table_delete')) {
//access granted //access granted
} }
else { else {
@@ -37,16 +37,16 @@ else {
//get the http values //get the http values
if (count($_GET)>0) { if (count($_GET)>0) {
$id = check_str($_GET["id"]); $id = check_str($_GET["id"]);
$virtual_table_uuid = check_str($_GET["virtual_table_uuid"]); $table_uuid = check_str($_GET["table_uuid"]);
$virtual_table_field_uuid = check_str($_GET["virtual_table_field_uuid"]); $table_field_uuid = check_str($_GET["table_field_uuid"]);
} }
//delete the data //delete the data
if (strlen($id)>0) { if (strlen($id)>0) {
$sql = ""; $sql = "";
$sql .= "delete from v_virtual_table_name_values "; $sql .= "delete from v_table_name_values ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_name_value_uuid = '$id' "; $sql .= "and table_name_value_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute(); $prep_statement->execute();
unset($sql); unset($sql);
@@ -54,7 +54,7 @@ else {
//redirect the user //redirect the user
require_once "includes/header.php"; require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_table_fields_edit.php?virtual_table_uuid=$virtual_table_uuid&id=$virtual_table_field_uuid\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=table_fields_edit.php?table_uuid=$table_uuid&id=$table_field_uuid\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Delete Complete\n"; echo "Delete Complete\n";
echo "</div>\n"; echo "</div>\n";
+47 -47
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_edit')) { if (permission_exists('table_edit')) {
//access granted //access granted
} }
else { else {
@@ -37,38 +37,38 @@ else {
//action add or update //action add or update
if (isset($_REQUEST["id"])) { if (isset($_REQUEST["id"])) {
$action = "update"; $action = "update";
$virtual_table_name_value_uuid = check_str($_REQUEST["id"]); $table_name_value_uuid = check_str($_REQUEST["id"]);
} }
else { else {
$action = "add"; $action = "add";
} }
if (strlen($_GET["virtual_table_field_uuid"]) > 0) { if (strlen($_GET["table_field_uuid"]) > 0) {
$virtual_table_field_uuid = check_str($_GET["virtual_table_field_uuid"]); $table_field_uuid = check_str($_GET["table_field_uuid"]);
} }
//POST to PHP variables //POST to PHP variables
if (count($_POST)>0) { if (count($_POST)>0) {
//$domain_uuid = check_str($_POST["domain_uuid"]); //$domain_uuid = check_str($_POST["domain_uuid"]);
$virtual_data_types_name = check_str($_POST["virtual_data_types_name"]); $data_types_name = check_str($_POST["data_types_name"]);
$virtual_data_types_value = check_str($_POST["virtual_data_types_value"]); $data_types_value = check_str($_POST["data_types_value"]);
$virtual_table_uuid = $_REQUEST["virtual_table_uuid"]; $table_uuid = $_REQUEST["table_uuid"];
$virtual_table_field_uuid = $_REQUEST["virtual_table_field_uuid"]; $table_field_uuid = $_REQUEST["table_field_uuid"];
} }
if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
$msg = ''; $msg = '';
if ($action == "update") { if ($action == "update") {
$virtual_table_name_value_uuid = check_str($_POST["virtual_table_name_value_uuid"]); $table_name_value_uuid = check_str($_POST["table_name_value_uuid"]);
} }
//check for all required data //check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; } 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($table_uuid) == 0) { $msg .= "Please provide: table_uuid<br>\n"; }
if (strlen($virtual_table_field_uuid) == 0) { $msg .= "Please provide: virtual_table_field_uuid<br>\n"; } if (strlen($table_field_uuid) == 0) { $msg .= "Please provide: table_field_uuid<br>\n"; }
if (strlen($virtual_data_types_name) == 0) { $msg .= "Please provide: Name<br>\n"; } if (strlen($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($data_types_value) == 0) { $msg .= "Please provide: Value<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) { if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php"; require_once "includes/header.php";
require_once "includes/persistformvar.php"; require_once "includes/persistformvar.php";
@@ -85,29 +85,29 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//add or update the database //add or update the database
if ($_POST["persistformvar"] != "true") { if ($_POST["persistformvar"] != "true") {
if ($action == "add") { if ($action == "add") {
$sql = "insert into v_virtual_table_name_values "; $sql = "insert into v_table_name_values ";
$sql .= "("; $sql .= "(";
$sql .= "virtual_table_name_value_uuid, "; $sql .= "table_name_value_uuid, ";
$sql .= "domain_uuid, "; $sql .= "domain_uuid, ";
$sql .= "virtual_table_uuid, "; $sql .= "table_uuid, ";
$sql .= "virtual_table_field_uuid, "; $sql .= "table_field_uuid, ";
$sql .= "virtual_data_types_name, "; $sql .= "data_types_name, ";
$sql .= "virtual_data_types_value "; $sql .= "data_types_value ";
$sql .= ") "; $sql .= ") ";
$sql .= "values "; $sql .= "values ";
$sql .= "("; $sql .= "(";
$sql .= "'".uuid()."', "; $sql .= "'".uuid()."', ";
$sql .= "'".$_SESSION['domain_uuid']."', "; $sql .= "'".$_SESSION['domain_uuid']."', ";
$sql .= "'$virtual_table_uuid', "; $sql .= "'$table_uuid', ";
$sql .= "'$virtual_table_field_uuid', "; $sql .= "'$table_field_uuid', ";
$sql .= "'$virtual_data_types_name', "; $sql .= "'$data_types_name', ";
$sql .= "'$virtual_data_types_value' "; $sql .= "'$data_types_value' ";
$sql .= ")"; $sql .= ")";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "includes/header.php"; require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_table_fields_edit.php?virtual_table_uuid=$virtual_table_uuid&id=$virtual_table_field_uuid\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=table_fields_edit.php?table_uuid=$table_uuid&id=$table_field_uuid\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Add Complete\n"; echo "Add Complete\n";
echo "</div>\n"; echo "</div>\n";
@@ -116,18 +116,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
} //if ($action == "add") } //if ($action == "add")
if ($action == "update") { if ($action == "update") {
$sql = "update v_virtual_table_name_values set "; $sql = "update v_table_name_values set ";
$sql .= "virtual_data_types_name = '$virtual_data_types_name', "; $sql .= "data_types_name = '$data_types_name', ";
$sql .= "virtual_data_types_value = '$virtual_data_types_value' "; $sql .= "data_types_value = '$data_types_value' ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; $sql .= "and table_uuid = '$table_uuid' ";
$sql .= "and virtual_table_field_uuid = '$virtual_table_field_uuid' "; $sql .= "and table_field_uuid = '$table_field_uuid' ";
$sql .= "and virtual_table_name_value_uuid = '$virtual_table_name_value_uuid' "; $sql .= "and table_name_value_uuid = '$table_name_value_uuid' ";
$db->exec(check_sql($sql)); $db->exec(check_sql($sql));
unset($sql); unset($sql);
require_once "includes/header.php"; require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=virtual_table_fields_edit.php?virtual_table_uuid=$virtual_table_uuid&id=$virtual_table_field_uuid\">\n"; echo "<meta http-equiv=\"refresh\" content=\"2;url=table_fields_edit.php?table_uuid=$table_uuid&id=$table_field_uuid\">\n";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "Update Complete\n"; echo "Update Complete\n";
echo "</div>\n"; echo "</div>\n";
@@ -139,22 +139,22 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//pre-populate the form //pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") { if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$virtual_table_uuid = $_GET["virtual_table_uuid"]; $table_uuid = $_GET["table_uuid"];
$virtual_table_field_uuid = $_GET["virtual_table_field_uuid"]; $table_field_uuid = $_GET["table_field_uuid"];
$virtual_table_name_value_uuid = $_GET["id"]; $table_name_value_uuid = $_GET["id"];
$sql = ""; $sql = "";
$sql .= "select * from v_virtual_table_name_values "; $sql .= "select * from v_table_name_values ";
$sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "where domain_uuid = '$domain_uuid' ";
//$sql .= "and virtual_table_uuid = '$virtual_table_uuid' "; //$sql .= "and table_uuid = '$table_uuid' ";
$sql .= "and virtual_table_field_uuid = '$virtual_table_field_uuid' "; $sql .= "and table_field_uuid = '$table_field_uuid' ";
$sql .= "and virtual_table_name_value_uuid = '$virtual_table_name_value_uuid' "; $sql .= "and table_name_value_uuid = '$table_name_value_uuid' ";
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute(); $prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED); $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) { foreach ($result as &$row) {
$virtual_data_types_name = $row["virtual_data_types_name"]; $data_types_name = $row["data_types_name"];
$virtual_data_types_value = $row["virtual_data_types_value"]; $data_types_value = $row["data_types_value"];
break; //limit to 1 row break; //limit to 1 row
} }
unset ($prep_statement); unset ($prep_statement);
@@ -176,10 +176,10 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n"; echo "<tr>\n";
if ($action == "add") { if ($action == "add") {
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Virtual Table Data Types Name Value Add</b></td>\n"; echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Table Data Types Name Value Add</b></td>\n";
} }
if ($action == "update") { if ($action == "update") {
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Virtual Table Data Types Name Value Edit</b></td>\n"; echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>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 "<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";
@@ -194,7 +194,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Name:\n"; echo " Name:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='data_types_name' maxlength='255' value=\"$data_types_name\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the name.\n"; echo "Enter the name.\n";
echo "</td>\n"; echo "</td>\n";
@@ -205,17 +205,17 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " Value:\n"; echo " Value:\n";
echo "</td>\n"; echo "</td>\n";
echo "<td class='vtable' align='left'>\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 " <input class='formfld' type='text' name='data_types_value' maxlength='255' value=\"$data_types_value\">\n";
echo "<br />\n"; echo "<br />\n";
echo "Enter the value.\n"; echo "Enter the value.\n";
echo "</td>\n"; echo "</td>\n";
echo "</tr>\n"; echo "</tr>\n";
echo " <tr>\n"; echo " <tr>\n";
echo " <td colspan='2' align='right'>\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='table_uuid' value='$table_uuid'>\n";
echo " <input type='hidden' name='virtual_table_field_uuid' value='$virtual_table_field_uuid'>\n"; echo " <input type='hidden' name='table_field_uuid' value='$table_field_uuid'>\n";
if ($action == "update") { if ($action == "update") {
echo " <input type='hidden' name='virtual_table_name_value_uuid' value='$virtual_table_name_value_uuid'>\n"; echo " <input type='hidden' name='table_name_value_uuid' value='$table_name_value_uuid'>\n";
} }
echo " <input type='submit' name='submit' class='btn' value='Save'>\n"; echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " </td>\n"; echo " </td>\n";
+15 -15
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_edit')) { if (permission_exists('table_edit')) {
//access granted //access granted
} }
else { else {
@@ -60,9 +60,9 @@ require_once "includes/paging.php";
echo "</tr></table>\n"; echo "</tr></table>\n";
//$sql = ""; //$sql = "";
//$sql .= " select * from v_virtual_table_name_values "; //$sql .= " select * from v_table_name_values ";
//$sql .= " where domain_uuid = '$domain_uuid' "; //$sql .= " where domain_uuid = '$domain_uuid' ";
//$sql .= " and virtual_table_field_uuid = '$virtual_table_field_uuid' "; //$sql .= " and table_field_uuid = '$table_field_uuid' ";
//if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } //if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
//$prep_statement = $db->prepare(check_sql($sql)); //$prep_statement = $db->prepare(check_sql($sql));
//$prep_statement->execute(); //$prep_statement->execute();
@@ -77,9 +77,9 @@ require_once "includes/paging.php";
//$offset = $rows_per_page * $page; //$offset = $rows_per_page * $page;
$sql = ""; $sql = "";
$sql .= " select * from v_virtual_table_name_values "; $sql .= " select * from v_table_name_values ";
$sql .= " where domain_uuid = '$domain_uuid' "; $sql .= " where domain_uuid = '$domain_uuid' ";
$sql .= " and virtual_table_field_uuid = '$virtual_table_field_uuid' "; $sql .= " and table_field_uuid = '$table_field_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
//$sql .= " limit $rows_per_page offset $offset "; //$sql .= " limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
@@ -95,23 +95,23 @@ require_once "includes/paging.php";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n"; echo "<tr>\n";
echo th_order_by('virtual_data_types_name', 'Name', $order_by, $order); echo th_order_by('data_types_name', 'Name', $order_by, $order);
echo th_order_by('virtual_data_types_value', 'Value', $order_by, $order); echo th_order_by('data_types_value', 'Value', $order_by, $order);
echo "<td align='right' width='42'>\n"; echo "<td align='right' width='42'>\n";
echo " <a href='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 " <a href='table_data_types_name_value_edit.php?table_uuid=".$row[table_uuid]."&table_field_uuid=".$row[table_field_uuid]."' alt='add'>$v_link_label_add</a>\n";
echo "</td>\n"; echo "</td>\n";
echo "<tr>\n"; echo "<tr>\n";
if ($result_count > 0) { if ($result_count > 0) {
foreach($result as $row) { foreach($result as $row) {
echo "<tr >\n"; 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[data_types_name]."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[virtual_data_types_value]."</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row[data_types_value]."</td>\n";
echo " <td valign='top' align='right'>\n"; echo " <td valign='top' align='right'>\n";
echo " <a href='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_name_value_uuid]."' alt='edit'>$v_link_label_edit</a>\n"; echo " <a href='table_data_types_name_value_edit.php?table_uuid=".$row[table_uuid]."&table_field_uuid=".$row[table_field_uuid]."&id=".$row[table_name_value_uuid]."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='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_name_value_uuid]."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n"; echo " <a href='table_data_types_name_value_delete.php?table_uuid=".$row[table_uuid]."&table_field_uuid=".$row[table_field_uuid]."&id=".$row[table_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='virtual_table_data_types_name_value_edit.php?id=".$row[virtual_table_name_value_uuid]."'\" value='e'>\n"; //echo " <input type='button' class='btn' name='' alt='edit' onclick=\"window.location='table_data_types_name_value_edit.php?id=".$row[table_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='virtual_table_data_types_name_value_delete.php?id=".$row[virtual_table_name_value_uuid]."' }\" value='x'>\n"; //echo " <input type='button' class='btn' name='' alt='delete' onclick=\"if (confirm('Are you sure you want to delete this?')) { window.location='table_data_types_name_value_delete.php?id=".$row[table_name_value_uuid]."' }\" value='x'>\n";
echo " </td>\n"; echo " </td>\n";
echo "</tr>\n"; echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; } if ($c==0) { $c=1; } else { $c=0; }
@@ -127,7 +127,7 @@ require_once "includes/paging.php";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n"; echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
//echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n"; //echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n"; echo " <td width='33.3%' align='right'>\n";
echo " <a href='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 " <a href='table_data_types_name_value_edit.php?table_uuid=".$row[table_uuid]."&table_field_uuid=".$row[table_field_uuid]."' alt='add'>$v_link_label_add</a>\n";
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";
echo " </table>\n"; echo " </table>\n";
+19 -19
View File
@@ -26,7 +26,7 @@
require_once "root.php"; require_once "root.php";
require_once "includes/require.php"; require_once "includes/require.php";
require_once "includes/checkauth.php"; require_once "includes/checkauth.php";
if (permission_exists('virtual_tables_view')) { if (permission_exists('table_view')) {
//access granted //access granted
} }
else { else {
@@ -60,7 +60,7 @@ require_once "includes/paging.php";
echo "</tr>\n"; echo "</tr>\n";
echo "</tr></table>\n"; echo "</tr></table>\n";
$sql = " select * from v_virtual_tables "; $sql = " select * from v_tables ";
$sql .= " where domain_uuid = '$domain_uuid' "; $sql .= " where domain_uuid = '$domain_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$prep_statement = $db->prepare(check_sql($sql)); $prep_statement = $db->prepare(check_sql($sql));
@@ -75,7 +75,7 @@ require_once "includes/paging.php";
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page); list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page; $offset = $rows_per_page * $page;
$sql = " select * from v_virtual_tables "; $sql = " select * from v_tables ";
$sql .= " where domain_uuid = '$domain_uuid' "; $sql .= " where domain_uuid = '$domain_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; } if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$sql .= " limit $rows_per_page offset $offset "; $sql .= " limit $rows_per_page offset $offset ";
@@ -92,14 +92,14 @@ require_once "includes/paging.php";
echo "<div align='center'>\n"; echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n"; echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n"; echo "<tr>\n";
echo th_order_by('virtual_table_label', 'Label', $order_by, $order); echo th_order_by('table_label', 'Label', $order_by, $order);
echo th_order_by('virtual_table_name', 'Table Name', $order_by, $order); echo th_order_by('table_name', 'Table Name', $order_by, $order);
echo th_order_by('virtual_table_auth', 'Authentication', $order_by, $order); echo th_order_by('table_auth', 'Authentication', $order_by, $order);
echo th_order_by('virtual_table_description', 'Description', $order_by, $order); echo th_order_by('table_description', 'Description', $order_by, $order);
//echo "<th align='center'>View</th>\n"; //echo "<th align='center'>View</th>\n";
echo "<td align='right' width='42'>\n"; echo "<td align='right' width='42'>\n";
if (permission_exists('virtual_tables_add')) { if (permission_exists('tables_add')) {
echo " <a href='virtual_tables_edit.php' alt='add'>$v_link_label_add</a>\n"; echo " <a href='table_edit.php' alt='add'>$v_link_label_add</a>\n";
} }
echo "</td>\n"; echo "</td>\n";
echo "<tr>\n"; echo "<tr>\n";
@@ -110,16 +110,16 @@ require_once "includes/paging.php";
else { //received results else { //received results
foreach($result as $row) { foreach($result as $row) {
echo "<tr >\n"; echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_table_label']."&nbsp;</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['table_label']."&nbsp;</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['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['table_auth']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['virtual_table_description']."&nbsp;</td>\n"; echo " <td valign='top' class='".$row_style[$c]."'>".$row['table_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n"; echo " <td valign='top' align='right'>\n";
if (permission_exists('virtual_tables_edit')) { if (permission_exists('table_edit')) {
echo " <a href='virtual_tables_edit.php?id=".$row['virtual_table_uuid']."' alt='edit'>$v_link_label_edit</a>\n"; echo " <a href='table_edit.php?id=".$row['table_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
} }
if (permission_exists('virtual_tables_delete')) { if (permission_exists('table_delete')) {
echo " <a href='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 " <a href='table_delete.php?id=".$row['table_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
} }
echo " </td>\n"; echo " </td>\n";
echo "</tr>\n"; echo "</tr>\n";
@@ -135,8 +135,8 @@ require_once "includes/paging.php";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n"; echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n"; echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n"; echo " <td width='33.3%' align='right'>\n";
if (permission_exists('virtual_tables_add')) { if (permission_exists('tables_add')) {
echo " <a href='virtual_tables_edit.php' alt='add'>$v_link_label_add</a>\n"; echo " <a href='table_edit.php' alt='add'>$v_link_label_add</a>\n";
} }
echo " </td>\n"; echo " </td>\n";
echo " </tr>\n"; echo " </tr>\n";