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

/halogy/application/modules/halogy/views/dashboard.php

https://bitbucket.org/haloweb/halogy-1.0/
PHP | 290 lines | 251 code | 39 blank | 0 comment | 21 complexity | 292d6568d970549261c7d1b48daa8f03 MD5 | raw file
  1. <script type="text/javascript">
  2. var days = <?php echo $days; ?>;
  3. </script>
  4. <script type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/jquery.flot.js"></script>
  5. <!--[if IE]>
  6. <script language="javascript" type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/excanvas.js"></script>
  7. <![endif]-->
  8. <script type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/jquery.flot.init.js"></script>
  9. <script type="text/javascript">
  10. function refresh(){
  11. $('div.loader').load('/admin/activity_ajax');
  12. timeoutID = setTimeout(refresh, 5000);
  13. }
  14. $(function(){
  15. timeoutID = setTimeout(refresh, 5000);
  16. });
  17. </script>
  18. <div id="tpl-2col">
  19. <div class="col1">
  20. <h1><strong><?php echo ($this->session->userdata('firstName')) ? ucfirst($this->session->userdata('firstName')) : $this->session->userdata('username'); ?>'s</strong> Dashboard</h1>
  21. <?php if ($errors = validation_errors()): ?>
  22. <div class="error">
  23. <?php echo $errors; ?>
  24. </div>
  25. <?php endif; ?>
  26. <?php if ($message): ?>
  27. <div class="message">
  28. <?php echo $message; ?>
  29. </div>
  30. <?php endif; ?>
  31. <ul class="dashboardnav">
  32. <li class="<?php echo ($days == 30) ? 'active' : ''; ?>"><a href="/admin">Last 30 Days</a></li>
  33. <li class="<?php echo ($days == 60) ? 'active' : ''; ?>"><a href="/admin/dashboard/60">Last 60 Days</a></li>
  34. <li class="<?php echo ($days == 90) ? 'active' : ''; ?>"><a href="/admin/dashboard/90">3 Months</a></li>
  35. <li><a href="/admin/tracking">Most Recent Visits</a></li>
  36. </ul>
  37. <div id="placeholder"></div>
  38. <div id="activity" class="loader">
  39. <?php echo $activity; ?>
  40. </div>
  41. <?php if (@in_array('pages', $this->permission->permissions)): ?>
  42. <div class="module">
  43. <h2><strong>Manage Your Pages</strong></h2>
  44. <p>You can set up a new page or edit other pages on your website easily.</p>
  45. <p><a href="/admin/pages" class="button">Manage Pages</a></p>
  46. </div>
  47. <?php endif; ?>
  48. <?php if (@in_array('pages_templates', $this->permission->permissions)): ?>
  49. <div class="module last">
  50. <h2><strong>Build Templates</strong></h2>
  51. <p>Gain full control over templates for pages and modules (such as the Blog).</p>
  52. <p><a href="/admin/pages/templates" class="button">Manage Templates</a></p>
  53. </div>
  54. <?php endif; ?>
  55. <?php if (@in_array('images', $this->permission->permissions)): ?>
  56. <div class="module">
  57. <h2><strong>Upload Images</strong></h2>
  58. <p>Upload images to your website, either individually or with a ZIP file.</p>
  59. <p><a href="/admin/images" class="button">Manage Images</a></p>
  60. </div>
  61. <?php endif; ?>
  62. <?php if (@in_array('users', $this->permission->permissions)): ?>
  63. <div class="module last">
  64. <h2><strong>Manage Your Users</strong></h2>
  65. <p>See who's using your site or add administrators to help you run it.</p>
  66. <p><a href="/admin/users" class="button">Manage Users</a></p>
  67. </div>
  68. <?php endif; ?>
  69. <?php if (@in_array('blog', $this->permission->permissions)): ?>
  70. <div class="module">
  71. <h2><strong>Get Using the Blog</strong></h2>
  72. <p>Add posts to your blog and view comments made by others.</p>
  73. <p><a href="/admin/blog" class="button">Manage Blog</a></p>
  74. </div>
  75. <?php endif; ?>
  76. <?php if (@in_array('shop', $this->permission->permissions)): ?>
  77. <div class="module last">
  78. <h2><strong>Build Your Shop</strong></h2>
  79. <p>Set up categories, add products and sell online through the shop.</p>
  80. <p><a href="/admin/shop" class="button">Manage Shop</a></p>
  81. </div>
  82. <?php endif; ?>
  83. <br class="clear" /><br />
  84. <?php if ($this->site->config['plan'] > 0 && $this->site->config['plan'] < 6): ?>
  85. <div class="quota">
  86. <div class="<?php echo ($quota > $this->site->plans['storage']) ? 'over' : 'used'; ?>" style="width: <?php echo ($quota > 0) ? (floor($quota / $this->site->plans['storage'] * 100)) : 0; ?>%"><?php echo floor($quota / $this->site->plans['storage'] * 100); ?>%</div>
  87. </div>
  88. <p><small>You have used <strong><?php echo number_format($quota); ?>kb</strong> out of your <strong><?php echo number_format($this->site->plans['storage']); ?> KB</strong> quota.</small></p>
  89. <?php endif; ?>
  90. <br />
  91. </div>
  92. <div class="col2">
  93. <h3>Site Info</h3>
  94. <table class="default">
  95. <tr>
  96. <th class="narrow">Site name:</th>
  97. <td><?php echo $this->site->config['siteName']; ?></td>
  98. </tr>
  99. <tr>
  100. <th class="narrow">Site URL:</th>
  101. <td><small><a href="<?php echo $this->site->config['siteURL']; ?>"><?php echo $this->site->config['siteURL']; ?></a></small></td>
  102. </tr>
  103. <tr>
  104. <th class="narrow">Site email:</th>
  105. <td><small><a href="mailto:<?php echo $this->site->config['siteEmail']; ?>"><?php echo $this->site->config['siteEmail']; ?></a></small></td>
  106. </tr>
  107. </table>
  108. <h3>Site Stats</h3>
  109. <table class="default">
  110. <tr>
  111. <th class="narrow">Disk space used:</th>
  112. <td><?php echo number_format($quota); ?> <small>KB</small></td>
  113. </tr>
  114. <tr>
  115. <th class="narrow">Total page views:</th>
  116. <td><?php echo number_format($numPageViews); ?> <small>views</small></td>
  117. </tr>
  118. <tr>
  119. <th class="narrow">Pages:</th>
  120. <td><?php echo $numPages; ?> <small>page<?php echo ($numPages != 1) ? 's' : ''; ?></small></td>
  121. </tr>
  122. <?php if (@in_array('blog', $this->permission->permissions)): ?>
  123. <tr>
  124. <th class="narrow">Blog posts:</th>
  125. <td><?php echo $numBlogPosts ?> <small>post<?php echo ($numBlogPosts != 1) ? 's' : ''; ?></small></td>
  126. </tr>
  127. <?php endif; ?>
  128. </table>
  129. <h3>User Stats</h3>
  130. <table class="default">
  131. <tr>
  132. <th class="narrow">Total users:</th>
  133. <td colspan="2"><?php echo number_format($numUsers); ?> <small>user<?php echo ($numUsers != 1) ? 's' : ''; ?></small></td>
  134. </tr>
  135. <tr>
  136. <th class="narrow">New today:</th>
  137. <td>
  138. <?php echo number_format($numUsersToday); ?> <small>user<?php echo ($numUsersToday != 1) ? 's' : ''; ?></small>
  139. </td>
  140. <td>
  141. <?php
  142. $difference = @round(100 / $numUsersYesterday * ($numUsersToday - $numUsersYesterday), 2);
  143. $polarity = ($difference < 0) ? '' : '+';
  144. ?>
  145. <?php if ($difference != 0): ?>
  146. <small>(<span style="color:<?php echo ($polarity == '+') ? 'green' : 'red'; ?>"><?php echo $polarity.$difference; ?>%</span>)</small>
  147. <?php endif; ?>
  148. </td>
  149. </tr>
  150. <tr>
  151. <th class="narrow">New yesterday:</th>
  152. <td colspan="2"><?php echo number_format($numUsersYesterday); ?> <small>user<?php echo ($numUsersYesterday != 1) ? 's' : ''; ?></small></td>
  153. </tr>
  154. <tr>
  155. <th class="narrow">New this week:</th>
  156. <td>
  157. <?php echo number_format($numUsersWeek); ?> <small>user<?php echo ($numUsersWeek != 1) ? 's' : ''; ?></small>
  158. </td>
  159. <td>
  160. <?php
  161. $difference = @round(100 / $numUsersLastWeek * ($numUsersWeek - $numUsersLastWeek), 2);
  162. $polarity = ($difference < 0) ? '' : '+';
  163. ?>
  164. <?php if ($difference != 0): ?>
  165. <small>(<span style="color:<?php echo ($polarity == '+') ? 'green' : 'red'; ?>"><?php echo $polarity.$difference; ?>%</span>)</small>
  166. <?php endif; ?>
  167. </td>
  168. </tr>
  169. <tr>
  170. <th class="narrow">New last week:</th>
  171. <td colspan="2"><?php echo number_format($numUsersLastWeek); ?> <small>user<?php echo ($numUsersLastWeek != 1) ? 's' : ''; ?></small></td>
  172. </tr>
  173. </table>
  174. <h3>Most popular pages</h3>
  175. <?php if ($popularPages): ?>
  176. <ol>
  177. <?php foreach ($popularPages as $page): ?>
  178. <li><?php echo anchor(site_url('/admin/pages/edit/'.$page['pageID']), $page['pageName']); ?></li>
  179. <?php endforeach; ?>
  180. </ol>
  181. <?php else: ?>
  182. <p><small>We don't have this information yet.</small></p>
  183. <?php endif; ?>
  184. <br />
  185. <?php if (@in_array('blog', $this->permission->sitePermissions)): ?>
  186. <h3>Most popular blog posts</h3>
  187. <?php if ($popularBlogPosts): ?>
  188. <ol>
  189. <?php foreach ($popularBlogPosts as $post): ?>
  190. <li><?php echo anchor(site_url('/admin/blog/edit_post/'.$post['postID']), $post['postTitle']); ?></li>
  191. <?php endforeach; ?>
  192. </ol>
  193. <?php else: ?>
  194. <p><small>We don't have this information yet.</small></p>
  195. <?php endif; ?>
  196. <br />
  197. <?php endif; ?>
  198. <?php if (@in_array('shop', $this->permission->sitePermissions)): ?>
  199. <h3>Most popular shop products</h3>
  200. <?php if ($popularShopProducts): ?>
  201. <ol>
  202. <?php foreach ($popularShopProducts as $product): ?>
  203. <li><?php echo anchor(site_url('/admin/shop/edit_product/'.$product['productID']), $product['productName']); ?></li>
  204. <?php endforeach; ?>
  205. </ol>
  206. <?php else: ?>
  207. <p><small>We don't have this information yet.</small></p>
  208. <?php endif; ?>
  209. <?php endif; ?>
  210. </div>
  211. <br class="clear" />
  212. </div>