Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getRocket()
- {
- global $conn;
- global $assetRepo;
- $rocket = [];
- $rocket_name = json_decode(file_get_contents('https://raw.githubusercontent.com/whitewillem/PMSF/develop/static/data/grunttype.json'), true);
- $sql = "SELECT latitude, longitude, name, image, UNIX_TIMESTAMP(CONVERT_TZ(incident_expiration, '+00:00', @@global.time_zone)) as stop, UNIX_TIMESTAMP(CONVERT_TZ(last_modified, '+00:00', @@global.time_zone)) as scanned, UNIX_TIMESTAMP(CONVERT_TZ(incident_start, '+00:00', @@global.time_zone)) as start, incident_grunt_type as type FROM pokestop WHERE name IS NOT NULL and incident_expiration > utc_timestamp() ORDER BY scanned desc;";
- $result = $conn->query($sql);
- // Check if mon available
- if ($result && $result->num_rows > 0) {
- while ($row = $result->fetch_object()) {
- $row->rgender = $rocket_name[$row->type]['grunt'];
- $row->rtype = $rocket_name[$row->type]['type'];
- $row->onefirst = $rocket_name[$row->type]['encounters']['first'];
- $row->onesecond = $rocket_name[$row->type]['encounters']['second'];
- $row->onethird = $rocket_name[$row->type]['encounters']['third'];
- if (is_array($row->onefirst) || is_array($row->onesecond) || is_array($row->onethird)) {
- foreach ($row->onefirst as $row->first) {
- $row->rockfirst = $assetRepo . 'pokemon_icon_' . $row->first . '.png<br>';
- }
- foreach ($row->onesecond as $row->second) {
- $row->rocksecond = $assetRepo . 'pokemon_icon_' . $row->second . '.png<br>';
- }
- foreach ($row->onethird as $row->third) {
- $row->rockthird = $assetRepo . 'pokemon_icon_' . $row->third . '.png<br>';
- }
- }
- $rocket[] = $row;
- }
- return $rocket;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement