<?php if (!defined('THINK_PATH')) exit();?>

<!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" />
<title><?php echo ($site_info["title"]); ?></title>
<meta name="keywords" content="<?php echo ($site_info["keyword"]); ?>" />
<meta name="description" content="<?php echo ($site_info["content"]); ?>" />
	

<link rel="stylesheet" type="text/css" href="<?php echo ($TMPL_PATH); ?>Public/css/style.css" />
<script type="text/javascript" src="<?php echo ($TMPL_PATH); ?>Public/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo ($TMPL_PATH); ?>Public/js/jquery.json.js"></script>
<script type="text/javascript" src="<?php echo ($TMPL_PATH); ?>Public/js/script.js"></script>
<script language="JavaScript">
<!--
//指定当前组模块URL地址 
var URL = '__URL__';
var ROOT_PATH = '__ROOT__';
var APP	 =	 '__APP__';
var PUBLIC = '<?php echo ($TMPL_PATH); ?>ThemeFiles';
var VAR_MODULE = '<?php echo c('VAR_MODULE');?>';
var VAR_ACTION = '<?php echo c('VAR_ACTION');?>';
var CURR_MODULE = '<?php echo ($module_name); ?>';
var KEYWORDS_EMPTY = '<?php echo L("KEYWORDS_EMPTY");?>';
var REPLY = '<?php echo L("REPLY");?>';
var IS_NAN	=	'<?php echo L("IS_NAN");?>';	
var FANWE_LANG_ID = '<?php echo ($FANWE_LANG_ID); ?>';
//-->
</script>
</head>

<body>
<div id="ajax_loader"></div>
<script type="text/javascript">
	initAjaxLoader();
</script>

<div class="wrap">
    <div id="header">
    	
    	<div class="f_l">
        	<a href="<?php echo c('SHOP_URL');?>" target="_blank" ><img src="__ROOT__<?php echo ($sunnyi_logo); ?>" /></a>
        </div><!--end logo-->
        <div class="f_l" style="padding-left:30px; width:300px;">

        	<ul class="top_menu">
        	<li class="top_home"><a href="__APP__/" >首页</a></li>
			<li class="top_pick"><a href="<?php echo u("Goods/pick");?>" >选购中心</a></li>
			<li class="top_member"><a href="<?php echo u("Message/index");?>" >留言中心</a></li>
			<li class="top_cart"><a href="<?php echo u("Cart/listCart");?>" >购物车</a></li>
        	</ul><!--end top_menu-->

            
            <div class="blank"></div><div class="blank"></div>
            <div class="top_login">
            	<div class="top_member">
<?php if($is_login): ?><?php echo L("WELCOMEBACK");?>&nbsp;&nbsp;<?php echo $_SESSION["user_name"];?>!  &nbsp;&nbsp;<a href="<?php echo u('UserCenter/index');?>"><?php echo L("USER_CENTER");?></a> <a href="<?php echo u('User/logout');?>"><?php echo L("LOGOUT");?></a>
            	<?php else: ?>
            		<?php echo L("WELCOME");?>&nbsp;&nbsp;[<a href="<?php echo u('User/register');?>"><?php echo L("REG");?></a>]&nbsp;&nbsp;[<a href="<?php echo u('User/login');?>"><?php echo L("LOGIN");?></a>]<?php endif; ?></div>
            </div><!--end top_login-->
		
        </div><!--end header_left-->
		<div class="cs_img" ></div>
	</div>
    <div class="blank" style="height:2px; font-size:0px; line-height:0px;"></div>
    <div class="main_nav">
    	<span style="position:absolute; right:0px;">
            	<span class="define_main_nav">
