sessionlist

This commit is contained in:
Claude 2012-06-14 11:42:32 +02:00
parent e5afc20e9b
commit 8a5d5f2844
3 changed files with 54 additions and 0 deletions

View File

@ -53,6 +53,7 @@ $route['lists'] = 'main/lists';
$route['lists/rss'] = 'main/lists/rss';
$route['lists/:num'] = 'main/lists/$1';
$route['spamadmin/:num'] = 'spamadmin/index';
$route['spamadmin/session/:any'] = 'spamadmin/session';
$route['about'] = 'main/about';
$route['iphone/:num'] = 'iphone';

View File

@ -4,6 +4,7 @@
* Function list:
* - __construct()
* - index()
* - session()
* Classes list:
* - Spamadmin extends CI_Controller
*/
@ -22,4 +23,12 @@ class Spamadmin extends CI_Controller
$data = $this->pastes->getSpamLists();
$this->load->view('spamlist', $data);
}
function session()
{
$this->load->model('pastes');
$session_id = 'sdf';
$data = $this->pastes->getSpamLists($session_id);
$this->load->view('list_sessionid', $data);
}
}

View File

@ -0,0 +1,44 @@
<?php $this->load->view('defaults/header');?>
<h1>Spamadmin</h1>
<?php
function checkNum($num){
return ($num%2) ? TRUE : FALSE;
}
$n = 0;
if(!empty($pastes)){ ?>
<table class="recent">
<tbody>
<tr>
<th class="title">Title</th>
<th class="name">Name</th>
<th class="lang">Language</th>
<th class="time">When</th>
<th class="time">Session</th>
</tr>
<?php foreach($pastes as $paste) {
if(checkNum($n) == TRUE) {
$eo = "even";
} else {
$eo = "odd";
}
$n++;
?>
<tr class="<?php echo $eo; ?>">
<td class="first"><a href="<?php echo site_url("view/".$paste['pid']); ?>"><?php echo $paste['title']; ?></a></td>
<td><?php echo $paste['name']; ?></td>
<td><?php echo $paste['lang']; ?></td>
<td><?php $p = explode(",", timespan($paste['created'], time())); echo $p[0]; ?> ago.</td>
<td><a href="<?php echo site_url('spamadmin/session/' . $paste['session_id']) ?>">[<?php echo substr($paste['session_id'], 0, 8); ?>...]</a></td>
</tr>
<?php }?>
</tbody>
</table>
<?php } else { ?>
<p>There have been no pastes :(</p>
<?php }?>
<?php echo $pages; ?>
<div class="spacer"></div>
<?php $this->load->view('defaults/footer');?>