<?php

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

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

<!--body start-->
	<?php
	
	//其他用户组
	if( getnum("gid") ){
		
		$gid = getnum("gid");
		
	}else{
		
		//loader
		require('include/naver.admin.php');
		
		//当前用户组
		$gid = getnum("gid") ? getnum("gid",0) : $_SESSION['Manager']["gid"];		
	}
	
	//从缓存读取
	$row = $_CACHE['system']['group'][$gid];
	
	//配置
    $config = $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($_G['project']['page'] 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($_G['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( $_CACHE['system']['module'] as $appid => $val ){
                        
                        if ($val["config"]) {
                                
                            //config
                            $file = VI_ROOT.$val["config"];
                            if( file_exists($file) ) require_once($file);
                            
                            $func = $_G['module'][$appid]['func'];
                            
                            if( is_array($func) ){
								
								echo '<ul class="func">';
                        
                        		echo '<li><strong>'.$_G['module'][$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();?>