<?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"><strong><font color="#ffffff">网页生成</font></strong></div></td>
	</tr>
	<tr>
		<td height="213" valign="top" bgcolor="#dee7ff"><br>
			<table width="90%" border="0" align="center" cellpadding="8" cellspacing="1" bgcolor="#FFFFFF">
				<?php
					switch($ls)	
					{
						case "normal":
				?>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b><font color="#0000FF">整站生成</font></b></li></td>
				</tr>
				<!--<tr bgcolor="#F4F4F4">
				  <td  style="padding-left:40px;" ><input type="button" value="生成整站" style="cursor:hand;color:#FF0000;" onclick="JavaScript:location='temp_index.php?ls=all_products&amp;productsall=ok';" />				    
				      &lt;&lt; 含产品页  </td>
			  </tr>-->
				<tr bgcolor="#F4F4F4">
				  <td  style="padding-left:40px;" ><input type="button" value="生成整站" style="cursor:hand;color:#FF0000;" onclick="JavaScript:location='temp_index.php?ls=all';" />
				      &lt;&lt;   不含产品页，产品很多时（&gt;600个）避免超时。 </td>
			  </tr>
				<tr bgcolor="#F4F4F4">
				  <td  style="padding-left:40px;" > 
				    <input  type="button" style="cursor:hand;color:#0000FF;" value="产品页生成" onclick="JavaScript:location='temp_index.php?ls=products&amp;productsall=ok'" />
				     </td>
			  </tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>首页(Home)</b></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" ><input type="button" value="首页(Home)生成" style="cursor:hand;color:#0000FF;" onClick="JavaScript:location='temp_index.php?ls=index';"></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>关于我们(About Us)</b></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" ><input type="button" value="关于我们(About Us)生成" style="cursor:hand;color:#0000FF;" onClick="JavaScript:location='temp_index.php?ls=aboutus';"></td>
				</tr>
				<!--<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>反馈(Feedbadk)</b></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" ><input type="button" value="生成反馈(Feedbadk)" style="cursor:hand;color:#0000FF;" onClick="JavaScript:location='temp_index.php?ls=feedback';"></td>
				</tr>-->
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>联系我们(Contact Us)</b></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" ><input type="button" value="联系我们(Contact Us)生成" style="cursor:hand;color:#0000FF;" onClick="JavaScript:location='temp_index.php?ls=contactus';"></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<?
							 $allcreatedfiles=" ";
							foreach($generalCreateFiles as $createdfile ) {
   								$allcreatedfiles.= ($createdfile.", &nbsp;");
							}

							?>
					<td style="padding-left:20px;" ><li><b>非主菜单页面<? echo $allcreatedfiles ?></b></li></td>
				</tr>
				<tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" ><input type="button" value="主菜单外其他页面生成"  style="cursor:hand;color:#0000FF;" onClick="JavaScript:location='temp_index.php?ls=nomenufiles';"></td>
				</tr>
                <tr bgcolor="#F4F4F4">
					<td  style="padding-left:40px;" ><input type="button" value="单页生成"  style="cursor:hand;color:#0000FF;" onClick="JavaScript:location='temp_index.php?ls=singlepage';"></td>
				</tr>

				<?php
							break;
							case "products"	:
						?>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>产品 (Products) 页面生成</b></li>
						<input  type="button" style="cursor:hand;color:#0000FF;" value="生成全部" onClick="JavaScript:location='temp_index.php?ls=products&productsall=ok'">
						<input type="button" style="cursor:hand;color:#0000FF;" value="生成大类<?=str_replace("\"","``",str_replace("\'","`",$cate_rows['cateName']))?>下页面" onclick="JavaScript:location='temp_index.php?ls=products&cateid=<?=$cate_rows['ID']?>&cateFolders=<?=urlencode($cate_rows['cateFolders'])?>&menuListscateid=<?=$menuListscateid?>';" /></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.php?ls=products&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.php?ls=products&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.php?ls=products&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;
							 case "other":
								
						?>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>News </strong> <span style="padding-left:46px;">
                          <input type="button" value="新闻生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=news';" />
					</span><strong>&nbsp;&nbsp;</strong></span></li></td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>FAQ </strong> &nbsp;&nbsp;</span><span style="padding-left:46px;">
					 <input type="button" value="问题生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=faq';" />
					</span></li></td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>Blog</strong>  <span style="padding-left:54px;">
				    <input type="button" value="博客生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=blog';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li>
					 <strong>Download</strong><span style="padding-left:26px;"><input type="button" value="下载生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=download';" /></span>
		             </li></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>Management</strong><span style="padding-left:4px;">
					  <input type="button" value="团队生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=management';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>Workshop</strong><span style="padding-left:22px;"><input type="button" value="车间生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=workshop';" />
					</span></li></td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>Video</strong><span style="padding-left:46px;">
					  <input type="button" value="视频生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=video';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>Quality</strong><span style="padding-left:40px;">
					  <input type="button" value="质量生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=qualitycontrol';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>R&D</strong><span style="padding-left:52px;">
					  <input type="button" value="生成研发" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=rd';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>Certificate</strong><span style="padding-left:18px;">
					  <input type="button" value="证书生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=certificate';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>Packing</strong><span style="padding-left:30px;">
					  <input type="button" value="包装生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=packing';" />
					</span></li></td>
				</tr>
				<tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>Brand</strong><span style="padding-left:42px;">
					  <input type="button" value="品牌生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=brand';" />
					</span></li></td>
				</tr>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><strong>History</strong><span style="padding-left:36px;">
					  <input type="button" value="公司历史生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=history';" />
					</span></li></td>
				</tr>
                <?php
				if(strpos("floor", $_SERVER['HTTP_HOST']) == false){
				?>
                <tr bgcolor="#B9DAFF">
					<td style="padding-left:20px;" ><li><b>test</b><span style="padding-left:54px;">
					  <input type="button" value="测试生成" style="cursor:hand;color:#0000FF;" onclick="JavaScript:location='temp_index.php?ls=test';" />
					</span></li></td>
				</tr>
				<?php
				}
							break;
						}
				?>
			</table>
	  <br></td>
	</tr>
</table>
</body>
</html>