sibtracker/system/modules/toptables.php
2019-05-18 13:46:03 +08:00

51 lines
1.4 KiB
PHP

<?php
if ( ! defined( 'DATALIFEENGINE' ) ) {
die( "Hacking attempt!" );
}
function showStatus( $statusId ) {
$statusId = intval( $statusId );
switch ( $statusId ) {
case "0":
$status = "<font color=\"#FF8000\">Îæèäàåòñÿ</font>";
break;
case "1":
$status = "<font color=\"#0000FF\">Ïðèíÿòî</font>";
break;
case "2":
$status = "<font color=\"#FF0000\">Îòêëîíåíî</font>";
break;
case "3":
$status = "<font color=\"#008000\">Âûïîëíåíî</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\">Ñòîë çàêàçîâ</a></center>";
$db->free();
$cache->save( "toporders", $toporders, $config['skin'] );
}
?>