contact settings support

This commit is contained in:
luis daniel lucio quiroz
2014-11-08 03:34:02 +00:00
parent 471d6e6530
commit 46225da3f4
5 changed files with 662 additions and 1 deletions

View File

@@ -133,6 +133,16 @@
$text['description-contact_category']['pt-pt'] = "Introduza a categoria.";
$text['description-contact_category']['fr-fr'] = "";
$text['label-contact_subcategory']['en-us'] = "Subcategory";
$text['label-contact_subcategory']['es-cl'] = "Subcategoría";
$text['label-contact_subcategory']['pt-pt'] = "Subcategoria";
$text['label-contact_subcategory']['fr-fr'] = "Sous-Catégorie";
$text['description-contact_subcategory']['en-us'] = "Enter the subcategory.";
$text['description-contact_subcategory']['es-cl'] = "Ingrese la categoría.";
$text['description-contact_subcategory']['pt-pt'] = "Introduza a subcategoria";
$text['description-contact_subcategory']['fr-fr'] = "";
$text['label-contact_role']['en-us'] = "Role";
$text['label-contact_role']['es-cl'] = "Rol";
$text['label-contact_role']['pt-pt'] = "Papel";
@@ -183,6 +193,75 @@
$text['description-contact_note']['pt-pt'] = "Introduza uma nota.";
$text['description-contact_note']['fr-fr'] = "";
$text['label-contact_properties']['en-us'] = "Properties";
$text['label-contact_properties']['es-cl'] = "Propiedades";
$text['label-contact_properties']['pt-pt'] = "Propiedades";
$text['label-contact_properties']['fr-fr'] = "Propietés";
$text['label-contact_value']['en-us'] = "Value";
$text['label-contact_value']['es-cl'] = "Valor";
$text['label-contact_value']['pt-pt'] = "Valor";
$text['label-contact_value']['fr-fr'] = "Valeur";
$text['description-contact_value']['en-us'] = "Enter the value of this setting.";
$text['description-contact_value']['es-cl'] = "Ingrese el valor para esta configuración.";
$text['description-contact_value']['pt-pt'] = "Introduza o valor desta definição.";
$text['description-contact_value']['fr-fr'] = "";
$text['label-true']['en-us'] = "True";
$text['label-true']['es-cl'] = "Verdadero";
$text['label-true']['pt-pt'] = "Sim";
$text['label-true']['fr-fr'] = "Oui";
$text['label-false']['en-us'] = "False";
$text['label-false']['es-cl'] = "Falso";
$text['label-false']['pt-pt'] = "Não";
$text['label-false']['fr-fr'] = "Non";
$text['label-order']['en-us'] = "Order";
$text['label-order']['es-cl'] = "Orden";
$text['label-order']['pt-pt'] = "Ordem";
$text['label-order']['fr-fr'] = "Ordre";
$text['description-order']['en-us'] = "Set the order (index) for this array element.";
$text['description-order']['es-cl'] = "Establecer el orden (<ED>ndice) para este elemento de la matriz.";
$text['description-order']['pt-pt'] = "Defina a ordem (<ED>ndice) para este elemento da matriz.";
$text['description-order']['fr-fr'] = "D<E9>finir l'ordre (index) pour cet <E9>l<E9>ment de tableau.";
$text['header-contact_setting-edit']['en-us'] = "Contact Setting";
$text['header-contact_setting-edit']['es-cl'] = "Configuraciones de contacto";
$text['header-contact_setting-edit']['pt-pt'] = "Definições do Contacto";
$text['header-contact_setting-edit']['fr-fr'] = "Paramètres du Contact";
$text['header-contact_setting-add']['en-us'] = "Contact Setting Add";
$text['header-contact_setting-add']['es-cl'] = "Agregar Configuración de Contacto";
$text['header-contact_setting-add']['pt-pt'] = "Adicionar Definição ao Contacto";
$text['header-contact_setting-add']['fr-fr'] = "Ajouter un paramètre au Contact";
$text['title-contact_setting-edit']['en-us'] = "Contact Setting";
$text['title-contact_setting-edit']['es-cl'] = "Configuraciones de contacto";
$text['title-contact_setting-edit']['pt-pt'] = "Definições do Contacto";
$text['title-contact_setting-edit']['fr-fr'] = "Paramètres du Contact";
$text['title-contact_setting-add']['en-us'] = "Contact Setting Add";
$text['title-contact_setting-add']['es-cl'] = "Agregar Configuración de Contacto";
$text['title-contact_setting-add']['pt-pt'] = "Adicionar Definição ao Contacto";
$text['title-contact_setting-add']['fr-fr'] = "Ajouter un paramètre au Contact";
$text['description-contact_setting-edit']['en-us'] = "Edit a setting for this contact.";
$text['description-contact_setting-edit']['es-cl'] = "Edita una configuración para este contacto.";
$text['description-contact_setting-edit']['pt-pt'] = "Editar uma definição deste contacto.";
$text['description-contact_setting-edit']['fr-fr'] = "Editer un paramètre du contact.";
$text['label-shared']['en-us'] = "Shared";
$text['label-shared']['es-cl'] = "Compartido";
$text['label-shared']['pt-pt'] = "Partilhada";

