PageRenderTime 56ms CodeModel.GetById 10ms app.highlight 18ms RepoModel.GetById 13ms 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">
 10function 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
 19<div id="tpl-2col">
 20	
 21	<div class="col1">
 22
 23		<h1><strong><?php echo ($this->session->userdata('firstName')) ? ucfirst($this->session->userdata('firstName')) : $this->session->userdata('username'); ?>'s</strong> Dashboard</h1>
 24		
 25		<?php if ($errors = validation_errors()): ?>
 26			<div class="error">
 27				<?php echo $errors; ?>
 28			</div>
 29		<?php endif; ?>
 30
 31		<?php if ($message): ?>
 32			<div class="message">
 33				<?php echo $message; ?>
 34			</div>
 35		<?php endif; ?>
 36
 37		<ul class="dashboardnav">
 38			<li class="<?php echo ($days == 30) ? 'active' : ''; ?>"><a href="/admin">Last 30 Days</a></li>
 39			<li class="<?php echo ($days == 60) ? 'active' : ''; ?>"><a href="/admin/dashboard/60">Last 60 Days</a></li>
 40			<li class="<?php echo ($days == 90) ? 'active' : ''; ?>"><a href="/admin/dashboard/90">3 Months</a></li>
 41			<li><a href="/admin/tracking">Most Recent Visits</a></li>
 42		</ul>
 43
 44		<div id="placeholder"></div>
 45		
 46		<div id="activity" class="loader">
 47			<?php echo $activity; ?>
 48		</div>
 49
 50		<?php if (@in_array('pages', $this->permission->permissions)): ?>
 51
 52			<div class="module">
 53			
 54				<h2><strong>Manage Your Pages</strong></h2>
 55			
 56				<p>You can set up a new page or edit other pages on your website easily.</p>
 57			
 58				<p><a href="/admin/pages" class="button">Manage Pages</a></p>
 59				
 60			</div>
 61
 62		<?php endif; ?>
 63
 64		
 65		<?php if (@in_array('pages_templates', $this->permission->permissions)): ?>
 66
 67			<div class="module last">
 68			
 69				<h2><strong>Build Templates</strong></h2>
 70			
 71				<p>Gain full control over templates for pages and modules (such as the Blog).</p>
 72	
 73				<p><a href="/admin/pages/templates" class="button">Manage Templates</a></p>
 74				
 75			</div>
 76			
 77		<?php endif; ?>
 78		
 79		<?php if (@in_array('images', $this->permission->permissions)): ?>
 80
 81			<div class="module">
 82			
 83				<h2><strong>Upload Images</strong></h2>
 84			
 85				<p>Upload images to your website, either individually or with a ZIP file.</p>
 86	
 87				<p><a href="/admin/images" class="button">Manage Images</a></p>
 88				
 89			</div>
 90			
 91		<?php endif; ?>
 92		
 93		<?php if (@in_array('users', $this->permission->permissions)): ?>
 94		
 95			<div class="module last">
 96			
 97				<h2><strong>Manage Your Users</strong></h2>
 98			
 99				<p>See who's using your site or add administrators to help you run it.</p>
