RecupScore.php 656 Bytes
Newer Older
David's avatar
David committed
1
<?php
2
	//don't really know what this is for… will see later…
David's avatar
David committed
3
	function score($role){
4
5
		require_once('./sys/load_iso.php');
		$lang_iso = new IsoLang();
David's avatar
David committed
6
7
8
9
10
11
12
13

		$db = db::getInstance();
		$user = user::getInstance();
		$langue = $user->langGame;

		if(isset($_SESSION["langDevin"]) && $_SESSION["langDevin"]!=""){
			$langue = $_SESSION["langDevin"];
		}
14

15
		$roleUt = "score_".$role;
David's avatar
David committed
16

17
		$sql = 'SELECT `'.$roleUt.'` FROM `stats` WHERE `userid`="'.$user->id.'" AND langue="'.$lang_iso->french_for($langue).'"';
David's avatar
David committed
18

19
20
		$resultat = 'err';
		if($db->query($sql)){
21
			$resultat = $db->fetch_assoc();
22
23
			$resultat = $resultat[$roleUt];
		}
David's avatar
David committed
24

25
		return $resultat;
David's avatar
David committed
26
27

	}
28
?>