<?php
if( !defined('ISDVBBS') ){
	header('HTTP/1.0 404 Not Found');
	exit;
}
?><!--<?php
$UserToolsCount = getUserToolsCount();
print <<<EOT
-->
<script language="JavaScript" src="templates/lang/{$GLOBALS['fsetting']['lang']}/js/pagination.js"></script>
<table  cellpadding="0" cellspacing="0" align="center" class="mainbox tableborder">
	<tr>
		<td width="180" valign="top">
			<table cellpadding="0" cellspacing="0" align="center" class="mainbox tableborder">
				<tr>
				<th align="center">{$lang['tpl.main.str1']}</th>
				</tr>
				<tr>
					<td align="left">
					<table cellpadding="0" cellspacing="0" class="mainbox" align="center">
						<tr>
							<td>{$lang['tpl.main.str2']}<b><font color="red">{$userinfo['usermoney']}</font></b> {$lang['tpl.main.str35']}</td>
						</tr>
						<tr>
							<td>{$lang['tpl.main.str3']}<b><font color="red">{$userinfo['userticket']}</font></b> {$lang['tpl.main.str4']}</td>
						</tr>
						<tr>
							<td>{$lang['tpl.main.str5']}<a href="?action=UserTools_List"><b><font color="red">{$UserToolsCount}</font></b></a> {$lang['tpl.main.str6']}</td>
						</tr>
						<tr>
							<td>{$lang['tpl.main.str7']}{$userinfo['userwealth']}</td>
						</tr>
						<tr>
							<td>{$lang['tpl.main.str8']}{$userinfo['userpost']}</td>
						</tr>
						<tr>
							<td>{$lang['tpl.main.str9']}{$userinfo['userep']}</td>
						</tr>
						<tr>
							<td>{$lang['tpl.main.str10']}{$userinfo['usercp']}</td>
						</tr>
						<tr>
							<td>{$lang['tpl.main.str11']}{$userinfo['userpower']}</td>
						</tr>
						
					</table>
				</td>
				</tr>
			</table>
		</td>
		
		<td valign="top" style="width:auto;">
			<table cellpadding=0 cellspacing=0 align="center" class="mainbox tableborder">
				<tr>
				<th height=23>{$lang['tpl.main.str12']}</th></tr>
				<tr><td height=23 style="line-height:21px">{$lang['tpl.main.str13']}</td></tr>
				<tr><td height="23" class="tablebody2" align="center">{$lang['tpl.main.str14']}</td>
				<tr><td height="25" class="tablebody1" align="center">
				<a href="userpay.php?action=usercenter">{$lang['tpl.main.str15']}</a> | 
				<a href="plus_tools_center.php?action=userbusstools_list&user_id={$userid}">{$lang['tpl.main.str16']}</a> | 
				<a href="userpay.php?action=UserToolsLog_List">{$lang['tpl.main.str17']}</a> | 
				<a href="javascript:openScript('plus_tools_infosetting.php?action=0&touserid={$userid}',600,450)">{$lang['tpl.main.str18']}</a> | 
				<a href="userpay.php"><font color=red>{$lang['tpl.main.str19']}</font></a></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td colspan="3" style="text-align:center;">
