Blame view

view/edit_config.html 1.16 KB
cf76164e6   Ting Chan   20190709
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
  <?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,"
  ")) != 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,"
  ")) != 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>