summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.GlobalMisc.php
blob: 80752846b293e550316e8f873571678d8df67eb1 (plain) (blame)
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
<?php

/**
* class z globalnimi nastavitvami/opcijami za vse surveye
*/

class GlobalMisc {
	
	static $getMisc = array();		// cache, ce veckrat dostopamo do istih podatkov
	
	static function getMisc($what) {
		
		if (isset(self::$getMisc[$what]))
			return self::$getMisc[$what];
			
		$sql = sisplet_query("SELECT * FROM srv_misc WHERE what = '$what'");
		$row = mysqli_fetch_array($sql);
		return self::$getMisc[$what] = $row['value'];
		
	}
	
	static function setMisc($what, $value) {
		
		$sql = sisplet_query("REPLACE INTO srv_misc (what, value) VALUES ('$what', '$value')");
		self::$getMisc[$what] = $value;
		
	}
	
}
	
?>