edit_config.html 1.16 KB
<?php
	//include('cfg/file_name.php');
	$open_file = '/home/pi/Desktop/vAlert/bin/vAlert8.cfg';
	$versionTXT='php/version.txt';
	shell_exec("sudo chmod 777 ".$open_file);
	$nn = 0;
	$i = 0;	
	$handle = @fopen($open_file,"r");
	//讀檔案
	while(($data = fgetcsv($handle,1000,"\n")) != false){
		foreach($data as $key => $value){
			if($value != ""){
				$title[] = (false !== ($rst =(strpos($value, "[")))) ? $value:'';
				$aa[] = $value;
				$i++;
			}
		}
		
	}
	$handle2 = @fopen($versionTXT,"r");
	//讀檔案
	$Device=array();
	while(($data = fgetcsv($handle2,1000,"\n")) != false){
		foreach($data as $key => $value){
			if($value != ""){
				$Device[]=$value;
				
			}
		}
		
	}
	$content = array_filter($aa);
	//$hidden  = array("[BLOCK_CONFIG_BY_ONE_ITEM]","[BACKUP_CONFIG]","[BACKUP_PROGRAM]","[BACKUP_IP]");
	$ignore = array("Palert Advance");

	switch($Device[0]){

	case 'Palert Plus':
       include("view/palert_plus_config.html");
	break;
	case 'Palert Plus S3':
       include("view/palert_s3_config.html");
	break;

	default:

	include("view/default_product_config.html");

	break;
}
?>

    </body>
</html>