<a href="<?php echo u('Goods/index',array('rec'=>'is_promote'));?>">
特价商品
</a>
<a href="<?php echo u('Goods/isHot');?>">
热卖商品
</a>
<a href="<?php echo u('Message/index');?>">
留言中心
</a>
</span>
       </span>
        <div class="nav_main">
        	<ul class="f_l">
        		<?php if(is_array($main_navs)): foreach($main_navs as $key=>$nav): ?><li><a href="<?php echo ($nav["url"]); ?>" <?php if($nav["act"] == '1'): ?>class="act"<?php endif; ?>  target="<?php echo ($nav["target"]); ?>"><?php echo ($nav["name_1"]); ?></a></li><?php endforeach; endif; ?>
            </ul>
            
        </div><!--end nav_main-->
    </div><!--end main_nav-->
	<div class="sub_main_nav">
		<div id="cart">
			 <a href="<?php echo u('Cart/listCart');?>"><?php echo L("YOUR_CART_HAVE");?> <span style="color:#da6700; font-size:12px; font-weight:bold; font-family:verdana;"><?php echo (intval($cart_info["total_number"])); ?></span> <?php echo L("UNIT_GOODS");?> 

	        </a>
		</div>
		<a href="<?php echo u('Cart/listCart');?>" id="gocheck"></a>
		<form name="search_form" action="__APP__" onsubmit="return checkKeywords();" >
    	<input type="hidden" name="<?php echo c('VAR_MODULE');?>" value="Goods" />
        <input type="hidden" name="<?php echo c('VAR_ACTION');?>" value="advSearch" />
		<input type="hidden" name="search" value="search" />
		<select name="cate_id">
						<option value='0' <?php if($cate_id == 0): ?>selected="selected"<?php endif; ?>><?php echo L("ALL_CATE");?></option>
						<?php if(is_array($cate_list)): foreach($cate_list as $key=>$cate_item): ?><option value="<?php echo ($cate_item["id"]); ?>" <?php if($cate_id == $cate_item['id']): ?>selected="selected"<?php endif; ?>><?php echo ($cate_item["name_1"]); ?></option><?php endforeach; endif; ?>
		</select>
		<select name="brand_id">
						<option value='0' <?php if($brand_id == 0): ?>selected="selected"<?php endif; ?>><?php echo L("ALL_BRAND");?></option>
						<?php if(is_array($brand_list)): foreach($brand_list as $key=>$brand_item): ?><option value="<?php echo ($brand_item["id"]); ?>" <?php if($brand_id == $brand_item['id']): ?>selected="selected"<?php endif; ?>><?php echo ($brand_item["name_1"]); ?></option><?php endforeach; endif; ?>
		</select>
		<?php if($spec_list): ?><?php if(is_array($spec_list)): foreach($spec_list as $key=>$spec_type): ?><select name="spec_type[<?php echo ($spec_type["spec_type"]["id"]); ?>]">
						<option value="" <?php if($spec_search_list[$spec_type['spec_type']['id']] == ''): ?>selected="selected"<?php endif; ?>>==<?php echo L("PLEASE_SELECT");?><?php echo ($spec_type["spec_type"]["name_1"]); ?>==</option>
						<?php if(is_array($spec_type["spec_list"])): foreach($spec_type["spec_list"] as $key=>$spec_item): ?><option value="<?php echo (urlencode($spec_item["spec_name"])); ?>" <?php if($spec_search_list[$spec_type['spec_type']['id']] == $spec_item['spec_name']): ?>selected="selected"<?php endif; ?>><?php echo ($spec_item["spec_name"]); ?></option><?php endforeach; endif; ?>
						</select><?php endforeach; endif; ?><?php endif; ?>
        <input type="text" class="txt_search" name="keywords" id="head_keywords" />&nbsp;&nbsp;<input type="submit" id="searchbtn" value="<?php echo L("SEARCH");?>" />&nbsp;&nbsp;<span ><a href="<?php echo u('Goods/advSearch');?>"><?php echo L("ADV_SEARCH");?></a></span>&nbsp;&nbsp;
</form>
		
	</div><!--end sub_main_nav--> 
</div><!--通用头部 header-->
</div><!--end wrap-->
<div class="blank5"></div>

<div class="blank"></div>
<div class="wrap">
<div class="f_l left">
	<div class="inc_tag">
    	<div class="inc_top"><?php echo L("ARTICLE_CATE_TREE");?></div>
        <div class="inc_mid" style="padding:0px;">
        	<ul class="list_01">
        	<?php if(is_array($article_cate_list)): foreach($article_cate_list as $key=>$cate_item): ?><li style="padding-left:<?php echo ($cate_item["level"]); ?>em;"><a href="<?php echo ($cate_item["url"]); ?>" <?php if($cate_item["act"] == 1): ?>class="cate_act"<?php endif; ?>><?php echo ($cate_item["name_1"]); ?></a></li><?php endforeach; endif; ?>
            </ul>
        </div>
        <div class="inc_foot"></div>
    </div><!--模块样式2-->	
	<div class="blank"></div>
	<div class="inc_02">
    	<div class="inc_top"><?php echo L("ARTICLE_SEARCH");?>
    	
    	</div>
        <div class="inc_mid clearfix">
        	<table class="article_search">
        		<form name="search_article" action="__APP__" method="get">
        		<tr>
        			<td><?php echo L("KEYWORDS");?>：</td>
        			<td><input type="text" class="txt_norequire" size=17 name="keywords" value="<?php echo ($keywords); ?>" /></td>
        		</tr>
        		<tr>
        			<td>
        			<input type="hidden" name="<?php echo c('VAR_MODULE');?>" value="Article" />
        			<input type="hidden" name="<?php echo c('VAR_ACTION');?>" value="index" />
        			</td>
        			<td><input type="submit" class="btn_01" value="<?php echo L("ARTICLE_SEARCH");?>" /></td>
        		</tr>
          		</form>
        	</table>
        </div>
        <div class="inc_foot"></div>
    </div><!--模块样式2-->	
	<div class="blank"></div>
	<?php if($relate_articles): ?><div class="inc_01">
    	<div class="inc_top"><?php echo (L("RELATE_ARTICLES")); ?></div>
        <div class="inc_mid">
        	<ul class="list_01">
        		<?php if(is_array($relate_articles)): foreach($relate_articles as $key=>$news_item): ?><li><a href="<?php echo ($news_item["url"]); ?>" title="<?php echo ($news_item["name_1"]); ?>"><?php echo ($news_item["short"]); ?></a> </li><?php endforeach; endif; ?>
 
            </ul>
        </div>
        <div class="inc_foot"></div>
    </div><!--模块样式1--><?php endif; ?>		
