<?php
	session_start;
	require_once('inc/conn.php');
	require_once('inc/constant.php');
	require_once('inc/ls_syscode.php');
	require_once('inc/check.php');
	$opendb=new mydb;
	require_once('inc/char_set.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">
<script language="JavaScript" src="js/ls.js"></script>
<title>无标题文档</title>
</head>
<body>
<table width="96%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#6396d6">
	<tr>
		<td height="18" background="images/admin_bg.gif"><div align="center"><font color="#ffffff"><strong>手机站生成</strong></font></div></td>
	</tr>
	<tr>
		<td height="213" valign="top" bgcolor="#dee7ff"><br>
			<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
				<?php
					switch($ls)	
					{
							case "mobile":
				?>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b><font color="#0000FF">手机整站生成</font></b><span style="padding-left:40px;">
					  <input type="button" value="生成整站" style="cursor:hand;color:#FF0000;" onclick="JavaScript:location='temp_index_m.php?ls=all_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>Home </b><span style="padding-left:40px;">
					  <input type="button" value="手机首页" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=index_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>About Us</b><span style="padding-left:40px;">
					  <input type="button" value="手机首页" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=aboutus_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>News</b><span style="padding-left:40px;">
					  <input type="button" value="手机新闻" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=news_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>FAQs</b><span style="padding-left:40px;">
					  <input type="button" value="手机常见问题" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=faq_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>Workshop</b><span style="padding-left:40px;">
					  <input type="button" value="手机工厂" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=workshop_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>Certificate</b><span style="padding-left:40px;">
					  <input type="button" value="手机证书" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=certificate_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>Quality</b><span style="padding-left:40px;">
					  <input type="button" value="手机质量" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=qualitycontrol_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>Packing</b><span style="padding-left:40px;">
					  <input type="button" value="生成包装" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=packing_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>Contact Us</b><span style="padding-left:40px;">
					  <input type="button" value="手机联系我们" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=contact_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<?
							 $m_allcreatedfiles=" ";
							foreach($m_generalCreateFiles as $m_createdfile ) {
   								$m_allcreatedfiles.= ($m_createdfile.",");
							}

							?>
					<td style="padding-left:20px;" ><li><b>Other<? echo $m_allcreatedfiles ?></b><span style="padding-left:40px;">
					  <input type="button" value="主菜单外其页面"  style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=nomenufiles_m';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>全部产品页</b><span style="padding-left:40px;">
					  <input type="button" value="手机产页面" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index_m.php?ls=products_m&productsall=ok';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" >&nbsp;</td>
				</tr>
                <tr>
					<td><table width="99%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">
							<?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=mysql_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=mysql_num_rows($midcate_query);
							   if($midcate_num!=0)	// cate has midcate
							   { 
							   		$i++;
									$menuListscateid=$i;
							    } 
							   else{ $menuListscateid=0; } 
							   ?>
							   	<tr bgcolor='#A4B6D7'
								onMouseOver=
									 	this.style.backgroundColor='#CCFFCC' 
									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=mysql_fetch_assoc($midcate_query))
							  { ?>

									<tr bgcolor='#f4f4f4'
									onMouseOver=
									 	this.style.backgroundColor='#CCFFCC' 
									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=mysql_num_rows($subcate_query);
									$mynum=mysql_num_rows($subcate_query);

									while($subcate_rows=mysql_fetch_assoc($subcate_query))
									{ ?>					
										<tr bgcolor='#f4f4f4'
										onMouseOver=
										 	this.style.backgroundColor='#CCFFCC' 
										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>
				<? 
						break;
						}
				?>
			</table>
	  <br></td>
	</tr>
</table>
</body>
</html>