-
Notifications
You must be signed in to change notification settings - Fork 3
/
devinLangue.php
executable file
·37 lines (26 loc) · 1.06 KB
/
devinLangue.php
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
<?php
session_start();
require_once("models/user.class.php");
require_once("sys/db.class.php");
require_once('./controllers/notificationMessage.php');
require_once('./models/userlvl.class.php');
require_once('./languages/language.php');
require_once('./sys/load_iso.php');
$lang_iso = new IsoLang();
$_SESSION["langDevin"] = $_POST["lang"];
$user = user::getInstance();
$userlang = $user->langGame;
$id = $user->id;
$sql = 'SELECT * FROM `score` WHERE langue="'.$lang_iso->french_for($_SESSION["langDevin"]).'" AND userid='.$id;
$db = db::getInstance();
$resultat=$db->query($sql);
if (!$resultat->num_rows>0){
$score=0;
$sql = "INSERT INTO `score`(`userid`, `scoreGlobal`, `scoreOracle`, `scoreDruide`, `scoreDevin`, `langue`) VALUES ($id,$score,$score,$score,$score,'".$lang_iso->french_for($_SESSION["langDevin"])."')";
$db->query($sql);
}
$mess = "Augur : ".$lang["languePlay"].$lang_iso->french_for($_SESSION["langDevin"]);
$notif = new Notification();
$notif->addNotifGAME($user->id,$mess,"./profil/diviner.jpg");
echo $_SESSION["langDevin"];
?>