/halogy/application/modules/halogy/views/sites.php

https://bitbucket.org/haloweb/halogy-1.0/ · PHP · 93 lines · 77 code · 16 blank · 0 comment · 6 complexity · ff91a6e78a4bce8ed09b79226b0fa8b5 MD5 · raw file

  1. <style type="text/css">
  2. .ac_results { padding: 0px; border: 1px solid black; background-color: white; overflow: hidden; z-index: 99999; }
  3. .ac_results ul { width: 100%; list-style-position: outside; list-style: none; padding: 0; margin: 0; }
  4. .ac_results li { margin: 0px; padding: 2px 5px; cursor: default; display: block; font: menu; font-size: 12px; line-height: 16px; overflow: hidden; }
  5. .ac_results li span.email { font-size: 10px; }
  6. .ac_loading { background: white url('<?php echo $this->config->item('staticPath'); ?>/images/loader.gif') right center no-repeat; }
  7. .ac_odd { background-color: #eee; }
  8. .ac_over { background-color: #0A246A; color: white; }
  9. </style>
  10. <script language="javascript" type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/jquery.fieldreplace.js"></script>
  11. <script type="text/javascript">
  12. $(function(){
  13. $('#searchbox').fieldreplace();
  14. function formatItem(row) {
  15. if (row[0].length) return row[1]+'<br /><span class="email">('+row[0]+')</span>';
  16. else return 'No results';
  17. }
  18. $('#searchbox').autocomplete("/halogy/ac_sites", { delay: "0", selectFirst: false, matchContains: true, formatItem: formatItem, minChars: 2 });
  19. $('#searchbox').result(function(event, data, formatted){
  20. $(this).parent('form').submit();
  21. });
  22. });
  23. </script>
  24. <h1 class="headingleft">Your Sites</h1>
  25. <div class="headingright">
  26. <form method="post" action="/halogy/sites/" class="default" id="search">
  27. <input type="text" name="searchbox" id="searchbox" class="formelement inactive" title="Search Sites..." />
  28. <input type="image" src="<?php echo $this->config->item('staticPath'); ?>/images/btn_search.gif" id="searchbutton" />
  29. </form>
  30. <a href="/halogy/add_site" class="button">Add Site</a>
  31. </div>
  32. <div class="clear"></div>
  33. <?php if ($sites): ?>
  34. <?php echo $this->pagination->create_links(); ?>
  35. <table class="default">
  36. <tr>
  37. <th><?php echo order_link('halogy/sites/viewall','siteName','Site Name'); ?></th>
  38. <th><?php echo order_link('halogy/sites/viewall','dateCreated','Date Created'); ?></th>
  39. <th><?php echo order_link('halogy/sites/viewall','siteDomain','Domain'); ?></th>
  40. <th><?php echo order_link('halogy/sites/viewall','altDomain','Staging Domain'); ?></th>
  41. <th class="narrow"><?php echo order_link('halogy/sites/viewall','active','Status'); ?></th>
  42. <th class="tiny">&nbsp;</th>
  43. </tr>
  44. <?php
  45. $i=0;
  46. foreach ($sites as $site):
  47. $class = ($i % 2) ? ' class="alt"' : ''; $i++;
  48. ?>
  49. <tr<?php echo $class; ?>>
  50. <td><?php echo anchor('/halogy/edit_site/'.$site['siteID'], $site['siteName']); ?></td>
  51. <td><?php echo dateFmt($site['dateCreated']); ?></td>
  52. <td><?php echo $site['siteDomain']; ?></td>
  53. <td><?php echo $site['altDomain']; ?></td>
  54. <td>
  55. <?php
  56. if ($site['active']) echo '<span style="color:green"><strong>Active</strong></span>';
  57. if (!$site['active']) echo '<span style="color:red">Suspended</span>';
  58. ?>
  59. </td>
  60. <td class="tiny">
  61. <?php echo anchor('/halogy/edit_site/'.$site['siteID'], 'Edit'); ?>
  62. </td>
  63. </tr>
  64. <?php endforeach; ?>
  65. </table>
  66. <?php echo $this->pagination->create_links(); ?>
  67. <p style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
  68. <?php else: ?>
  69. <?php if (count($_POST)): ?>
  70. <p>No sites found.</p>
  71. <?php else: ?>
  72. <p>You haven't created any sites yet. Create one using the &ldquo;Add Site&rdquo; link above.</p>
  73. <?php endif; ?>
  74. <?php endif; ?>