<!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>CuuMall商城系统安装程序</title>
<style type="text/css">
<!--
body {
	background-color: #B0D6F0;
	margin-top: 0px;
	margin-bottom: 0px;
}
.STYLE2 {
	font-size: 26px;
	font-weight: bold;
	font-family: "宋体";
	color: #FFFFFF;
}
.STYLE3 {font-family: Arial, Helvetica, sans-serif}
.STYLE6 {
	font-size: 14px;
	color: #FFFFFF;
}
.STYLE7 {
	font-size: 14px;
	font-weight: bold;
	color: #FF6633;
}
.STYLE8 {
	font-size: 12px;
	font-weight: bold;
	color: #FFFFFF;
}
.STYLE9 {
	font-size: 12px;
	color: #0162CD;
}
.STYLE11 {font-size: 16px}
.xieyi {
	border-top-style: none;
	border-right-style: none;
	border-bottom-style: none;
	border-left-style: none;
}
.STYLE12 {
	color: #0F70C7;
	font-size: 12px;
	font-weight: bold;
}
.STYLE13 {color: #FF0000}
-->
</style>
</head>
<?php 
	//遍历目录分析
   	function expfile($filename)
   	{
   		$tmp=array();
   		$i=0;
   	foreach ($filename as $key=>$value)
   		{
   			$tmp=explode("|", $value);
   			$arra[$i]["filename"]=$key;
   			$arra[$i]["isread"]=$tmp[0];
   			$arra[$i]["iswrite"]=$tmp[1];
   			$tmp="";
   			$i++;
   		}
   		return $arra;
   	}
    function tpl()
   	{
   		GLOBAL $arr;
   		//模板文件
   		$tpl=dirr("../Tpl/default");
   		$d_tpl=expfile($tpl);
   		$arr=NULL;
		return $d_tpl;
   	}
	//配置文件
	function con()
	{
	    //配置文件
   		$d_con[0]["filename"]="../Conf/config.php";
   	    $d_con[0]["isread"]=(is_readable("../Conf/config.php"))?1:0;
   	    $d_con[0]["iswrite"]=(is_writable("../Conf/config.php"))?1:0;
		return $d_con;
	}
	//配置文件2
	function cmm()
	{
	    $d_cmm[0]["filename"]="../kernel/Common/convention.php";
   	    $d_cmm[0]["isread"]=(is_readable("../kernel/Common/convention.php"))?1:0;
   	    $d_cmm[0]["iswrite"]=(is_writable("../kernel/Common/convention.php"))?1:0;
		return $d_cmm;
	}
	//程序文件
	function app()
	{
	    GLOBAL $arr;
	    $app=dirr("../Lib");
   		$d_app=expfile($app);
   		$arr=NULL;
		return $d_app;
	}
	//缓存文件
	/*function run()
	{
	    GLOBAL $arr;
	    $run=dirr("../Runtime");
   		$d_run=expfile($run);
   		$arr=NULL;
		return $d_run;
	}*/
   
   	//遍历目录
   	function dirr($file)
   	{   
   		GLOBAL $arr;
   		$d = dir($file);
		while (false !== ($entry = $d->read())) 
		{
			if(in_array($entry,array('.','..')))continue;
			if(!(is_dir($file."/".$entry)))continue;
			$arr[$file."/".$entry]=((is_readable($file."/".$entry))?1:0)."|".((is_writable($file."/".$entry))?1:0);
			dirr($file."/".$entry);
      	}
        $d->close();
        return $arr;
   	}
	//是否输出
	function yesno($val)
	{
	 if($val==1)
	 {
	  $num="√";
	 }
	 else
	 {
	  $num="<font color=red>×</font>";
	 }
	 return $num;
	}
?>
<body>
<table width="980" height="694" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="694" valign="top" bgcolor="#FFFFFF"><?php require "top.php";?><table width="980" height="529" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="248" height="529" valign="top"><?php require "left.php";?></td>
          <td width="732" valign="top"><table width="100%" height="57" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td height="57"><div align="center" class="STYLE7 STYLE11">有梦想就有希望-CuuMall商城系统(www.CuuMall.com)</div></td>
            </tr>
          </table>
            <table width="98%" height="470" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#278DFE">
              <tr>
                <td height="468" valign="top" bgcolor="#FFFFFF"><table width="100%" height="23" border="0" cellpadding="3" cellspacing="1">
                  <tr>
                    <td height="21" bgcolor="#0168DA"><div align="center"><span class="STYLE8">第三步：设置目录权限</span></div></td>
                  </tr>
                </table>
                  <table width="100%" height="415" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="415" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td height="14"></td>
                        </tr>
                      </table>
                        <table width="98%" border="0" align="center" cellpadding="3" cellspacing="0">
                          <tr>
                            <td height="22" bgcolor="#D6E0EF"><span class="STYLE12">提示信息</span></td>
                          </tr>
                        </table>
                        <table width="98%" height="86" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6E0EF">
                          <tr>
                            <td height="84" bgcolor="#FFFFFF"><table height="68" cellpadding="3" cellspacing="0">
                              <tr>
                                <td width="559" height="31" class="STYLE9">●&nbsp;&nbsp;<span class="STYLE13">如果您的服务器是windows操作系统，可以跳过这一步</span></td>
                              </tr>
                              <tr>
                                <td height="28" class="STYLE9">●&nbsp;&nbsp;将下面的目录或文件权限设置为0777，是目录要将权限应用于子目录中</td>
                              </tr>
                              
                              
                            </table>
                            </td>
                          </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="14"></td>
                          </tr>
                        </table>
                        <table width="98%" height="221" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#D6E0EF">
                          <tr>
                            <td width="43%" height="22" class="STYLE12"><div align="center">目录文件名称</div></td>
                            <td width="30%" class="STYLE12"><div align="center">是否可读</div></td>
                            <td width="27%" class="STYLE12"><div align="center">是否可写</div></td>
                          </tr>
                          <?php foreach(tpl() as $key=>$value){?>
                          <tr>
                            <td bgcolor="#FFFFFF" class="STYLE9" height="30"><?php echo $value["filename"]?>
                              </td>
                            <td bgcolor="#FFFFFF" class="STYLE9"><div align="center"><?php 
							echo yesno($value["isread"]); ?></div></td>
                            <td bgcolor="#FFFFFF" class="STYLE9"><div align="center"><?php echo yesno($value["iswrite"]);?></div></td>
                          </tr>
                          <?php }?>
                           <?php foreach(con() as $key=>$value){?>
                          <tr>
                            <td bgcolor="#FFFFFF" class="STYLE9" height="30"><?php echo $value["filename"]?></td>
                            <td bgcolor="#FFFFFF" class="STYLE9"><div align="center"><?php 
							echo yesno($value["isread"]); ?></div></td>
                            <td bgcolor="#FFFFFF" class="STYLE9"><div align="center"><?php echo yesno($value["iswrite"]);?></div></td>
                          </tr>
                           <?php }?>
                           <?php foreach(cmm() as $key=>$value){?>
                          <tr>
                            <td bgcolor="#FFFFFF" class="STYLE9" height="30"><?php echo $value["filename"]?></td>
                            <td bgcolor="#FFFFFF" class="STYLE9"><div align="center"><?php 
							echo yesno($value["isread"]); ?></div></td>
                            <td bgcolor="#FFFFFF" class="STYLE9"><div align="center"><?php echo yesno($value["iswrite"]);?></div></td>
                          </tr>
                          <?php }?>
                          <?php foreach(app() as $key=>$value){?>
                          <tr>
                            <td bgcolor="#FFFFFF" class="STYLE9" height="30"><?php echo $value["filename"]?></td>
                            <td bgcolor="#FFFFFF" class="STYLE9"><div align="center"><?php 
							echo yesno($value["isread"]); ?></div></td>
                            <td bgcolor="#FFFFFF" class="STYLE9"><div align="center"><?php echo yesno($value["iswrite"]);?></div></td>
                          </tr>
                          <?php }?>
                         
                      </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td height="14"></td>
                          </tr>
                        </table></td>
                    </tr>
                  </table>
                  <table width="100%" height="31" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td height="31" bgcolor="#E0EEF5"><div align="center">
                        <input type="button" name="button" id="button" value="上一步" style="background-color:#FFFFFF; color:#0162CD;"   onclick="javascript:history.go(-1);"  />
                        &nbsp;&nbsp;
                        <input type="button" name="button3" id="button3" value="刷新权限状态" style="background-color:#FFFFFF; color:#0162CD;" onclick="self.location.href='step3.php?f=3';" />
                        &nbsp;&nbsp;
<input type="button" name="button2" id="button2" value="下一步" style="background-color:#FFFFFF; color:#0162CD;" onclick="self.location.href='step4.php?f=4';" />
                      </div></td>
                    </tr>
                  </table></td>
              </tr>
            </table></td>
        </tr>
      </table><?php require "buttom.php";?>
    </td>
  </tr>
</table>
</body>
</html>