</div><!--end f_l-->
<div class="f_r right">
	<div class="inc_03">
    	<div class="inc_top"><?php echo ($article_info["name_1"]); ?></div>
        <div class="inc_mid clearfix">
			<div class="article_title"><?php echo ($article_info["name_1"]); ?></div>
			<div class="article_info">
				<?php echo L("ARTICLE_AUTHOR");?>：<?php echo ($article_info["author"]); ?>&nbsp;&nbsp;
				<?php echo L("ARTICLE_UPDATE_TIME");?>：<?php echo (substr($article_info["update_time_format"],0,10)); ?>&nbsp;&nbsp;
				<?php echo L("CLICK_COUNT");?>：<?php echo ($article_info["click_count"]); ?>&nbsp;&nbsp;
			</div>
			<div class="article_content"><?php echo ($article_info["content_1"]); ?></div>
			<div class="tr">
						<?php if($next_item): ?><a href="<?php echo ($next_item["url"]); ?>"><?php echo L("PREV_ITEM");?></a><?php endif; ?>
						<?php if($prev_item): ?><a href="<?php echo ($prev_item["url"]); ?>"><?php echo L("NEXT_ITEM");?></a><?php endif; ?>
			</div>
			<?php if($attachment_list): ?><div class="attachment">
			<span class="attachment_title"><?php echo L("ATTACHMENT_LIST");?></span>
			<div class="blank5"></div>
				<?php if(is_array($attachment_list)): foreach($attachment_list as $key=>$attachment_item): ?><?php echo ($attachment_item["name_1"]); ?> &nbsp;&nbsp;(<?php echo L("DOWN_COUNT");?>：<?php echo ($attachment_item["count"]); ?>) &nbsp;&nbsp;<a href="<?php echo ($attachment_item["url"]); ?>"><?php echo L("DOWNLOAD");?></a>
				<div class="blank5"></div><?php endforeach; endif; ?>
			</div><?php endif; ?>
        </div>
        <div class="inc_foot"></div>
    </div><!--模块样式3-->
	
	<div class="blank"></div>    
        <script type="text/javascript">
   function refresh(obj)
   {
	   var timenow = new Date().getTime();
	   obj.src= '__ROOT__/?<?php echo c('VAR_MODULE');?>=Sunnyi&<?php echo c('VAR_ACTION');?>=verify&rand='+timenow;
   }
   </script>
   <div class="inc_03">
    	<div class="inc_top"><?php echo L("MESSAGE_LIST");?></div>
        <div class="inc_mid clearfix">
			<div class="message_list">
        	<?php if(is_array($message_list)): foreach($message_list as $key=>$message_item): ?><div class="message_item" style="padding:10px 0px; margin-bottom:10px;">
				<div class="user_msg">
        		<div class="message_title"><input type="hidden" value="<?php echo ($message_item["id"]); ?>" /> <span class="mainmsg">留言</span><span class="msg_title"> <?php echo ($message_item["title"]); ?> </span>  <?php if($message_item["is_top"] == 1): ?><span class="msgtop">&nbsp;</span><?php endif; ?> <span class="msgname"><?php echo ($message_item["user_name"]); ?></span> 说：<span class="msgtime">	<?php echo ($message_item["create_time_format"]); ?> </span> <a href="#message_form" class="msgreply" onclick="reply_message(this)"><?php echo L("REPLY");?></a></div>
        		<div class="blank5"></div>
        		<div class="message_content"><?php echo (nl2br($message_item["content"])); ?></div>
				</div>
        		<?php if($message_item['user_reply']): ?><div class="blank5"></div>
        		<div class="user_reply">
        		<?php if(is_array($message_item["user_reply"])): foreach($message_item["user_reply"] as $key=>$reply_item): ?><span class="replymsg">回复</span> <span class="message_title"><span class="msg_title"><?php echo ($reply_item["title"]); ?></span>  <span class="msgname"><?php echo ($reply_item["user_name"]); ?></span> 说：	<span class="msgtime"><?php echo ($reply_item["create_time_format"]); ?></span></span>
        			<div class="blank5"></div>
        			<div class="message_content"><?php echo (nl2br($reply_item["content"])); ?></div>
        			<div class="blank5"></div><?php endforeach; endif; ?>
        		</div><?php endif; ?>
        		<?php if($message_item['admin_reply']['id'] != 0): ?><div class="blank5"></div>
        		<div class="admin_reply">
        			<span class="replymsg">回复</span> <span class="message_title"><?php echo ($message_item["admin_reply"]["title"]); ?> <span class="msgtime"><?php echo ($message_item["admin_reply"]["create_time_format"]); ?></span></span>
        			<div class="blank5"></div>
        			<div class="message_content"><?php echo (nl2br($message_item["admin_reply"]["content"])); ?></div>
        			<div class="blank5"></div>
        		</div><?php endif; ?>
        	</div><?php endforeach; endif; ?>
     	   </div>
        </div>
        <div class="inc_foot"></div>
    </div><!--模块样式3-->	
    <div class="blank"></div>
    <div class="pages"><?php echo ($pages); ?></div>
    <div class="blank"></div>


   <form name="message" action="<?php echo ($POST_URL); ?>" id="message_form" method="post" />
    <div class="inc_03" <?php if($hide_msg_form): ?>style="display:none;"<?php endif; ?>>
    	<div class="inc_top"><?php echo L("SUBMIT_MESSAGE");?></div>
        <div class="inc_mid clearfix" style="padding:10px;">
			<table width=100%>
				<tr>
					<td><?php echo L("MESSAGE_USER");?>：</td>
					<td>
					<input type="hidden" value="<?php echo $_SESSION["user_id"];?>" name="user_id" />
					<?php if($is_login): ?><?php echo $_SESSION["user_name"];?>
					<input type="hidden" name="user_name" value="<?php echo $_SESSION["user_name"];?>" class="txt_require"/>
					<?php else: ?>
					<input type="text" name="user_name" class="txt_require" /><?php endif; ?>
					</td>
				</tr>
				<tr>
					<td><?php echo L("EMAIL");?>：</td>
					<td>
					<?php if($is_login): ?><?php echo $_SESSION["user_email"];?>
					<input type="hidden" name="user_email" value="<?php echo $_SESSION["user_email"];?>"/>
					<?php else: ?>
					<input type="text" name="user_email" class="txt_require"/><?php endif; ?>
					</td>
				</tr>
				<?php if($module_name == 'Article' or $module_name == 'Goods'): ?></if>
				<tr>
					<td><?php echo L("SCORE");?>：</td>
					<td>
					<label>1<?php echo L("FEN");?>：<input type="radio" name="score" value="1" /></label>
					<label>2<?php echo L("FEN");?>：<input type="radio" name="score" value="2" /></label>
					<label>3<?php echo L("FEN");?>：<input type="radio" name="score" value="3" /></label>
					<label>4<?php echo L("FEN");?>：<input type="radio" name="score" value="4" /></label>
					<label>5<?php echo L("FEN");?>：<input type="radio" name="score" value="5" checked="checked" /></label>
					</td>
				</tr><?php endif; ?>
				<tr>
					<td><?php echo L("MESSAGE_TITLE");?>：</td>
					<td><input type="text" name="title" id="message_title" class="txt_require" /><span id="message_title_span"></span></td>
				</tr>
				<tr>
					<td><?php echo L("MESSAGE_CONTENT");?>：</td>
					<td><textarea name="content" cols="50" rows="3" id="message_content" class="txt_require"></textarea></td>
				</tr>
				<?php if(sunnyiC('VERIFY_ON') == 1): ?><tr>
					<td><?php echo L("VERIFY_CODE");?>：</td>
					<td>
						<input type="text" name="verify" class="txt_require box" />
						<img id="verifyImg" SRC="__ROOT__/?<?php echo c('VAR_MODULE');?>=Sunnyi&<?php echo c('VAR_ACTION');?>=verify" onClick="refresh(this)" BORDER="0" ALT="<?php echo L("REFRESH_VERIFY_TIP");?>" style="cursor:pointer" align="absmiddle">
					</td>
				</tr><?php endif; ?>
				<tr>
					<td>
						<input type="hidden" name="rec_module" value="<?php echo ($module_name); ?>" />
						<input type="hidden" name="rec_id" value="<?php echo ($rec_id); ?>" />
						<input type="hidden" name="<?php echo c("VAR_MODULE");?>" value="Message" />
						<input type="hidden" name="<?php echo c("VAR_ACTION");?>" value="add" />
						<input type="hidden" name="pid" value="0" id="pid" />
					</td>
					<td><input type="submit" value="<?php echo L("SUBMIT");?>" /> <input type="button" value="<?php echo L("RESET");?>" onclick="reset_reply()" /></td>
				</tr>
			</table>
        </div>
        <div class="inc_foot"></div>
    </div><!--模块样式3-->	
    <!-- end 商品详细描述 -->
    </form>

	
