<?

if ( $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest' ) {
    //header( 'Content-type: text/html; charset=windows-1251' );
    include_once ROOT_DIR . '/engine/config.php';
    include_once ROOT_DIR . '/engine/function.php';
} else {
    if ( !defined( 'MISOFT' ) ) { exit(); }
}

$sql_ban2x3 = mysql_query( "SELECT id, img FROM banners WHERE paused = 1 and type = 0 ORDER BY RAND() LIMIT 1" );

if ( mysql_num_rows( $sql_ban2x3 ) > 0 ) {
    $row_ban2x3 = mysql_fetch_array( $sql_ban2x3 );
    ?>
    <a href="/bview=<?=$row_ban2x3['id']?>" target="_blank">
        <img src="/temp/banner/200x300/<?=$row_ban2x3['img']?>" alt="" width="200" height="300" class="banner3_style_img" />
    </a>
    <?
} else {
    echo '<img src="temp/banner/200x300/no.png" alt="" width="200" height="300" class="banner3_style_img" />';
}
?>