Multilinguified Schemas

This commit is contained in:
Nate Jones 2013-06-21 16:02:05 +00:00
parent 5a94de2769
commit 2c50b240bf
14 changed files with 482 additions and 300 deletions

View File

@ -0,0 +1,119 @@
<?php
$text['title-schemas']['en-us'] = 'Schemas';
$text['title-schema']['en-us'] = 'Schema';
$text['title-field']['en-us'] = 'Field';
$text['title-name_value']['en-us'] = 'Select Box Option';
$text['title-data_view']['en-us'] = 'Schema Data View';
$text['title-data']['en-us'] = 'Schema Data';
$text['title-import']['en-us'] = 'Schema Import';
$text['title-import_results']['en-us'] = 'Schema Import Results';
$text['header-schemas']['en-us'] = 'Schemas';
$text['header-schema']['en-us'] = 'Schema';
$text['header-fields']['en-us'] = 'Fields';
$text['header-field']['en-us'] = 'Field';
$text['header-name_values']['en-us'] = 'Select Box Options';
$text['header-name_value']['en-us'] = 'Select Box Option';
$text['header-data_view']['en-us'] = 'Schema Data View';
$text['header-data']['en-us'] = 'Schema Data';
$text['header-import']['en-us'] = 'Schema Import';
$text['header-import_results']['en-us'] = 'Schema Import Results';
$text['description-schemas']['en-us'] = 'Provides the ability to quickly define information to store and dynamically makes tools available to view, add, edit, delete, and search.';
$text['description-schema']['en-us'] = 'Define the properties of the schema below.';
$text['description-fields']['en-us'] = 'Lists the fields in the database.';
$text['description-field']['en-us'] = 'Define the properties of the field below.';
$text['description-name_values']['en-us'] = 'Name and value pairs of the Select Box.';
$text['description-name_value']['en-us'] = 'Define a name and value pair for the Select Box.';
$text['label-category']['en-us'] = 'Category';
$text['label-label']['en-us'] = 'Label';
$text['label-name']['en-us'] = 'Name';
$text['label-schema_name']['en-us'] = 'Schema Name';
$text['label-authentication']['en-us'] = 'Authentication';
$text['label-parent_schema']['en-us'] = 'Parent Schema';
$text['label-description']['en-us'] = 'Description';
$text['label-field_label']['en-us'] = 'Label';
$text['label-field_name']['en-us'] = 'Name';
$text['label-field_type']['en-us'] = 'Type';
$text['label-field_value']['en-us'] = 'Value';
$text['label-field_visibility']['en-us'] = 'Visibility';
$text['label-field_column']['en-us'] = 'Column';
$text['label-field_required']['en-us'] = 'Required';
$text['label-field_search_by']['en-us'] = 'Search By';
$text['label-field_order']['en-us'] = 'Field Order';
$text['label-field_tab_order']['en-us'] = 'Tab Order';
$text['label-field_description']['en-us'] = 'Description';
$text['label-name_value_name']['en-us'] = 'Name';
$text['label-name_value_value']['en-us'] = 'Value';
$text['label-import_data']['en-us'] = 'Data';
$text['label-import_delimiter']['en-us'] = 'Delimiter';
$text['label-import_enclosure']['en-us'] = 'Enclosure';
$text['description-category']['en-us'] = 'Select the category.';
$text['description-label']['en-us'] = 'Enter the label.';
$text['description-name']['en-us'] = 'Enter the schema name.';
$text['description-authentication']['en-us'] = 'Choose whether to require authentication.';
$text['description-parent_schema']['en-us'] = 'Select a parent schema.';
$text['description-description']['en-us'] = 'Enter a description (optional).';
$text['description-field_label']['en-us'] = 'Enter the field label.';
$text['description-field_name']['en-us'] = 'Enter field name.';
$text['description-field_type']['en-us'] = 'Select the field type.';
$text['description-field_value']['en-us'] = 'Enter the default value.';
$text['description-field_visibility']['en-us'] = 'Choose whether the field is hidden from the list.';
$text['description-field_search_by']['en-us'] = 'Choose whether the field will be used for searches.';
$text['description-field_column']['en-us'] = 'Determines which column to show the field in.';
$text['description-field_required']['en-us'] = 'Choose whether the field is required.';
$text['description-field_order']['en-us'] = 'Enter the order of the field.';
$text['description-field_tab_order']['en-us'] = 'Enter the tab order.';
$text['description-field_description']['en-us'] = 'Enter the description (optional).';
$text['description-name_value_name']['en-us'] = 'Enter the option text.';
$text['description-name_value_value']['en-us'] = 'Enter the option value.';
$text['description-import_data']['en-us'] = 'Copy and paste the comma delimitted data into the text area to begin the import.';
$text['description-import_delimiter']['en-us'] = 'Select the field/column delimiter.';
$text['description-import_enclosure']['en-us'] = 'Select the field/column data enclosure.';
$text['option-true']['en-us'] = 'True';
$text['option-false']['en-us'] = 'False';
$text['option-fusionpbx']['en-us'] = 'FusionPBX';
$text['option-other']['en-us'] = 'Other';
$text['option-visible']['en-us'] = 'Visible';
$text['option-hidden']['en-us'] = 'Hidden';
$text['option-text']['en-us'] = 'Text';
$text['option-number']['en-us'] = 'Number';
$text['option-date']['en-us'] = 'Date';
$text['option-email']['en-us'] = 'Email';
$text['option-label']['en-us'] = 'Label';
$text['option-phone']['en-us'] = 'Phone';
$text['option-check_box']['en-us'] = 'Check Box';
$text['option-text_area']['en-us'] = 'Text Area';
$text['option-select']['en-us'] = 'Select';
$text['option-hidden']['en-us'] = 'Hidden';
$text['option-uuid']['en-us'] = 'UUID';
$text['option-password']['en-us'] = 'Password';
$text['option-pin_number']['en-us'] = 'PIN Number';
$text['option-image_upload']['en-us'] = 'Image Upload';
$text['option-file_upload']['en-us'] = 'File Upload';
$text['option-url']['en-us'] = 'URL';
$text['option-modified_date']['en-us'] = 'Modified Date';
$text['option-modified_user']['en-us'] = 'Modified User';
$text['button-add']['en-us'] = 'Add';
$text['button-edit']['en-us'] = 'Edit';
$text['button-delete']['en-us'] = 'Delete';
$text['button-back']['en-us'] = 'Back';
$text['button-save']['en-us'] = 'Save';
$text['button-view']['en-us'] = 'View';
$text['button-import']['en-us'] = 'Import';
$text['button-search_all']['en-us'] = 'Search All';
$text['button-prev']['en-us'] = 'Previous';
$text['button-next']['en-us'] = 'Next';
$text['confirm-delete']['en-us'] = 'Do you really want to delete this?';
$text['message-add']['en-us'] = 'Add Completed';
$text['message-update']['en-us'] = 'Update Completed';
$text['message-delete']['en-us'] = 'Delete Completed';
$text['message-required']['en-us'] = 'Please provide: ';
?>

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
if (count($_GET)>0) {
//declare variable(s)
@ -94,7 +100,7 @@ if (count($_GET)>0) {
//show a message to the user before the redirect
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//set http get variables to php variables
$search_all = check_str($_GET["search_all"]);
$schema_uuid = check_str($_GET["schema_uuid"]);
@ -357,8 +363,8 @@ else {
//show a message to the user before the redirect
echo "<div align='center'>\n";
if ($action == "add") { echo "Add Complete\n"; }
if ($action == "update") { echo "Update Complete\n"; }
if ($action == "add") { echo $text['message-add']."\n"; }
if ($action == "update") { echo $text['message-update']."\n"; }
echo "</div>\n";
require_once "includes/footer.php";
return;
@ -366,6 +372,7 @@ else {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-data'];
//pre-populate the form
if ($action == "update") {
@ -431,7 +438,7 @@ else {
}
//detect a new row id
if ($previous_row_id != $row['data_row_uuid']) {
if ($row_id_found) {
if ($row_id_found) {
if (!$next_row_id_found) {
//make sure it is not the current row id
if ($data_row_uuid != $row['data_row_uuid']) {
@ -458,7 +465,7 @@ else {
$total_records = $x;
//set record number
if (strlen($_GET["n"]) == 0) {
if (strlen($_GET["n"]) == 0) {
$n = 1;
}
else {
@ -472,25 +479,24 @@ else {
//echo "<script language=\"javascript\" src=\"/includes/calendar_lw_layers.js\"></script>\n";
//echo "<script language=\"javascript\" src=\"/includes/calendar_lw_menu.js\"></script>";
//begin creating the content
//begin creating the content
echo "<br />";
//get the title and description of the schema
echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n";
echo " <tr>\n";
echo " <td width='50%' valign='top' nowrap='nowrap'>\n";
echo " <b>$schema_label \n";
echo " <b>$schema_label ";
if ($action == "add") {
echo " Add\n";
echo $text['button-add']."\n";
}
else {
echo "Edit\n";
echo $text['button-edit']."\n";
}
echo " </b>\n";
echo " &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n";
if ($action == "update" && permission_exists('schema_data_edit')) {
echo " <input type='button' class='btn' name='' alt='add' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_uuid'\" value='Add'>\n";
//echo " <input type='button' class='btn' name='' alt='delete' onclick=\"if (confirm('Do you really want to delete this?')){window.location='schema_delete.php?id=".$schema_uuid."&?data_row_uuid=".$data_row_uuid."&data_parent_row_uuid=$data_parent_row_uuid';}\" value='Delete'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-add']."' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_uuid'\" value='".$text['button-add']."'>\n";
}
echo " <br />\n";
echo " $schema_description\n";
@ -502,21 +508,19 @@ else {
echo "<td align='center' valign='top' nowrap='nowrap'>\n";
if ($action == "update" && permission_exists('schema_data_edit')) {
//echo " <input type='button' class='btn' name='' alt='first' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_uuid&data_row_uuid=".$first_data_row_uuid."'\" value='First'>\n";
if (strlen($previous_data_row_uuid) == 0) {
echo " <input type='button' class='btn' name='' alt='prev' disabled='disabled' value='Prev'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-prev']."' disabled='disabled' value='".$text['button-prev']."'>\n";
}
else {
echo " <input type='button' class='btn' name='' alt='prev' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_uuid&data_row_uuid=".$previous_data_row_uuid."&search_all=$search_all&n=".($n-1)."'\" value='Prev ".$previous_record_id."'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-prev']."' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_uuid&data_row_uuid=".$previous_data_row_uuid."&search_all=$search_all&n=".($n-1)."'\" value='".$text['button-prev']." ".$previous_record_id."'>\n";
}
echo " <input type='button' class='btn' name='' alt='prev' value='".$record_number_array[$data_row_uuid]." of $total_records'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-prev']."' value='".$record_number_array[$data_row_uuid]." (".$total_records.")'>\n";
if (strlen($next_data_row_uuid) == 0) {
echo " <input type='button' class='btn' name='' alt='next' disabled='disabled' value='Next'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-next']."' disabled='disabled' value='".$text['button-next']."'>\n";
}
else {
echo " <input type='button' class='btn' name='' alt='next' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_uuid&data_row_uuid=".$next_data_row_uuid."&search_all=$search_all&n=".($n+1)."'\" value='Next ".$next_record_id."'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-next']."' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_uuid&data_row_uuid=".$next_data_row_uuid."&search_all=$search_all&n=".($n+1)."'\" value='".$text['button-next']." ".$next_record_id."'>\n";
}
//echo " <input type='button' class='btn' name='' alt='last' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_uuid&data_row_uuid=".$last_data_row_uuid."'\" value='Last'>\n";
}
echo " &nbsp;&nbsp;&nbsp;";
echo " &nbsp;&nbsp;&nbsp;";
@ -530,18 +534,18 @@ else {
//echo " <input type='hidden' name='data_parent_row_uuid' value='$data_parent_row_uuid'>\n";
//echo " <input type='hidden' name='data_row_uuid' value='$first_data_row_uuid'>\n";
echo " <input class='formfld' type='text' name='search_all' value='$search_all'>\n";
echo " <input class='btn' type='submit' name='submit' value='Search All'>\n";
echo " <input class='btn' type='submit' name='submit' value='".$text['button-search_all']."'>\n";
echo "</td>\n";
echo "</form>\n";
echo "<td width='5%' align='right' valign='top' nowrap='nowrap'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='schema_data_view.php?id=$schema_uuid'\" value='Back'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='schema_data_view.php?id=$schema_uuid'\" value='".$text['button-back']."'>\n";
echo "</td>\n";
}
else {
echo " <td width='50%' align='right'>\n";
//echo " <input type='button' class='btn' name='' alt='prev' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_parent_id&data_row_uuid=$data_parent_row_uuid'\" value='Prev'>\n";
//echo " <input type='button' class='btn' name='' alt='next' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_parent_id&data_row_uuid=$data_parent_row_uuid'\" value='Next'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_parent_id&data_row_uuid=$data_parent_row_uuid'\" value='Back'>\n";
//echo " <input type='button' class='btn' name='' alt='".$text['button-prev']."' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_parent_id&data_row_uuid=$data_parent_row_uuid'\" value='".$text['button-prev']."'>\n";
//echo " <input type='button' class='btn' name='' alt='".$text['button-next']."' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_parent_id&data_row_uuid=$data_parent_row_uuid'\" value='".$text['button-next']."'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='schema_data_edit.php?schema_uuid=$schema_parent_id&data_row_uuid=$data_parent_row_uuid'\" value='".$text['button-back']."'>\n";
echo " </td>\n";
}
echo " </tr>\n";
@ -711,16 +715,16 @@ else {
echo "<tr>\n";
switch ($row['field_name']) {
case "true":
echo "<td>True</td><td width='50'><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' checked='checked' value='true' /></td>\n";
echo "<td>False</td><td><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='false'></td>\n";
echo "<td>".$text['option-true']."</td><td width='50'><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' checked='checked' value='true' /></td>\n";
echo "<td>".$text['option-false']."</td><td><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='false'></td>\n";
break;
case "false":
echo "<td>True</td><td width='50'><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='true' /></td>\n";
echo "<td>False</td><td><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' checked='checked' value='false' /></td>\n";
echo "<td>".$text['option-true']."</td><td width='50'><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='true' /></td>\n";
echo "<td>".$text['option-false']."</td><td><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' checked='checked' value='false' /></td>\n";
break;
default:
echo "<td>True</td><td width='50'><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='true' /></td>\n";
echo "<td>False</td><td><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='false' /></td>\n";
echo "<td>".$text['option-true']."</td><td width='50'><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='true' /></td>\n";
echo "<td>".$text['option-false']."</td><td><input tabindex='".$row['field_order_tab']."' class='formfld' style='width:90%' type='checkbox' name='".$x."field_value' value='false' /></td>\n";
}
echo "</tr>\n";
@ -893,7 +897,7 @@ else {
echo "<a href='download.php?f=".$data_row[$row['field_name']]."'>".$data_row[$row['field_name']]."</a>";
echo "</td>";
echo "<td align='right'>";
echo "<input tabindex='".$row['field_order_tab']."' type='button' class='btn' title='delete' onclick=\"document.getElementById('".$row['field_name']."').innerHTML=".$row['field_name']."\" value='x'>\n";
echo "<input tabindex='".$row['field_order_tab']."' type='button' class='btn' title='".$text['button-delete']."' onclick=\"document.getElementById('".$row['field_name']."').innerHTML=".$row['field_name']."\" value='x'>\n";
echo "</td>";
echo "</tr>";
echo "</table>";
@ -934,11 +938,11 @@ else {
echo " <tr>\n";
echo " <td colspan='999' align='right'>\n";
if ($action == "add" && permission_exists('schema_data_add')) {
echo " <input type='submit' class='btn' name='submit' value='save'>\n";
echo " <input type='submit' class='btn' name='submit' value='".$text['button-save']."'>\n";
}
if ($action == "update" && permission_exists('schema_data_edit')) {
echo " <input type='hidden' name='data_row_uuid' value='$data_row_uuid'>\n";
echo " <input type='submit' tabindex='9999999' class='btn' name='submit' value='Save'>\n";
echo " <input type='submit' tabindex='9999999' class='btn' name='submit' value='".$text['button-save']."'>\n";
}
echo " </td>\n";
echo " </tr>\n";

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
if (strlen($_GET["id"]) > 0) {
$schema_uuid = check_str($_GET["id"]);
if (strlen($_GET["data_parent_row_uuid"])>0) {
@ -44,15 +50,16 @@ if (strlen($_GET["id"]) > 0) {
//used for changing the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
$order = $_GET["order"];
//used to alternate colors when paging
//used to alternate colors when paging
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-data_view'];
//get the information about the schema by using the id
$sql = "select * from v_schemas ";
@ -255,7 +262,7 @@ if (strlen($_GET["id"]) > 0) {
echo " <input class='formfld' type='text' name='search_all' value=\"$search_all\">\n";
echo " <input type='hidden' name='id' value='$schema_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='".$text['button-search_all']."'>\n";
echo "</form>\n";
}
echo " </td>\n";
@ -275,7 +282,7 @@ if (strlen($_GET["id"]) > 0) {
else {
$param = "&id=$schema_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;
//list the data in the database
@ -297,7 +304,7 @@ if (strlen($_GET["id"]) > 0) {
}
echo "<td align='right' width='42'>\n";
if (permission_exists('schema_data_add')) {
echo " <a href='schema_data_edit.php?schema_uuid=".$schema_uuid."&data_parent_row_uuid=$data_parent_row_uuid' alt='add'>$v_link_label_add</a>\n";
echo " <a href='schema_data_edit.php?schema_uuid=".$schema_uuid."&data_parent_row_uuid=$data_parent_row_uuid' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "</tr>\n";
@ -351,14 +358,14 @@ if (strlen($_GET["id"]) > 0) {
echo "<td valign='top' align='right' nowrap='nowrap'>\n";
if (permission_exists('schema_data_edit')) {
if (strlen($data_parent_row_uuid) == 0) {
echo " <a href='schema_data_edit.php?schema_uuid=".$row["schema_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";
echo " <a href='schema_data_edit.php?schema_uuid=".$row["schema_uuid"]."&data_parent_row_uuid=$data_parent_row_uuid&data_row_uuid=".$row['data_row_uuid']."&search_all=$search_all' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
else {
echo " <a href='schema_data_edit.php?schema_uuid=".$row["schema_uuid"]."&data_parent_row_uuid=$data_parent_row_uuid&data_row_uuid=".$row['data_row_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='schema_data_edit.php?schema_uuid=".$row["schema_uuid"]."&data_parent_row_uuid=$data_parent_row_uuid&data_row_uuid=".$row['data_row_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
}
if (permission_exists('schema_delete')) {
echo" <a href='schema_delete.php?data_row_uuid=".$row['data_row_uuid']."&data_parent_row_uuid=$data_parent_row_uuid&schema_uuid=".$schema_uuid."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo" <a href='schema_delete.php?data_row_uuid=".$row['data_row_uuid']."&data_parent_row_uuid=$data_parent_row_uuid&schema_uuid=".$schema_uuid."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo "</td>\n";
@ -375,7 +382,7 @@ if (strlen($_GET["id"]) > 0) {
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('schema_data_add')) {
echo " <a href='schema_data_edit.php?schema_uuid=".$schema_uuid."&data_parent_row_uuid=$data_parent_row_uuid' alt='add'>$v_link_label_add</a>\n";
echo " <a href='schema_data_edit.php?schema_uuid=".$schema_uuid."&data_parent_row_uuid=$data_parent_row_uuid' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//get the http get variable
if (count($_GET)>0) {
$id = check_str($_GET["id"]);
@ -54,7 +60,7 @@ if (strlen($id) > 0) {
//redirect the user
echo "<meta http-equiv=\"refresh\" content=\"2;url=schemas.php\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
//show the footer

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
@ -64,14 +70,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
//if (strlen($schema_category) == 0) { $msg .= "Please provide: Schema Category<br>\n"; }
//if (strlen($schema_label) == 0) { $msg .= "Please provide: Label<br>\n"; }
if (strlen($schema_name) == 0) { $msg .= "Please provide: Schema Name<br>\n"; }
//if (strlen($schema_auth) == 0) { $msg .= "Please provide: Authentication<br>\n"; }
//if (strlen($schema_captcha) == 0) { $msg .= "Please provide: Captcha<br>\n"; }
//if (strlen($schema_parent_uuid) == 0) { $msg .= "Please provide: Parent Schema<br>\n"; }
//if (strlen($schema_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
if (strlen($schema_name) == 0) { $msg .= $text['message-required'].$text['label-schema_name']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@ -124,7 +123,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=schemas.php\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@ -152,7 +151,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=schemas.php\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@ -184,6 +183,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-schema'];
//show the content
echo "<div align='center'>";
@ -196,78 +196,78 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>Schema</b></td>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>".$text['header-schema']."</b></td>\n";
echo "<td width='70%' align='right'>\n";
if (strlen($schema_uuid) > 0) {
echo " <input type='button' class='btn' name='' alt='view' onclick=\"window.location='schema_data_view.php?id=".$row["schema_uuid"]."'\" value='View'>&nbsp;&nbsp;\n";
echo " <input type='button' class='btn' name='' alt='import' onclick=\"window.location='schema_import.php?id=".$row["schema_uuid"]."'\" value='Import'>&nbsp;&nbsp;\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-view']."' onclick=\"window.location='schema_data_view.php?id=".$row["schema_uuid"]."'\" value='".$text['button-view']."'>&nbsp;&nbsp;\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-import']."' onclick=\"window.location='schema_import.php?id=".$row["schema_uuid"]."'\" value='".$text['button-import']."'>&nbsp;&nbsp;\n";
}
include "export/index.php";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='schemas.php'\" value='Back'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='schemas.php'\" value='".$text['button-back']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"left\" colspan='2'>\n";
echo "Provides the ability to quickly define information to store and dynamically makes tools available to view, add, edit, delete, and search. <br /><br />\n";
echo $text['description-schema']."<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Category:\n";
echo " ".$text['label-category'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$select_name = 'v_schemas';$field_name = 'schema_category';$sql_where_optional = "";$field_current_value = $schema_category;
echo html_select_other($db, $select_name, $field_name, $sql_where_optional, $field_current_value);
echo "Select the category.\n";
echo $text['description-category']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Label:\n";
echo " ".$text['label-label'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='schema_label' maxlength='255' value=\"$schema_label\">\n";
echo "<br />\n";
echo "Enter the label.\n";
echo $text['description-label']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " Name:\n";
echo " ".$text['label-name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='schema_name' maxlength='255' value=\"$schema_name\">\n";
echo "<br />\n";
echo "Enter the schema name.\n";
echo $text['description-name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Authentication:\n";
echo " ".$text['label-authentication'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='schema_auth'>\n";
echo " <option value=''></option>\n";
if ($schema_auth == "yes") {
echo " <option value='yes' SELECTED >yes</option>\n";
if ($schema_auth == "yes") {
echo " <option value='yes' SELECTED >".$text['option-true']."</option>\n";
}
else {
echo " <option value='yes'>yes</option>\n";
echo " <option value='yes'>".$text['option-true']."</option>\n";
}
if ($schema_auth == "no") {
echo " <option value='no' SELECTED >no</option>\n";
if ($schema_auth == "no") {
echo " <option value='no' SELECTED >".$text['option-false']."</option>\n";
}
else {
echo " <option value='no'>no</option>\n";
echo " <option value='no'>".$text['option-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Choose whether to require authentication.\n";
echo $text['description-authentication']."\n";
echo "</td>\n";
echo "</tr>\n";
@ -278,13 +278,13 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//echo "<td class='vtable' align='left'>\n";
//echo " <select class='formfld' name='schema_captcha'>\n";
//echo " <option value=''></option>\n";
//if ($schema_captcha == "yes") {
//if ($schema_captcha == "yes") {
// echo " <option value='yes' SELECTED >yes</option>\n";
//}
//else {
// echo " <option value='yes'>yes</option>\n";
//}
//if ($schema_captcha == "no") {
//if ($schema_captcha == "no") {
// echo " <option value='no' SELECTED >no</option>\n";
//}
//else {
@ -298,7 +298,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Parent Schema:\n";
echo " ".$text['label-parent_schema'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
@ -306,6 +306,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <option value=''></option>\n";
$sql = "select * from v_schemas ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and schema_name not like '".$schema_name."'";
$prep_statement = $db->prepare($sql);
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
@ -320,18 +321,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " </select>\n";
echo "<br />\n";
echo "Select a parent schema.\n";
echo $text['description-parent_schema']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Description:\n";
echo " ".$text['label-description'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <textarea class='formfld' name='schema_description' rows='4'>$schema_description</textarea>\n";
echo "<br />\n";
echo "Enter a description.\n";
echo $text['description-description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
@ -340,7 +341,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo " <input type='hidden' name='schema_uuid' value='$schema_uuid'>\n";
}
echo " <input type='hidden' name='schema_captcha' value='$schema_captcha'>\n";
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//get the http values
if (count($_GET) > 0) {
$id = check_str($_GET["id"]);
@ -54,7 +60,7 @@ else {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=schema_edit.php?id=$schema_uuid\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//set the action as an add or update
if (isset($_REQUEST["id"])) {
$action = "update";
@ -71,18 +77,14 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
//if (strlen($field_label) == 0) { $msg .= "Please provide: Label<br>\n"; }
if (strlen($field_name) == 0 && $field_type != "label") { $msg .= "Please provide: Name<br>\n"; }
if (strlen($field_type) == 0) { $msg .= "Please provide: Type<br>\n"; }
//if (strlen($field_value) == 0) { $msg .= "Please provide: Value<br>\n"; }
if (strlen($field_list_hidden) == 0) { $msg .= "Please provide: List Visibility<br>\n"; }
//if (strlen($field_search_by) == 0) { $msg .= "Please provide: Search By<br>\n"; }
if (strlen($field_column) == 0) { $msg .= "Please provide: Column<br>\n"; }
if (strlen($field_required) == 0) { $msg .= "Please provide: Required<br>\n"; }
if (strlen($field_order) == 0) { $msg .= "Please provide: Field Order<br>\n"; }
if (strlen($field_order_tab) == 0) { $msg .= "Please provide: Tab Order<br>\n"; }
//if (strlen($field_description) == 0) { $msg .= "Please provide: Description<br>\n"; }
if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
if (strlen($field_name) == 0 && $field_type != "label") { $msg .= $text['message-required'].$text['label-field_name']."<br>\n"; }
if (strlen($field_type) == 0) { $msg .= $text['message-required'].$text['label-field_type']."<br>\n"; }
if (strlen($field_list_hidden) == 0) { $msg .= $text['message-required'].$text['label-field_visibility']."<br>\n"; }
if (strlen($field_column) == 0) { $msg .= $text['message-required'].$text['label-field_column']."<br>\n"; }
if (strlen($field_required) == 0) { $msg .= $text['message-required'].$text['label-field_required']."<br>\n"; }
if (strlen($field_order) == 0) { $msg .= $text['message-required'].$text['label-field_order']."<br>\n"; }
if (strlen($field_order_tab) == 0) { $msg .= $text['message-required'].$text['label-field_tab_order']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@ -140,7 +142,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=schema_edit.php?id=$schema_uuid\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@ -168,7 +170,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=schema_edit.php?id=$schema_uuid\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@ -207,6 +209,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-field'];
//begin the content
echo "<div align='center'>";
@ -219,333 +222,285 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Field</b></td>\n";
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='back' onclick=\"window.location='schema_edit.php?id=$schema_uuid'\" value='Back'></td>\n";
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>".$text['header-field']."</b></td>\n";
echo "<td width='70%' align='right'><input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='schema_edit.php?id=$schema_uuid'\" value='".$text['button-back']."'></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"left\" colspan=\"2\">\n";
echo "Lists the fields in the database.<br /><br />\n";
echo $text['description-field']."<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Label:\n";
echo " ".$text['label-field_label'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='field_label' maxlength='255' value=\"$field_label\">\n";
echo "<br />\n";
echo "Enter the field label.\n";
echo $text['description-field_label']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Name:\n";
echo " ".$text['label-field_name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='field_name' maxlength='255' value=\"$field_name\">\n";
echo "<br />\n";
echo "Enter field name.\n";
echo $text['description-field_name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Type:\n";
echo " ".$text['label-field_type'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='field_type'>\n";
echo " <option value=''></option>\n";
if ($field_type == "text") {
echo " <option value='text' selected='selected'>Text</option>\n";
echo " <option value='text' selected='selected'>".$text['option-text']."</option>\n";
}
else {
echo " <option value='text'>Text</option>\n";
echo " <option value='text'>".$text['option-text']."</option>\n";
}
if ($field_type == "numeric") {
echo " <option value='numeric' selected='selected'>Number</option>\n";
echo " <option value='numeric' selected='selected'>".$text['option-number']."</option>\n";
}
else {
echo " <option value='numeric'>Number</option>\n";
echo " <option value='numeric'>".$text['option-number']."</option>\n";
}
if ($field_type == "date") {
echo " <option value='date' selected='selected'>Date</option>\n";
echo " <option value='date' selected='selected'>".$text['option-date']."</option>\n";
}
else {
echo " <option value='date'>Date</option>\n";
echo " <option value='date'>".$text['option-date']."</option>\n";
}
if ($field_type == "email") {
echo " <option value='email' selected='selected'>Email</option>\n";
echo " <option value='email' selected='selected'>".$text['option-email']."</option>\n";
}
else {
echo " <option value='email'>Email</option>\n";
echo " <option value='email'>".$text['option-email']."</option>\n";
}
if ($field_type == "label") {
echo " <option value='label' selected='selected'>Label</option>\n";
echo " <option value='label' selected='selected'>".$text['option-label']."</option>\n";
}
else {
echo " <option value='label'>Label</option>\n";
echo " <option value='label'>".$text['option-label']."</option>\n";
}
if ($field_type == "phone") {
echo " <option value='phone' selected='selected'>Phone</option>\n";
echo " <option value='phone' selected='selected'>".$text['option-phone']."</option>\n";
}
else {
echo " <option value='phone'>Phone</option>\n";
echo " <option value='phone'>".$text['option-phone']."</option>\n";
}
//if ($field_type == "truefalse") {
// echo " <option value='truefalse' selected='selected'>True or False</option>\n";
//}
//else {
// echo " <option value='truefalse'>True or False</option>\n";
//}
if ($field_type == "checkbox") {
echo " <option value='checkbox' selected='selected'>Check Box</option>\n";
echo " <option value='checkbox' selected='selected'>".$text['option-check_box']."</option>\n";
}
else {
echo " <option value='checkbox'>Check Box</option>\n";
echo " <option value='checkbox'>".$text['option-check_box']."</option>\n";
}
//if ($field_type == "radiobutton") {
// echo " <option value='radiobutton' selected='selected' >Radio Button</option>\n";
//}
//else {
// echo " <option value='radiobutton'>Radio Button</option>\n";
//}
if ($field_type == "textarea") {
echo " <option value='textarea' selected='selected'>Textarea</option>\n";
echo " <option value='textarea' selected='selected'>".$text['option-text_area']."</option>\n";
}
else {
echo " <option value='textarea'>Textarea</option>\n";
echo " <option value='textarea'>".$text['option-text_area']."</option>\n";
}
if ($field_type == "select") {
echo " <option value='select' selected='selected'>Select</option>\n";
echo " <option value='select' selected='selected'>".$text['option-select']."</option>\n";
}
else {
echo " <option value='select'>Select</option>\n";
echo " <option value='select'>".$text['option-select']."</option>\n";
}
if ($field_type == "hidden") {
echo " <option value='hidden' selected='selected'>Hidden</option>\n";
echo " <option value='hidden' selected='selected'>".$text['option-hidden']."</option>\n";
}
else {
echo " <option value='hidden'>Hidden</option>\n";
echo " <option value='hidden'>".$text['option-hidden']."</option>\n";
}
if ($field_type == "uuid") {
echo " <option value='uuid' selected='selected'>UUID</option>\n";
echo " <option value='uuid' selected='selected'>".$text['option-uuid']."</option>\n";
}
else {
echo " <option value='uuid'>UUID</option>\n";
echo " <option value='uuid'>".$text['option-uuid']."</option>\n";
}
//if ($field_type == "ipv4") {
// echo " <option value='ipv4' selected='selected'>IP version 4</option>\n";
//}
//else {
// echo " <option value='ipv4'>IP version 4</option>\n";
//}
//if ($field_type == "ipv6") {
// echo " <option value='ipv6' selected='selected'>IP version 6</option>\n";
//}
//else {
// echo " <option value='ipv6'>IP version 6</option>\n";
//}
//if ($field_type == "money") {
// echo " <option value='money' selected='selected'>Money</option>\n";
//}
//else {
// echo " <option value='money'>Money</option>\n";
//}
if ($field_type == "password") {
echo " <option value='password' selected='selected'>Password</option>\n";
echo " <option value='password' selected='selected'>".$text['option-password']."</option>\n";
}
else {
echo " <option value='password'>Password</option>\n";
echo " <option value='password'>".$text['option-password']."</option>\n";
}
if ($field_type == "pin_number") {
echo " <option value='pin_number' selected='selected'>PIN Number</option>\n";
echo " <option value='pin_number' selected='selected'>".$text['option-pin_number']."</option>\n";
}
else {
echo " <option value='pin_number'>PIN Number</option>\n";
echo " <option value='pin_number'>".$text['option-pin_number']."</option>\n";
}
if ($field_type == "image") {
echo " <option value='image' selected='selected'>Upload Image</option>\n";
echo " <option value='image' selected='selected'>".$text['option-image_upload']."</option>\n";
}
else {
echo " <option value='image'>Upload Image</option>\n";
echo " <option value='image'>".$text['option-image_upload']."</option>\n";
}
if ($field_type == "file") {
echo " <option value='upload_file' selected='selected'>Upload File</option>\n";
echo " <option value='upload_file' selected='selected'>".$text['option-file_upload']."</option>\n";
}
else {
echo " <option value='file'>Upload File</option>\n";
echo " <option value='file'>".$text['option-file_upload']."</option>\n";
}
//if ($field_type == "yesno") {
// echo " <option value='yesno' selected='selected'>Yes or No</option>\n";
//}
//else {
// echo " <option value='yesno'>Yes or No</option>\n";
//}
if ($field_type == "url") {
echo " <option value='url' selected='selected'>URL</option>\n";
echo " <option value='url' selected='selected'>".$text['option-url']."</option>\n";
}
else {
echo " <option value='url'>URL</option>\n";
echo " <option value='url'>".$text['option-url']."</option>\n";
}
//if ($field_type == "add_date") {
// echo " <option value='add_date' selected='selected'>Add Date</option>\n";
//}
//else {
// echo " <option value='add_date'>Add Date</option>\n";
//}
//if ($field_type == "add_user") {
// echo " <option value='add_user' selected='selected'>Add User</option>\n";
//}
//else {
// echo " <option value='add_user'>Add User</option>\n";
//}
if ($field_type == "mod_date") {
echo " <option value='mod_date' selected='selected'>Modified Date</option>\n";
echo " <option value='mod_date' selected='selected'>".$text['option-modified_date']."</option>\n";
}
else {
echo " <option value='mod_date'>Modified Date</option>\n";
echo " <option value='mod_date'>".$text['option-modified_date']."</option>\n";
}
if ($field_type == "mod_user") {
echo " <option value='mod_user' selected='selected'>Modified User</option>\n";
echo " <option value='mod_user' selected='selected'>".$text['option-modified_user']."</option>\n";
}
else {
echo " <option value='mod_user'>Modified User</option>\n";
echo " <option value='mod_user'>".$text['option-modified_user']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Select the field type.\n";
echo $text['description-field_type']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Value:\n";
echo " ".$text['label-field_value'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='field_value' maxlength='255' value=\"$field_value\">\n";
echo "<br />\n";
echo "Enter the default value.\n";
echo $text['description-field_value']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " List Visibility:\n";
echo " ".$text['label-field_visibility'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='field_list_hidden'>\n";
echo " <option value=''></option>\n";
if ($field_list_hidden == "show") {
echo " <option value='show' selected='selected'>show</option>\n";
echo " <option value='show' selected='selected'>".$text['option-visible']."</option>\n";
}
else {
echo " <option value='show'>show</option>\n";
echo " <option value='show'>".$text['option-visible']."</option>\n";
}
if ($field_list_hidden == "hide") {
echo " <option value='hide' selected='selected'>hide</option>\n";
echo " <option value='hide' selected='selected'>".$text['option-hidden']."</option>\n";
}
else {
echo " <option value='hide'>hide</option>\n";
echo " <option value='hide'>".$text['option-hidden']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Choose whether the field is hidden from the list.\n";
echo $text['description-field_visibility']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Search By:\n";
echo " ".$text['label-field_search_by'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='field_search_by'>\n";
echo " <option value=''></option>\n";
if ($field_search_by == "yes") {
echo " <option value='yes' selected='selected'>yes</option>\n";
echo " <option value='yes' selected='selected'>".$text['option-true']."</option>\n";
}
else {
echo " <option value='yes'>yes</option>\n";
echo " <option value='yes'>".$text['option-true']."</option>\n";
}
if ($field_search_by == "no") {
echo " <option value='no' selected='selected'>no</option>\n";
echo " <option value='no' selected='selected'>".$text['option-false']."</option>\n";
}
else {
echo " <option value='no'>no</option>\n";
echo " <option value='no'>".$text['option-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Choose whether the field will be used for searches.\n";
echo $text['description-field_search_by']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Column:\n";
echo " ".$text['label-field_column'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='field_column' maxlength='255' value=\"$field_column\">\n";
echo "<br />\n";
echo "Determines which column to show the field in.\n";
echo $text['description-field_column']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Required:\n";
echo " ".$text['label-field_required'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='field_required'>\n";
echo " <option value=''></option>\n";
if ($field_required == "yes") {
echo " <option value='yes' selected='selected'>yes</option>\n";
echo " <option value='yes' selected='selected'>".$text['option-true']."</option>\n";
}
else {
echo " <option value='yes'>yes</option>\n";
echo " <option value='yes'>".$text['option-true']."</option>\n";
}
if ($field_required == "no") {
echo " <option value='no' selected='selected'>no</option>\n";
echo " <option value='no' selected='selected'>".$text['option-false']."</option>\n";
}
else {
echo " <option value='no'>no</option>\n";
echo " <option value='no'>".$text['option-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo "Choose whether the field is required.\n";
echo $text['description-field_required']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Field Order:\n";
echo " ".$text['label-field_order'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='field_order' maxlength='255' value='$field_order'>\n";
echo "<br />\n";
echo "Enter the order of the field.\n";
echo $text['description-field_order']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Tab Order:\n";
echo " ".$text['label-field_tab_order'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='field_order_tab' maxlength='255' value='$field_order_tab'>\n";
echo "<br />\n";
echo "Enter the tab order.\n";
echo $text['description-field_tab_order']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Description:\n";
echo " ".$text['label-field_description'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='field_description' maxlength='255' value=\"$field_description\">\n";
echo "<br />\n";
echo "Enter the description.\n";
echo $text['description-field_description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
@ -554,7 +509,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='schema_field_uuid' value='$schema_field_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";

View File

@ -33,6 +33,7 @@ else {
echo "access denied";
exit;
}
require_once "includes/header.php";
require_once "includes/paging.php";
@ -48,12 +49,12 @@ $order = $_GET["order"];
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align=\"left\" nowrap=\"nowrap\"><b>Fields</b></td>\n";
echo "<td width='50%' align=\"left\" nowrap=\"nowrap\"><b>".$text['header-fields']."</b></td>\n";
echo "<td width='50%' align=\"right\">&nbsp;</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"left\" colspan=\"2\">\n";
echo "Lists the fields in the database.<br /><br />\n";
echo $text['description-fields']."<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</tr></table>\n";
@ -80,19 +81,19 @@ $order = $_GET["order"];
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('field_label', 'Label', $order_by, $order);
echo th_order_by('field_name', 'Name', $order_by, $order);
echo th_order_by('field_type', 'Type', $order_by, $order);
echo th_order_by('field_column', 'Column', $order_by, $order);
echo th_order_by('field_required', 'Required', $order_by, $order);
echo th_order_by('field_list_hidden', 'Visible', $order_by, $order);
echo th_order_by('field_search_by', 'Search By', $order_by, $order);
echo th_order_by('field_order', 'Field Order', $order_by, $order);
echo th_order_by('field_order_tab', 'Tab Order', $order_by, $order);
echo th_order_by('field_description', 'Description', $order_by, $order);
echo th_order_by('field_label', $text['label-field_label'], $order_by, $order);
echo th_order_by('field_name', $text['label-field_name'], $order_by, $order);
echo th_order_by('field_type', $text['label-field_type'], $order_by, $order);
echo th_order_by('field_column', $text['label-field_column'], $order_by, $order);
echo th_order_by('field_required', $text['label-field_required'], $order_by, $order);
echo th_order_by('field_list_hidden', $text['label-field_visibility'], $order_by, $order);
echo th_order_by('field_search_by', $text['label-field_search_by'], $order_by, $order);
echo th_order_by('field_order', $text['label-field_order'], $order_by, $order);
echo th_order_by('field_order_tab', $text['label-field_tab_order'], $order_by, $order);
echo th_order_by('field_description', $text['label-field_description'], $order_by, $order);
echo "<td align='right' width='42'>\n";
if (permission_exists('schema_view')) {
echo " <a href='schema_field_edit.php?schema_uuid=".$schema_uuid."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='schema_field_edit.php?schema_uuid=".$schema_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "<tr>\n";
@ -102,20 +103,63 @@ $order = $_GET["order"];
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_label']."&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['field_type']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
switch ($row['field_type']) {
case "text" : echo $text['option-text']; break;
case "numeric" : echo $text['option-number']; break;
case "date" : echo $text['option-date']; break;
case "email" : echo $text['option-email']; break;
case "label" : echo $text['option-label']; break;
case "phone" : echo $text['option-phone']; break;
case "checkbox" : echo $text['option-check_box']; break;
case "textarea" : echo $text['option-text_area']; break;
case "select" : echo $text['option-select']; break;
case "hidden" : echo $text['option-hidden']; break;
case "uuid" : echo $text['option-uuid']; break;
case "password" : echo $text['option-password']; break;
case "pin_number" : echo $text['option-pin_number']; break;
case "image" : echo $text['option-image_upload']; break;
case "upload_file" : echo $text['option-file_upload']; break;
case "url" : echo $text['option-url']; break;
case "mod_date" : echo $text['option-modified_date']; break;
case "mod_user" : echo $text['option-modified_user']; break;
default : echo $row['field_type'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_column']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_required']."</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['field_search_by']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if ($row['field_required'] == 'yes') {
echo $text['option-true'];
}
else if ($row['field_required'] == 'no') {
echo $text['option-false'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if ($row['field_list_hidden'] == 'show') {
echo $text['option-visible'];
}
else if ($row['field_list_hidden'] == 'hide') {
echo $text['option-hidden'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if ($row['field_search_by'] == 'yes') {
echo $text['option-true'];
}
else if ($row['field_search_by'] == 'no') {
echo $text['option-false'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['field_order']."</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['field_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('schema_edit')) {
echo " <a href='schema_field_edit.php?schema_uuid=".$row['schema_uuid']."&id=".$row['schema_field_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='schema_field_edit.php?schema_uuid=".$row['schema_uuid']."&id=".$row['schema_field_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('schema_delete')) {
echo " <a href='schema_field_delete.php?schema_uuid=".$row['schema_uuid']."&id=".$row['schema_field_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='schema_field_delete.php?schema_uuid=".$row['schema_uuid']."&id=".$row['schema_field_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
@ -132,7 +176,7 @@ $order = $_GET["order"];
echo " <td width='33.3%' align='center' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('schema_add')) {
echo " <a href='schema_field_edit.php?schema_uuid=".$schema_uuid."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='schema_field_edit.php?schema_uuid=".$schema_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
if (count($_POST)>0) {
$schema_uuid = trim($_REQUEST["id"]);
$data = trim($_POST["data"]);
@ -111,7 +117,7 @@ if (count($_POST)>0) {
$sql .= "'$this->field_order_tab', ";
$sql .= "'$this->field_description' ";
$sql .= ")";
if (!$this->db_field_exists()) {
if (!$this->db_field_exists()) {
$db->exec(check_sql($sql));
}
unset($sql);
@ -186,7 +192,7 @@ if (count($_POST)>0) {
}
}
//built in str_getcsv requires PHP 5.3 or higher, this function can be used to reproduct the functionality but requirs PHP 5.1.0 or higher
//built in str_getcsv requires PHP 5.3 or higher, this function can be used to reproduct the functionality but requirs PHP 5.1.0 or higher
if(!function_exists('str_getcsv')) {
function str_getcsv($input, $delimiter = ",", $enclosure = '"', $escape = "\\") {
$fp = fopen("php://memory", 'r+');
@ -203,13 +209,14 @@ if (count($_POST)>0) {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-import_results'];
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\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>".$text['header-import_results']."</b></td>\n";
echo "<td width='70%' align='right' valign='top'>\n";
echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='schema_import.php?id=$schema_uuid'\" value='Back'>\n";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='schema_import.php?id=$schema_uuid'\" value='".$text['button-back']."'>\n";
echo " <br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
@ -297,14 +304,14 @@ if (count($_POST)>0) {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-import'];
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
echo "<tr>\n";
echo "<td width='30%' nowrap='nowrap' align='left' valign='top'><b>Import</b></td>\n";
echo "<td width='30%' nowrap='nowrap' align='left' valign='top'><b>".$text['header-import']."</b></td>\n";
echo "<td width='70%' align='right' valign='top'>\n";
//echo " <input type='button' class='btn' name='' alt='back' onclick=\"window.location='schema_import.php?id=$schema_uuid'\" value='Back'>\n";
echo " <br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
@ -321,46 +328,46 @@ if (count($_POST)>0) {
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Data:\n";
echo " ".$text['label-import_data'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <textarea name='data' id='data' rows='7' class='txt' wrap='off'>$data</textarea\n";
echo " <textarea name='data' id='data' rows='7' class='txt' wrap='off'>$data</textarea>\n";
echo "<br />\n";
echo "Copy and paste the comma delimitted data into the text area to begin the import.\n";
echo $text['description-import_data']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Delimiter:\n";
echo " ".$text['label-import_delimiter'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' style='width:40px;' name='data_delimiter'>\n";
echo " <option value=','>,</option>\n";
echo " <option value='|'>|</option>\n";
echo " <select class='formfld' style='width: 100px;' name='data_delimiter'>\n";
echo " <option value=','>, (Comma)</option>\n";
echo " <option value='|'>| (Pipe)</option>\n";
echo " </select>\n";
echo "<br />\n";
echo "Select the delimiter.\n";
echo $text['description-import_delimiter']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " Enclosure:\n";
echo " ".$text['label-import_enclosure'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' style='width:40px;' name='data_enclosure'>\n";
echo " <option value='\"'>\"</option>\n";
echo " <option value=''></option>\n";
echo " <select class='formfld' style='width: 150px;' name='data_enclosure'>\n";
echo " <option value='\"'>\" (Double-Quote)</option>\n";
echo " <option value=''>(Nothing)</option>\n";
echo " </select>\n";
echo "<br />\n";
echo "Select the enclosure.\n";
echo $text['description-import_enclosure']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
echo " <input type='submit' name='import' class='btn' value='Import'>\n";
echo " <input type='submit' name='import' class='btn' value='".$text['button-import']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//get the http values
if (count($_GET) > 0) {
$id = check_str($_GET["id"]);
@ -55,7 +61,7 @@ else {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=schema_field_edit.php?schema_uuid=$schema_uuid&id=$schema_field_uuid\">\n";
echo "<div align='center'>\n";
echo "Delete Complete\n";
echo $text['message-delete']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;

View File

@ -34,6 +34,12 @@ else {
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
@ -64,11 +70,11 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
//check for all required data
if (strlen($domain_uuid) == 0) { $msg .= "Please provide: domain_uuid<br>\n"; }
if (strlen($schema_uuid) == 0) { $msg .= "Please provide: schema_uuid<br>\n"; }
if (strlen($schema_field_uuid) == 0) { $msg .= "Please provide: schema_field_uuid<br>\n"; }
if (strlen($data_types_name) == 0) { $msg .= "Please provide: Name<br>\n"; }
if (strlen($data_types_value) == 0) { $msg .= "Please provide: Value<br>\n"; }
if (strlen($domain_uuid) == 0) { $msg .= $text['message-required']."domain_uuid<br>\n"; }
if (strlen($schema_uuid) == 0) { $msg .= $text['message-required']."schema_uuid<br>\n"; }
if (strlen($schema_field_uuid) == 0) { $msg .= $text['message-required']."schema_field_uuid<br>\n"; }
if (strlen($data_types_name) == 0) { $msg .= $text['message-required'].$text['label-name_value_name']."<br>\n"; }
if (strlen($data_types_value) == 0) { $msg .= $text['message-required'].$text['label-name_value_value']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
require_once "includes/persistformvar.php";
@ -109,7 +115,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=schema_field_edit.php?schema_uuid=$schema_uuid&id=$schema_field_uuid\">\n";
echo "<div align='center'>\n";
echo "Add Complete\n";
echo $text['message-add']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@ -129,7 +135,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require_once "includes/header.php";
echo "<meta http-equiv=\"refresh\" content=\"2;url=schema_field_edit.php?schema_uuid=$schema_uuid&id=$schema_field_uuid\">\n";
echo "<div align='center'>\n";
echo "Update Complete\n";
echo $text['message-update']."\n";
echo "</div>\n";
require_once "includes/footer.php";
return;
@ -160,6 +166,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//show the header
require_once "includes/header.php";
$page["title"] = $text['title-name_value'];
//show the content
echo "<div align='center'>";
@ -174,38 +181,38 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
echo "<tr>\n";
if ($action == "add") {
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Table Data Types Name Value Add</b></td>\n";
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>".$text['header-name_value']." ".$text['button-add']."</b></td>\n";
}
if ($action == "update") {
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>Table Data Types Name Value Edit</b></td>\n";
echo "<td align='left' width='30%' nowrap=\"nowrap\"><b>".$text['header-name_value']." ".$text['button-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='".$text['button-back']."' onclick=\"history.go(-1);return true;\" value='".$text['button-back']."'></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"left\" colspan='2'>\n";
echo "Stores the name and value pairs.<br /><br />\n";
echo $text['description-name_value']."<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Name:\n";
echo " ".$text['label-name_value_name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='data_types_name' maxlength='255' value=\"$data_types_name\">\n";
echo "<br />\n";
echo "Enter the name.\n";
echo $text['description-name_value_name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap=\"nowrap\">\n";
echo " Value:\n";
echo " ".$text['label-name_value_value'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='data_types_value' maxlength='255' value=\"$data_types_value\">\n";
echo "<br />\n";
echo "Enter the value.\n";
echo $text['description-name_value_value']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
@ -215,7 +222,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
echo " <input type='hidden' name='schema_name_value_uuid' value='$schema_name_value_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='Save'>\n";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";

View File

@ -49,12 +49,12 @@ require_once "includes/paging.php";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align=\"left\" nowrap=\"nowrap\"><b>Schema Name Values</b></td>\n";
echo "<td width='50%' align=\"left\" nowrap=\"nowrap\"><b>".$text['header-name_values']."</b></td>\n";
echo "<td width='50%' align=\"right\">&nbsp;</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align=\"left\" nowrap=\"nowrap\" colspan='2'>\n";
echo "Stores the name and value pairs.<br /><br />\n";
echo $text['description-name_values']."<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "</tr></table>\n";
@ -71,9 +71,9 @@ require_once "includes/paging.php";
//$rows_per_page = 10;
//$param = "";
//$page = $_GET['page'];
//if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
//list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
//$offset = $rows_per_page * $page;
//if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
//list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
//$offset = $rows_per_page * $page;
$sql = "select * from v_schema_name_values ";
$sql .= "where domain_uuid = '$domain_uuid' ";
@ -93,10 +93,10 @@ require_once "includes/paging.php";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('data_types_name', 'Name', $order_by, $order);
echo th_order_by('data_types_value', 'Value', $order_by, $order);
echo th_order_by('data_types_name', $text['label-name_value_name'], $order_by, $order);
echo th_order_by('data_types_value', $text['label-name_value_value'], $order_by, $order);
echo "<td align='right' width='42'>\n";
echo " <a href='schema_name_value_edit.php?schema_uuid=".$row["schema_uuid"]."&schema_field_uuid=".$row["schema_field_uuid"]."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='schema_name_value_edit.php?schema_uuid=".$row["schema_uuid"]."&schema_field_uuid=".$row["schema_field_uuid"]."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo "</td>\n";
echo "<tr>\n";
@ -106,13 +106,11 @@ require_once "includes/paging.php";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[data_types_name]."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row[data_types_value]."</td>\n";
echo " <td valign='top' align='right'>\n";
echo " <a href='schema_name_value_edit.php?schema_uuid=".$row["schema_uuid"]."&schema_field_uuid=".$row["schema_field_uuid"]."&id=".$row["schema_name_value_uuid"]."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='schema_name_value_delete.php?schema_uuid=".$row["schema_uuid"]."&schema_field_uuid=".$row["schema_field_uuid"]."&id=".$row["schema_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='schema_name_value_edit.php?id=".$row["schema_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='schema_name_value_delete.php?id=".$row["schema_name_value_uuid"]."' }\" value='x'>\n";
echo " <a href='schema_name_value_edit.php?schema_uuid=".$row["schema_uuid"]."&schema_field_uuid=".$row["schema_field_uuid"]."&id=".$row["schema_name_value_uuid"]."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
echo " <a href='schema_name_value_delete.php?schema_uuid=".$row["schema_uuid"]."&schema_field_uuid=".$row["schema_field_uuid"]."&id=".$row["schema_name_value_uuid"]."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
echo " </td>\n";
echo "</tr>\n";
if ($c==0) { $c=1; } else { $c=0; }
$c = ($c==0) ? 1 : 0;
} //end foreach
unset($sql, $result, $row_count);
} //end if results
@ -125,7 +123,7 @@ require_once "includes/paging.php";
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='right'>\n";
echo " <a href='schema_name_value_edit.php?schema_uuid=".$row["schema_uuid"]."&schema_field_uuid=".$row["schema_field_uuid"]."' alt='add'>$v_link_label_add</a>\n";
echo " <a href='schema_name_value_edit.php?schema_uuid=".$row["schema_uuid"]."&schema_field_uuid=".$row["schema_field_uuid"]."' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";

View File

@ -33,7 +33,16 @@ else {
echo "access denied";
exit;
}
//add multi-lingual support
require_once "app_languages.php";
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
require_once "includes/header.php";
$page["title"] = $text['title-schemas'];
require_once "includes/paging.php";
//get the http get variables
@ -49,12 +58,12 @@ require_once "includes/paging.php";
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>Schemas</b></td>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['header-schemas']."</b></td>\n";
echo "<td width='50%' align='right'>&nbsp;</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
echo "Provides the ability to quickly define information to store and dynamically makes tools available to view, add, edit, delete, and search.\n";
echo $text['description-schemas']."\n";
echo "<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
@ -71,9 +80,9 @@ require_once "includes/paging.php";
$rows_per_page = 100;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var_3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
$sql = " select * from v_schemas ";
$sql .= " where domain_uuid = '$domain_uuid' ";
@ -92,14 +101,14 @@ require_once "includes/paging.php";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
echo "<tr>\n";
echo th_order_by('schema_label', 'Label', $order_by, $order);
echo th_order_by('schema_name', 'Schema Name', $order_by, $order);
echo th_order_by('schema_auth', 'Authentication', $order_by, $order);
echo th_order_by('schema_description', 'Description', $order_by, $order);
echo th_order_by('schema_label', $text['label-label'], $order_by, $order);
echo th_order_by('schema_name', $text['label-schema_name'], $order_by, $order);
echo th_order_by('schema_auth', $text['label-authentication'], $order_by, $order);
echo th_order_by('schema_description', $text['label-description'], $order_by, $order);
//echo "<th align='center'>View</th>\n";
echo "<td align='right' width='42'>\n";
if (permission_exists('schema_add')) {
echo " <a href='schema_edit.php' alt='add'>$v_link_label_add</a>\n";
echo " <a href='schema_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo "</td>\n";
echo "<tr>\n";
@ -112,14 +121,21 @@ require_once "includes/paging.php";
echo "<tr >\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['schema_label']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['schema_name']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['schema_auth']."</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
if ($row['schema_auth'] == 'yes') {
echo $text['option-true'];
}
else if ($row['schema_auth'] == 'false') {
echo $text['option-false'];
}
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['schema_description']."&nbsp;</td>\n";
echo " <td valign='top' align='right'>\n";
if (permission_exists('schema_edit')) {
echo " <a href='schema_edit.php?id=".$row['schema_uuid']."' alt='edit'>$v_link_label_edit</a>\n";
echo " <a href='schema_edit.php?id=".$row['schema_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
}
if (permission_exists('schema_delete')) {
echo " <a href='schema_delete.php?id=".$row['schema_uuid']."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
echo " <a href='schema_delete.php?id=".$row['schema_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
}
echo " </td>\n";
echo "</tr>\n";
@ -136,7 +152,7 @@ require_once "includes/paging.php";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td width='33.3%' align='right'>\n";
if (permission_exists('schema_add')) {
echo " <a href='schema_edit.php' alt='add'>$v_link_label_add</a>\n";
echo " <a href='schema_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>\n";
}
echo " </td>\n";
echo " </tr>\n";