</div><!--end f_r-->
<div class="blank"></div>
</div><!--主体-->
<div class="wrap">
<div class="help_center clearfix">
<?php if(is_array($help_center)): foreach($help_center as $key=>$help_cate): ?><div class="inc_05">
    	<div class="inc_top"><a href="<?php echo ($help_cate["url"]); ?>"><?php echo ($help_cate["name_1"]); ?></a>

    	</div>
        <div class="inc_mid">
        	<ul class="list_01">
        	<?php if(is_array($help_cate["list"])): foreach($help_cate["list"] as $key=>$article_item): ?><li><a href="<?php echo ($article_item["url"]); ?>" class="f_l" title="<?php echo ($article_item["name_1"]); ?>"><?php echo ($article_item["short"]); ?></a>&nbsp;&nbsp; </li><?php endforeach; endif; ?>
            </ul>
        </div>
        <div class="inc_foot"></div>
    </div><!--模块样式2--><?php endforeach; endif; ?>
</div>
<div class="blank"></div>
<div class="help_center clearfix">
    	<div class="inc_top"><?php echo L("LINK");?>
    	<span class="more"><a href="<?php echo u("Link/index");?>"><?php echo L("MORE");?></a></span>
    	</div>
        <div class="inc_mid clearfix">
        	<div class="blank"></div>
        <div class="img_link">
		
		<?php if(is_array($links["img"])): foreach($links["img"] as $key=>$link): ?><a href="<?php echo ($link["url"]); ?>" target="_blank" title="<?php echo ($link["desc"]); ?>">
				<?php if($link['type'] == 1): ?><img src="__ROOT__<?php echo ($link["logo"]); ?>" alt="<?php echo ($link["name"]); ?>" width=88 height=31 />
				<?php else: ?>
				<img src="<?php echo ($link["logo"]); ?>" alt="<?php echo ($link["name"]); ?>" width=88 height=31 /><?php endif; ?>
			</a><?php endforeach; endif; ?>
		</div>
		<div class="blank"></div>
		<div class="txt_link">

		<?php if(is_array($links["txt"])): foreach($links["txt"] as $key=>$link): ?><a href="<?php echo ($link["url"]); ?>" target="_blank" title="<?php echo ($link["desc"]); ?>">
				<?php echo ($link["name"]); ?>
			</a><?php endforeach; endif; ?>
        </div>
        </div>
        <div class="inc_foot"></div>
</div><!--模块样式6-->

<div class="blank"></div>
	<div class="foot_nav">
    
        <div class="nav_main">
        	<ul class="f_l">
        		<?php if(is_array($foot_navs)): foreach($foot_navs as $key=>$nav): ?><li><a href="<?php echo ($nav["url"]); ?>" <?php if($nav["act"] == '1'): ?>class="act"<?php endif; ?>  target="<?php echo ($nav["target"]); ?>" ><?php echo ($nav["name_1"]); ?></a></li><?php endforeach; endif; ?>
            </ul>
             <span class="f_r">
             	<span class="define_main_nav">
            	<a href="#" style="color:#666;"><?php echo L("TOP");?></a>
                </span>
            </span>
        </div><!--end nav_main-->

    </div><!--end main_nav-->
 <div class="blank"></div>
 
 <div class="blank"></div>
 <div class="foot_info">
 	<?php echo L("SYS_NAME");?>：<?php echo ($Sunnyi["name"]); ?> &nbsp;&nbsp;<?php echo L("SYS_VERSION");?>：<?php echo ($Sunnyi["version"]); ?><br /><?php echo L("SYS_COPYRIGHT");?>&copy; <?php echo ($Sunnyi["author"]); ?>
 </div>
</div>
</body>
</html>