PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 0ms

/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
11<script language="javascript" type="text/javascript" src="<?php echo $this->config->item('staticPath'); ?>/js/jquery.fieldreplace.js"></script>
12<script type="text/javascript">
13$(function(){
14    $('#searchbox').fieldreplace();
15	function formatItem(row) {
16		if (row[0].length) return row[1]+'<br /><span class="email">('+row[0]+')</span>';
17		else return 'No results';
18	}
19	$('#searchbox').autocomplete("/halogy/ac_sites", { delay: "0", selectFirst: false, matchContains: true, formatItem: formatItem, minChars: 2 });
20	$('#searchbox').result(function(event, data, formatted){
21		$(this).parent('form').submit();
22	});	
23});
24</script>
25
26<h1 class="headingleft">Your Sites</h1>
27
28<div class="headingright">
29
30	<form method="post" action="/halogy/sites/" class="default" id="search">
31		<input type="text" name="searchbox" id="searchbox" class="formelement inactive" title="Search Sites..." />
32		<input type="image" src="<?php echo $this->config->item('staticPath'); ?>/images/btn_search.gif" id="searchbutton" />
33	</form>
34
35	<a href="/halogy/add_site" class="button">Add Site</a>
36</div>
37
38<div class="clear"></div>
39
40<?php if ($sites): ?>
41
42<?php echo $this->pagination->create_links(); ?>
43
44<table class="default">
45	<tr>
46		<th><?php echo order_link('halogy/sites/viewall','siteName','Site Name'); ?></th>
47		<th><?php echo order_link('halogy/sites/viewall','dateCreated','Date Created'); ?></th>
48		<th><?php echo order_link('halogy/sites/viewall','siteDomain','Domain'); ?></th>
49		<th><?php echo order_link('halogy/sites/viewall','altDomain','Staging Domain'); ?></th>		
50		<th class="narrow"><?php echo order_link('halogy/sites/viewall','active','Status'); ?></th>		
51		<th class="tiny">&nbsp;</th>
52	</tr>
53<?php
54	$i=0;
55	foreach ($sites as $site):
56	$class = ($i % 2) ? ' class="alt"' : ''; $i++;
57?>
58	<tr<?php echo $class; ?>>
59		<td><?php echo anchor('/halogy/edit_site/'.$site['siteID'], $site['siteName']); ?></td>
60		<td><?php echo dateFmt($site['dateCreated']); ?></td>		
61		<td><?php echo $site['siteDomain']; ?></td>
62		<td><?php echo $site['altDomain']; ?></td>		
63		<td>
64			<?php
65				if ($site['active']) echo '<span style="color:green"><strong>Active</strong></span>';
66				if (!$site['active']) echo '<span style="color:red">Suspended</span>';
67			?>
68		</td>	
69		<td class="tiny">
70			<?php echo anchor('/halogy/edit_site/'.$site['siteID'], 'Edit'); ?>
71		</td>
72	</tr>
73<?php endforeach; ?>
74</table>
75
76<?php echo $this->pagination->create_links(); ?>
77
78<p style="text-align: right;"><a href="#" class="button grey" id="totop">Back to top</a></p>
79
80<?php else: ?>
81
82	<?php if (count($_POST)): ?>
83	
84		<p>No sites found.</p>
85	
86	<?php else: ?>
87	
88		<p>You haven't created any sites yet. Create one using the &ldquo;Add Site&rdquo; link above.</p>
89	
90	<?php endif; ?>
91
92<?php endif; ?>
93