added initial admin/admin account when sql/install is executed, also added the admin's functionality: libuserlist
--HG-- branch : quitta-gsoc-2013hg/feature/sse2
parent
4f82afa5d0
commit
8ff40bb619
@ -1,50 +1,60 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
//This checks to see if there is a page number. If not, it will set it to page 1
|
|
||||||
if (!(isset($_GET['pagenum']))){
|
|
||||||
$pagenum = 1;
|
|
||||||
}else{
|
|
||||||
$pagenum = $_GET['pagenum'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//Here we count the number of results
|
function libuserlist(){
|
||||||
global $cfg;
|
|
||||||
$dbl = new DBLayer($cfg['db']['lib']);
|
//This checks to see if there is a page number. If not, it will set it to page 1
|
||||||
$rows = $dbl->executeWithoutParams("SELECT * FROM ams_querycache")->rowCount();
|
if (!(isset($_GET['pagenum']))){
|
||||||
|
$pagenum = 1;
|
||||||
//This is the number of results displayed per page
|
}else{
|
||||||
$page_rows = 2;
|
$pagenum = $_GET['pagenum'];
|
||||||
|
}
|
||||||
//This tells us the page number of our last page
|
|
||||||
$last = ceil($rows/$page_rows);
|
//Here we count the number of results
|
||||||
|
global $cfg;
|
||||||
//this makes sure the page number isn't below one, or more than our maximum pages
|
$dbl = new DBLayer($cfg['db']['lib']);
|
||||||
if ($pagenum < 1)
|
$rows = $dbl->executeWithoutParams("SELECT * FROM ams_querycache")->rowCount();
|
||||||
{
|
if($rows > 0){
|
||||||
$pagenum = 1;
|
//This is the number of results displayed per page
|
||||||
}else if ($pagenum > $last) {
|
$page_rows = 2;
|
||||||
$pagenum = $last;
|
|
||||||
}
|
//This tells us the page number of our last page
|
||||||
|
$last = ceil($rows/$page_rows);
|
||||||
//This sets the range to display in our query
|
|
||||||
$max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows;
|
//this makes sure the page number isn't below one, or more than our maximum pages
|
||||||
|
if ($pagenum < 1)
|
||||||
//This is your query again, the same one... the only difference is we add $max into it
|
{
|
||||||
$data = $dbl->executeWithoutParams("SELECT * FROM ams_querycache $max");
|
$pagenum = 1;
|
||||||
|
}else if ($pagenum > $last) {
|
||||||
//This is where we put the results in a resultArray to be sent to smarty
|
$pagenum = $last;
|
||||||
|
}
|
||||||
$pageResult['liblist'] = Array();
|
|
||||||
$i = 0;
|
//This sets the range to display in our query
|
||||||
while($row = $data->fetch(PDO::FETCH_ASSOC)){
|
$max = 'limit ' .($pagenum - 1) * $page_rows .',' .$page_rows;
|
||||||
$decode = json_decode($row['query']);
|
|
||||||
$pageResult['liblist'][$i]['id'] = $row['SID'];
|
//This is your query again, the same one... the only difference is we add $max into it
|
||||||
$pageResult['liblist'][$i]['type'] = $row['type'];
|
$data = $dbl->executeWithoutParams("SELECT * FROM ams_querycache $max");
|
||||||
$pageResult['liblist'][$i]['name'] = $decode[0];
|
|
||||||
$pageResult['liblist'][$i]['mail'] = $decode[2];
|
//This is where we put the results in a resultArray to be sent to smarty
|
||||||
$i++;
|
|
||||||
}
|
$pageResult['liblist'] = Array();
|
||||||
$pageResult['permission'] = 1;
|
$i = 0;
|
||||||
$pageResult['no_visible_elements'] = 'FALSE';
|
while($row = $data->fetch(PDO::FETCH_ASSOC)){
|
||||||
helpers :: loadtemplate( 'libuserlist', $pageResult);
|
$decode = json_decode($row['query']);
|
||||||
exit();
|
$pageResult['liblist'][$i]['id'] = $row['SID'];
|
||||||
|
$pageResult['liblist'][$i]['type'] = $row['type'];
|
||||||
|
$pageResult['liblist'][$i]['name'] = $decode[0];
|
||||||
|
$pageResult['liblist'][$i]['mail'] = $decode[2];
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//check if shard is online
|
||||||
|
try{
|
||||||
|
$dbs = new DBLayer($cfg['db']['shard']);
|
||||||
|
$pageResult['shard'] = "online";
|
||||||
|
}catch(PDOException $e) {
|
||||||
|
$pageResult['shard'] = "offline";
|
||||||
|
}
|
||||||
|
return $pageResult;
|
||||||
|
}
|
@ -1,15 +1,11 @@
|
|||||||
{extends file="layout.tpl"}
|
{extends file="layout.tpl"}
|
||||||
{block name=menu}
|
{block name=menu}
|
||||||
<li class="nav-header hidden-tablet">Main</li>
|
<li class="nav-header hidden-tablet">Main</li>
|
||||||
<li><a class="ajax-link" href="index.php"><i class="icon-home"></i><span class="hidden-tablet"> Dashboard</span></a></li>
|
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php"><i class="icon-home"></i><span class="hidden-tablet"> Dashboard</span></a></li>
|
||||||
<li><a class="ajax-link" href="settings.php"><i class="icon-cog"></i><span class="hidden-tablet"> Settings</span></a></li>
|
|
||||||
<li><a href="logout.php"><i class="icon-lock"></i><span class="hidden-tablet"> Logout</span></a></li>
|
|
||||||
<li class="nav-header hidden-tablet">Admin</li>
|
<li class="nav-header hidden-tablet">Admin</li>
|
||||||
<li><a class="ajax-link" href="checkuser.php"><i class="icon-user"></i><span class="hidden-tablet">UserList</span></a></li>
|
<li style="margin-left: -2px;"><a class="ajax-link" href="index.php?page=libuserlist"><i class="icon-th-list"></i><span class="hidden-tablet"> Liblist</span></a></li>
|
||||||
<li><a class="ajax-link" href="banlist.php"><i class="icon-remove"></i><span class="hidden-tablet"> BanList</span></a></li>
|
<li class="nav-header hidden-tablet">Actions</li>
|
||||||
<li class="nav-header hidden-tablet">Ticketing</li>
|
<li style="margin-left: -2px;"><a href="?page=logout"><i class="icon-off"></i><span class="hidden-tablet"> Logout </span></a></li>
|
||||||
<li><a class="ajax-link" href="generalqueue.php"><i class="icon-th-list"></i><span class="hidden-tablet"> General Queue</span></a></li>
|
|
||||||
<li><a class="ajax-link" href="personalQueue.php"><i class="icon-tag"></i><span class="hidden-tablet"> Personal Queue</span></a></li>
|
|
||||||
<li><a class="ajax-link" href="archive.php"><i class="icon-folder-open"></i><span class="hidden-tablet"> Ticket Archive</span></a></li>
|
|
||||||
{/block}
|
{/block}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue