<?php
//if($flag=='getData')
{
	require("../../element/sub_inc/commfunc.php");
	require("../../element/sub_inc/lib.inc");
}
?>
<?php
function getTableFile($sysTypeNo)
{
	$pubDb = "OMC_PUB";
	$path='/usr/local/apache/htdocs/db_backup/downloadAll/';
	$tableName = "OBJ_".$sysTypeNo.".param_99";
	$filePath = $path . $tableName.".csv";
	
	if (is_file($filePath))
		unlink($filePath);
	$csvFileUpdateSql="	SELECT * 
			INTO OUTFILE '{$filePath}' 
			FIELDS TERMINATED BY ',' 
			LINES TERMINATED BY '\n' 
			FROM $tableName 
		";		
	$csvFileUpdateResult = mysqli_query($pubConn ,$csvFileUpdateSql);
	echo mysqli_error($pubConn);		
}
?>
<?
$allSysArr = array(
	array('typeNo' => 322,),
	array('typeNo' => 325,),
	array('typeNo' => 330,),
	array('typeNo' => 340,),
	array('typeNo' => 350,),
	array('typeNo' => 360,),
	array('typeNo' => 370,),
	array('typeNo' => 380,),
	
	array('typeNo' => 111),
	array('typeNo' => 222),
	array('typeNo' => 223)
);
for($i=0; $i<sizeof($allSysArr); $i++)
{
	if($curSys == $allSysArr[$i][typeNo])
	{
		$i++;
		break;
	}
}
if($i<sizeof($allSysArr))
	$nextSys = $allSysArr[$i][typeNo];
else
	$nextSys = "Finished";
//0	
echo "###";
//1
echo $flag;
echo "###";
//2
echo $allSysStr;
echo "###";
//3
echo $curSys;
echo "###";
//4
echo $nextSys;
echo "###";

//sleep(1);

if($flag=='getData')
{
//	$sysId = $curSys."_99_99";
//	$oidsysarr=array(
//		array('oid'=>'2',		'sysid'=> $sysId,	'selectsysid'=>'-1')//MSC
//	);
//	//GetParam($oidsysarr,0,0,0);
	echo "OK";
}
if($flag=="createTable")
{
	//getTableFile($curSys);
	echo "OK";
}
//echo "deal with $sysTemNo";

?>