<!--
EOT;
switch(trim($action)){
	case 'usertools_list':
		$UserTools_List =& getUserToolsList();
		print <<<EOT
-->
			<table border="0" cellpadding="0" cellspacing="0" align="center" class="mainbox tableborder">
				<tr align="center">
					<th height="23" width="20%">{$lang['tpl.main.str20']}</th>
					<th width="15%">{$lang['tpl.main.str21']}</th>
					<th width="15%">{$lang['tpl.main.str22']}</th>
					<th width="15%">{$lang['tpl.main.str23']}</th>
					<th width="15%">{$lang['tpl.main.str24']}</th>
					<th width="20%">{$lang['tpl.main.str25']}</th>
				</tr>
<!--
EOT;
		if( empty($UserTools_List) || !is_array($UserTools_List) ){
			print <<<EOT
-->
				<tr><td colspan="6" align="center">{$lang['tpl.main.str26']}</td></tr>
<!--
EOT;
		} else{
			foreach( $UserTools_List as $val ){
				print <<<EOT
-->
				<tr>
					<td align="center" height=24>{$val['toolsname']}</td>
					<td align="center">{$val['toolscount']}</td>
					<td align="center">{$val['salecount']}</td>
					<td align="center"><font color="{$_DCACHE['stylecss'][19]}">{$val['salemoney']}</font></td>
					<td align="center"><font color="{$_DCACHE['stylecss'][19]}">{$val['saleticket']}</font></td>
					<td align="center"><A href="JavaScript:openScript('plus_tools_pay.php?action=SellTools&toolsid={$val['toolsid']}&bussid={$val['id']}',600,450)">{$lang['tpl.main.str27']}</A></td>
				</tr>
<!--
EOT;
			}
		}
		print <<<EOT
-->
			</table>
<!--
EOT;
		break;
	case 'userbusstools_list':
		$UserBussToolsList =& getUserBussToolsList();
		print <<<EOT
-->
			<table  cellpadding=0 cellspacing="0" align="center" class="mainbox tableborder">
				<tr align="center">
					<th height="23" width="20%">{$lang['tpl.main.str20']}</th>
					<th width="15%">{$lang['tpl.main.str28']}</th>
					<th width="15%">{$lang['tpl.main.str23']}</th>
					<th width="15%">{$lang['tpl.main.str24']}</th>
					<th width="15%">{$lang['tpl.main.str22']}</th>
					<th width="20%">{$lang['tpl.main.str25']}</th>
				</tr>
				<tr>
					<td colspan="6" height="24">{$lang['tpl.main.str29']}</td>
				</tr>
<!--
EOT;
		if( empty($UserBussToolsList['result_set']) || !is_array($UserBussToolsList['result_set']) ){
			print <<<EOT
-->
				<tr>
					<td colspan="6" align="center">{$lang['tpl.main.str26']}</td>
				</tr>
			</table>
<!--
EOT;
		} else{
			foreach( $UserBussToolsList['result_set'] as $val ){
				print <<<EOT
-->
				<tr>
					<td align="center" height="24">{$val['toolsname']}</td>
					<td align="center">{$val['username']}</td>
					<td align="center"><font color="{$_DCACHE['stylecss'][19]}">{$val['salemoney']}</font></td>
					<td align="center"><font color="{$_DCACHE['stylecss'][19]}">{$val['saleticket']}</font></td>
					<td align="center">{$val['salecount']}</td>
					<td align="center"><A href="JavaScript:openScript('plus_tools_pay.php?action=BuyUserTools&toolsid={$val['toolsid']}&bussid={$val['id']}',600,450)">{$lang['tpl.main.str30']}</A></td>
				</tr>
<!--
EOT;
			}
		print <<<EOT
-->
			</table>
			<SCRIPT>PageList({$UserBussToolsList['page']},3,{$UserBussToolsList['max_rows']},{$UserBussToolsList['RecordTotal']},'action=userbusstools_list',1);</SCRIPT>
<!--
EOT;
		}
		break;
	default:
		$Tools_List =& getToolsList();
		print <<<EOT
-->
			<table  cellpadding="0" cellspacing="0" align="center" class="mainbox">
<!--
EOT;
		if( empty($Tools_List['result_set']) || !is_array($Tools_List['result_set']) ){
			print <<<EOT
-->
				<tr><td colspan="5" align="center">{$lang['tpl.main.str26']}</td></tr>
			</table>
<!--
EOT;
		} else{
			global $lang;
			include_once INC_PATH.'DV_Encoding.class.php';
			$objEnc =& DV_Encoding::GetEncoding($charset);
			foreach( $Tools_List['result_set'] as $index => $val ){
				$ToolsImg = $val['toolsimg'] ? $val['toolsimg'] : 'dv_plus/tools/pic/none.jpg';
				$ToolsTitle = $val['toolsinfo'];
				if( $objEnc->StrLength($ToolsTitle) > 18 ){
					$val['toolsinfo'] = $objEnc->SubString($val['toolsinfo'],0,16);
				}
				$encodedToolsInfo = htmlspecialchars($val['toolsinfo']);
				$encodedToolsTitle = htmlspecialchars($ToolsTitle);
				if( $val['isstar'] == 1 ){
					$strTmp1 = '<a href="JavaScript:openScript(\'plus_tools_pay.php?action=BuyTools&toolsid='.$val['id'].'\',600,450)"><img src="'.strtolower($ToolsImg).'" border="0"/></a>';
					$strTmp3 = '<a href="JavaScript:openScript(\'plus_tools_pay.php?action=BuyTools&toolsid='.$val['id'].'\',600,450)">'.$lang['tpl.main.str30'].'</a>';
				} else{
					$strTmp = '<img src="'.$ToolsImg.'" border="0"/>';
					$strTmp3 = $lang['tpl.main.str31'];
				}
				if( $val['sysstock'] < 0 ){
					$strTmp2 = $lang['tpl.main.str32'];
				} else{
					$strTmp2 = $val['sysstock'];
				}
				$strTR = '';
				if( $index % 3 === 0 ){
					if( $index === 0 ){
						$strTR = '<tr>';
					} else{
						$strTR = "</tr>\r\n				<tr>";
					}
				}
				if( !($val['buytype'] >= 0 && $val['buytype'] <= 3) ){
					$val['buytype'] = '-1';
				}
				print <<<EOT
-->
				{$strTR}
					<td valign="top" width="33%">
						<table  cellpadding="0" cellspacing="0" class="mainbox tableborder" align="center">
							<tr><th height="20" colspan="3">{$encodedToolsInfo}</th></tr>
							<tr><td height="20" colspan="3" title="{$encodedToolsInfo}"><li>{$encodedToolsTitle}</td></tr>
							<tr>
								<td align="center" Width="50%" rowspan="5"{$strTmp1}</td>
								<td width="15%" height="20">{$lang['tpl.main.str23']}</td><!--{$_DCACHE['stylecss'][19]}-->
								<td width="35%" height="20"><font color="red">{$val['usermoney']}</font></td>
							</tr>
							<tr>
								<td>{$lang['tpl.main.str24']}</td>
								<td><font color="red">{$val['userticket']}</font></td>
							</tr>
							<tr>
								<td>{$lang['tpl.main.str33']}</td>
								<td><font class="redfont">{$lang['GetBuyType'][$val['buytype']]}</font></td>
							</tr>
							<tr>
								<td>{$lang['tpl.main.str34']}</td>
								<td>{$strTmp2}</td>
							</tr>
							<tr>
								<td colspan="2" align="center">{$strTmp3}</td>
							</tr>
						</table>
					</td>
<!--
EOT;
			}
		print <<<EOT
-->
			</table>
			<SCRIPT>PageList({$Tools_List['page']},3,{$Tools_List['max_rows']},{$Tools_List['RecordTotal']},'action=',1);</SCRIPT>
<!--
EOT;
		}
		break;
}
print <<<EOT
-->
		</td>
	</tr>
</table>
<!--
EOT;
?>-->