100	
101				<p><a href="/admin/users" class="button">Manage Users</a></p>
102				
103			</div>
104
105		<?php endif; ?>
106
107		<?php if (@in_array('blog', $this->permission->permissions)): ?>
108
109			<div class="module">
110			
111				<h2><strong>Get Using the Blog</strong></h2>
112			
113				<p>Add posts to your blog and view comments made by others.</p>
114	
115				<p><a href="/admin/blog" class="button">Manage Blog</a></p>
116				
117			</div>
118			
119		<?php endif; ?>
120
121		<?php if (@in_array('shop', $this->permission->permissions)): ?>
122			<div class="module last">
123			
124				<h2><strong>Build Your Shop</strong></h2>
125			
126				<p>Set up categories, add products and sell online through the shop.</p>
127			
128				<p><a href="/admin/shop" class="button">Manage Shop</a></p>
129				
130			</div>
131		<?php endif; ?>
132
133		<br class="clear" /><br />
134
135		<?php if ($this->site->config['plan'] > 0 && $this->site->config['plan'] < 6): ?>		
136
137			<div class="quota">
138				<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>
139			</div>
140			
141			<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>
142
143		<?php endif; ?>
144
145		<br />
146	
147	</div>
148	
149	<div class="col2">
150
151		<h3>Site Info</h3>
152		
153		<table class="default">
154			<tr>
155				<th class="narrow">Site name:</th>
156				<td><?php echo $this->site->config['siteName']; ?></td>
157			</tr>
158			<tr>
159				<th class="narrow">Site URL:</th>
160				<td><small><a href="<?php echo $this->site->config['siteURL']; ?>"><?php echo $this->site->config['siteURL']; ?></a></small></td>
161			</tr>
162			<tr>
163				<th class="narrow">Site email:</th>
164				<td><small><a href="mailto:<?php echo $this->site->config['siteEmail']; ?>"><?php echo $this->site->config['siteEmail']; ?></a></small></td>
165			</tr>
166		</table>
167
168		<h3>Site Stats</h3>
169		
170		<table class="default">
171			<tr>
172				<th class="narrow">Disk space used:</th>
173				<td><?php echo number_format($quota); ?> <small>KB</small></td>
174			</tr>
175			<tr>
176				<th class="narrow">Total page views:</th>
177				<td><?php echo number_format($numPageViews); ?> <small>views</small></td>
178			</tr>
179			<tr>
180				<th class="narrow">Pages:</th>
181				<td><?php echo $numPages; ?> <small>page<?php echo ($numPages != 1) ? 's' : ''; ?></small></td>
182			</tr>
183			<?php if (@in_array('blog', $this->permission->permissions)): ?>
184				<tr>
185					<th class="narrow">Blog posts:</th>
186					<td><?php echo $numBlogPosts ?> <small>post<?php echo ($numBlogPosts != 1) ? 's' : ''; ?></small></td>
187				</tr>
188			<?php endif; ?>
189		</table>
190
191		<h3>User Stats</h3>
192		
193		<table class="default">
194			<tr>
195				<th class="narrow">Total users:</th>
196				<td colspan="2"><?php echo number_format($numUsers); ?> <small>user<?php echo ($numUsers != 1) ? 's' : ''; ?></small></td>
197			</tr>
198			<tr>
199				<th class="narrow">New today:</th>
200				<td>			
201					<?php echo number_format($numUsersToday); ?> <small>user<?php echo ($numUsersToday != 1) ? 's' : ''; ?></small>
202				</td>
203				<td>
204					<?php
205						$difference = @round(100 / $numUsersYesterday * ($numUsersToday - $numUsersYesterday), 2);
206						$polarity = ($difference < 0) ? '' : '+';
207					?>						
208					<?php if ($difference != 0): ?>
209						<small>(<span style="color:<?php echo ($polarity == '+') ? 'green' : 'red'; ?>"><?php echo $polarity.$difference; ?>%</span>)</small>
210					<?php endif; ?>
211				</td>
212			</tr>
213			<tr>
214				<th class="narrow">New yesterday:</th>
215				<td colspan="2"><?php echo number_format($numUsersYesterday); ?> <small>user<?php echo ($numUsersYesterday != 1) ? 's' : ''; ?></small></td>
216			</tr>
217			<tr>
218				<th class="narrow">New this week:</th>
219				<td>
220					<?php echo number_format($numUsersWeek); ?> <small>user<?php echo ($numUsersWeek != 1) ? 's' : ''; ?></small>
221				</td>
222				<td>
223					<?php
224						$difference = @round(100 / $numUsersLastWeek * ($numUsersWeek - $numUsersLastWeek), 2);
225						$polarity = ($difference < 0) ? '' : '+';
226					?>				
227					<?php if ($difference != 0): ?>
228						<small>(<span style="color:<?php echo ($polarity == '+') ? 'green' : 'red'; ?>"><?php echo $polarity.$difference; ?>%</span>)</small>
229					<?php endif; ?>
230				</td>
231			</tr>
232			<tr>
233				<th class="narrow">New last week:</th>
234				<td colspan="2"><?php echo number_format($numUsersLastWeek); ?> <small>user<?php echo ($numUsersLastWeek != 1) ? 's' : ''; ?></small></td>
235			</tr>
236		</table>	
237
238		<h3>Most popular pages</h3>
239
240		<?php if ($popularPages): ?>
241			<ol>		
242				<?php foreach ($popularPages as $page): ?>
243					<li><?php echo anchor(site_url('/admin/pages/edit/'.$page['pageID']), $page['pageName']); ?></li>
244				<?php endforeach; ?>
245			</ol>
246		<?php else: ?>
247			<p><small>We don't have this information yet.</small></p>
248		<?php endif; ?>
249
250		<br />
251		
252<?php if (@in_array('blog', $this->permission->sitePermissions)): ?>
253
254		<h3>Most popular blog posts</h3>
255
256		<?php if ($popularBlogPosts): ?>
257			<ol>		
258				<?php foreach ($popularBlogPosts as $post): ?>
259					<li><?php echo anchor(site_url('/admin/blog/edit_post/'.$post['postID']), $post['postTitle']); ?></li>
260				<?php endforeach; ?>
261			</ol>
262		<?php else: ?>
263			<p><small>We don't have this information yet.</small></p>
264		<?php endif; ?>
265
266		<br />
267		
268<?php endif; ?>
269
270<?php if (@in_array('shop', $this->permission->sitePermissions)): ?>		
271
272		<h3>Most popular shop products</h3>
273
274		<?php if ($popularShopProducts): ?>
275			<ol>		
276				<?php foreach ($popularShopProducts as $product): ?>
277					<li><?php echo anchor(site_url('/admin/shop/edit_product/'.$product['productID']), $product['productName']); ?></li>
278				<?php endforeach; ?>
279			</ol>
280		<?php else: ?>
281			<p><small>We don't have this information yet.</small></p>
282		<?php endif; ?>
283
284<?php endif; ?>
285		
286	</div>
287	
288	<br class="clear" />
289
290</div>