hunt_group_call_forward.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /*
  3. FusionPBX
  4. Version: MPL 1.1
  5. The contents of this file are subject to the Mozilla Public License Version
  6. 1.1 (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.mozilla.org/MPL/
  9. Software distributed under the License is distributed on an "AS IS" basis,
  10. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. for the specific language governing rights and limitations under the
  12. License.
  13. The Original Code is FusionPBX
  14. The Initial Developer of the Original Code is
  15. Mark J Crane <[email protected]>
  16. Portions created by the Initial Developer are Copyright (C) 2008-2012
  17. the Initial Developer. All Rights Reserved.
  18. Contributor(s):
  19. Mark J Crane <[email protected]>
  20. */
  21. include "root.php";
  22. require_once "resources/require.php";
  23. require_once "resources/check_auth.php";
  24. //check permissions
  25. if (permission_exists('hunt_group_call_forward')) {
  26. require_once "resources/header.php";
  27. $page["title"] = $text['title-hunt-group_call_forward'];
  28. require_once "resources/paging.php";
  29. //add multi-lingual support
  30. $language = new text;
  31. $text = $language->get();
  32. $order_by = $_GET["order_by"];
  33. $order = $_GET["order"];
  34. echo "<div align='center'>";
  35. echo "<table width='100%' border='0' cellpadding='0' cellspacing='2'>\n";
  36. echo "<tr class='border'>\n";
  37. echo " <td align=\"center\">\n";
  38. if ($is_included != "true") {
  39. echo " <br>";
  40. echo " <table width=\"100%\" border=\"0\" cellpadding=\"6\" cellspacing=\"0\">\n";
  41. echo " <tr>\n";
  42. echo " <td align='left'><b>".$text['header-hunt-group_call_forward']."</b><br>\n";
  43. echo " ".$text['description-hunt_group_call_forward']."\n";
  44. echo " </td>\n";
  45. echo " </tr>\n";
  46. echo " </table>\n";
  47. echo " <br />";
  48. }
  49. $sql = "select * from v_hunt_groups ";
  50. $sql .= "where domain_uuid = '$domain_uuid' ";
  51. $sql .= "and hunt_group_type <> 'dnd' ";
  52. $sql .= "and hunt_group_type <> 'call_forward' ";
  53. $sql .= "and hunt_group_type <> 'follow_me_simultaneous' ";
  54. $sql .= "and hunt_group_type <> 'follow_me_sequence' ";
  55. if (!(permission_exists('hunt_group_add') || permission_exists('hunt_group_edit'))) {
  56. $sql .= "and hunt_group_user_list like '%|".$_SESSION["username"]."|%' ";
  57. }
  58. if (strlen($order_by)> 0) {
  59. $sql .= "order by $order_by $order ";
  60. }
  61. else {
  62. $sql .= "order by hunt_group_extension asc ";
  63. }
  64. $prep_statement = $db->prepare(check_sql($sql));
  65. $prep_statement->execute();
  66. $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
  67. $result_count = count($result);
  68. unset ($prep_statement, $sql);
  69. $c = 0;
  70. $row_style["0"] = "row_style0";
  71. $row_style["1"] = "row_style1";
  72. if ($is_included == "true" && $result_count == 0) {
  73. //hide this when there is no result
  74. }
  75. else {
  76. echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
  77. echo "<tr>\n";
  78. echo "<th>".$text['label-extension']."</th>\n";
  79. echo "<th>".$text['label-tools']."</th>\n";
  80. echo "<th>".$text['label-description']."</th>\n";
  81. echo "</tr>\n";
  82. }
  83. if ($result_count > 0) {
  84. foreach($result as $row) {
  85. echo "<tr >\n";
  86. echo " <td valign='top' class='".$row_style[$c]."'>".$row['hunt_group_extension']."</td>\n";
  87. echo " <td valign='top' class='".$row_style[$c]."'>\n";
  88. echo " <a href='".PROJECT_PATH."/app/hunt_group/hunt_group_call_forward_edit.php?id=".$row['hunt_group_uuid']."&a=call_forward' alt='".$text['label-call_forward']."'>".$text['label-call_forward']."</a> \n";
  89. echo " </td>\n";
  90. echo " <td valign='top' class='row_stylebg' width='40%'>".$row['hunt_group_description']."&nbsp;</td>\n";
  91. echo "</tr>\n";
  92. if ($c==0) { $c=1; } else { $c=0; }
  93. }
  94. unset($sql, $result, $row_count);
  95. } //end if results
  96. if ($is_included == "true" && $result_count == 0) {
  97. //hide this when there is no result
  98. }
  99. else {
  100. echo "</table>";
  101. echo "<br>";
  102. echo "<br>";
  103. echo "<br>";
  104. }
  105. echo "</table>";
  106. echo "</div>";
  107. if ($is_included != "true") {
  108. require_once "resources/footer.php";
  109. }
  110. }
  111. ?>