sibtracker/system/modules/toptables.php

51 lines
1.4 KiB
PHP
Raw Permalink Normal View History

2019-05-18 13:46:03 +08:00
<?php
if ( ! defined( 'DATALIFEENGINE' ) ) {
die( "Hacking attempt!" );
}
function showStatus( $statusId ) {
$statusId = intval( $statusId );
switch ( $statusId ) {
case "0":
$status = "<font color=\"#FF8000\"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></font>";
break;
case "1":
$status = "<font color=\"#0000FF\"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></font>";
break;
case "2":
$status = "<font color=\"#FF0000\"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></font>";
break;
case "3":
$status = "<font color=\"#008000\"><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></font>";
break;
}
return $status;
}
$toporders = $cache->open( "toporders", $config['skin'] );
if( ! $toporders ) {
$db->query( "SELECT id, runame, enname, status FROM " . PREFIX . "_table ORDER BY date DESC LIMIT 0,10");
while ( $row = $db->get_row() ) {
if ( $row['runame'] ){ $name = $row['runame']; }
elseif ( $row['enname'] ){ $name = $row['enname']; }
if( strlen( $name ) > 15 ) $name = stripslashes( substr( $name, 0, 15 ) ) . "...";
else $name = stripslashes( $name );
$tblid = intval($row['id']);
$status = showStatus( $row['status'] );
$id = ++$i-3;
$toporders .= "<a href=\"/orders/".$tblid."/\">" . $name . "</a><div style=\"float:right\">" . $status . "</div><br />";
}
$toporders .= "<hr><center><a href=\"/orders\"><3E><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD></a></center>";
$db->free();
$cache->save( "toporders", $toporders, $config['skin'] );
}
?>