PageRenderTime 29ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/oc-admin/themes/modern/main/index.php

https://bitbucket.org/ricktaylord/osclass
PHP | 144 lines | 127 code | 1 blank | 16 comment | 7 complexity | 3331a306af54f5959c1f86d5ecc856e4 MD5 | raw file
Possible License(s): LGPL-2.1, GPL-2.0
  1. <?php
  2. /**
  3. * OSClass – software for creating and publishing online classified advertising platforms
  4. *
  5. * Copyright (C) 2010 OSCLASS
  6. *
  7. * This program is free software: you can redistribute it and/or modify it under the terms
  8. * of the GNU Affero General Public License as published by the Free Software Foundation,
  9. * either version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
  12. * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  13. * See the GNU Affero General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Affero General Public
  16. * License along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. $numUsers = __get("numUsers") ;
  19. $numAdmins = __get("numAdmins") ;
  20. $numItems = __get("numItems") ;
  21. $numItemsSpam = __get("numItemsSpam") ;
  22. $numItemsBlock = __get("numItemsBlock") ;
  23. $numItemsInactive = __get("numItemsInactive") ;
  24. $numItemsPerCategory = __get("numItemsPerCategory") ;
  25. $newsList = __get("newsList") ;
  26. $comments = __get("comments") ;
  27. ?>
  28. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  29. <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="<?php echo str_replace('_', '-', osc_current_user_locale()) ; ?>">
  30. <head>
  31. <?php osc_current_admin_theme_path('head.php') ; ?>
  32. </head>
  33. <body>
  34. <?php osc_current_admin_theme_path('header.php') ; ?>
  35. <!-- container -->
  36. <div id="content">
  37. <?php osc_current_admin_theme_path( 'include/backoffice_menu.php' ) ; ?>
  38. <!-- right container -->
  39. <div class="right">
  40. <div class="header_title">
  41. <h1 class="dashboard"><?php _e('Dashboard') ; ?></h1>
  42. </div>
  43. <?php osc_show_flash_message('admin') ; ?>
  44. <!-- dashboard -->
  45. <div class="main-page">
  46. <!-- dashboard boxes -->
  47. <div class="sortable_div">
  48. <div class="float50per">
  49. <div class="latest-items ui-dialog ui-corner-all">
  50. <h3 class="ui-dialog-titlebar"><?php _e('Items by category') ; ?></h3>
  51. <div class="ui-state-body">
  52. <?php if( !empty($numItemsPerCategory) ) { ?>
  53. <ul>
  54. <?php foreach($numItemsPerCategory as $c) { ?>
  55. <li>
  56. <a href="<?php echo osc_admin_base_url(true); ?>?page=items&amp;catId=<?php echo $c['pk_i_id'] ; ?>"><?php echo $c['s_name'] ; ?></a>
  57. <?php echo "(" . $c['i_num_items'] . "&nbsp;" . ( ( $c['i_num_items'] == 1 ) ? __('Item') : __('Items') ) . ")" ; ?>
  58. <ul>
  59. <?php foreach($c['categories'] as $subc) {?>
  60. <li>
  61. <a href="<?php echo osc_admin_base_url(true); ?>?page=items&amp;catId=<?php echo $subc['pk_i_id'];?>"><?php echo $subc['s_name'] ; ?></a>
  62. <?php echo "(" . $subc['i_num_items'] . " " . ( ( $subc['i_num_items'] == 1 ) ? __('Item') : __('Items') ) . ")" ; ?>
  63. </li>
  64. <?php }?>
  65. </ul>
  66. </li>
  67. <?php }?>
  68. </ul>
  69. <?php } else { ?>
  70. <?php _e("There aren't any uploaded items yet") ; ?>
  71. <?php } ?>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="float50per">
  76. <div class="dashboard-statistics ui-dialog ui-corner-all">
  77. <h3 class="ui-dialog-titlebar"><?php _e('Statistics'); ?></h3>
  78. <div class="ui-state-body">
  79. <ul>
  80. <li><?php printf( __('Number of items: %d'), (int) $numItems ) ; ?></li>
  81. <li><?php printf( __('Number of public users: %d'), (int) $numUsers ) ; ?></li>
  82. <li><?php printf( __('Number of administrators: %d'), $numAdmins ) ; ?></li>
  83. <li><?php printf( __('Number of items marked as spam: %d'), $numItemsSpam) ; ?></li>
  84. <li><?php printf( __('Number of items marked as blocked: %d'), $numItemsBlock) ; ?></li>
  85. <li><?php printf( __('Number of items marked as inactive: %d'), $numItemsInactive ) ; ?></li>
  86. </ul>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="float50per">
  91. <div class="latest-comments ui-dialog ui-corner-all">
  92. <h3 class="ui-dialog-titlebar"><?php _e('Latest comments') ; ?></h3>
  93. <div class="ui-state-body">
  94. <?php if (count($comments) > 0) { ?>
  95. <ul>
  96. <?php foreach($comments as $c) { ?>
  97. <li>
  98. <strong><?php echo $c['s_author_name'] ; ?></strong> <?php _e('Commented on item') ; ?> <em><a title="<?php echo $c['s_body'] ; ?>" target='_blank' href='<?php echo osc_base_url(true) . '?page=item&amp;id=' . $c['fk_i_item_id'] ; ?>' id='dt_link'><?php echo $c['s_title'] ; ?></a></em>
  99. </li>
  100. <?php } ?>
  101. </ul>
  102. <?php } else { ?>
  103. <?php _e("There aren't any comments yet") ; ?>
  104. <?php } ?>
  105. </div>
  106. </div>
  107. </div>
  108. <div class="float50per">
  109. <div class="latest-news ui-dialog ui-corner-all">
  110. <h3 class="ui-dialog-titlebar"><?php _e('Latest news from OSClass') ; ?></h3>
  111. <div class="ui-state-body">
  112. <?php if( is_array($newsList) ) { ?>
  113. <ul>
  114. <?php foreach ($newsList as $list) { ?>
  115. <?php $new = ( strtotime($list['pubDate']) > strtotime('-1 week') ? true : false ) ; ?>
  116. <li>
  117. <a href="<?php echo $list['link'] ; ?>" target="_blank"><?php echo $list['title'] ; ?></a>
  118. <?php if( $new ) { ?>
  119. <span style="color:red; font-size:10px; font-weight:bold;"><?php _e('new') ; ?></span>
  120. <?php } ?>
  121. </li>
  122. <?php } ?>
  123. </ul>
  124. <?php } else { ?>
  125. <?php _e('Unable to fetch news from OSClass. Please try again later') ; ?>
  126. <?php } ?>
  127. </div>
  128. </div>
  129. </div>
  130. <div class="clear"></div>
  131. </div>
  132. <!-- /dashboard boxes -->
  133. </div>
  134. <!-- /dashboard -->
  135. </div>
  136. <!-- /right container -->
  137. </div>
  138. <!-- /container -->
  139. <?php osc_current_admin_theme_path('footer.php') ; ?>
  140. </body>
  141. </html>