<!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>SiteStar管理后台</title>
<link rel="stylesheet" type="text/css" href="<?php echo P_TPL_WEB; ?>/css/style1.css" />
<!-- 23/03/2010 Jane Add >> -->
<?php include_once(P_INC.'/global_js.php');?>
<script language="javascript">
<!--
	$(document).ready(function(){
		<?php
			$uid = SessionHolder::get('user/id');
			$o_user = new User($uid);
			if(($o_user->wizard == 1) && (SessionHolder::get('user/wizard') != 'no') && (DEFAULT_LOCALE == 'zh_CN')) {
		?>
		siteGuid();
		<?php SessionHolder::set('user/wizard','no');
		}?>
	});

	function siteGuid() 
    {  	
        show_iframe_win('index.php?<?php echo Html::uriquery('mod_wizard', 'admin_index'); ?>', '', 732, 503);
	}
//-->
</script>
<!-- 23/03/2010 Jane Add << -->
</head>
<body>
	<div id="top">
		<a target="_blank" href="http://www.sitestar.cn"><img style="border:none;" width="192" height="53" src="<?php echo P_TPL_WEB;?>/images/top_logo.jpg"/></a>
		<ul>
						
        	<li><a href="index.php"><?php echo __('Dashboard');?></a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
            <?php 
            	if(DEFAULT_LOCALE == 'zh_CN') {
            ?>	
           <li><a href="#" onclick="siteGuid()"><?php _e('Guide');?></a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
            <?php }?>		
           <li><a href="http://help.sitestar.cn" target='_blank'><?php _e('Help');?></a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
                
           <li><a href="#" onclick="show_iframe_win('index.php?<?php echo Html::uriquery('mod_about', 'admin_index'); ?>', '', 395, 225)"><?php _e('About');?></a>&nbsp;&nbsp;|&nbsp;&nbsp;</li>
            	
           <li><a class="exit" href="index.php?<?php echo Html::xuriquery('frontpage', 'dologout');?>" title="Logout"><?php _e('Logout');?></a></li>
    	</ul>   
    </div>
    
    <div id="menu">
    	<div id="menu_l"><span class="icon1">
    	<?php 
    	$o_locale = new Parameter();
    	$locale_items = $o_locale->findAll("`key` = 'DEFAULT_LOCALE'");
    	$_user = SessionHolder::get('user/login');
    	if($locale_items[0]->val == 'zh_CN') {
    		$showMsg = '您好尊敬的'.$_user.'会员';
    	} elseif($locale_items[0]->val == 'en') {
    		$showMsg = 'Hello,'.$_user;
    	}
    	echo $showMsg;
    	?>
    	</span></div>        <ul>
        <?php 
        $o_admin_menu_category = new AdminMenuCategory();
        $admin_menu_category_items = $o_admin_menu_category->findAll();
        foreach($admin_menu_category_items as $v){
        	if($v->module == 'mod_modules' && $v->action == 'index') {
        		$str .= '<li class="lii"><a href="index.php?'.Html::xuriquery('mod_modules', 'index').'" target="_blank">'.__('Layouts').'</a></li>';
        		$flag = true;
        	}
        	
        	if($v->module == 'mod_authorization' && $v->action == 'admin_list'){
        		$str .= '<li class="lii"><a style="color:#F30;background:none;" href="http://www.sitestar.cn/license/" target="_blank">'.__('Licenses').'</a></li>';
        		$flag = true;
        	}
        	if(!$flag) {
        		$str .= '<li class="lii"><a href="index.php?'.Html::xuriquery($v->module, $v->action).'">'.__($v->category_name).'</a></li>';
        	}
        	$flag = false;
        }
		                     
		     $str .= '</ul>
		        <div id="menu_r"> <a href="../?_v=preview" target=_blank>'.__('Preview Home').'</a></div>
		    </div>';
		     
		echo $str;
        ?>    
    </div>
    
    <div style="margin-left:198px; margin-top:10px; height:32px; line-height:32px;_position:relative;_bottom:48px;_right:22px;"><span class="index_icon7">&nbsp;</span><?php _e('Welcome to use the Professional Website Setup System，SiteStar, which is your first choice for website set-up!');?></div>
    
    <div id="left">
    	<h1><span class='icon2'><?php _e('Settings');?></span></h1>
        <ul>
        	<li class='icon3'><a href='index.php?_m=mod_site&amp;_a=admin_list&amp;_r=_page'><?php _e('Web Settings');?></a></li>
        	<li class='icon3'><a href='index.php?_m=mod_qq&amp;_a=admin_list&amp;_r=_page'><?php _e('Services');?></a></li>
        	<li class='icon3'><a href='index.php?_m=mod_payaccount&amp;_a=admin_list&amp;_r=_page'><?php _e('Payment Accounts');?></a></li>
        	<li class='icon3'><a href='index.php?_m=mod_statistics&amp;_a=admin_list&amp;_r=_page'><?php _e('Statistics');?></a></li>
        	<li class='icon3'><a href='index.php?_m=mod_friendlink&amp;_a=admin_list&amp;_r=_page'><?php _e('Hot Links');?></a></li>
        	<li class='icon3'><a href='index.php?_m=mod_backup&amp;_a=admin_list&amp;_r=_page'><?php _e('Data Bakup/Recovery');?></a></li>
        </ul>
	</div>
    
	<div id="center">
            	<div class="in_r"> 
                <h3><span class="index_icon2">&nbsp;</span><?php _e('Document management');?></h3>
                <p>
					<?php 
						if(!ToolKit::getCorp()){
							include ROOT.'/licence.dat';
							_e('Licenced');
							_e('Licenced domain');echo $l0;
							_e('Licenced start');echo $l2;
							_e('Licenced end');echo $l4;
						} else {
							_e('Licence Desc');
						}
					?>
				</p>
            </div>
            
            <div class="in_r">    
                <h3><span class="index_icon4">&nbsp;</span><?php _e('Shortcut Menus');?></h3>
                <p>
                    <a href="index.php?_m=mod_template&_a=admin_list&_r=_page" class="orange">【<?php _e('Templates');?>】</a>&nbsp;|&nbsp;
                    <a href="index.php?_m=mod_site&_a=admin_list&_r=_page" class="orange">【<?php _e('Web Settings');?>】</a>&nbsp;|&nbsp;
                    <a href="index.php?_m=mod_product&_a=admin_add&_r=_page" class="orange">【<?php _e('Add Product');?>】</a>&nbsp;|&nbsp;
                    <a href="index.php?_m=mod_qq&_a=admin_list&_r=_page" class="orange">【<?php _e('Services');?>】</a>&nbsp;|&nbsp;
                    <a href="index.php?_m=mod_payaccount&_a=admin_list&_r=_page" class="orange">【<?php _e('Payment Accounts');?>】</a>
                </p>
            </div>    

            <div class="in_r">
            	<h3><span class="index_icon5">&nbsp;</span><?php _e('Basic Informations');?></h3>
                <p>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="20%">Php <?php _e('Version');?>:</td>
                    <td width="80%"><?php echo PHP_VERSION;?></td>
                  </tr>
                  <tr>
                    <td> Mysql <?php _e('Version');?>:</td>
                    <?php $db_host = (Config::$db_host).":".(Config::$port); $link = mysql_connect($db_host, Config::$db_user, Config::$db_pass) or die("Could not connect: " . mysql_error());?>
                    <td><?php $info = mysql_get_server_info();echo $info;mysql_close($link);?></td>
                  </tr>
                  <tr>
                    <td> Register_Globals:</td>
                    <td><?php if(ini_get('register_globals') == 0) echo 'Off'; else echo 'On';?></td>
                  </tr>
                  <tr>
                    <td>Magic_quotes_gpc:</td>
                    <td><?php if(ini_get('magic_quotes_gpc') == 0) echo 'Off'; else echo 'On';?></td>
                  </tr>
                  <tr>
                    <td><?php _e('Upload Max Filesize');?></td>
                    <td><?php echo ini_get('upload_max_filesize');?></td>
                  </tr>
                  <tr>
                    <td><?php _e('Sitestar Version');?></td>
                    <td><?php echo SYSVER;?></td>
                  </tr>
                </table>
      	
                </p>
            </div>
            
            <div class="in_r">
           		<h3><span class="index_icon6">&nbsp;</span><?php _e('Helps');?></h3>
                <p>
                	
                    <a href="http://help.sitestar.cn/" target='_blank'><?php _e('Online Help');?></a>&nbsp;|&nbsp;
                    <a href="http://bbs.sitestar.cn" target='_blank'><?php _e('Official BBS');?></a>&nbsp;|&nbsp;
                    <a href="http://www.cndns.com" target='_blank'><?php _e('Recommended Host');?></a>
                </p>
    		</div>    
    </div>
    <?php 
    $db = MysqlConnection::get();
    $prefix = Config::$tbl_prefix;
    
    $user_sql = <<<SQL
