<?php
	require_once('_approot.php');	
	
	$ls=$_GET['ls'];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="css/admin.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/style2.css" />
<script language="JavaScript" src="js/ls.js"></script>
<title>无标题文档</title>
<style>
button{ padding:5px 15px;}
</style>
</head>
<body bgcolor="#f4f4f4">
<table width="100%" border="0" align="center" cellpadding="1" cellspacing="1">
	<tr>
        <td height="18" style="border-bottom:2px solid #00c0ef; padding-bottom:5px;"><div align="center"><font color="#3c8dbc" style="font-size:16px;">手机站生成</font></div>
				</td>
	</tr>
	<tr>
		<td height="213" valign="top"><br>
			<table width="98%" border="0" align="center" cellpadding="8" cellspacing="1" bgcolor="#f0f0ee">
				<?php
					switch($ls)	
					{
							case "mobile":
				?>
				<tr height="47">
					<td style="padding-left:20px;" ><li><b><font color="#0000FF">手机整站生成</font></b><span style="padding-left:0px;">
					  <button type="button" value="生成整站" onclick="JavaScript:location='temp_index_m.php?ls=all_m';" />生成整站</button>
					</span></li></td>
				</tr>
				<tr height="47">
				  <td style="padding-left:20px;" ><li>Home<span style="padding-left:40px;">
					  <button type="button" value="首页生成"  onclick="JavaScript:location='temp_index_m.php?ls=index_m';" />首页生成</button>
					</span></li></td>
				</tr>
				<tr height="47">
					<td style="padding-left:20px;" ><li>About Us<span style="padding-left:20px;">
					  <button type="button" value="关于我们" onclick="JavaScript:location='temp_index_m.php?ls=aboutus_m';" />关于我们</button>
					</span></li></td>
				</tr>
			<tr height="47">
					<td style="padding-left:20px;" ><li>News<span style="padding-left:40px;">
					  <button type="button" value="新闻生成"  onclick="JavaScript:location='temp_index_m.php?ls=news_m';" />新闻生成</button>
					</span></li></td>
				</tr>
              <tr height="47">
					<td style="padding-left:20px;" ><li>
					Download<span style="padding-left:19px;"><button type="button" value="下载生成" onclick="JavaScript:location='temp_index_m.php?ls=download_m';" />下载生成</button></span>
		             </li></td>
				</tr>
               <tr height="47">
					<td style="padding-left:20px;" ><li>FAQs<span style="padding-left:42px;">
					  <button type="button" value="常见问题"onclick="JavaScript:location='temp_index_m.php?ls=faq_m';" />常见问题</button>
					</span></li></td>
				</tr>
               <tr height="47">
					<td style="padding-left:20px;" ><li>Workshop<span style="padding-left:12px;">
					  <button type="button" value="工厂生成"  onclick="JavaScript:location='temp_index_m.php?ls=workshop_m';" />工厂生成</button>
					</span></li></td>
				</tr>
               <tr height="47">
					<td style="padding-left:20px;" ><li>Certificate<span style="padding-left:12px;">
					  <button type="button" value="证书生成" onclick="JavaScript:location='temp_index_m.php?ls=certificate_m';" />证书生成</button>
					</span></li></td>
				</tr>
              <tr height="47">
					<td style="padding-left:20px;" ><li>Quality<span style="padding-left:32px;">
					  <button type="button" value="质量控制" onclick="JavaScript:location='temp_index_m.php?ls=qualitycontrol_m';" />质量控制</button>
					</span></li></td>
				</tr>
               <tr height="47">
					<td style="padding-left:20px;" ><li>Packing<span style="padding-left:24px;">
					  <button type="button" value="包装生成"  onclick="JavaScript:location='temp_index_m.php?ls=packing_m';" />包装生成</button>
					</span></li></td>
				</tr>
				<tr height="47">
					<td style="padding-left:20px;" ><li>Contactus<span style="padding-left:11px;">
					  <button type="button" value="联系我们" onclick="JavaScript:location='temp_index_m.php?ls=contact_m';" />联系我们</button>
					</span></li></td>
				</tr>
			<tr height="47">
					<?php 							 $m_allcreatedfiles=" ";
							foreach($m_generalCreateFiles as $m_createdfile ) {
   								$m_allcreatedfiles.= ($m_createdfile.", &nbsp;");
							}

							?>
					<td style="padding-left:20px;" ><li>Others<span style="padding-left:29px;">
					  <button type="button" value="其他页面"  onclick="JavaScript:location='temp_index_m.php?ls=nomenufiles_m';" />其他页面</button>
					</span><b><?php echo $m_allcreatedfiles ?></b></li></td>
				</tr>
               <tr height="47">
					<td style="padding-left:20px;" > </td>
				</tr>
				<tr height="47">
					<td  style="padding-left:40px;" ><b>产品页面</b>
                    <button type="button" value="全部产品页" onclick="JavaScript:location='temp_index_m.php?ls=products_m&productsall=ok';" />全部产品页</button></td>
				</tr>
                <tr>
					<td><table width="98%" border="0" align="center" cellpadding="3" cellspacing="1">
							<?php
							$cate_sql="select * from ls_products where  midcateName is null and  midcateID is null and  subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
							$cate_query=$opendb->query($cate_sql); 
							$b=1;
							$i=0;	//start replace 鼠标悬停菜单
							while($cate_rows=mysqli_fetch_assoc($cate_query))
							 { 
							   $midcate_sql="select * from ls_products where cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and midcateID=".$cate_rows['ID']." and  enable=1 order by Num asc";
							   $midcate_query=$opendb->query($midcate_sql);
							   $midcate_num=mysqli_num_rows($midcate_query);
							   if($midcate_num!=0)	// cate has midcate
							   { 
							   		$i++;
									$menuListscateid=$i;
							    } 
							   else{ $menuListscateid=0; } 
							   ?>
							   <tr height='47'
								onMouseOver=
									 	this.style.backgroundColor='#e5e5e5' 
									onMouseOut=
									 	this.style.backgroundColor='#A4B6D7' 
									>
							   	  <td width="7%" style='padding-left:15px;'><?= "B-". $b ?></td>
								  	<td width="30%">
								  		<img src='images/tree_cate.gif'>
							  		  <?=			$cate_rows['cateName']?>
								  	</td>
								  	<td width="63%"><input type="button" style="cursor:hand;color:#0000FF;" value="生成<?=str_replace("\"","``",str_replace("\'","`",$cate_rows['cateName']))?>下产品页" onclick="JavaScript:location='temp_index_m.php?ls=products_m&cateid=<?=$cate_rows['ID']?>&cateFolders=<?=urlencode($cate_rows['cateFolders'])?>&menuListscateid=<?=$menuListscateid?>';">
</td>
					  </tr>
								
								<?php
								$m=1;

							   while($midcate_rows=mysqli_fetch_assoc($midcate_query))
							  { ?>

									<tr height='47'
									onMouseOver=
									 	this.style.backgroundColor='#e5e5e5' 
									onMouseOut=
									 	this.style.backgroundColor='#f4f4f4' 
									>
									  <td style='padding-left:15px;'><?=	 "M-".$b."-".$m?></td>
										<td style='padding-left:15px;'>
											&nbsp; &nbsp;<img src='images/tree_midcate.gif'>
										  <?=			$midcate_rows['midcateName']?>
										</td>
										<td>
											<input type="button" style="cursor:hand;color:#0000FF;" value="生成<?=str_replace("\"","``",str_replace("\'","`",$midcate_rows['midcateName']))?>下产品页" onclick="JavaScript:location='temp_index_m.php?ls=products_m&midcateid=<?=$midcate_rows['ID']?>&midcateFolders=<?=urlencode($midcate_rows['midcateFolders'])?>&cateid=<?=$cate_rows['ID']?>&cateFolders=<?=urlencode($cate_rows['cateFolders'])?>&menuListscateid=<?=$menuListscateid?>';">
										</td>
									</tr>
									<?php
									
									$s=1;

							 	 	$subcate_sql="select * from ls_products where cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and subcateID=".$midcate_rows['ID']." and enable=1 order by Num asc";
									$subcate_query=$opendb->query($subcate_sql);
									$myrows=mysqli_num_rows($subcate_query);
									$mynum=mysqli_num_rows($subcate_query);

									while($subcate_rows=mysqli_fetch_assoc($subcate_query))
									{ ?>					
									<tr height='47'
										onMouseOver=
										 	this.style.backgroundColor='#e5e5e5' 
										onMouseOut=
										 	this.style.backgroundColor='#f4f4f4' 
										>
										  <td style='padding-left:15px;'><?="S-".$b."-".$m."-".$s?></td>
											<td style='padding-left:15px;'>
										&nbsp; &nbsp;&nbsp; &nbsp; 		<img src='images/tree_subcate.gif'>&nbsp;
										<?=			$subcate_rows['subcateName']?>
											</td>
											<td>
												<input type="button" style="cursor:hand;color:#0000FF;" value="生成<?=str_replace("\"","``",str_replace("\'","`",$subcate_rows['subcateName']))?>下产品页" onclick="JavaScript:location='temp_index_m.php?ls=products_m&subcateid=<?=$subcate_rows['ID']?>&subcateFolders=<?=urlencode($subcate_rows['subcateFolders'])?>&midcateid=<?=$midcate_rows['ID']?>&midcateFolders=<?=urlencode($midcate_rows['midcateFolders'])?>&cateid=<?=$cate_rows['ID']?>&cateFolders=<?=urlencode($cate_rows['cateFolders'])?>&menuListscateid=<?=$menuListscateid?>';">
											</td>
										</tr>
								<?php		$s++;   } 

								$m++;   } 
					$b++;	 } 
						?>
						</table></td>
				</tr>
				<?php 
						break;
						}
				?>
			</table>
	  <br></td>
	</tr>
</table>
</body>
</html>