summaryrefslogtreecommitdiffstats
path: root/admin/survey/classes/class.GlobalMisc.php
blob: 446bf6067bc4028f8f0a3d65beb17fdce496dd4c (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
32
33
34
35
<?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'");
		
		if(mysqli_num_rows($sql) > 0){
			$row = mysqli_fetch_array($sql);
			return self::$getMisc[$what] = $row['value'];
		}

		return false;
	}
	
	static function setMisc($what, $value) {
		
		$sql = sisplet_query("REPLACE INTO srv_misc (what, value) VALUES ('$what', '$value')");
		self::$getMisc[$what] = $value;
		
	}
	
}
	
?>