<?php
/*********************************************************      
 程序说明：         
    功能说明：提供各mssBak分时下载。
              
    调用关系：调用: header.inc    
              被调用:        
 
    变量说明：

    作者：Cui Ticun    2004-11-23
      
修改注释：      
NO.1      
Name: 
Date: 
Description: 
*********************************************************/
require("../../inc/header.inc");
$DEBUG = 0;

$helpId = "5.1.5"; 
$ThisPage="$strMaintenance&nbsp;>&nbsp;MSS Backup Download";
$blank4 .="&nbsp;&nbsp;&nbsp;&nbsp;";
$db = 'OMC_PUB';
$elementTable='elementExistConf';

/**********    FUNCTION START::TREEOLD  *************/
function treeOld($directory,$blank,$sys_name) 
{ 	
	$DEBUG=0;
	
	$mydir=@dir($directory);
	if(!$mydir){
		echo "<br><br><font size=\"3\" color=\"#FF0000\"><b>Error: can't open this directory:  \"$directory\" .It's not exist!</b></font>";
		exit();
	}
	$blank .="<img border=\"0\" src=\"../../images/blank.gif\">"; //用一个空白图片表示每层目录间的间隔
	$k=0;
	while($file=$mydir->read()){ 
		if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){
			continue;
		}elseif($file =="." || $file ==".."){
			continue;
		}else{
			if (strstr($file,$sys_name) == NULL) continue;
			if (strstr($file,"tgz") == NULL) continue;
			if(substr("$directory/$file",-2) == 'gz'){
				$type_image="<img border=\"0\" src=\"../../images/zip_file.gif\">";
			}elseif(substr("$directory/$file",-3) == 'csv'){
				$type_image="<img border=\"0\" src=\"../../images/csv_file.gif\">";
			}else{
				$type_image="<img border=\"0\" src=\"../../images/unknown_file.gif\">";
			}
			$fileList[$k] ="<tr><td width=\"50%\">$blank $type_image <a href=\"$directory/$file\" >$file</a></td>";
			$filemod = filemtime("$directory/$file");
			$filemodtime = date("Y-m-d h:i:s ", $filemod);
			$fileTimeList[$k] ="<td width=\"50%\">$filemodtime</td>";
			$k++;
		}
		
	}//end of while

	$mydir->close();
	for($h=0;$h<sizeof($fileList);$h++){
		echo "{$fileList[$h]}";
		echo "{$fileTimeList[$h]}";
	}
} //end the program 
/**********    FUNCTION END:: TREEOLD     *************/
?>

<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">

<?php 
adjust_head();
adjust_title_head();
echo "<TABLE id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<TR>";
echo "<TD width=\"50%\" align=\"left\">";
echo "$ThisPage"; 
echo "</TD>";
echo "<TD width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</TD>";
echo "</TR>";
echo "</TABLE>";

adjust_title_tail();
adjust_content_head();

/****************    TABLE START:: DISPLAY DETAILS    ************************/
echo "<TABLE width=\"100%\">";
echo "<BR>";
$blank='';
$tmpSql = " SELECT * FROM elementExistConf WHERE  elementName='AUC' AND existFlag='1'";
if($DEBUG)	echo "<br>tmpSql=$tmpSql";
$tmpRes = mysqli_query($pubConn,$tmpSql);
if(mysqli_num_rows($tmpRes)>0){
	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>AUC</b></TD></TR>\n"; 
	treeold("../../../mssBakData/auc",$blank,"Auc");
}
$tmpSql = " SELECT * FROM elementExistConf WHERE  elementName='EIR' AND existFlag='1'";
if($DEBUG)	echo "<br>tmpSql=$tmpSql";
$tmpRes = mysqli_query($pubConn,$tmpSql);
if(mysqli_num_rows($tmpRes)>0){

	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>EIR</b></TD></TR>\n"; 
	treeold("../../../mssBakData/eir",$blank,"Eir");
}
$tmpSql = " SELECT * FROM elementExistConf WHERE  elementName='HLR' AND existFlag='1'";
if($DEBUG)	echo "<br>tmpSql=$tmpSql";
$tmpRes = mysqli_query($pubConn,$tmpSql);
if(mysqli_num_rows($tmpRes)>0){
	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>HLR</b></TD></TR>\n"; 
	treeold("../../../mssBakData/hlr",$blank,"Hlr");
}
$tmpSql = " SELECT * FROM elementExistConf WHERE  elementName='PPS' AND existFlag='1'";
if($DEBUG)	echo "<br>tmpSql=$tmpSql";
$tmpRes = mysqli_query($pubConn,$tmpSql);
if(mysqli_num_rows($tmpRes)>0){
	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>PPS Subscriber</b></TD></TR>\n"; 
	treeold("../../../mssBakData/pps",$blank,"ppsSubs");


	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>PPS Recharge Card</b></TD></TR>\n"; 
	treeold("../../../mssBakData/pps",$blank,"ppsRechargeCard");

	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>PPS Tariff</b></TD></TR>\n"; 
	treeold("../../../mssBakData/pps",$blank,"ppsTariff");
}

//MNP
$tmpSql = " SELECT * FROM elementExistConf WHERE  elementName='MNP' AND existFlag='1'";
if($DEBUG)	echo "<br>tmpSql=$tmpSql";
$tmpRes = mysqli_query($pubConn,$tmpSql);
if(mysqli_num_rows($tmpRes)>0){
	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>MNP</b></TD></TR>\n"; 
	treeold("../../../mssBakData/mnp",$blank,"npdbMem");
}

//opr
$tmpSql = " SELECT * FROM elementExistConf WHERE  elementName='OPPS' AND existFlag='1'";
if($DEBUG)	echo "<br>tmpSql=$tmpSql";
$tmpRes = mysqli_query($pubConn,$tmpSql);
if(mysqli_num_rows($tmpRes)>0){
	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>OPR</b></TD></TR>\n"; 
	treeold("../../../mssBakData/opr",$blank,"Opr");
}

//iPALIM
$tmpSql = " SELECT * FROM elementExistConf WHERE  elementName='iPALIM' AND existFlag='1'";
if($DEBUG)	echo "<br>tmpSql=$tmpSql";
$tmpRes = mysqli_query($pubConn,$tmpSql);
if(mysqli_num_rows($tmpRes)>0){
	$blank="<img border=\"0\" src=\"../../images/blank.gif\">";
	echo "<TR><TD colspan=\"4\">$blank<img border=\"0\" src=\"../../images/open.gif\">&nbsp;&nbsp;<b>iPALIM</b></TD></TR>\n"; 
	treeold("../../../mssBakData/palim",$blank,"palim");
}

echo "</TABLE>";
adjust_content_tail();
/****************    TABLE END:: DISPLAY DETAILS    ************************/
?>
</body>
</html>