View File

@@ -766,6 +766,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
require "contact_addresses.php";
require "contact_extensions.php";
require "contact_notes.php";
require "contact_settings.php";
echo "</td>\n";
}
@@ -775,4 +776,4 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
//include the footer
require_once "resources/footer.php";
?>
?>

View File

@@ -0,0 +1,57 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//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) {
$id = check_str($_GET["id"]);
$contact_uuid = check_str($_GET["contact_uuid"]);
}
if (strlen($id)>0) {
//delete domain_setting
$sql = "delete from v_contact_settings ";
$sql .= "where contact_uuid = '$contact_uuid' ";
$sql .= "and contact_setting_uuid = '$id' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
unset($sql);
}
//redirect the user
$_SESSION["message"] = $text['message-delete'];
header("Location: contact_edit.php?id=".$contact_uuid);
return;
?>

View File

@@ -0,0 +1,352 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//add multi-lingual support
require_once "app_languages.php";
foreach($text['button-save'] as $key => $value) {
$languages[$key] = '';
}
foreach($text as $key => $value) {
$text[$key] = $value[$_SESSION['domain']['language']['code']];
}
//action add or update
if (isset($_REQUEST["id"])) {
$action = "update";
$contact_setting_uuid = check_str($_REQUEST["id"]);
}
else {
$action = "add";
}
if (strlen($_GET["contact_uuid"]) > 0) {
$contact_uuid = check_str($_GET["contact_uuid"]);
}
$domain_uuid = $_SESSION['domain_uuid'];
//get http post variables and set them to php variables
if (count($_POST) > 0) {
$contact_setting_category = strtolower(check_str($_POST["contact_setting_category"]));
$contact_setting_subcategory = strtolower(check_str($_POST["contact_setting_subcategory"]));
$contact_setting_name = strtolower(check_str($_POST["contact_setting_name"]));
$contact_setting_value = check_str($_POST["contact_setting_value"]);
$contact_setting_order = check_str($_POST["contact_setting_order"]);
$contact_setting_enabled = strtolower(check_str($_POST["contact_setting_enabled"]));
$contact_setting_description = check_str($_POST["contact_setting_description"]);
}
if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
$msg = '';
if ($action == "update") {
$contact_setting_uuid = check_str($_POST["contact_setting_uuid"]);
}
//check for all required data
//if (strlen($domain_setting_category) == 0) { $msg .= $text['message-required'].$text['label-category']."<br>\n"; }
//if (strlen($domain_setting_subcategory) == 0) { $msg .= $text['message-required'].$text['label-subcategory']."<br>\n"; }
//if (strlen($domain_setting_name) == 0) { $msg .= $text['message-required'].$text['label-type']."<br>\n"; }
//if (strlen($domain_setting_value) == 0) { $msg .= $text['message-required'].$text['label-value']."<br>\n"; }
//if (strlen($domain_setting_order) == 0) { $msg .= $text['message-required'].$text['label-order']."<br>\n"; }
//if (strlen($domain_setting_enabled) == 0) { $msg .= $text['message-required'].$text['label-enabled']."<br>\n"; }
//if (strlen($domain_setting_description) == 0) { $msg .= $text['message-required'].$text['label-description']."<br>\n"; }
if (strlen($msg) > 0 && strlen($_POST["persistformvar"]) == 0) {
require_once "resources/header.php";
require_once "resources/persist_form_var.php";
echo "<div align='center'>\n";
echo "<table><tr><td>\n";
echo $msg."<br />";
echo "</td></tr></table>\n";
persistformvar($_POST);
echo "</div>\n";
require_once "resources/footer.php";
return;
}
//add or update the database
if ($_POST["persistformvar"] != "true") {
$contact_setting_order = ($contact_setting_order != '') ? $contact_setting_order : 'null';
//add the domain
if ($action == "add" && permission_exists('domain_setting_add')) {
$sql = "insert into v_contact_settings ";
$sql .= "(";
$sql .= "contact_setting_uuid, ";
$sql .= "contact_uuid, ";
$sql .= "domain_uuid, ";
$sql .= "contact_setting_category, ";
$sql .= "contact_setting_subcategory, ";
$sql .= "contact_setting_name, ";
$sql .= "contact_setting_value, ";
$sql .= "contact_setting_order, ";
$sql .= "contact_setting_enabled, ";
$sql .= "contact_setting_description ";
$sql .= ")";
$sql .= "values ";
$sql .= "(";
$sql .= "'".uuid()."', ";
$sql .= "'$contact_uuid', ";
$sql .= "'$domain_uuid', ";
$sql .= "'$contact_setting_category', ";
$sql .= "'$contact_setting_subcategory', ";
$sql .= "'$contact_setting_name', ";
$sql .= "'$contact_setting_value', ";
$sql .= "$contact_setting_order, ";
$sql .= "'$contact_setting_enabled', ";
$sql .= "'$contact_setting_description' ";
$sql .= ")";
$db->exec(check_sql($sql));
unset($sql);
} //if ($action == "add")
//update the domain
if ($action == "update") {
$sql = "update v_contact_settings set ";
$sql .= "contact_setting_category = '$contact_setting_category', ";
$sql .= "contact_setting_subcategory = '$contact_setting_subcategory', ";
$sql .= "contact_setting_name = '$contact_setting_name', ";
$sql .= "contact_setting_value = '$contact_setting_value', ";
$sql .= "contact_setting_order = $contact_setting_order, ";
$sql .= "contact_setting_enabled = '$contact_setting_enabled', ";
$sql .= "contact_setting_description = '$contact_setting_description' ";
$sql .= "where contact_uuid = '$contact_uuid' ";
$sql .= "and contact_setting_uuid = '$contact_setting_uuid'";
$db->exec(check_sql($sql));
unset($sql);
} //if ($action == "update")
//redirect the browser
if ($action == "update") {
$_SESSION["message"] = $text['message-update'];
}
if ($action == "add") {
$_SESSION["message"] = $text['message-add'];
}
header("Location: contact_edit.php?id=".$contact_uuid);
return;
} //if ($_POST["persistformvar"] != "true")
} //(count($_POST)>0 && strlen($_POST["persistformvar"]) == 0)
//pre-populate the form
if (count($_GET)>0 && $_POST["persistformvar"] != "true") {
$contact_setting_uuid = check_str($_GET["id"]);
$sql = "select * from v_contact_settings ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and contact_setting_uuid = '$contact_setting_uuid' ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
foreach ($result as &$row) {
$contact_setting_category = $row["contact_setting_category"];
$contact_setting_subcategory = $row["contact_setting_subcategory"];
$contact_setting_name = $row["contact_setting_name"];
$contact_setting_value = $row["contact_setting_value"];
$contact_setting_order = $row["contact_setting_order"];
$contact_setting_enabled = $row["contact_setting_enabled"];
$contact_setting_description = $row["contact_setting_description"];
break; //limit to 1 row
}
unset ($prep_statement);
}
//show the header
require_once "resources/header.php";
if ($action == "update") {
$document['title'] = $text['title-contact_setting-edit'];
}
elseif ($action == "add") {
$document['title'] = $text['title-contact_setting-add'];
}
//show the content
echo "<div align='center'>";
echo "<table width='100%' border='0' cellpadding='0' cellspacing=''>\n";
echo "<tr class='border'>\n";
echo " <td align=\"left\">\n";
echo " <br>";
echo "<form method='post' name='frm' action=''>\n";
echo "<div align='center'>\n";
echo "<table width='100%' border='0' cellpadding='6' cellspacing='0'>\n";
echo "<tr>\n";
echo "<td align='left' width='30%' nowrap='nowrap'><b>";
if ($action == "update") {
echo $text['header-contact_setting-edit'];
}
if ($action == "add") {
echo $text['header-contact_setting-add'];
}
echo "</b></td>\n";
echo "<td width='70%' align='right'>";
echo " <input type='button' class='btn' name='' alt='".$text['button-back']."' onclick=\"window.location='contact_edit.php?id=$contact_uuid'\" value='".$text['button-back']."'>";
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td align='left' colspan='2'>\n";
if ($action == "update") {
echo $text['description-contact_setting-edit'];
}
if ($action == "add") {
echo $text['header-contact_setting-add'];
}
echo "<br /><br />\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-contact_category'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='contact_setting_category' maxlength='255' value=\"$contact_setting_category\">\n";
echo "<br />\n";
echo $text['description-contact_category']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-contact_subcategory'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='contact_setting_subcategory' maxlength='255' value=\"$contact_setting_subcategory\">\n";
echo "<br />\n";
echo $text['description-contact_subcategory']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-contact_name'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='contact_setting_name' maxlength='255' value=\"$contact_setting_name\">\n";
echo "<br />\n";
echo $text['description-contact_name']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-contact_value'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
$category = $row['contact_setting_category'];
$subcategory = $row['contact_setting_subcategory'];
$name = $row['contact_setting_name'];
echo " <input class='formfld' type='text' name='contact_setting_value' maxlength='255' value=\"".$row['contact_setting_value']."\">\n";
echo "<br />\n";
echo $text['description-contact_value']."\n";
echo "</td>\n";
echo "</tr>\n";
if ($name == "array") {
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap='nowrap' width='30%'>\n";
echo " ".$text['label-order']."\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select name='contact_setting_order' class='formfld'>\n";
$i=0;
while($i<=999) {
$selected = ($i == $contact_setting_order) ? "selected" : null;
if (strlen($i) == 1) {
echo " <option value='00$i' ".$selected.">00$i</option>\n";
}
if (strlen($i) == 2) {
echo " <option value='0$i' ".$selected.">0$i</option>\n";
}
if (strlen($i) == 3) {
echo " <option value='$i' ".$selected.">$i</option>\n";
}
$i++;
}
echo " </select>\n";
echo " <br />\n";
echo $text['description-order']."\n";
echo "</td>\n";
echo "</tr>\n";
}
echo "<tr>\n";
echo "<td class='vncellreq' valign='top' align='left' nowrap>\n";
echo " ".$text['label-enabled'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <select class='formfld' name='contact_setting_enabled'>\n";
if ($contact_setting_enabled == "true") {
echo " <option value='true' selected='selected'>".$text['label-true']."</option>\n";
}
else {
echo " <option value='true'>".$text['label-true']."</option>\n";
}
if ($contact_setting_enabled == "false") {
echo " <option value='false' selected='selected'>".$text['label-false']."</option>\n";
}
else {
echo " <option value='false'>".$text['label-false']."</option>\n";
}
echo " </select>\n";
echo "<br />\n";
echo $text['description-enabled']."\n";
echo "</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<td class='vncell' valign='top' align='left' nowrap='nowrap'>\n";
echo " ".$text['label-description'].":\n";
echo "</td>\n";
echo "<td class='vtable' align='left'>\n";
echo " <input class='formfld' type='text' name='contact_setting_description' maxlength='255' value=\"$contact_setting_description\">\n";
echo "<br />\n";
echo $text['description-description']."\n";
echo "</td>\n";
echo "</tr>\n";
echo " <tr>\n";
echo " <td colspan='2' align='right'>\n";
echo " <input type='hidden' name='contact_uuid' value='$contact_uuid'>\n";
if ($action == "update") {
echo " <input type='hidden' name='contact_setting_uuid' value='$contact_setting_uuid'>\n";
}
echo " <input type='submit' name='submit' class='btn' value='".$text['button-save']."'>\n";
echo " </td>\n";
echo " </tr>";
echo "</table>";
echo "</form>";
echo " </td>";
echo " </tr>";
echo "</table>";
echo "</div>";
//include the footer
require_once "resources/footer.php";
?>

View File

@@ -0,0 +1,172 @@
<?php
/*
FusionPBX
Version: MPL 1.1
The contents of this file are subject to the Mozilla Public License Version
1.1 (the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
for the specific language governing rights and limitations under the
License.
The Original Code is FusionPBX
The Initial Developer of the Original Code is
Mark J Crane <markjcrane@fusionpbx.com>
Portions created by the Initial Developer are Copyright (C) 2008-2012
the Initial Developer. All Rights Reserved.
Contributor(s):
Mark J Crane <markjcrane@fusionpbx.com>
Luis Daniel Lucio Quiroz <dlucio@okay.com.mx>
*/
require_once "root.php";
require_once "resources/require.php";
require_once "resources/check_auth.php";
//require_once "resources/header.php";
require_once "resources/paging.php";
//get variables used to control the order
$order_by = $_GET["order_by"];
$order = $_GET["order"];
//prepare to page the results
$sql = "select count(*) as num_rows from v_contact_settings ";
$sql .= "where contact_uuid = '$contact_uuid' ";
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
$prep_statement = $db->prepare($sql);
if ($prep_statement) {
$prep_statement->execute();
$row = $prep_statement->fetch(PDO::FETCH_ASSOC);
if ($row['num_rows'] > 0) {
$num_rows = $row['num_rows'];
}
else {
$num_rows = '0';
}
}
//prepare to page the results
$rows_per_page = 100;
$param = "";
$page = $_GET['page'];
if (strlen($page) == 0) { $page = 0; $_GET['page'] = 0; }
list($paging_controls, $rows_per_page, $var3) = paging($num_rows, $param, $rows_per_page);
$offset = $rows_per_page * $page;
//get the list
$sql = "select * from v_contact_settings ";
$sql .= "where domain_uuid = '$domain_uuid' ";
$sql .= "and contact_uuid = '$contact_uuid' ";
if (strlen($order_by) == 0) {
$sql .= "order by contact_setting_category, contact_setting_subcategory, contact_setting_order asc ";
}
else {
$sql .= "order by $order_by $order ";
}
$sql .= "limit $rows_per_page offset $offset ";
$prep_statement = $db->prepare(check_sql($sql));
$prep_statement->execute();
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
$result_count = count($result);
unset ($prep_statement, $sql);
$c = 0;
$row_style["0"] = "row_style0";
$row_style["1"] = "row_style1";
//show the content
echo "<table width='100%' border='0'>\n";
echo "<tr>\n";
echo "<td width='50%' align='left' nowrap='nowrap'><b>".$text['label-contact_properties']."</b></td>\n";
echo "<td width='50%' align='right'>&nbsp;</td>\n";
echo "</tr>\n";
echo "</table>\n";
echo "<br /><br />";
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
if ($result_count > 0) {
$previous_category = '';
foreach($result as $row) {
if ($previous_category != $row['contact_setting_category']) {
echo "<tr>";
echo " <td colspan='6' align='left'>\n";
echo " <br />\n";
echo " <br />\n";
echo " <b>";
echo " ".ucfirst($row['contact_setting_category']);
echo " </b>\n";
echo " </td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo "<th>".$text['label-subcategory']."</th>";
echo "<th>".$text['label-type']."</th>";
echo "<th>".$text['label-value']."</th>";
echo "<th style='text-align: center;'>".$text['label-enabled']."</th>";
echo "<th>".$text['label-description']."</th>";
echo "<td class='list_control_icons'>";
echo "<a href='contact_setting_edit.php?contact_uuid=".$contact_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo "</td>\n";
echo "</tr>\n";
}
$tr_link = " href='contact_setting_edit.php?contact_uuid=".$contact_uuid."&id=".$row['contact_setting_uuid']."'";
echo "<tr ".$tr_link.">\n";
echo " <td valign='top' class='".$row_style[$c]."'>";
echo "<a href='contact_setting_edit.php?contact_uuid=".$contact_uuid."&id=".$row['contact_setting_uuid']."'>".$row['contact_setting_subcategory']."</a>";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>".$row['contact_setting_name']."&nbsp;</td>\n";
echo " <td valign='top' class='".$row_style[$c]."'>\n";
$category = $row['contact_setting_category'];
$subcategory = $row['contact_setting_subcategory'];
$name = $row['contact_setting_name'];
if ($category == "callingcard" && $subcategory == "username" && $name == "var" ) {
echo " ******** &nbsp;\n";
}
elseif ($category == "callingcard" && $subcategory == "password" && $name == "var" ) {
echo " ******** &nbsp;\n";
} else {
echo $row['contact_setting_value'];
}
echo " &nbsp;\n";
echo " </td>\n";
echo " <td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".ucwords($row['contact_setting_enabled'])."&nbsp;</td>\n";
echo " <td valign='top' class='row_stylebg'>".$row['contact_setting_description']."&nbsp;</td>\n";
echo " <td class='list_control_icons'>";
echo "<a href='contact_setting_edit.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_setting_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
echo "<a href='contact_setting_delete.php?contact_uuid=".$row['contact_uuid']."&id=".$row['contact_setting_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
echo " </td>\n";
echo "</tr>\n";
$previous_category = $row['contact_setting_category'];
if ($c==0) { $c=1; } else { $c=0; }
} //end foreach
unset($sql, $result, $row_count);
} //end if results
echo "<tr>\n";
echo "<td colspan='6' align='left'>\n";
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
echo " <tr>\n";
echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
echo " <td class='list_control_icons'>";
echo "<a href='contact_setting_edit.php?contact_uuid=".$contact_uuid."' alt='".$text['button-add']."'>$v_link_label_add</a>";
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
echo "</td>\n";
echo "</tr>\n";
echo "</table>";
//include the footer
//require_once "resources/footer.php";
?>