<?php
	session_start();
	require_once("../Wx.Config.php");	//只加载一次
	
	//得到购物车号
	$strdefcartid=trim($_REQUEST['cartid']);
	if(strlen($strdefcartid)>16)
	{
		$_SESSION["main_defcarttempid"] = $strdefcartid;
	}
	$strdefcartid = trim($_SESSION["main_defcarttempid"]);
	if(strlen($strdefcartid) < 16)
	{
		header('Location: loadpage.php');
	}
?>

<!DOCTYPE html>
<html>
<head>
	<meta charset="gb2312">	
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="format-detection" content="telephone=0">
	<meta name="apple-touch-fullscreen" content="1">

	<title>微信商城</title>
	
	<link rel="stylesheet" href="css/mycss.css"> 
	<script src="jsp4/jquery.js"></script>
	<!--<link rel="stylesheet" href="jsp5/jquery.mobile-1.4.5.min.css">-->
	<!--<script src="jsp4/jquery.mobile-1.4.3.min.js"></script>-->
	<script src="jsp5/jquery.mobile-1.4.5.min.js"></script>
	<link rel="stylesheet" href="jsp5/jquery.mobile-1.4.5.min.css">
	
	
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	  
    
	<script language="JavaScript"> 
		//不允许进行后退
		javascript:window.history.forward(0); 
	</script>
	
	<style type="text/css">     
		.clear{overflow:hidden; clear:both; width:0px; height:0px; }     
		.imgbox{width:640px; margin:0 auto; text-align:center; }     
		ul{padding:0px; margin:0px;}     
		ul li{float:left; list-style:none; }     
		ul li.select{display:block;}     
		.imgnum span{border-radius:12px; font:normal normal bold 12px/15px 微软雅黑; color:#FFF; margin-left:6px; padding:3px 6px 3px 6px; background-color:#F90; cursor:pointer;}
		.imgnum span.onselect{background-color:#F00;}     
		.imgnum{text-align:center; float:right; margin:-32px 30px; position:relative;}   
	</style>
	
</head>

<?php

	
	//加载系统参数信息
	require_once("db/db.php");	
	require_once("common/common.php");
	
	$fltintegralcashrate = 0;
		
	$sql=sprintf("SELECT IntegralCashRate from VIP_Config");
	$result = querySql($sql);
	
	if($row = fetch_array($result))
	{
		$fltintegralcashrate = $row['IntegralCashRate'];
	}
	freeResult($result);	//释放数据库
	
	//得到当前购物车数量
	$strCartCount = '';
	$sql=sprintf("SELECT SUM(Item_Count)AS SumCount FROM WX_Temp_List Where CartTempID='%s' And DListNo=0",$strdefcartid);
	$result = querySql($sql);
	if($row = fetch_array($result))
	{
		$strCartCount  = $row['SumCount'];
	}
	freeResult($result);	//释放数据库
	
	$strDefItemType='';
	if(strlen($strDefItemTypeID)>0)
	{
		$sql = sprintf("SELECT Item_Name FROM TR_Basic_Item Where Item_Type='微信商城类型' And Item_Text='%s' Order By Item_Type ASC",$strDefItemTypeID);
		$result = querySql($sql);
		if($row = fetch_array($result))
		{
			$strDefItemType  = $row['Item_Name'];
		}
		freeResult($result);	//释放数据库
	}
	
	$intNumLeft = 4;
	if($strCartCount=='')
	{
		$strCartImg='images/cart1.png';
	}
	else
	{
		$strCartImg='images/cart2.png';

		
		if($strCartCount>9)
		{
			$intNumLeft=0;
		}
	}
	
	$intBannerHeight = 190;
?>

<body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">		
<!--第一个页面的内容实现---------------------------->
<section data-role="page" id="page1">	
	<!--
	<header data-role="header" data-position="fixed" data-tap-toggle="false" style="border-top-width:0px;border-bottom-width:0px;">
        <table width="100%" height="52" border="0" cellpadding="0" cellspacing="0" bgcolor="<?php echo WxMainConfig::colHeadBkColor;?>">
		   	<tr>
				<td height="52" width="52" align="center">
					<a target="_blank" data-transition="flip" href="index2.php?dlistno=<?php echo $strselDListNo;?>">
						<div>
							<img src="images\seld.png" width="21" height="15" border="0" style="margin-top:3px;">
						</div>
					</a>
				</td>
				<td height="52" align="center" valign="middle">
	                <span style="color:<?php echo WxMainConfig::colHeadTextColor;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:19px;text-shadow:none;">微信商城</span>
               	</td>
				<td height="52" width="52" valign="middle">
					<div id="MyCart" width="45" height="45" style="width:45px; height:45px; background-image:url(<?php echo $strCartImg;?>);">
						<div id="MyNumDiv" style="width:30px;height:40px;padding-top:3px;padding-left:<?php echo $intNumLeft;?>px;">
							<span id="spansumg" style="color:#fff;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none; margin-left:10px;"><?php echo $strCartCount;?></span> 
						</div>
					</div>
										
				</td>
		  	</tr>
		</table>
	</header>
	-->
	
	<article data-role="none">
		<div class="imgbox" style="width:100%;height:<?php echo $intBannerHeight;?>px;align:center;">       
			<ul id="banner_img">         
				<li>
					<img width="100%" style="height:<?php echo $intBannerHeight;?>px;" border="0" src="images/b1.png"/>
					<div style="margin-top:-30px;margin-left:10px;" align="left">
						<span style="color: #F3EDED;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-decoration: none;text-shadow:none;">中餐厅这副图的具体描述文字1</span>
					</div>
				</li>
				<li>
					<img width="100%" style="height:<?php echo $intBannerHeight;?>px;" border="0" src="images/b2.png"/>
					<div style="margin-top:-30px;margin-left:10px;" align="left">
						<span style="color: #F3EDED;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-decoration: none;text-shadow:none;">中餐厅这副图的具体描述文字2</span>
					</div>
				</li>
				<li>
					<img width="100%" style="height:<?php echo $intBannerHeight;?>px;" border="0" src="images/b3.png"/>
					<div style="margin-top:-30px;margin-left:10px;" align="left">
						<span style="color: #F3EDED;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-decoration: none;text-shadow:none;">中餐厅这副图的具体描述文字3</span>
					</div>
				</li>
				<li>
					<img width="100%" style="height:<?php echo $intBannerHeight;?>px;" border="0" src="images/b4.png"/>
					<div style="margin-top:-30px;margin-left:10px;" align="left">
						<span style="color: #F3EDED;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-decoration: none;text-shadow:none;">中餐厅这副图的具体描述文字4</span>
					</div>
				</li>
			</ul>   
			<div class="clear"></div>   
			
		</div> 
	
		<script type="text/javascript">      
			var time = "";      
			var index = 1;      
			$(function () 
			{        
				showimg(index);        //鼠标移入移出        
				$(".imgnum span").hover(function () 
				{         
					clearTimeout(time);         
					var icon=$(this).text();         
					$(".imgnum span").removeClass("onselect").eq(icon-1).addClass("onselect");         
					$("#banner_img li").hide().stop(true,true).eq(icon-1).fadeIn("slow");        
				}, function () 
				{         
					index=$(this).text()> 3 ? 1 :parseInt($(this).text())+1;         
					time = setTimeout("showimg(" + index + ")", 3000);        
				});      
			});         
				
			function showimg(num) 
			{        
				index = num;        
				$(".imgnum span").removeClass("onselect").eq(index-1).addClass("onselect");
				$("#banner_img li").hide().stop(true,true).eq(index-1).fadeIn("slow");
				index = index + 1 > 4 ? 1 : index + 1; 
				time = setTimeout("showimg(" + index + ")", 3000);
			}   
		</script> 
		
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
            <tr>
				<td height="45" colspan="3">
					<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
						<tr>
							<td height="100%" width="20%" align="center">
								<div style="width:60px;height:40px;background-color:#F4EFEF;">
								</div>
							</td>
							<td height="100%" width="20%" align="center">
								<div style="width:60px;height:40px;background-color:#F4EFEF;">
								</div>
							</td>
							<td height="100%" width="20%" align="center">
								<div style="width:60px;height:40px;background-color:#F4EFEF;">
								</div>
							</td>
							<td height="100%" width="20%" align="center">
								<div style="width:60px;height:40px;background-color:#F4EFEF;">
								</div>
							</td>
							<td height="100%" width="20%" align="center">
								<div style="width:60px;height:40px;background-color:#F4EFEF;">
								</div>
							</td>
						</tr>
					</table>
				</td>
			</tr>
                <?php 
					$intRowIndex = 0;
					$strolditemtype ='';
					
					if(strlen($strDefItemType)>0)
					{
						$sql = sprintf("SELECT ItemNo,ItemName,ItemUnite,ItemPrice,Remarks,wximage,wxitemtype FROM CGS_Item_List Where wxmall>0 And wxitemtype='%s' Order By wxitemtype ASC",$strDefItemType);
					}
					else
					{
						$sql = sprintf("SELECT ItemNo,ItemName,ItemUnite,ItemPrice,Remarks,wximage,wxitemtype FROM CGS_Item_List Where wxmall>0 Order By wxitemtype ASC");
					}
					$result = querySql($sql);
	
					while($row = fetch_array($result))
					{
						$stritemno = $row['ItemNo'];
						$stritemname = $row['ItemName'];
						$fltprice = $row['ItemPrice'];
						$stritemunite = trim($row['ItemUnite']);
						$strremarks = trim($row['Remarks']);
						$stritemimg = trim($row['wximage']);
						$stritemtype = trim($row['wxitemtype']);
						
						$stritemimg = 'mall_images/'.$stritemimg ;
						
						//处理数据转换和显示
						$fltintegralval =  round($fltprice * $fltintegralcashrate,0);
					
						$stritemprice =  number_format($fltprice,1);
						$striteminteg =  number_format($fltintegralval,0);
						$stritemprice = str_replace(',','',$stritemprice);
						$striteminteg = str_replace(',','',$striteminteg);
					
					
						if(strlen($stritemunite)>0)
							$stritemunite ='/'.$stritemunite;
					
						$strremarks2 = $strremarks;
						if(strlen($strremarks)>26)
						{
							$strremarks	=  mb_substr($strremarks,0,26,'gb2312').'...';
						}
					
					
						$intRowIndex = $intRowIndex + 1;
						
						if($stritemtype!=$strolditemtype)
						{
				?>
				<tr bgcolor="#F4EFEF">
					<td height="28" width="5"></td>
					<td height="28" align="center">
						<span style="color: #535353;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;text-decoration: none;"><?php echo $stritemtype; ?></span> 
					</td>
					<td height="28" width="5"></td>
				</tr>
				<tr>
					<td height="1" colspan="3" align="left" bgcolor="#F2E2E2"></td>
				</tr>
				<?php 
							$strolditemtype = $stritemtype;
						} 
				?>
                <tr><td height="5" colspan="3"></td></tr>
                <tr>
					<td height="15" width="5"></td>
					<td height="15" align="left">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
							<tr>
								<td height="90" width="130"><a href="#"><IMG src="<?php echo $stritemimg; ?>" width="130" height="90" border="0" style="border-radius:3px;"></a></td>
								<td height="90" width="10"></td>
								<td height="90">
									<!---显示商品信息：图片，项目名称，单价，对应积分，项目说明 -->
									<a data-transition="slide" href="#ShowRoomInput<?php echo $intRowIndex;?>" data-rel="popup" data-position-to="window" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666;text-decoration: none;">
										<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
											<tr><td height="25"> 
													<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;"><?php echo $stritemname; ?></span> 
											</td></tr>
                                            
											<tr><td height="20"> 
                                            		<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                                                    	<tr>
                                                        	<td width="100" height="100%">
                                                            	<span style="color: #996600;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;">￥<?php echo $stritemprice.$stritemunite; ?></span> 
                                                            </td>
                                                            
                                                            <td width="13" height="100%">
	                                                            <img src="images\jfimg.png" width="12" height="15" border="0" style="margin-top:3px;">
                                                            </td>
                                                            <td height="100%">
	                                                            <span style="color: #996600;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:14px;"><?php echo $striteminteg; ?></span> 
                                                            </td>
                                                        </tr>
                                                    </table>		
													
											</td></tr>
											
                                            <tr><td height="45" valign="top">
													<span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:12px;"><?php echo $strremarks; ?></span> 
											</td></tr>
										</table>
                                    </a>    
                                        
                                        
                                    <!-- 以下是点击项目弹出的详细信息界面 -->
                                  	<div data-role="popup" id="ShowRoomInput<?php echo $intRowIndex;?>" data-corners="false">
                                        <a href="#" data-rel="back" class="ui-btn ui-corner-all ui-shadow ui-btn-a ui-icon-delete ui-btn-icon-notext ui-btn-right">Close</a>
                                        <table width="280" height="155" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
                                            <tr><td height ="2" colspan="3" align="center"></td></tr>
                                            <tr><td height ="35" colspan="3" align="center"><span style="color: #808000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:18px;text-shadow:none;"><?php echo $stritemname; ?></span></td></tr>
                                            <tr><td height ="1" colspan="3" align="center" bgcolor="#F2E2E2"></td></tr>
                                            <tr><td height ="10" colspan="3" align="center"></td></tr>
                                                                                        
                                             <tr>
                                                <td height ="18" width="10"></td>
                                                <td height ="18">
                                                	<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                                                    	<tr>
                                                        	<td width="54" height="100%" align="right">
                                                            	<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none;">单价：</span>
                                                            </td>
                                                            <td height="100%" align="left" colspan="2">
                                                            	<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none;">￥<?php echo $stritemprice.$stritemunite; ?></span>
                                                            </td>
                                                        </tr>
                                                        
                                                        <tr><td height="4" colspan="3"></td></tr>
                                                     	<tr>
                                                        	<td width="54" height="100%" align="right">
                                                            	<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none;">积分：</span>
                                                            </td>
                                                            
                                                        	<td width="14" height="100%" align="left">
                                                        		<img src="images\jfimg.png" width="12" height="15" border="0" style="margin-top:3px;">
                                                        	</td>
                                                            <td height="100%" align="left">
                                                            	<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:15px;text-shadow:none;"><?php echo $striteminteg; ?>分</span>
                                                            </td>
                                                        </tr>
                                                     </table>	
                                                
                                                </td>
                                                <td height ="18" width="10"></td>
                                            </tr>
                                                                 

                                            <tr>
                                            	<td height ="18" width="10"></td>
                                            	<td height ="18" align="left">
                                                	<span style="color: #999999;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:13px;"><?php echo $strremarks2; ?></span> 
                                            	</td>
                                                <td height ="18" width="10"></td>
                                            </tr>
                                            
                                            <tr><td height ="10" colspan="3" align="center"></td></tr>
                                                                        
                                            <tr>
                                                <td height ="40" width="10"></td>
                                                <td height ="40" align="center">
                                                    <div data-rel="back" onClick="bmtSaveToTempTable(<?php echo $stritemno;?>,<?php echo $intRowIndex;?>)" style="border-radius:5px;width:80%; height:38px; background-color:#D7AA28;">
                                                        <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
                                                            <tr><td width="100%" height="100%" align="center">
                                                                <span style="color:#fff ;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">加入购物车</span>                            	
                                                            </td></tr>
                                                        </table>
                                                    </div>
                                                </td>
                                                <td height ="40" width="10"></td>
                                            </tr>
                                            
                                            <tr><td height ="15" colspan="3" align="center"></td></tr>
                                        
                                        </table>
                                    </div>
                                    <!----------------------------------------------------->
								</td>
							</tr>
						</table>
					</td>
					<td height="15" width="5"></td>
				</tr>
				
                <tr><td height="1" colspan="3"></td></tr>
                
				<tr>
					<td height="1" width="5"></td>
					<td height="1" align="left" bgcolor="#F2E2E2"></td>
					<td height="1" width="5"></td>
				</tr>
                
                <?php	
						
					}
					freeResult($result);	//释放数据库
					closeDb();				//关闭数据库
				?>
                
                
			<tr>
				<td height="8" width="5"></td>
				<td height="8" align="left"></td>
				<td height="8" width="5"></td>
			</tr>
		</table>
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false" style="border-top:0px solid #F2E2E2;border-bottom:1px solid #F2E2E2;border-left:1px solid #F2E2E2;border-right:1px solid #F2E2E2;">
		<table width="100%" height="10" border="0" cellpadding="0" cellspacing="0">
			<tr height="100%" valign="top">
				<td width="25%">					
					<a class="ui-btn ui-icon-home ui-btn-icon-top" data-transition="slide" target="_blank" href="#" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666;">首页</a>
				</td>
				<td width="25%">					
					<a class="ui-btn ui-icon-bullets ui-btn-icon-top" data-transition="slide" target="_blank" href="orderlist.php?bstat=0" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666">我的订单</a>
				</td>
				<td width="25%">
					<a class="ui-btn ui-icon-shop ui-btn-icon-top" data-transition="slide" target="_blank" href="cartlist.php" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666">购物车</a>
				</td>
				<td width="25%">
					<a class="ui-btn ui-icon-user ui-btn-icon-top" data-transition="slide" target="_blank" href="vipmain.php" style="width:100%;height:10px;margin:0px auto 0px auto;color:#666666">我的账户</a>
				</td>
			</tr>
		</table>						
	</footer>
    
    <script type="text/javascript">
				
		//相应提交按钮事件处理部分
		function bmtSaveToTempTable(selitemno,myboxid)
		{			
			//开始保存项目到购物车中
			var strret;
			//用ajax的“同步方式”调用一般处理程序
			$.ajax({
				url: "savetotemp.php?selitno=" + selitemno ,
				async: false,//改为同步方式
				type: "POST",
				//data: {doid:1, rmid: "strRoomNo" },
				success: function (RetData) 
				{
					strret = RetData;
				}
			});

			//alert(strret);
			if(strret==1)
			{
				//关闭弹出窗口
				var $myd = $("#ShowRoomInput" + myboxid);
				$myd.popup('close');
				
				//更新购物车数量
				var strCount = document.getElementById("spansumg").innerHTML;
				if(strCount=='')
				{
					strCount=0;
				}
				var intNewCount = parseInt(strCount); 
				intNewCount = intNewCount + 1;
								
				if(intNewCount<1)
				{
					document.getElementById('MyCart').style.backgroundImage = 'url(images/cart1.png)';
				}
				else
				{
					document.getElementById('MyCart').style.backgroundImage = 'url(images/cart2.png)';	
				}
					
				document.getElementById("spansumg").innerHTML = intNewCount;
				if(intNewCount>9)
				{
					$("#MyNumDiv").css("padding-left","0px");
				}
			}
										
		}
		
	</script>
	
    
	
</section>



<!--选择分店的部分代码---------------------------->
<section data-role="page" id="pagetype">
	<header data-role="header" data-position="fixed" data-tap-toggle="false" style="border-top-width:0px;border-bottom-width:0px;">
        <table width="100%" height="52" border="0" cellpadding="0" cellspacing="0" bgcolor="<?php echo WxMainConfig::colHeadBkColor;?>">
		   	<tr>
				<td height="50" width="30" align="right">
	                <a href="#page1" target="_blank"data-iconpos="notext">
	                    <img src="images\back.png" width="12" height="21" border="0" style="margin-top:3px;">
                    </a>
				</td>
				<td height="50" width="10"></td>
				<td height="50" align="left">
					<div style="padding-top:2px;">
						<table width="100%" height="45" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td align="center">
                                    <span style="color:<?php echo WxMainConfig::colHeadTextColor;?>;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:19px;text-shadow:none;">选择项目类型</span>
                                </td>
								<td width="50"></td>
							</tr>
						</table>
					</div>
				</td>
			</tr>
		</table>
	</header>
	
	<article data-role="content">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
			<tr>
				<td height="1" width="5"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="5"></td>
			</tr>
			
			<tr><td height="5" colspan="3"></td></tr>
			<tr>
				<td height="15" width="5"></td>
				<td height="15" align="left">
					<a href="index.php?itmType=" target="_blank"data-iconpos="notext" style="text-decoration:none;text-shadow:none;">
						<table width="100%" border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td height="36" width="32" valign="middle">
									<img src="images\item.png" width="18" height="22" border="0" style="margin-top:1px;">
								</td>
								<td height="36" valign="middle">
									<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-shadow:none;">所有类型</span> 
								</td>
							</tr>
							
						</table>
					</a>
				</td>
				<td height="15" width="5"></td>
			</tr>
			
			<tr><td height="4" colspan="3"></td></tr>
			
			<tr>
				<td height="1" width="5"></td>
				<td height="1" align="left" bgcolor="#F2E2E2"></td>
				<td height="1" width="5"></td>
			</tr>
				
		 <?php
		 	$intRowPos = 0;
			$sql = sprintf("SELECT Item_Name,Item_Text FROM TR_Basic_Item Where Item_Type='微信商城类型' Order By Item_Type ASC");
			$result = querySql($sql);
	
			while($row = fetch_array($result))
			{
				$stritemtypeid = $row['Item_Text'];
				$stritemtype = $row['Item_Name'];
				$intRowPos = $intRowPos + 1;
		?>
			<tr><td height="5" colspan="3"></td></tr>
                <tr>
					<td height="15" width="5"></td>
					<td height="15" align="left">
						<a href="index.php?itmType=<?php echo $stritemtypeid;?>" target="_blank" data-iconpos="notext" style="text-decoration:none;text-shadow:none;">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td height="36" width="32" valign="middle">
										<img src="images\item.png" width="18" height="22" border="0" style="margin-top:1px;">
									</td>
									<td height="36" valign="middle">
										<span style="color: #000;font: 12px/1.5 '微软雅黑',tahoma, Srial, helvetica, sans-serif; font-size:16px;text-decoration:none;text-shadow:none;"><?php echo $intRowPos.'. '.$stritemtype; ?></span> 
									</td>
								</tr>
								
							</table>
						</a>
					</td>
					<td height="15" width="5"></td>
				</tr>
				
                <tr><td height="4" colspan="3"></td></tr>
                
				<tr>
					<td height="1" width="5"></td>
					<td height="1" align="left" bgcolor="#F2E2E2"></td>
					<td height="1" width="5"></td>
				</tr>
			
		<?php
			}
			//释放数据库
			freeResult($result);
			closeDb();
		 ?>
		  
		</table> 
		
	</article>
	
	<footer data-role="footer" data-position="fixed" data-tap-toggle="false">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
			<tr><td height="8"></td></tr>
		</table>
	</footer>
</section>

</body>
	
</html>