<!-- Title -->
<div class="primary-block">
    <div class="main-content">
        <h1 class="title-content">Thanh Lý Đồ</h1>
    </div>
</div>
<div class="priority-block out-top-20">
    <div class="head-block">
        <h1 class="title-head"><span class="text-semibold">Lưu ý</span></h1>
    </div>
    <div class="in-20">
        <ul class="noted in-left-10">
		<li>1. Bạn phải để đồ hoàn hảo cần đổi vào HÒM ĐỒ ẢO.</li>
		<li>2. Giá thu mua đồ cũ như sau : tùy thuộc vào giá trị món đồ.</li>
		<li>Vpoint nhận được dựa vào Cấp độ của item, các dòng như Luck, Exc, ....</li>
		<li>Đồ cấp càng cao giá trị càng cao.</li>
		<li>Không phân biệt loại đồ gì. Miễn là tất cả là đồ EXC.</li>
		<li><font color=red>Chú ý: Cân nhắc trước khi thực hiện chức năng, vì khi bấm Thanh Lý Items sẽ không thể lấy lại, BQT không chịu trách nhiệm việc nhầm lẫn của người chơi.</font></li>
        </ul>
    </div>
</div>
<!-- End Title -->
<!-- Content -->
<div class="primary-block out-top-20">
    <div class="in-20 font-14 text-semibold">
	<h1 class="title-head"><span class="text-semibold">Danh sách Item trong hòm đồ ảo của bạn</span></h1>
        <div class="out-top-20">
