else if($action=="online")
{
addonline(getuid_sid($sid),"Online List","");
echo "<card id=\"main\" title=\"*ONLINE*\">";
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$num_items = getnumonline(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT
a.name, a.perm, b.place, b.userid FROM ibwf_users a
INNER JOIN ibwf_online b ON a.id = b.userid
GROUP BY 1,2
LIMIT $limit_start, $items_per_page
";
echo "<p align=\"center\">";
echo "<img src=\"images/onlinenow.gif\" alt=\"*\"/>
";
echo " <a href=\"index.php?action=stfol&sid=$sid\"><smal l>Helpdesk Online:".$noi[0]."</a>
";
$items = mysql_query($sql);
echo mysql_error();
while ($item = mysql_fetch_array($items))
{$sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$item[0]'"));
if($sex[0]=="M"){$usersex = "<img src=\"images/male.gif\" alt=\" \"/>";}
if($sex[0]=="F"){$usersex = "<img src=\"images/female.gif\" alt=\" \"/>";}
if($item[1]=='0')
{
$tit = "";
}if($item[1]=='1')
{
$tit = "²";
}if($item[1]=='2')
{
$tit = "¹";
} if($item[1]=='3')
{
$tit = "¹";
} if($item[1]=='4')
{
$tit = "~";
}$lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$usersex$tit$item[0]</a>";
echo "$lnk
";
}
echo "</small></p>";
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"index.php?action=online&page=$ppage& ;sid=$sid\">«PREV</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"index.php?action=online&page=$npage& ;sid=$sid\">Next»</a>";
}
echo "
$page/$num_pages
";
if($num_pages>2)
{
echo getjumper($action, $sid,"index");
}
echo "</p>";
////// UNTILL HERE >>
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
{
addonline(getuid_sid($sid),"Online List","");
echo "<card id=\"main\" title=\"*ONLINE*\">";
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$num_items = getnumonline(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT
a.name, a.perm, b.place, b.userid FROM ibwf_users a
INNER JOIN ibwf_online b ON a.id = b.userid
GROUP BY 1,2
LIMIT $limit_start, $items_per_page
";
echo "<p align=\"center\">";
echo "<img src=\"images/onlinenow.gif\" alt=\"*\"/>
";
echo " <a href=\"index.php?action=stfol&sid=$sid\"><smal l>Helpdesk Online:".$noi[0]."</a>
";
$items = mysql_query($sql);
echo mysql_error();
while ($item = mysql_fetch_array($items))
{$sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$item[0]'"));
if($sex[0]=="M"){$usersex = "<img src=\"images/male.gif\" alt=\" \"/>";}
if($sex[0]=="F"){$usersex = "<img src=\"images/female.gif\" alt=\" \"/>";}
if($item[1]=='0')
{
$tit = "";
}if($item[1]=='1')
{
$tit = "²";
}if($item[1]=='2')
{
$tit = "¹";
} if($item[1]=='3')
{
$tit = "¹";
} if($item[1]=='4')
{
$tit = "~";
}$lnk = "<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$usersex$tit$item[0]</a>";
echo "$lnk
";
}
echo "</small></p>";
echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"index.php?action=online&page=$ppage& ;sid=$sid\">«PREV</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"index.php?action=online&page=$npage& ;sid=$sid\">Next»</a>";
}
echo "
$page/$num_pages
";
if($num_pages>2)
{
echo getjumper($action, $sid,"index");
}
echo "</p>";
////// UNTILL HERE >>
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
Comment