-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtitleupdater.php
executable file
·45 lines (45 loc) · 1.56 KB
/
titleupdater.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
38
39
40
41
42
43
44
45
<?php
include 'connection.php';
$id=$_SESSION['id'];
$queryRank=mysqli_query($db,"SELECT cup,title FROM users where user_id='$id'")or die(mysqli_error($db));
$sql=mysqli_query($db,"SELECT * FROM cups where userid='$id'")or die(mysqli_error($db));
$cup=0;
while($row=mysqli_fetch_assoc($sql)){
$cup+=$row['cup'];
}
if($cup < 1200){
mysqli_query($db,"UPDATE users SET title='Newbie',cup='$cup' WHERE user_id='$id'");
}
elseif($cup >1200 and $cup<1400)
{
mysqli_query($db,"UPDATE users SET title='Pupil',cup='$cup' WHERE user_id='$id'");
}
elseif($cup >1400 and $cup < 1600)
{
mysqli_query($db,"UPDATE users SET title='Specialist',cup='$cup' WHERE user_id='$id'");
}
elseif($cup >1600 and $cup < 1900)
{
mysqli_query($db,"UPDATE users SET title='Expert',cup='$cup' WHERE user_id='$id'");
}
elseif($cup >1900 and $cup < 2100)
{
mysqli_query($db,"UPDATE users SET title='Candidate Master',cup='$cup' WHERE user_id='$id'");
}
elseif($cup >2100 and $cup < 2300)
{
mysqli_query($db,"UPDATE users SET title='Master',cup='$cup' WHERE user_id='$id'");
}
elseif($cup >2300 and $cup < 2400)
{
mysqli_query($db,"UPDATE users SET title='International Master',cup='$cup' WHERE user_id='$id'");
}
elseif($cup >2400 and $cup < 2600)
{
mysqli_query($db,"UPDATE users SET title='International Grandmaster',cup='$cup' WHERE user_id='$id'");
}
elseif($cup >3000)
{
mysqli_query($db,"UPDATE users SET title='Legendry Grandmaster',cup='$cup' WHERE user_id='$id'");
}
?>