<ul class="list-shop">
        <? 
            if(count($listitem_arr) > 0) {
            foreach($listitem_arr as $item) { 
			$lvitem=$item['level'];
			$vitri=$item['vitri'];
			$item_code=$item['item_code'];
			$Item_Info=check_code($item_code,2);
			$item_name=$Item_Info[name];
			$iteminfo=$Item_Info[info];
			
			$dongluck = $Item_Info[luck];
			$dongopt = $Item_Info[opt];
			$dongskill = $Item_Info[skill];
			$dongexc = $Item_Info[exc];
			$capdo = $Item_Info[capdo];
			$level = $Item_Info[level];
			$id = $Item_Info[id];
			$group = $Item_Info[group];
			$exc_anc = $Item_Info[exc_anc];
			$socket = $Item_Info[socket];
			$num_socket = $Item_Info[num_socket];
			
			$id_12_arr = array(3,4,5,6,36,37,38,39,40,42,43,49,50);
			
			if($dongexc>0 || $exc_anc==2 || $num_socket>0 || ($group==12 && in_array($id, $id_12_arr)) || ($group==13 && $id==30)){
				switch ($capdo){
					case 0:
					$vpcong_capdo = $vp_cap[$capdo];
					$vpcong_exc = $dongexc*$vp_exc[$capdo];
					$vpcong_luck = $dongluck*$vp_luck[$capdo];
					$vpcong_other = $dongskill*$vp_other[$capdo] + $dongopt*$vp_other[$capdo] + $num_socket*$vp_other[$capdo];
					break;
					case 1:
					$vpcong_capdo = $vp_cap[$capdo];
					$vpcong_exc = $dongexc*$vp_exc[$capdo];
					$vpcong_luck = $dongluck*$vp_luck[$capdo];
					$vpcong_other = $dongskill*$vp_other[$capdo] + $dongopt*$vp_other[$capdo] + $num_socket*$vp_other[$capdo];
					break;
					case 2:
					$vpcong_capdo = $vp_cap[$capdo];
					$vpcong_exc = $dongexc*$vp_exc[$capdo];
					$vpcong_luck = $dongluck*$vp_luck[$capdo];
					$vpcong_other = $dongskill*$vp_other[$capdo] + $dongopt*$vp_other[$capdo] + $num_socket*$vp_other[$capdo];
					break;
					case 3:
					$vpcong_capdo = $vp_cap[$capdo];
					$vpcong_exc = $dongexc*$vp_exc[$capdo];
					$vpcong_luck = $dongluck*$vp_luck[$capdo];
					$vpcong_other = $dongskill*$vp_other[$capdo] + $dongopt*$vp_other[$capdo] + $num_socket*$vp_other[$capdo];
					break;
					case 4:
					$vpcong_capdo = $vp_cap[$capdo];
					$vpcong_exc = $dongexc*$vp_exc[$capdo];
					$vpcong_luck = $dongluck*$vp_luck[$capdo];
					$vpcong_other = $dongskill*$vp_other[$capdo] + $dongopt*$vp_other[$capdo] + $num_socket*$vp_other[$capdo];
					break;
					case 5:
					$vpcong_capdo = $vp_cap[$capdo];
					$vpcong_exc = $dongexc*$vp_exc[$capdo];
					$vpcong_luck = $dongluck*$vp_luck[$capdo];
					$vpcong_other = $dongskill*$vp_other[$capdo] + $dongopt*$vp_other[$capdo] + $num_socket*$vp_other[$capdo];
					break;
					case 6:
					$vpcong_capdo = $vp_cap[$capdo];
					$vpcong_exc = $dongexc*$vp_exc[$capdo];
					$vpcong_luck = $dongluck*$vp_luck[$capdo];
					$vpcong_other = $dongskill*$vp_other[$capdo] + $dongopt*$vp_other[$capdo] + $num_socket*$vp_other[$capdo];
					break;
					default : $vpcong_capdo=0; $vpcong_exc=0; $vpcong_luck=0; $vpcong_other=0;
				}
				switch ($level){
					case 0:
					$vpcong_level = $vp_lv[$level];
					break;
					case 1:
					$vpcong_level = $vp_lv[$level];
					break;
					case 2:
					$vpcong_level = $vp_lv[$level];
					break;
					case 3:
					$vpcong_level = $vp_lv[$level];
					break;
					case 4:
					$vpcong_level = $vp_lv[$level];
					break;
					case 5:
					$vpcong_level = $vp_lv[$level];
					break;
					case 6:
					$vpcong_level = $vp_lv[$level];
					break;
					case 7:
					$vpcong_level = $vp_lv[$level];
					break;
					case 8:
					$vpcong_level = $vp_lv[$level];
					break;
					case 9:
					$vpcong_level = $vp_lv[$level];
					break;
					case 10:
					$vpcong_level = $vp_lv[$level];
					break;
					case 11:
					$vpcong_level = $vp_lv[$level];
					break;
					case 12:
					$vpcong_level = $vp_lv[$level];
					break;
					case 13:
					$vpcong_level = $vp_lv[$level];
					break;
					case 14:
					$vpcong_level = $vp_lv[$level];
					break;
					case 15:
					$vpcong_level = $vp_lv[$level];
					break;
					default : $vpcong_level = 0;
				}
				
				if($group==12 && in_array($id, $id_12_arr)){
					switch ($capdo){
						case 2:
						$vpcong_capdo = $vp_capw_2;
						$vpcong_exc = $dongexc*$vp_excw_2;
						$vpcong_luck = $dongluck*$vp_luckw_2;
						$vpcong_other = $dongskill*$vp_otherw_2 + $dongopt*$vp_otherw_2;
						break;
						case 25:
						$vpcong_capdo = $vp_capw_2_5;
						$vpcong_exc = $dongexc*$vp_excw_2_5;
						$vpcong_luck = $dongluck*$vp_luckw_2_5;
						$vpcong_other = $dongskill*$vp_otherw_2_5 + $dongopt*$vp_otherw_2_5;
						break;
						case 3:
						$vpcong_capdo = $vp_capw_3;
						$vpcong_exc = $dongexc*$vp_excw_3;
						$vpcong_luck = $dongluck*$vp_luckw_3;
						$vpcong_other = $dongskill*$vp_otherw_3 + $dongopt*$vp_otherw_3;
						break;
						default : $vpcong_capdo=0; $vpcong_exc=0; $vpcong_luck=0; $vpcong_other=0;
					}
				}

			$vpcong = $vpcong_luck + $vpcong_exc + $vpcong_other + $vpcong_capdo + $vpcong_level;
        ?>
		<li>
                <div class="shop-item" id="itemthanhlydo_<? echo $item['vitri']; ?>">
                    <div class="image-item" onMouseOut='hidetip();' onMouseOver="showtip('<center><? echo $iteminfo; ?></center>');">
                        <img src="items/<? echo $item['image'].".gif"; ?>">
                    </div>
                    <div class="info-item">
                        <p class="name" onMouseOut='hidetip();' onMouseOver="showtip('<center><? echo $iteminfo; ?></center>');">
						<? echo $item_name; ?>
                        <div class="info-row-1">
                            <div class="block-show">
                                <div class="list-price">
                                    <span><font color=yellow>Tổng: <? echo $vpcong; ?> Vpoint</font></span>
                                </div>
                            </div>
                            <div class="block-hide">
                                <div class="buy">
                                    <div class="button-buy">
										<a href="#webshop_active_<? echo $vitri; ?>" class="btn btn-green btn_webshop_exl_up">THANH LÝ</a>
										<span id="btn_webshop_waiting_<? echo $vitri; ?>"></span>
                                    </div>
                                    <div style="display:none">
                                        <div id="webshop_active_<? echo $vitri; ?>" style="width: 600px; height: 250px;">

									<table class="table table-blue table-text-center table-border-2">
									<thead>
									<tr>
									<th colspan="2" align="center">THÔNG TIN THANH LÝ ĐỒ</th>
									</tr>
									</thead>
									<tbody id="item_<? echo $item['vitri']; ?>">

								<tr>
									<td align="center">Tên Item</td>
									<td align="center"><span class="tag tag-orange"><? echo $item_name; ?></span></td>
								</tr>

								<tr>
									<td align="center">Số Vpoint nhận được</td>
									<td align="center"><? echo $vpcong; ?> Vpoint</td>
								</tr>

								<tr>
									<td align="center" colspan="2">		
									<input type="button" class="btn btn-green btn_thanhlydo" vitri="<? echo $vitri; ?>" item_code="<? echo $item_code; ?>" value="THANH LÝ" /> 
									</td>
								</tr>

									</tbody>
								</table>
								<center>
								<span id="thanhlydo_send_loading_<? echo $vitri; ?>"></span><br />
								<span id="thanhlydo_send_view_<? echo $vitri; ?>"></span>
								</center>
								</div>
								</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
		</li>
        <? } } } else echo "<center><font color='red'><strong>Không có Items hoặc tài khoản chưa thoát game, chưa đăng ký bảo vệ ACC/IP.</strong></font></center>"; ?>
</ul>
        </div>
    </div>
</div>
<!-- End Content -->