rsslist.php 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. echo "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"\" href=\"rss.php\" />\n";
  38. $order_by = $_GET["order_by"];
  39. $order = $_GET["order"];
  40. echo "<table width='100%'>";
  41. echo "<tr>";
  42. echo "<td align='left'>";
  43. echo " <b>".escape($module_title)." ".$text['label-list']."</b>";
  44. echo "</td>";
  45. echo "<td align='right'>";
  46. //echo " <input type='button' class='btn' name='' onclick=\"window.location='rssadd.php'\" value='Add $module_title'>&nbsp; &nbsp;\n";
  47. echo "</td>";
  48. echo "</tr>";
  49. echo "</table>";
  50. $sql = "";
  51. $sql .= "select * from v_rss ";
  52. $sql .= "where domain_uuid = '$domain_uuid' ";
  53. $sql .= "and rss_category = '$rss_category' ";
  54. $sql .= "and length(rss_del_date) = 0 ";
  55. $sql .= "or domain_uuid = '$domain_uuid' ";
  56. $sql .= "and rss_category = '$rss_category' ";
  57. $sql .= "and rss_del_date is null ";
  58. if (strlen($order_by)> 0) {
  59. $sql .= "order by $order_by $order ";
  60. }
  61. else {
  62. $sql .= "order by rss_order asc ";
  63. }
  64. //echo $sql;
  65. $prep_statement = $db->prepare(check_sql($sql));
  66. $prep_statement->execute();
  67. $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
  68. $result_count = count($result);
  69. $c = 0;
  70. $row_style["0"] = "row_style0";
  71. $row_style["1"] = "row_style1";
  72. echo "<table class='tr_hover' width='100%' border='0' cellpadding='2' cellspacing='0'>\n";
  73. echo "<tr>";
  74. echo th_order_by('rss_title', $text['label-title'], $order_by, $order);
  75. echo th_order_by('rss_link', $text['label-link'], $order_by, $order);
  76. //echo th_order_by('rss_sub_category', 'Template', $order_by, $order);
  77. echo th_order_by('rss_group', $text['label-group'], $order_by, $order);
  78. echo th_order_by('rss_order', $text['label-order'], $order_by, $order, '', "style='text-align: center;'");
  79. if ($result_count == 0) { //no results
  80. echo "<td class='list_control_icons'>\n";
  81. }
  82. else {
  83. echo "<td class='list_control_icons'>\n";
  84. }
  85. echo " <a href='rssadd.php' alt='add'>$v_link_label_add</a>\n";
  86. echo "</td>\n";
  87. echo "</tr>";
  88. if ($result_count > 0) {
  89. foreach($result as $row) {
  90. //print_r( $row );
  91. $tr_link = "href='rssupdate.php?rss_uuid=".escape($row[rss_uuid])."'";
  92. echo "<tr ".$tr_link.">\n";
  93. //echo "<td valign='top'><a href='rssupdate.php?rss_uuid=".escape($row[rss_uuid])."'>".escape($row[rss_uuid])."</a></td>";
  94. //echo "<td valign='top'>".$row[rss_category]."</td>";
  95. echo "<td valign='top' nowrap class='".$row_style[$c]."'><a href='rssupdate.php?rss_uuid=".escape($row[rss_uuid])."'>".$row[rss_title]."</a></td>";
  96. echo "<td valign='top' nowrap class='".$row_style[$c]."'><a href='/index.php?c=".escape($row[rss_link])."'>".escape($row[rss_link])."</a></td>";
  97. //echo "<td valign='top' class='".$row_style[$c]."'>".$row[rss_sub_category]."&nbsp;</td>";
  98. if (strlen($row[rss_group]) > 0) {
  99. echo "<td valign='top' class='".$row_style[$c]."'>".escape($row[rss_group])."</td>";
  100. }
  101. else {
  102. echo "<td valign='top' class='".$row_style[$c]."'>public</td>";
  103. }
  104. //echo "<td valign='top'>".$row[rss_description]."</td>";
  105. //echo "<td valign='top'>".$row[rss_img]."</td>";
  106. //echo "<td valign='top'>&nbsp;".$row[rss_optional_1]."&nbsp;</td>"; //priority
  107. //echo "<td valign='top' class='".$row_style[$c]."'>&nbsp;";
  108. //sif ($row[rss_optional_2]=="100") {
  109. // echo "Complete";
  110. //}
  111. //else {
  112. // echo $row[rss_optional_2]."%";
  113. //}
  114. //echo "&nbsp;</td>"; //completion status
  115. //echo "<td valign='top'>".$row[rss_optional_3]."</td>";
  116. //echo "<td valign='top'>".$row[rss_optional_4]."</td>";
  117. //echo "<td valign='top'>".$row[rss_optional_5]."</td>";
  118. echo "<td valign='top' class='".$row_style[$c]."' style='text-align: center;'>".escape($row[rss_order])."</td>";
  119. //echo "<td valign='top' align='center'>";
  120. //echo " <input type='button' class='btn' name='' onclick=\"window.location='rssmoveup.php?menuparentid=".escape($row[menuparentid])."&rss_uuid=".escape($row[rss_uuid])."&rss_order=".escape($row[rss_order])."'\" value='<' title='".escape($row[rss_order]).". Move Up'>";
  121. //echo " <input type='button' class='btn' name='' onclick=\"window.location='rssmovedown.php?menuparentid=".escape($row[menuparentid])."&rss_uuid=".escape($row[rss_uuid])."&rss_order=".escape($row[rss_order])."'\" value='>' title='".escape($row[rss_order]).". Move Down'>";
  122. //echo "</td>";
  123. echo " <td class='list_control_icons'>";
  124. echo "<a href='rssupdate.php?rss_uuid=".escape($row[rss_uuid])."' alt='".$text['label-edit']."'>$v_link_label_edit</a>";
  125. echo "<a href='rssdelete.php?rss_uuid=".escape($row[rss_uuid])."' alt='delete' onclick=\"return confirm('".$text['message-confirm-delete']."')\">$v_link_label_delete</a>";
  126. echo "</td>\n";
  127. //echo "<td valign='top' align='right' class='".$row_style[$c]."'>";
  128. //echo " <input type='button' class='btn' name='' onclick=\"if (confirm('Are you sure you wish to continue?')) { window.location='rssdelete.php?rss_uuid=".escape($row[rss_uuid])."' }\" value='Delete'>";
  129. //echo "</td>";
  130. echo "</tr>";
  131. if ($c==0) { $c=1; } else { $c=0; }
  132. } //end foreach
  133. unset($sql, $result, $row_count);
  134. } //end if results
  135. echo "<tr>\n";
  136. echo "<td colspan='6' align='left'>\n";
  137. echo " <table border='0' width='100%' cellpadding='0' cellspacing='0'>\n";
  138. echo " <tr>\n";
  139. echo " <td width='33.3%' nowrap>&nbsp;</td>\n";
  140. echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
  141. echo " <td class='list_control_icons'>\n";
  142. echo " <a href='rssadd.php' alt='add'>$v_link_label_add</a>\n";
  143. echo " </td>\n";
  144. echo " </tr>\n";
  145. echo " </table>\n";
  146. echo "</td>\n";
  147. echo "</tr>\n";
  148. echo "</table>\n";
  149. echo "<br><br>";
  150. //echo "<input type='button' class='btn' name='' onclick=\"window.location='rsssearch.php'\" value='Search'>&nbsp; &nbsp;\n";
  151. //echo "<input type='button' class='btn' name='' onclick=\"window.location='rssadd.php'\" value='Add ".escape($module_title)."'>&nbsp; &nbsp;\n";
  152. require_once "resources/footer.php";
  153. unset ($result_count);
  154. unset ($result);
  155. unset ($key);
  156. unset ($val);
  157. unset ($c);
  158. ?>