<?php

/*
*	Copyright VeryIDE,2007-2010
*	http://www.veryide.com/
*
*	$Id:veryide.profile.php ,v1 10:39 2008-10-16 Leilei $
*/

require("../../include/header.php");
html_start("我的权限 - VeryIDE");
?>

<!--body start-->
	<?php
	
	//其他用户组
	if( GetNumber("gid") ){
		
		$gid = GetNumber("gid");
		
	}else{
		
		//loader
		loader_setting("naver.admin");
		
		//当前用户组
		$gid = GetNumber("gid") ? GetNumber("gid",0) : $_SESSION["Manager"]["gid"];		
	}
	
	//$gid = GetNumber("gid") ? GetNumber("gid",0) : $_SESSION["Manager"]["gid"];
			
	//从缓存读取
	$row = $VICACHE["sys.group"][$gid];
	
	//配置
    $config = fix_json( $row["config"] );
	
	?>
    	
	<div id="box">
                        
        <table cellpadding="0" cellspacing="0" class="form">
        
            <tr><td colspan="2" class="section"><strong>基本信息</strong></td></tr>
            
            <tr>
                <td width="60"><strong>分组名称：</strong></td>
                <td>
               		<label><?php echo $row["name"];?></label>
                </td>
            </tr>
        
            <tr>
                <td><strong>分组标识：</strong></td>
                <td>		
					<?php                    
                    echo '<img src="'.VI_BASE.'image/medal/'.$row["medal"].'" />';                    
                    ?>
                </td>
            </tr>
                
            <tr><td colspan="2" class="section"><strong>系统页面</strong></td></tr>
            
            <tr>
                <td><strong></strong></td>
                <td>
                
                    <ul class="func">
                    
                    <?php
                    
                    $i = 0;
                    foreach($Project["pages"] as $key => $value){
                        echo '<li><label>'.loader_image( ($config[$key]=='Y'?'valid.gif':'invalid.gif') ).' '.$value.'</label></li>';
                        
                        if( $i>=6 ){
                            echo '<br />';
                            $i=0;
                        }else{							
                            $i++;
                        }
                    }
                    
                    ?>
                    
                    </ul>
                    
                </td>
            </tr>
                
            <tr><td colspan="2" class="section"><strong>系统权限</strong></td></tr>
            
            <tr>
                <td><strong></strong></td>
                <td>
                    
                    <?php
                    $i = 0;
                    foreach($Project["func"] as $group => $array){
                        
                        echo '<ul class="func">';
                        
                        echo '<li><strong>'.$group.'：</strong></li>';
                        
                        foreach($array as $key => $value){
                        
                            echo '<li><label>'.loader_image( ($config['sys-'.$key]=='Y'?'valid.gif':'invalid.gif') ).' '.$value.'</label></li>';
                        
                        }							
                        echo '</ul>';
                        
                    }
                    
                    ?>
                    
                </td>
            </tr>
            
                
            <tr><td colspan="2" class="section"><strong>模块权限</strong></td></tr>
            
            <tr>
                <td><strong></strong></td>
                <td>
                    
					<?php
                    
                    //读取配置			   
                     
                    foreach($VICACHE["sys.module"] as $key=>$val){
                        
                        //appid
                        $appid = $key;
                        
                        if ($val["config"]) {
                                
                            //config
                            $file = VI_ROOT.$val["config"];
                            if( file_exists($file) ) require_once($file);
                            
                            $func = $Modules[$appid]["func"];
                            
                            if( is_array($func) ){
								
								echo '<ul class="func">';
                        
                        		echo '<li><strong>'.$Modules[$appid]["name"].'：</strong></li>';
                                
                                
                                foreach($func as $item => $name){
                                    
                                    echo '<li><label>'.loader_image( ($config['mod-'.$item]=='Y'?'valid.gif':'invalid.gif') ).' '.$name.'</label></li>';									
                            
                                }
                                
                               echo '</ul>';
                                
                            }
                                
                        }
                    }
                    
                    ?>
                    
                </td>
            </tr>
        
        </table>

	</div>
<!--body end-->

<?php html_close();?>