File "admin.class.php"

Full Path: /home/xgsotb2m/public_html/spo/panel/admin.class.php
File size: 591 bytes
MIME-type: --
Charset: utf-8

<?php 
 
class Admin{

public $JSON_FILE = 0;
public $JSON_DATA = 0;
public $JSON_DECODED_DATA = 0;
public $JSON_UPDATES = 0;

public function setDataFile($PATH){
	$this->JSON_FILE = $PATH;
	$this->JSON_DATA = file_get_contents($this->JSON_FILE);
}

public function getData(){
	return json_decode($this->JSON_DATA, true);
}

public function update($root, $arr){
	$data = $this->getData();
		foreach($arr as $k=>$v){
		$data[$root][$k] = str_replace('"', "'", $v);
		$update = json_encode($data);
		file_put_contents($this->JSON_FILE, $update);
		}

}

}



?>