<? if(isset($_SESSION['mu_username'])){ include('templates/acc_manager.aspx'); }else{ ?>
    <div class="home-login-block">
        <div class="home-left">
            <div class="out-right-30" id='BlockLeft'>
                
                      
                <div class="primary-block out-top-30">
    <?
        if($Use_DauGiaNguoc == 1) {
            if(count($listitem_arr) > 0) {
    ?>
        <hr />
        <center><a href="#com&act=daugianguoc" rel="ajax"><b><? echo $lang_home_dgn; ?></b></a></center><br />
        
        <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#9999FF" class='item_form MyTable'>
            <tr bgcolor="#FFFFFF">
            <? 
                $item_count = 0;
                $image_width_total = 0;
                foreach($listitem_arr as $item) { 
                    $item_view = false;
                    $thehe_str = "";
                    foreach($item['thehe'] as $thehe_val) {
                        if(strlen($thehe_choise[$thehe_val]) > 0) {
                            if(isset($_SESSION['acc_thehe'])) {
                                if($thehe_val == $_SESSION['acc_thehe']) $item_view = true;
                            } else {
                                $item_view = true;
                            }
                            
                            if(strlen($thehe_str) > 0) $thehe_str .= " - ";
                            $thehe_str .= "<strong>". $thehe_choise[$thehe_val] ."</strong>";
                        }
                    }
                    if($item_view === true) {
                        ++$item_count;
                        $image_info = getimagesize("items/". $item['item_image']. ".gif");
                        $image_width = $image_info[0];
                        $image_width_total += $image_width;
                        if($image_width_total > 500) break;
            ?>
                <td align="center" bgcolor="#121212">
                    <a href="#com&act=daugianguoc&page=daugianguoc_listitem_biding" rel="ajax" id="item_dgn_tooltip_<? echo $item['bid_id']; ?>" class="item_dg_tooltip">
                        <img src="items/<? echo $item['item_image']; ?>.gif" /><br />
                        <strong><font color='cyan'><? echo number_format($item['price_min'], 0, ',', '.'); ?> Gcoin</font></strong><br />
                        <strong><font color='orange'><? echo $item['time_end']; ?></font></strong>
                    </a>
                    <div id="data_item_dgn_tooltip_<? echo $item['bid_id']; ?>" style="display:none;">
                        <div style="background-color: #121212; font-size: 12px;"><? echo $item['item_info']; ?></div>
                    </div>
                </td>
            <? if($item_count == 5) break; } } ?>
            </tr>
        </table>
    <?
            }
        }
    ?>
    
    <?
        if($Use_DauGia == 1) {
            if(count($group_item) > 0) {
    ?>
        <hr />
            <center><b><? echo $lang_home_market; ?></b><br /><br />
            
            <?
                $count_flag = 0;
                
                foreach($group_item as $group_key => $group_val) {
                    if($group_key > 0) {
                        if($group_key % 5 == 0) {
                            echo "<br />";
                        } else {
                            echo " | ";
                        }
                    }
            ?>
                <a href="#com&act=daugia&page=daugia_biding&type=<? echo $group_val['group_type']; ?>" rel="ajax"><? echo $group_val['group_name']; ?> (<strong><font color='blue'><? echo $group_val['group_count']; ?></font></strong>)</a>
                    
            <? } ?>
            </center><br />
            <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#176093" class='item_form' align="center">
                <tr>
                <?
                    $item_count = 0;
                    $image_width_total = 0;
                    foreach($listitem_dg_arr as $item) {
                        ++$item_count;
                        $image_info = getimagesize("items/". $item['item_image']. ".gif");
                        $image_width = $image_info[0];
                        $image_width_total += $image_width;
                        if($image_width_total > 500) break;
                ?>
                    <td align="center" valign="bottom">
                        <a href="#com&act=daugia&page=daugia_biding&type=<? echo $item['item_group']; ?>" rel="ajax" id="item_dg_tooltip_<? echo $item['bid_id']; ?>" class="item_dg_tooltip">
                        <img src="items/<? echo $item['item_image']; ?>.gif" /><br />
                        <strong><font color='cyan'><? echo number_format($item['bid_gcoin'], 0, ',', '.'); ?> Gcoin</font></strong><br />
                        <strong><font color='orange'><? echo $item['name']; ?></font></strong><br />
                        <strong><font color='orange'><? echo $item['bid_end']; ?></font></strong>
                        </a>
                        <div id="data_item_dg_tooltip_<? echo $item['bid_id']; ?>" style="display:none;">
                            <div style="background-color: #121212; font-size: 12px;"><? echo $item['item_info']; ?></div>
                        </div>
                    </td>
                <?
                        if($item_count == 5) break;
                    }
                ?>
                </tr>
            </table>
    <?
            }
        }
    ?>
                    </div>
                </div>
    
    
            <?  if(isset($Use_Tintuc4r) && $Use_Tintuc4r == 1){ ?>
            <div class="primary-block out-top-20">
                <div class="home-slide">
                        <? include_once('forum_news/getdata.php'); ?>
                </div>
            </div>
            <? } ?>
    
                </div>
                <?if(isset($Use_Tintuc) && $Use_Tintuc == 1){?>
                <!--Load Tin Tuc-->
                <?php include_once('modules/ajax_news.php'); ?>
                <?php } ?>
                
        </div>
        
        <div class="home-right">
            <div class="primary-block">
                <div class="login-block in-10">
                    <?
                        // KM Card
                        include_once('config/config_napthe.php');
                        $time_now = time();
                            if(isset($kmbegin) && isset($kmend) && strtotime($kmbegin) <= $time_now && (strtotime($kmend) + 24*60*60 - 1) >= $time_now && $khuyenmai_phantram > 0) {
                                ?> <p class="login-text">Tin khuyến mãi</p><?php
                                $kmbegin_date = date('d/m', strtotime($kmbegin));
                                $kmend_date = date('d/m', strtotime($kmend));
                                echo "<br /><br /><center><span class='tag tag-orange'>Khuyến mại nạp thẻ</span> : <span class='tag tag-red'><strong>$khuyenmai_phantram%</strong></span><br /><br />Từ 0h00 $kmbegin_date<br />Đến 24h00 $kmend_date</center>";
                            }
                        // KM Card End
                        
                    ?>
                    <br />
    
    
    
                </div>
            </div>
        </div>
    </div>
    <? } ?>