message
This commit is contained in:
51
system/modules/toptables.php
Normal file
51
system/modules/toptables.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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'] );
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user