SELECT COUNT(*) AS count_user FROM {$prefix}users
SQL;
	$result_user = $db->query($user_sql);
	$rows_user = $result_user->fetchRows(); 
	
	$article_sql = <<<SQL
SELECT COUNT(*) AS count_article FROM {$prefix}articles	
SQL;
	$result_article = $db->query($article_sql);
	$rows_article = $result_article->fetchRows();
	
	$product_sql = <<<SQL
SELECT COUNT(*) AS count_product FROM {$prefix}products	
SQL;
	$result_product = $db->query($product_sql);
	$rows_product = $result_product->fetchRows();
	
	$order_sql = <<<SQL
SELECT COUNT(*) AS count_order FROM {$prefix}online_orders
SQL;
	$result_order = $db->query($order_sql);
	$rows_order = $result_order->fetchRows();
	
	$message_sql = <<<SQL
SELECT COUNT(*) AS count_message FROM {$prefix}messages
SQL;
	$result_message = $db->query($message_sql);
	$rows_message = $result_message->fetchRows();
    ?>
	<div id="right" style="margin-top:11px;_margin-top:10px;">
		<div class="in_r">
			<h3><span class="index_icon1">&nbsp;</span><?php _e('Information Statistics');?></h3>
             <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td><?php _e('Users Number');?>:<?php echo $rows_user[0]['count_user'];?></td>
              </tr>
              <tr>
                <td><?php _e('Articles Number');?>:<?php echo $rows_article[0]['count_article'];?></td>
              </tr>
              <tr>
                <td><?php _e('Products Number');?>:<?php echo $rows_product[0]['count_product'];?></td>
              </tr>
              <tr>
                <td><?php _e('Orders Number');?>:<?php echo $rows_order[0]['count_order'];?></td>
              </tr>
              <tr>
                <td><?php _e('Message Number');?>:<?php echo $rows_message[0]['count_message'];?></td>
              </tr>
            </table><br />
		</div>
                
		<div class="in_r">
            <h3><span class="index_icon3">&nbsp;</span><?php _e('Official Tendency');?></h3>
            <?php $content_1 = file_get_contents("http://dome.sitestar.cn/discuz/sitestar_news1.php");echo $content_1;?>
		<br />
		</div>
             
    </div>
    <div id="footer" style="position:relative;top:135px;">Copyright © 2010 SiteStar.cn All Rights Reserved.&nbsp;&nbsp;&nbsp;&nbsp;</div>
</body>
</html>
