rsssubcategorylist.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. James Rose <[email protected]>
  21. */
  22. include "root.php";
  23. require_once "resources/require.php";
  24. require_once "resources/check_auth.php";
  25. require_once "config.php";
  26. if (permission_exists('content_view')) {
  27. //access granted
  28. }
  29. else {
  30. echo "access denied";
  31. exit;
  32. }
  33. //add multi-lingual support
  34. $language = new text;
  35. $text = $language->get();
  36. require_once "resources/header.php";
  37. $order_by = $_GET["order_by"];
  38. $order = $_GET["order"];
  39. echo "<div align='center'>";
  40. echo "<table border='0' cellpadding='0' cellspacing='2'>\n";
  41. echo "<tr class='border'>\n";
  42. echo " <td align=\"left\">\n";
  43. echo " <br>";
  44. $sql = "";
  45. $sql .= "select * from v_rss_sub_category ";
  46. $sql .= "where domain_uuid = '$domain_uuid' ";
  47. if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
  48. $prep_statement = $db->prepare(check_sql($sql));
  49. $prep_statement->execute();
  50. $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
  51. $result_count = count($result);
  52. $c = 0;
  53. $row_style["0"] = "background-color: #F5F5DC;";
  54. $row_style["1"] = "background-color: #FFFFFF;";
  55. echo "<div align='left'>\n";
  56. echo "<table border='0' cellpadding='1' cellspacing='1'>\n";
  57. echo "<tr><td colspan='100%'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>";
  58. if ($result_count == 0) { //no results
  59. echo "<tr><td>&nbsp;</td></tr>";
  60. }
  61. else { //received results
  62. echo "<tr>";
  63. echo "<th nowrap>&nbsp; &nbsp; ";
  64. if (strlen($order_by)==0) {
  65. echo "<a href='?order_by=rss_sub_category_uuid&order=desc' title='ascending'>rss_sub_category_uuid</a>";
  66. }
  67. else {
  68. if ($order=="asc") {
  69. echo "<a href='?order_by=rss_sub_category_uuid&order=desc' title='ascending'>rss_sub_category_uuid</a>";
  70. }
  71. else {
  72. echo "<a href='?order_by=rss_sub_category_uuid&order=asc' title='descending'>rss_sub_category_uuid</a>";
  73. }
  74. }
  75. echo "&nbsp; &nbsp; </th>";
  76. echo "<th nowrap>&nbsp; &nbsp; ";
  77. if (strlen($order_by)==0) {
  78. echo "<a href='?order_by=rss_category&order=desc' title='ascending'>rss_category</a>";
  79. }
  80. else {
  81. if ($order=="asc") {
  82. echo "<a href='?order_by=rss_category&order=desc' title='ascending'>rss_category</a>";
  83. }
  84. else {
  85. echo "<a href='?order_by=rss_category&order=asc' title='descending'>rss_category</a>";
  86. }
  87. }
  88. echo "&nbsp; &nbsp; </th>";
  89. echo "<th nowrap>&nbsp; &nbsp; ";
  90. if (strlen($order_by)==0) {
  91. echo "<a href='?order_by=rss_sub_category&order=desc' title='ascending'>rss_sub_category</a>";
  92. }
  93. else {
  94. if ($order=="asc") {
  95. echo "<a href='?order_by=rss_sub_category&order=desc' title='ascending'>rss_sub_category</a>";
  96. }
  97. else {
  98. echo "<a href='?order_by=rss_sub_category&order=asc' title='descending'>rss_sub_category</a>";
  99. }
  100. }
  101. echo "&nbsp; &nbsp; </th>";
  102. echo "<th nowrap>&nbsp; &nbsp; ";
  103. if (strlen($order_by)==0) {
  104. echo "<a href='?order_by=rss_sub_category_description&order=desc' title='ascending'>rss_sub_category_description</a>";
  105. }
  106. else {
  107. if ($order=="asc") {
  108. echo "<a href='?order_by=rss_sub_category_description&order=desc' title='ascending'>rss_sub_category_description</a>";
  109. }
  110. else {
  111. echo "<a href='?order_by=rss_sub_category_description&order=asc' title='descending'>rss_sub_category_description</a>";
  112. }
  113. }
  114. echo "&nbsp; &nbsp; </th>";
  115. echo "<th nowrap>&nbsp; &nbsp; ";
  116. if (strlen($order_by)==0) {
  117. echo "<a href='?order_by=rss_add_user&order=desc' title='ascending'>rss_add_user</a>";
  118. }
  119. else {
  120. if ($order=="asc") {
  121. echo "<a href='?order_by=rss_add_user&order=desc' title='ascending'>rss_add_user</a>";
  122. }
  123. else {
  124. echo "<a href='?order_by=rss_add_user&order=asc' title='descending'>rss_add_user</a>";
  125. }
  126. }
  127. echo "&nbsp; &nbsp; </th>";
  128. echo "<th nowrap>&nbsp; &nbsp; ";
  129. if (strlen($order_by)==0) {
  130. echo "<a href='?order_by=rss_add_date&order=desc' title='ascending'>rss_add_date</a>";
  131. }
  132. else {
  133. if ($order=="asc") {
  134. echo "<a href='?order_by=rss_add_date&order=desc' title='ascending'>rss_add_date</a>";
  135. }
  136. else {
  137. echo "<a href='?order_by=rss_add_date&order=asc' title='descending'>rss_add_date</a>";
  138. }
  139. }
  140. echo "&nbsp; &nbsp; </th>";
  141. echo "</tr>";
  142. echo "<tr><td colspan='100%'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
  143. foreach($result as $row) {
  144. //print_r( $row );
  145. echo "<tr style='".$row_style[$c]."'>\n";
  146. echo "<td valign='top'><a href='rss_sub_categoryupdate.php?rss_sub_category_uuid=".escape($row[rss_sub_category_uuid])."'>".escape($row[rss_sub_category_uuid])."</a></td>";
  147. echo "<td valign='top'>".escape($row[rss_category])."</td>";
  148. echo "<td valign='top'>".escape($row[rss_sub_category])."</td>";
  149. echo "<td valign='top'>".escape($row[rss_sub_category_description])."</td>";
  150. echo "<td valign='top'>".escape($row[rss_add_user])."</td>";
  151. echo "<td valign='top'>".escape($row[rss_add_date])."</td>";
  152. echo "</tr>";
  153. echo "<tr><td colspan='100%'><img src='/images/spacer.gif' width='100%' height='1' style='background-color: #BBBBBB;'></td></tr>\n";
  154. if ($c==0) { $c=1; } else { $c=0; }
  155. } //end foreach unset($sql, $result, $row_count);
  156. echo "</table>\n";
  157. echo "</div>\n";
  158. echo " <br><br>";
  159. echo " </td>\n";
  160. echo "</tr>\n";
  161. } //end if results
  162. echo "</table>\n";
  163. echo "<input type='button' class='btn' name='' onclick=\"window.location='rss_sub_categorysearch.php'\" value='".$text['button-search']."'>&nbsp; &nbsp;\n";
  164. echo "<input type='button' class='btn' name='' onclick=\"window.location='rss_sub_categoryadd.php'\" value='".$text['button-add-title']."'>&nbsp; &nbsp;\n";
  165. echo "</div>";
  166. echo "<br><br>";
  167. require_once "resources/footer.php";
  168. unset ($result_count);
  169. unset ($result);
  170. unset ($key);
  171. unset ($val);
  172. unset ($c);
  173. ?>