forked from bbdoc/PoracleWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
db_mad.php
63 lines (42 loc) · 1.54 KB
/
db_mad.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
function get_quest_mons() {
include "./config.php";
$conn = new mysqli($scan_dbhost.":".$scan_dbport, $scan_dbuser, $scan_dbpass, $scan_dbname);
$sql = "SELECT distinct quest_pokemon_id id FROM trs_quest WHERE quest_pokemon_id > 0 AND quest_reward_type = 7 order by quest_pokemon_id;";
$result = $conn->query($sql);
$mons=array();
while($row = $result->fetch_assoc()) {
array_push($mons, $row['id']);
}
if (isset($additional_quest_mons) && !empty($additional_quest_mons)) {
$add_mons = explode(",", $additional_quest_mons);
foreach ($add_mons as &$mon) {
array_push($mons, $mon);
}
}
$mons=array_unique($mons);
sort($mons);
return $mons;
}
function get_quest_items() {
include "./config.php";
$conn = new mysqli($scan_dbhost.":".$scan_dbport, $scan_dbuser, $scan_dbpass, $scan_dbname);
$sql = "SELECT distinct quest_item_id id FROM trs_quest WHERE quest_item_id > 0 order by quest_item_id;";
$result = $conn->query($sql);
$items=array();
while($row = $result->fetch_assoc()) {
array_push($items, $row['id']);
}
return $items;
}
function get_quest_energy() {
include "./config.php";
$conn = new mysqli($scan_dbhost.":".$scan_dbport, $scan_dbuser, $scan_dbpass, $scan_dbname);
$sql = "SELECT distinct(quest_pokemon_id) id FROM trs_quest WHERE quest_reward_type = 12 ORDER BY quest_pokemon_id;";
$result = $conn->query($sql);
$mons=array();
while($row = $result->fetch_assoc()) {
array_push($mons, $row['id']);
}
return $mons;
}