├── img ├── br.png ├── da.png ├── de.png ├── en.png ├── es.png ├── fr.png ├── it.png ├── nl.png ├── pl.png ├── pt.png ├── se.png ├── homer.png ├── candy │ ├── 0.png │ ├── 377.png │ ├── 378.png │ ├── 379.png │ └── 486.png ├── discord.png ├── nav │ ├── egg.png │ ├── gym.png │ ├── lure.png │ ├── mons.png │ ├── nest.png │ ├── quest.png │ ├── invasion.png │ └── raid.svg ├── raid_1.png ├── raid_10.png ├── raid_11.png ├── raid_13.png ├── raid_14.png ├── raid_15.png ├── raid_3.png ├── raid_4.png ├── raid_5.png ├── raid_6.png ├── raid_7.png ├── raid_8.png ├── raid_9.png ├── raid_90.png ├── no_avatar.png ├── position.png └── telegram.png ├── favicon.png ├── lures ├── 501.png ├── 502.png ├── 503.png ├── 504.png ├── 505.png └── 506.png ├── .gitignore ├── package.json ├── logout.php ├── Dockerfile ├── actions ├── set_language.php ├── roles.php ├── action_error.php ├── areas.php ├── migrate.php ├── server_settings.php ├── set_location.php ├── channel_sync.php ├── lures.php └── nests.php ├── composer.json ├── examples ├── apache_http.example.conf ├── apache_ssl.example.conf ├── config_example.php └── nginx.example.conf ├── include ├── defaults.php ├── uicons_repo.php ├── geo_cache.php ├── db_connect.php ├── edit_area_distance.php ├── add_area_distance.php ├── db_mad.php ├── db_rdm.php ├── toplinks.php └── cache_handler.php ├── .github └── workflows │ ├── php.yml │ └── publish.yml ├── modal ├── logout_modal.php ├── delete_quests_modal.php ├── delete_gyms_modal.php ├── delete_nests_modal.php ├── delete_lures_modal.php ├── delete_invasions_modal.php ├── delete_monster_raids_modal.php ├── delete_eggs_modal.php ├── delete_raids_modal.php ├── areapic_modal.php ├── delete_monsters_modal.php ├── distance_show_modal.php ├── location_modal.php ├── distance_quests_modal.php ├── distance_gyms_modal.php ├── distance_pokemons_modal.php ├── distance_lures_modal.php ├── distance_nests_modal.php ├── distance_invasions_modal.php ├── distance_raids_modal.php ├── edit_lures_modal.php ├── areas_modal.php ├── edit_quests_modal.php ├── edit_raids_modal.php ├── edit_eggs_modal.php ├── edit_nests_modal.php └── edit_invasions_modal.php ├── docker-compose.example.yml ├── js ├── nav.js ├── get_position.js ├── scripts.js └── functions.js ├── search_mons.php ├── config.env.php ├── search_mons.js ├── telegram_auth.php ├── css └── nav.css ├── admin_connect.php ├── pages └── display │ ├── manage_roles.php │ ├── profiles.php │ ├── manage_users.php │ └── migrate.php ├── discord_auth.php ├── README.md ├── unregistered.php ├── index.php └── login.php /img/br.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/br.png -------------------------------------------------------------------------------- /img/da.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/da.png -------------------------------------------------------------------------------- /img/de.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/de.png -------------------------------------------------------------------------------- /img/en.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/en.png -------------------------------------------------------------------------------- /img/es.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/es.png -------------------------------------------------------------------------------- /img/fr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/fr.png -------------------------------------------------------------------------------- /img/it.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/it.png -------------------------------------------------------------------------------- /img/nl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/nl.png -------------------------------------------------------------------------------- /img/pl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/pl.png -------------------------------------------------------------------------------- /img/pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/pt.png -------------------------------------------------------------------------------- /img/se.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/se.png -------------------------------------------------------------------------------- /favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/favicon.png -------------------------------------------------------------------------------- /img/homer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/homer.png -------------------------------------------------------------------------------- /lures/501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/lures/501.png -------------------------------------------------------------------------------- /lures/502.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/lures/502.png -------------------------------------------------------------------------------- /lures/503.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/lures/503.png -------------------------------------------------------------------------------- /lures/504.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/lures/504.png -------------------------------------------------------------------------------- /lures/505.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/lures/505.png -------------------------------------------------------------------------------- /lures/506.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/lures/506.png -------------------------------------------------------------------------------- /img/candy/0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/candy/0.png -------------------------------------------------------------------------------- /img/discord.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/discord.png -------------------------------------------------------------------------------- /img/nav/egg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/nav/egg.png -------------------------------------------------------------------------------- /img/nav/gym.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/nav/gym.png -------------------------------------------------------------------------------- /img/raid_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_1.png -------------------------------------------------------------------------------- /img/raid_10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_10.png -------------------------------------------------------------------------------- /img/raid_11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_11.png -------------------------------------------------------------------------------- /img/raid_13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_13.png -------------------------------------------------------------------------------- /img/raid_14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_14.png -------------------------------------------------------------------------------- /img/raid_15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_15.png -------------------------------------------------------------------------------- /img/raid_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_3.png -------------------------------------------------------------------------------- /img/raid_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_4.png -------------------------------------------------------------------------------- /img/raid_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_5.png -------------------------------------------------------------------------------- /img/raid_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_6.png -------------------------------------------------------------------------------- /img/raid_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_7.png -------------------------------------------------------------------------------- /img/raid_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_8.png -------------------------------------------------------------------------------- /img/raid_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_9.png -------------------------------------------------------------------------------- /img/raid_90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/raid_90.png -------------------------------------------------------------------------------- /img/candy/377.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/candy/377.png -------------------------------------------------------------------------------- /img/candy/378.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/candy/378.png -------------------------------------------------------------------------------- /img/candy/379.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/candy/379.png -------------------------------------------------------------------------------- /img/candy/486.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/candy/486.png -------------------------------------------------------------------------------- /img/nav/lure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/nav/lure.png -------------------------------------------------------------------------------- /img/nav/mons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/nav/mons.png -------------------------------------------------------------------------------- /img/nav/nest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/nav/nest.png -------------------------------------------------------------------------------- /img/nav/quest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/nav/quest.png -------------------------------------------------------------------------------- /img/no_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/no_avatar.png -------------------------------------------------------------------------------- /img/position.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/position.png -------------------------------------------------------------------------------- /img/telegram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/telegram.png -------------------------------------------------------------------------------- /img/nav/invasion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bbdoc/PoracleWeb/HEAD/img/nav/invasion.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | config.php 2 | *.OLD 3 | *.swp 4 | test* 5 | subs* 6 | composer.lock 7 | node_modules/ 8 | .cache 9 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "PoracleWeb", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "@fortawesome/fontawesome-free": "^5.15.1", 6 | "bootstrap": "^4.5.3", 7 | "jquery": "^3.5.1", 8 | "jquery.easing": "^1.4.1" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /logout.php: -------------------------------------------------------------------------------- 1 | prepare("UPDATE humans SET language = ? WHERE id = ?"); 15 | $stmt->bind_param("ss", $_GET['lng'], $_SESSION['id']); 16 | $stmt->execute() or die(mysqli_error($conn)); 17 | $stmt->close(); 18 | 19 | header("Location: $redirect_url"); 20 | 21 | ?> 22 | -------------------------------------------------------------------------------- /actions/roles.php: -------------------------------------------------------------------------------- 1 | array( 8 | 'method'=>"POST", 9 | 'header'=>"Accept-language: en\r\n" . 10 | "X-Poracle-Secret: $api_secret\r\n" 11 | ) 12 | ); 13 | 14 | $context = stream_context_create($opts); 15 | 16 | $result = @file_get_contents("$api_address/api/humans/".$_SESSION['id']."/roles/".$_GET['type']."/".$_GET['id'], false, $context); 17 | 18 | header("Location: $redirect_url?type=display&page=manage_roles"); 19 | 20 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bbdoc/poracleweb", 3 | "description": "Web Inteface to handle alarms configuration in PoracleJS", 4 | "license": "AGPL-3.0-or-later", 5 | "homepage": "https://github.com/bbdoc/PoracleWeb", 6 | "authors": [ 7 | { 8 | "name": "bbdoc" 9 | } 10 | ], 11 | "require": { 12 | "php": ">= 7.0" 13 | }, 14 | "require-dev": { 15 | "php-parallel-lint/php-console-highlighter": "0.5.0", 16 | "php-parallel-lint/php-parallel-lint": "1.2.0" 17 | }, 18 | "scripts": { 19 | "test": [ 20 | "parallel-lint . --exclude vendor" 21 | ] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/apache_http.example.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerAdmin admin@domain.de 3 | ServerName sub.domain.de 4 | ServerAlias sub.domain.de 5 | 6 | DocumentRoot /var/www/html/PoracleWeb 7 | 8 | ErrorLog ${APACHE_LOG_DIR}/error.log 9 | CustomLog ${APACHE_LOG_DIR}/access.log combined 10 | 11 | RewriteCond %{HTTP_HOST} !^sub\.domain\.de$ [NC] 12 | RewriteRule ^/$ http://%{HTTP_HOST}/ [L,R=301] 13 | RewriteEngine on 14 | RewriteCond %{SERVER_NAME} =sub.domain.de 15 | RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] 16 | 17 | -------------------------------------------------------------------------------- /include/defaults.php: -------------------------------------------------------------------------------- 1 | 0, 5 | "pvp_ranking_worst"=>4096, 6 | "pvp_ranking_min_cp"=>0, 7 | "ultra_league_ranking_min_cp"=>0, 8 | "min_iv"=>0, 9 | "max_iv"=>100, 10 | "min_cp"=>0, 11 | "max_cp"=>9000, 12 | "min_level"=>0, 13 | "max_level"=>55, 14 | "min_weight"=>0, 15 | "max_weight"=>9000000, 16 | "atk"=>0, 17 | "def"=>0, 18 | "sta"=>0, 19 | "max_atk"=>15, 20 | "max_def"=>15, 21 | "max_sta"=>15, 22 | "gender"=>0, 23 | "size"=>-1, 24 | "max_size"=>5 25 | ); 26 | 27 | $min_poracle_version = "4.8.3"; 28 | $max_pokemon="1008"; 29 | 30 | $other_grunt_types = array( 31 | "7"=>"gold-stop", 32 | "8"=>"kecleon", 33 | "9"=>"showcase" 34 | ); 35 | 36 | ?> 37 | -------------------------------------------------------------------------------- /include/uicons_repo.php: -------------------------------------------------------------------------------- 1 | "https://raw.githubusercontent.com/whitewillem/PogoAssets/main/uicons", 4 | "Whitewillem Outline" => "https://raw.githubusercontent.com/whitewillem/PogoAssets/main/uicons-outline", 5 | "Nileplumb Home" => "https://raw.githubusercontent.com/nileplumb/PkmnHomeIcons/master/UICONS", 6 | "Nileplumb Outline" => "https://raw.githubusercontent.com/nileplumb/PkmnHomeIcons/master/UICONS_OS_128", 7 | "Nileplumn Shuffle" => "https://raw.githubusercontent.com/nileplumb/PkmnShuffleMap/master/UICONS", 8 | "Jms412 Shuffle" => "https://raw.githubusercontent.com/jms412/PkmnShuffleMap/master/UICONS_Half_Shiny_128", 9 | "Jms412 Home" => "https://raw.githubusercontent.com/jms412/PkmnHomeIcons/master/UICONS_Half_Shiny_128" 10 | ); 11 | ?> 12 | -------------------------------------------------------------------------------- /.github/workflows/php.yml: -------------------------------------------------------------------------------- 1 | name: PHP Composer 2 | 3 | on: 4 | push: 5 | pull_request: 6 | 7 | jobs: 8 | run: 9 | runs-on: ubuntu-latest 10 | strategy: 11 | matrix: 12 | php-versions: 13 | - "7.0" 14 | - "7.1" 15 | - "7.2" 16 | - "7.3" 17 | - "7.4" 18 | - "8.0" 19 | - "8.1" 20 | 21 | name: PHP ${{ matrix.php-versions }} test 22 | steps: 23 | - name: Checkout 24 | uses: actions/checkout@v4 25 | 26 | - name: Setup PHP 27 | uses: shivammathur/setup-php@v2 28 | with: 29 | php-version: ${{ matrix.php-versions }} 30 | coverage: none 31 | tools: composer 32 | 33 | - name: Install dependencies 34 | run: composer install --prefer-dist --no-progress 35 | 36 | - name: Run tests 37 | run: composer test 38 | -------------------------------------------------------------------------------- /examples/apache_ssl.example.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | ServerAdmin admin@domain.de 4 | ServerName sub.domain.de 5 | ServerAlias sub.domain.de 6 | 7 | 8 | Options Indexes FollowSymLinks 9 | AllowOverride All 10 | Require all granted 11 | 12 | 13 | DocumentRoot /var/www/html/PoracleWeb 14 | 15 | ErrorLog ${APACHE_LOG_DIR}/PoracleWeberror.log 16 | CustomLog ${APACHE_LOG_DIR}/PoracleWebaccess.log combined 17 | 18 | RewriteCond %{HTTP_HOST} !^sub\.domain\.de$ [NC] 19 | RewriteRule ^/$ http://%{HTTP_HOST}/ [L,R=301] 20 | 21 | 22 | SSLCertificateFile /etc/letsencrypt/live/mysite/fullchain.pem 23 | SSLCertificateKeyFile /etc/letsencrypt/live/mysite/privkey.pem 24 | Include /etc/letsencrypt/options-ssl-apache.conf 25 | 26 | 27 | -------------------------------------------------------------------------------- /modal/logout_modal.php: -------------------------------------------------------------------------------- 1 | 3 | 4 | 22 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | 3 | on: [push] 4 | 5 | env: 6 | REGISTRY: ghcr.io 7 | IMAGE_NAME: ${{ github.repository }} 8 | 9 | jobs: 10 | build-and-push-image: 11 | runs-on: ubuntu-latest 12 | permissions: 13 | contents: read 14 | packages: write 15 | steps: 16 | - name: Checkout repository 17 | uses: actions/checkout@v4 18 | - name: Log in to the Container registry 19 | uses: docker/login-action@v3 20 | with: 21 | registry: ${{ env.REGISTRY }} 22 | username: ${{ github.actor }} 23 | password: ${{ secrets.GITHUB_TOKEN }} 24 | - name: Extract metadata (tags, labels) for Docker 25 | id: meta 26 | uses: docker/metadata-action@v5 27 | with: 28 | images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} 29 | - name: Build and push Docker image 30 | uses: docker/build-push-action@v6 31 | with: 32 | context: . 33 | push: true 34 | tags: ${{ steps.meta.outputs.tags }} 35 | labels: ${{ steps.meta.outputs.labels }} 36 | -------------------------------------------------------------------------------- /docker-compose.example.yml: -------------------------------------------------------------------------------- 1 | version: '3.1' 2 | services: 3 | poracle-web: 4 | image: ghcr.io/bbdoc/poracleweb:main 5 | container_name: poracle-web 6 | restart: unless-stopped 7 | tty: true 8 | # for the configuration you can work with environment variables or bind config.php into container 9 | # environment: 10 | # PORACLE_DB_HOST: poracle-db 11 | # PORACLE_DB_DATABASE: poracledb 12 | # PORACLE_DB_USERNAME: poracleuser 13 | # PORACLE_DB_PASSWORD: dbPassword 14 | # PORACLE_DB_PORT: 3306 15 | # ADMIN_ID: 123456789123456 16 | # REDIRECT_URL: https://poracle.map.com # 17 | # DISCORD_BOT_CLIENT_ID: 123456789123456789 18 | # DISCORD_BOT_CLIENT_SECRET: abcdefghijklmnopqrstuvwxyz 19 | # MAP_URL: https://tiles.map.com/staticmap/poracle-web?img=https://raw.githubusercontent> 20 | # MAP_PORACLE_WEB: https://tiles.map.com/staticmap/poracle-web 21 | depends_on: 22 | - poracle-db 23 | - poracle 24 | volumes: 25 | # - ./config.php:/var/www/html/config.php 26 | - /etc/localtime:/etc/localtime:ro 27 | ports: 28 | - 127.0.0.1:9060:80 29 | -------------------------------------------------------------------------------- /modal/delete_quests_modal.php: -------------------------------------------------------------------------------- 1 | 10 | 15 | 27 | 28 | -------------------------------------------------------------------------------- /examples/config_example.php: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 26 | 27 | -------------------------------------------------------------------------------- /modal/delete_nests_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 14 | 26 | 27 | -------------------------------------------------------------------------------- /modal/delete_lures_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 14 | 26 | 27 | -------------------------------------------------------------------------------- /modal/delete_invasions_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 14 | 26 | 27 | -------------------------------------------------------------------------------- /js/nav.js: -------------------------------------------------------------------------------- 1 | 2 | // SideNav 3 | $('[data-trigger]').on('click', function () { 4 | var offcanvasId = $(this).attr('data-trigger') 5 | $(offcanvasId).toggleClass('show') 6 | $('.screen-overlay').toggleClass('show') 7 | }) 8 | 9 | $('.screen-overlay').click(function () { 10 | $('.offcanvas').removeClass('show') 11 | $('.screen-overlay').removeClass('show') 12 | }) 13 | 14 | $(window).on('scroll', function () { 15 | if (!$('#header').visible()) { 16 | $('.offcanvas').removeClass('show') 17 | $('.screen-overlay').removeClass('show') 18 | } 19 | }) 20 | 21 | // Nav Styling 22 | $('#color-button-dark').on('click', function () { 23 | darkMode() 24 | Store.set('navColor', 'dark') 25 | }) 26 | 27 | $('#color-button-light').on('click', function () { 28 | lightMode() 29 | Store.set('navColor', 'light') 30 | }) 31 | 32 | $('#color-button-secondary').on('click', function () { 33 | greyMode() 34 | Store.set('navColor', 'grey') 35 | }) 36 | 37 | // Close on Menu Item Click 38 | 39 | document.getElementById("logout").addEventListener("click", function(event) { 40 | $('.offcanvas').removeClass('show') 41 | $('.screen-overlay').removeClass('show') 42 | }); 43 | 44 | 45 | -------------------------------------------------------------------------------- /modal/delete_monster_raids_modal.php: -------------------------------------------------------------------------------- 1 | 10 | 15 | 27 | 28 | -------------------------------------------------------------------------------- /modal/delete_eggs_modal.php: -------------------------------------------------------------------------------- 1 | 10 | 15 | 27 | 28 | -------------------------------------------------------------------------------- /modal/delete_raids_modal.php: -------------------------------------------------------------------------------- 1 | 10 | 15 | 27 | 28 | -------------------------------------------------------------------------------- /modal/areapic_modal.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 28 | -------------------------------------------------------------------------------- /examples/nginx.example.conf: -------------------------------------------------------------------------------- 1 | server { 2 | server_name yourdomain.com; 3 | client_max_body_size 8M; 4 | 5 | location / { 6 | include /etc/nginx/mime.types; 7 | root /your/dir/to/poracleweb; 8 | index index.php index.html index.htm; 9 | } 10 | location ~ \.php$ { 11 | root /your/dir/to/poracleweb; 12 | try_files $uri =404; 13 | fastcgi_pass unix:/var/run/php/php7.4-fpm.sock; 14 | fastcgi_index index.php; 15 | fastcgi_param HTTP_IF_NONE_MATCH $http_if_none_match; 16 | fastcgi_param HTTP_IF_MODIFIED_SINCE $http_if_modified_since; 17 | fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; 18 | fastcgi_read_timeout 300; 19 | include fastcgi_params; 20 | } 21 | # deny access to .htaccess files, if Apache's document root 22 | # concurs with nginx's one 23 | # 24 | location ~ /\.ht { 25 | deny all; 26 | } 27 | listen 443 ssl http2; 28 | ssl_certificate /opt/cloudflare/yourdomain.com.chain.pem; 29 | ssl_certificate_key /opt/cloudflare/yourdomain.com.privkey.pem; 30 | } 31 | server { 32 | if ($host = yourdomain.com) { 33 | return 301 https://$host$request_uri; 34 | } 35 | listen 80; 36 | server_name yourdomain.com; 37 | return 404; 38 | } 39 | -------------------------------------------------------------------------------- /js/get_position.js: -------------------------------------------------------------------------------- 1 | 2 | var error_div = document.getElementById("position_error_div"); 3 | 4 | function getLocation() { 5 | if (navigator.geolocation) { 6 | navigator.geolocation.getCurrentPosition(setPosition, showError); 7 | } else { 8 | error_div.style.display = "block" 9 | document.getElementById("NOT_SUPPORTED").style.display = "block" 10 | } 11 | } 12 | 13 | function setPosition(position) { 14 | window.location = './actions/set_location.php?lat=' + position.coords.latitude + '&lon=' + position.coords.longitude; 15 | } 16 | 17 | function showError(error) { 18 | switch(error.code) { 19 | case error.PERMISSION_DENIED: 20 | error_div.style.display = "block" 21 | document.getElementById("PERMISSION_DENIED").style.display = "block" 22 | break; 23 | case error.POSITION_UNAVAILABLE: 24 | error_div.style.display = "block" 25 | document.getElementById("POSITION_UNAVAILABLE").style.display = "block" 26 | break; 27 | case error.TIMEOUT: 28 | error_div.style.display = "block" 29 | document.getElementById("TIMEOUT").style.display = "block" 30 | break; 31 | case error.UNKNOWN_ERROR: 32 | error_div.style.display = "block" 33 | document.getElementById("UNKNOWN_ERROR").style.display = "block" 34 | break; 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /include/geo_cache.php: -------------------------------------------------------------------------------- 1 | 'True') { 6 | 7 | $opts = array( 8 | 'http'=>array( 9 | 'method'=>"GET", 10 | 'header'=>"Accept-language: en\r\n" . 11 | "X-Poracle-Secret: $api_secret\r\n" 12 | ) 13 | ); 14 | 15 | $context = stream_context_create($opts); 16 | 17 | $geo_hash = file_get_contents("$api_address/api/geofence/all/hash", false, $context); 18 | $json = json_decode($geo_hash, true); 19 | $geo_hash = $json['areas']; 20 | 21 | foreach ($json['areas'] as $area_name => $hash) { 22 | 23 | $geo_hash[strtoupper($area_name)] = $hash; 24 | $encode_name = rawurlencode($area_name); 25 | $area_name = strtoupper(str_replace(' ', '_', $area_name)); 26 | 27 | // Call Each Geofence and check hash 28 | 29 | if (!file_exists("./.cache/geo_".$area_name."_".$hash.".png")) { 30 | $geo = file_get_contents("$api_address/api/geofence/".$encode_name."/map", false, $context); 31 | $json = json_decode($geo, true); 32 | $png=$json['url']; 33 | if ( isset($png) ) { 34 | if ( @fopen($png, 'r') ) { 35 | file_put_contents("./.cache/geo_".$area_name."_".$hash.".png", file_get_contents($png)); 36 | } 37 | } 38 | } 39 | 40 | } 41 | 42 | } 43 | 44 | ?> 45 | -------------------------------------------------------------------------------- /search_mons.php: -------------------------------------------------------------------------------- 1 | $pokemon_id) { 20 | unset($mons[$pokemon_id]); 21 | } 22 | } 23 | 24 | foreach($mons as $pokemon_id => $pokemon_name_type) { 25 | if ($pokemon_id <= $max_pokemon) { 26 | if ( $_POST['search'] == "ALL" || stripos(stripAccents($pokemon_name_type), stripAccents($_POST['search'])) !== FALSE ) { 27 | $i=$pokemon_id; 28 | $pokemon_name=explode("_", $pokemon_name_type); 29 | $pokemon_name=$pokemon_name[0]; 30 | echo "
  • "; 31 | echo "\n"; 32 | echo ""; 35 | echo "
  • \n"; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /modal/delete_monsters_modal.php: -------------------------------------------------------------------------------- 1 | 11 | 17 | 30 | 31 | -------------------------------------------------------------------------------- /config.env.php: -------------------------------------------------------------------------------- 1 | connect_errno) { 19 | echo "Failed to connect to MySQL: " . $conn->connect_error; 20 | exit(); 21 | } 22 | } 23 | 24 | // Get DB Settings into variables 25 | 26 | $sql = "SHOW TABLES LIKE 'pweb_settings'"; 27 | $result = $conn->query($sql); 28 | 29 | if ($result->num_rows <> 0) { 30 | 31 | $sql = "select * FROM pweb_settings"; 32 | $result = $conn->query($sql); 33 | 34 | while ($row = $result->fetch_assoc()) { 35 | ${$row['setting']} = $row['value']; 36 | if ( ${$row['setting']} == "") { unset( ${$row['setting']} ); } 37 | } 38 | 39 | } 40 | 41 | // Set Default UICONS Repo 42 | 43 | if (!isset($uicons_pkmn)) { $uicons_pkmn = "https://raw.githubusercontent.com/whitewillem/PogoAssets/main/uicons"; } 44 | if (!isset($uicons_raid)) { $uicons_raid = "https://raw.githubusercontent.com/whitewillem/PogoAssets/main/uicons"; } 45 | if (!isset($uicons_gym)) { $uicons_gym = "https://raw.githubusercontent.com/whitewillem/PogoAssets/main/uicons"; } 46 | if (!isset($uicons_reward)) { $uicons_reward = "https://raw.githubusercontent.com/whitewillem/PogoAssets/main/uicons"; } 47 | -------------------------------------------------------------------------------- /modal/distance_show_modal.php: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | 17 | 18 | 24 |
    25 | 26 | 34 | 35 | 39 | 40 | 41 |
    42 | 43 |
    44 | 48 | 49 | -------------------------------------------------------------------------------- /search_mons.js: -------------------------------------------------------------------------------- 1 | //Getting value from "ajax.php". 2 | 3 | function fill(Value) { 4 | //Assigning value to "search" div in "search.php" file. 5 | //Hiding "display" div in "search.php" file. 6 | $('#display').hide(); 7 | } 8 | 9 | $(document).ready(function() { 10 | //On pressing a key on "Search box" in "search.php" file. This function will be called. 11 | $("#search").keyup(function() { 12 | //Assigning search box value to javascript variable named as "name". 13 | var name = $('#search').val(); 14 | var type = $('#search_type').val(); 15 | //Validating, if "name" is empty. 16 | if (name == "") { 17 | //Assigning empty value to "display" div in "search.php" file. 18 | $("#display").html(""); 19 | } 20 | //If name is not empty. 21 | else { 22 | //AJAX is called. 23 | $.ajax({ 24 | //AJAX type is "Post". 25 | type: "POST", 26 | //Data will be sent to "add_mons.php". 27 | url: "search_mons.php", 28 | //Data, that will be sent to "add_mons.php". 29 | data: { 30 | //Assigning value of "name" into "search" variable. 31 | search: name, 32 | searchtype: type 33 | }, 34 | //If result found, this funtion will be called. 35 | success: function(html) { 36 | //Assigning result to "display" div in "search.php" file. 37 | $("#display").html(html).show(); 38 | } 39 | }); 40 | } 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /telegram_auth.php: -------------------------------------------------------------------------------- 1 | $value) { 18 | $data_check_arr[] = $key . '=' . $value; 19 | } 20 | sort($data_check_arr); 21 | 22 | $data_check_string = implode("\n", $data_check_arr); 23 | $secret_key = hash('sha256', $telegram_bot_token, true); 24 | $hash = hash_hmac('sha256', $data_check_string, $secret_key); 25 | 26 | if (strcmp($hash, $check_hash) !== 0) { 27 | header("Location: $redirect_url/?return=invalid_auth"); 28 | exit(); 29 | } 30 | 31 | if ((time() - $auth_data['auth_date']) > 86400) { 32 | header("Location: $redirect_url/?return=expired"); 33 | exit(); 34 | } 35 | 36 | $_SESSION['type'] = "telegram:user"; 37 | $_SESSION['id'] = $_GET['id']; 38 | $_SESSION['avatar'] = @$_GET['photo_url']; 39 | if (isset($_SESSION['username'])) { 40 | $_SESSION['username'] = $_GET['username']; 41 | } else { 42 | $_SESSION['username'] = @$_GET['first_name'] . " " . @$_GET['last_name']; 43 | } 44 | 45 | include_once "./session.php"; 46 | 47 | if (isset($no_api) && $no_api == "True") { 48 | header("Location: $redirect_url?type=display&page=server_settings"); 49 | } else if (version_compare($_SESSION['poracleVersion'], $min_poracle_version) < 0) { 50 | header("Location: $redirect_url?type=display&page=server_settings"); 51 | } else { 52 | header("Location: $redirect_url"); 53 | } 54 | -------------------------------------------------------------------------------- /modal/location_modal.php: -------------------------------------------------------------------------------- 1 | 5 | 9 | 10 | 13 | 14 | 19 | 20 | "; 28 | 29 | ?> 30 | 31 |
    32 | 33 |
    34 |
    35 | 38 |
    39 |
    40 | 41 |
    42 | 43 |
    44 | 45 |
    46 |
    47 | 48 |
    49 | 50 | 54 | 55 |
    56 | -------------------------------------------------------------------------------- /actions/action_error.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | PoracleWeb 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
    20 | 21 | "; 24 | # foreach ($_POST as $key => $value) { 25 | # echo ""; 26 | # echo ""; 27 | # echo $key; 28 | # echo ""; 29 | # echo ""; 30 | # echo $value; 31 | # echo ""; 32 | # echo ""; 33 | # } 34 | # echo ""; 35 | 36 | ?> 37 | 38 |
    39 |
    40 | Oops...

    41 |

    42 | Looks like Something went wrong, you shouldn't be here.

    43 | Please get back to homepage:

    44 | 45 | PoracleWeb 46 | 47 |
    48 |
    49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /js/scripts.js: -------------------------------------------------------------------------------- 1 | (function($) { 2 | "use strict"; // Start of use strict 3 | 4 | // Toggle the side navigation 5 | $("#sidebarToggle, #sidebarToggleTop").on('click', function(e) { 6 | $("body").toggleClass("sidebar-toggled"); 7 | $(".sidebar").toggleClass("toggled"); 8 | if ($(".sidebar").hasClass("toggled")) { 9 | $('.sidebar .collapse').collapse('hide'); 10 | }; 11 | }); 12 | 13 | // Close any open menu accordions when window is resized below 768px 14 | $(window).resize(function() { 15 | if ($(window).width() < 768) { 16 | $('.sidebar .collapse').collapse('hide'); 17 | }; 18 | 19 | // Toggle the side navigation when window is resized below 480px 20 | if ($(window).width() < 480 && !$(".sidebar").hasClass("toggled")) { 21 | $("body").addClass("sidebar-toggled"); 22 | $(".sidebar").addClass("toggled"); 23 | $('.sidebar .collapse').collapse('hide'); 24 | }; 25 | }); 26 | 27 | // Prevent the content wrapper from scrolling when the fixed side navigation hovered over 28 | $('body.fixed-nav .sidebar').on('mousewheel DOMMouseScroll wheel', function(e) { 29 | if ($(window).width() > 768) { 30 | var e0 = e.originalEvent, 31 | delta = e0.wheelDelta || -e0.detail; 32 | this.scrollTop += (delta < 0 ? 1 : -1) * 30; 33 | e.preventDefault(); 34 | } 35 | }); 36 | 37 | // Scroll to top button appear 38 | $(document).on('scroll', function() { 39 | var scrollDistance = $(this).scrollTop(); 40 | if (scrollDistance > 100) { 41 | $('.scroll-to-top').fadeIn(); 42 | } else { 43 | $('.scroll-to-top').fadeOut(); 44 | } 45 | }); 46 | 47 | // Smooth scrolling using jQuery easing 48 | $(document).on('click', 'a.scroll-to-top', function(e) { 49 | var $anchor = $(this); 50 | $('html, body').stop().animate({ 51 | scrollTop: ($($anchor.attr('href')).offset().top) 52 | }, 1000, 'easeInOutExpo'); 53 | e.preventDefault(); 54 | }); 55 | 56 | })(jQuery); // End of use strict 57 | -------------------------------------------------------------------------------- /modal/distance_quests_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | prepare("SELECT distance from quest WHERE id = ? GROUP by distance"); 12 | $stmt->bind_param("s", $_SESSION['id']); 13 | $stmt->execute(); 14 | $result = $stmt->get_result(); 15 | if ($result->num_rows == 1) { 16 | while ($row = $result->fetch_assoc()) { 17 | $distance_set = $row['distance']; 18 | } 19 | } else { 20 | $distance_set = 0; 21 | } 22 | $stmt->close(); 23 | ?> 24 |
    25 | 45 | 51 |
    52 | 53 | -------------------------------------------------------------------------------- /modal/distance_gyms_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | prepare("SELECT distance from gym WHERE id = ? GROUP by distance"); 12 | $stmt->bind_param("s", $_SESSION['id']); 13 | $stmt->execute(); 14 | $result = $stmt->get_result(); 15 | if (!empty($result) && $result->num_rows == 1) { 16 | while ($row = $result->fetch_assoc()) { 17 | $distance_set = $row['distance']; 18 | } 19 | } else { 20 | $distance_set = 0; 21 | } 22 | $stmt->close(); 23 | ?> 24 |
    25 | 45 | 51 |
    52 | 53 | -------------------------------------------------------------------------------- /modal/distance_pokemons_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | prepare("SELECT distance from monsters WHERE id = ? GROUP by distance"); 12 | $stmt->bind_param("s", $_SESSION['id']); 13 | $stmt->execute(); 14 | $result = $stmt->get_result(); 15 | if ($result->num_rows == 1) { 16 | while ($row = $result->fetch_assoc()) { 17 | $distance_set = $row['distance']; 18 | } 19 | } else { 20 | $distance_set = 0; 21 | } 22 | $stmt->close(); 23 | ?> 24 |
    25 | 45 | 51 |
    52 | 53 | -------------------------------------------------------------------------------- /modal/distance_lures_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | prepare("SELECT distance from lures WHERE id = ? GROUP by distance"); 12 | $stmt->bind_param("s", $_SESSION['id']); 13 | $stmt->execute(); 14 | $result = $stmt->get_result(); 15 | if (!empty($result) && $result->num_rows == 1) { 16 | while ($row = $result->fetch_assoc()) { 17 | $distance_set = $row['distance']; 18 | } 19 | } else { 20 | $distance_set = 0; 21 | } 22 | $stmt->close(); 23 | ?> 24 |
    25 | 45 | 51 |
    52 | 53 | -------------------------------------------------------------------------------- /modal/distance_nests_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | prepare("SELECT distance from nests WHERE id = ? GROUP by distance"); 12 | $stmt->bind_param("s", $_SESSION['id']); 13 | $stmt->execute(); 14 | $result = $stmt->get_result(); 15 | if (!empty($result) && $result->num_rows == 1) { 16 | while ($row = $result->fetch_assoc()) { 17 | $distance_set = $row['distance']; 18 | } 19 | } else { 20 | $distance_set = 0; 21 | } 22 | $stmt->close(); 23 | ?> 24 |
    25 | 45 | 51 |
    52 | 53 | -------------------------------------------------------------------------------- /modal/distance_invasions_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | prepare("SELECT distance from invasion WHERE id = ? GROUP by distance"); 12 | $stmt->bind_param("s", $_SESSION['id']); 13 | $stmt->execute(); 14 | $result = $stmt->get_result(); 15 | if (!empty($result) && $result->num_rows == 1) { 16 | while ($row = $result->fetch_assoc()) { 17 | $distance_set = $row['distance']; 18 | } 19 | } else { 20 | $distance_set = 0; 21 | } 22 | $stmt->close(); 23 | ?> 24 |
    25 | 45 | 51 |
    52 | 53 | -------------------------------------------------------------------------------- /modal/distance_raids_modal.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | prepare("SELECT distance from (SELECT distance,id from raid UNION SELECT distance,id from egg) raidegg WHERE id = ? GROUP by distance"); 12 | $stmt->bind_param("s", $_SESSION['id']); 13 | $stmt->execute(); 14 | $result = $stmt->get_result(); 15 | if ($result->num_rows == 1) { 16 | while ($row = $result->fetch_assoc()) { 17 | $distance_set = $row['distance']; 18 | } 19 | } else { 20 | $distance_set = 0; 21 | } 22 | $stmt->close(); 23 | ?> 24 |
    25 | 45 | 51 |
    52 | 53 | -------------------------------------------------------------------------------- /actions/areas.php: -------------------------------------------------------------------------------- 1 | $value) { 12 | if (substr($key, 0, 5) === "area_") { 13 | $area = substr($key, 5); 14 | $area = strtolower($area); 15 | $area = str_replace('%20', ' ', $area); 16 | array_push($area_list, "\"$area\""); 17 | } 18 | } 19 | $area_list = implode(',', $area_list); 20 | $area_list = "[" . $area_list . "]"; 21 | 22 | // Update Humans Table if current Profile is active 23 | $stmt = $conn->prepare("UPDATE humans set area = ? WHERE id = ? AND current_profile_no = ?"); 24 | if (false === $stmt) { 25 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=UAH1&sql=$stmt->error"); 26 | exit(); 27 | } 28 | $rs = $stmt->bind_param("ssi", $area_list, $_SESSION['id'], $_SESSION['profile']); 29 | if (false === $rs) { 30 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=UAH2&sql=$stmt->error"); 31 | exit(); 32 | } 33 | $rs = $stmt->execute(); 34 | if (false === $rs) { 35 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=UAH3&sql=$stmt->error"); 36 | exit(); 37 | } 38 | $stmt->close(); 39 | 40 | // Update Profile if exist 41 | $stmt = $conn->prepare("UPDATE profiles set area = ? WHERE id = ? AND profile_no = ?"); 42 | if (false === $stmt) { 43 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=UAP1&sql=$stmt->error"); 44 | exit(); 45 | } 46 | $rs = $stmt->bind_param("ssi", $area_list, $_SESSION['id'], $_SESSION['profile']); 47 | if (false === $rs) { 48 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=UAP2&sql=$stmt->error"); 49 | exit(); 50 | } 51 | $rs = $stmt->execute(); 52 | if (false === $rs) { 53 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=UAP3&sql=$stmt->error"); 54 | exit(); 55 | } 56 | $stmt->close(); 57 | 58 | 59 | header("Location: $redirect_url?type=display&page=area&return=success_update_areas"); 60 | exit(); 61 | } 62 | 63 | include "./action_error.php"; 64 | 65 | -------------------------------------------------------------------------------- /include/edit_area_distance.php: -------------------------------------------------------------------------------- 1 | "True" ) { 4 | $area_check="checked"; 5 | $distance_check=""; 6 | $style="style='display:none;'"; 7 | } else { 8 | $area_check=""; 9 | $distance_check="checked"; 10 | $style=""; 11 | } 12 | 13 | ?> 14 | 15 | "True" && $disable_location <> "True" ) { ?> 16 |
    17 |
    18 | 23 | 28 |
    29 |
    30 | "True" && $disable_areas == "True") { ?> 31 |
    32 |
    33 | 37 |
    38 |
    39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | "True" ) { ?> 47 |
    48 | ' 49 | min='0' max='' class="form-control text-center"> 50 |
    > 51 | 52 |
    53 |
    54 | 55 | 56 | -------------------------------------------------------------------------------- /include/add_area_distance.php: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | "True" && @$disable_areas <> "True" ) { ?> 13 | 14 |
    15 |
    16 |
    17 |
    18 | 21 | 24 |
    25 |
    26 |
    27 | ' style="display:" 28 | class="form-control text-center"> 29 | 32 |
    33 |
    34 |
    35 | "True" && @$disable_areas == "True" ) { ?> 36 |
    37 |
    38 |
    39 |
    40 | 43 |
    44 |
    45 |
    46 | ' 47 | class="form-control text-center"> 48 |
    49 | 50 |
    51 |
    52 |
    53 |
    54 | 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /css/nav.css: -------------------------------------------------------------------------------- 1 | .nav-icon { 2 | color:#999c9f; 3 | cursor: pointer; 4 | } 5 | .nav-icon:hover { 6 | color: white !important; 7 | } 8 | 9 | a.dropdown-item:hover { 10 | background-color: #dadada78; 11 | background-image: none; 12 | } 13 | 14 | .dropdown-menu.navbar-dropdown.scrollable-menu.show { 15 | max-height: 80vh; 16 | overflow-x: hidden; 17 | } 18 | 19 | .language-dropdown { 20 | top: 47px; 21 | left: -115px; 22 | } 23 | 24 | a.navbar-brand { 25 | left: 70px; 26 | position: absolute; 27 | } 28 | 29 | .navbar { 30 | margin-bottom: 20px; 31 | height: 60px; 32 | padding: .5rem 1rem; 33 | } 34 | 35 | .offcanvas-header { 36 | display: block; 37 | } 38 | 39 | .screen-overlay { 40 | height: 100%; 41 | z-index: 30; 42 | position: absolute; 43 | top: 0; 44 | left: 0; 45 | opacity: 0; 46 | visibility: hidden; 47 | background-color: rgba(0,0,0, 0.9); 48 | transition: opacity .2s linear, visibility .1s, width 1s ease-in; 49 | } 50 | .screen-overlay.show { 51 | transition: opacity .5s ease, width 0s; 52 | opacity: 0.4; 53 | width: 100%; 54 | top:60px; 55 | visibility: visible; 56 | } 57 | 58 | .offcanvas { 59 | visibility: hidden; 60 | transform: translateX(-100%); 61 | border-radius: 5px; 62 | display: block; 63 | position: absolute; 64 | top: 60px; 65 | left: 0; 66 | height: 100%; 67 | z-index: 1200; 68 | width: 18em; 69 | overflow-y: scroll; 70 | overflow-x: hidden; 71 | transition: visibility .2s ease-in-out, transform .2s ease-in-out; 72 | } 73 | 74 | .offcanvas.show { 75 | visibility: visible; 76 | transform: translateX(0); 77 | } 78 | 79 | .heading-title { 80 | top: 6px; 81 | position: relative; 82 | } 83 | 84 | .card-header-navbar[aria-expanded="false"]:after { 85 | content: "\f067"; /* fa-plus */ 86 | font-family: 'Font Awesome\ 5 Free'; 87 | font-weight: 900; 88 | position: absolute; 89 | right: 30px; 90 | top: 21px; 91 | font-size: 10px; 92 | } 93 | .card-header-navbar[aria-expanded="true"]:after { 94 | content: "\f068"; /* fa-minus */ 95 | font-family: 'Font Awesome\ 5 Free'; 96 | font-weight: 900; 97 | position: absolute; 98 | right: 30px; 99 | top: 21px; 100 | font-size: 10px; 101 | } 102 | 103 | .btn:focus { 104 | box-shadow: none; 105 | } 106 | .dropdown-item:active { 107 | background-color: #fff; 108 | } 109 | 110 | .border { 111 | border: 1px solid #dfdfdf; 112 | } 113 | 114 | .card.z-depth-0.bordered { 115 | width: 114%; 116 | margin-left: -18px; 117 | } 118 | 119 | .color-button { 120 | height: 21px; 121 | width: 21px; 122 | margin-right: 5px; 123 | border: 1px solid #ced4da; 124 | border-radius: 10px; 125 | position: relative; 126 | top: 2px; 127 | -webkit-tap-highlight-color: rgba(255, 255, 255, 0) !important; 128 | -webkit-focus-ring-color: rgba(255, 255, 255, 0) !important; 129 | outline: none !important; 130 | } 131 | 132 | .form-control { 133 | margin-bottom: 15px; 134 | } 135 | -------------------------------------------------------------------------------- /actions/migrate.php: -------------------------------------------------------------------------------- 1 | query($sql); 17 | 18 | # UPDATE HUMANS TABLE 19 | $stmt = $conn->prepare("UPDATE humans set id = ?, type = ?, name = ? where id = ?;"); 20 | $rs = $stmt->bind_param("ssss", $target_id, $target_type, $target_user, $source_id); 21 | $rs = $stmt->execute(); 22 | $stmt->close(); 23 | 24 | # UPDATE MONSTERS TABLE 25 | $stmt = $conn->prepare("UPDATE monsters set id = ? where id = ?;"); 26 | $rs = $stmt->bind_param("ss", $target_id, $source_id); 27 | $rs = $stmt->execute(); 28 | $stmt->close(); 29 | 30 | # UPDATE EGG TABLE 31 | $stmt = $conn->prepare("UPDATE egg set id = ? where id = ?;"); 32 | $rs = $stmt->bind_param("ss", $target_id, $source_id); 33 | $rs = $stmt->execute(); 34 | $stmt->close(); 35 | 36 | # UPDATE RAID TABLE 37 | $stmt = $conn->prepare("UPDATE raid set id = ? where id = ?;"); 38 | $rs = $stmt->bind_param("ss", $target_id, $source_id); 39 | $rs = $stmt->execute(); 40 | $stmt->close(); 41 | 42 | # UPDATE QUEST TABLE 43 | $stmt = $conn->prepare("UPDATE quest set id = ? where id = ?;"); 44 | $rs = $stmt->bind_param("ss", $target_id, $source_id); 45 | $rs = $stmt->execute(); 46 | $stmt->close(); 47 | 48 | # UPDATE INVASION TABLE 49 | $stmt = $conn->prepare("UPDATE invasion set id = ? where id = ?;"); 50 | $rs = $stmt->bind_param("ss", $target_id, $source_id); 51 | $rs = $stmt->execute(); 52 | $stmt->close(); 53 | 54 | # UPDATE WEATHER TABLE 55 | $stmt = $conn->prepare("UPDATE weather set id = ? where id = ?;"); 56 | $rs = $stmt->bind_param("ss", $target_id, $source_id); 57 | $rs = $stmt->execute(); 58 | $stmt->close(); 59 | 60 | # ENABLE FOREIGN KEY CHECKS 61 | $sql = "SET foreign_key_checks = 1;"; 62 | $result = $conn->query($sql); 63 | 64 | # CONNECT NEW USER 65 | $_SESSION['id']=$target_id; 66 | $_SESSION['username']=$target_user; 67 | $_SESSION['avatar']=$target_avatar; 68 | $_SESSION['type']=$target_type; 69 | 70 | # UPDATE ADMIN ID 71 | unset($_SESSION['admin_id']); 72 | if (isset($admin_id)) { 73 | $admins = explode(",", $admin_id); 74 | } 75 | foreach ($admins as &$admin) { 76 | if ($_SESSION['id'] == $admin) 77 | { 78 | $_SESSION['admin_id'] = $_SESSION['id']; 79 | $_SESSION['admin_username'] = $_SESSION['username']; 80 | $_SESSION['admin_dbname'] = $_SESSION['dbname']; 81 | $_SESSION['admin_type'] = $_SESSION['type']; 82 | } 83 | } 84 | 85 | header("Location: $redirect_url?return=success_migrate&mig_source=Discord&mig_target=Telegram"); 86 | exit(); 87 | 88 | } 89 | 90 | include "./action_error.php"; 91 | 92 | -------------------------------------------------------------------------------- /actions/server_settings.php: -------------------------------------------------------------------------------- 1 | query($sql); 10 | 11 | $languages = array(); 12 | foreach ($_POST as $key => $value) { 13 | 14 | if (strpos($key, 'language') !== false) { 15 | array_push($languages,substr($key,9,11)); 16 | } else if ( $key == "scan_dbpass" && trim($value) == "" ) { 17 | continue; 18 | } else if ( $key == "api_secret" && trim($value) == "" ) { 19 | continue; 20 | } else if ( $key == "telegram_bot_token" && trim($value) == "" ) { 21 | continue; 22 | } 23 | else if ( $key != "action" && $key != "update" ) 24 | { 25 | if (strpos($key, 'disable') !== false) { 26 | if ( $value == "on" ) { $value = "False"; } 27 | if ( $value == "off" ) { $value = "True"; } 28 | } else if ( $key == "api_address" ) { 29 | $value = rtrim($value, '/'); 30 | } else { 31 | if ( $value == "on" ) { $value = "True"; } 32 | if ( $value == "off" ) { $value = "False"; } 33 | } 34 | 35 | $stmt = $conn->prepare("INSERT INTO pweb_settings (setting, value) VALUES (?, ?) ON DUPLICATE KEY UPDATE value=?"); 36 | if (false === $stmt) { 37 | header("Location: $redirect_url/?type=display&page=server_settings&return=sql_error&phase=E1&sql=$stmt->error"); 38 | exit(); 39 | } 40 | 41 | $rs = $stmt->bind_param("sss", $key, $value, $value); 42 | if (false === $rs) { 43 | header("Location: $redirect_url/?type=display&page=server_settings&return=sql_error&phase=E2&sql=$stmt->error"); 44 | exit(); 45 | } 46 | 47 | $rs = $stmt->execute(); 48 | if (false === $rs) { 49 | header("Location: $redirect_url/?type=display&page=server_settings&return=sql_error&phase=E3&sql=$stmt->error"); 50 | exit(); 51 | } 52 | 53 | $stmt->close(); 54 | 55 | } 56 | 57 | } 58 | 59 | $languages = implode (",", $languages); 60 | if ( $languages == "" ) { $languages = "en"; } 61 | 62 | $stmt = $conn->prepare("INSERT INTO pweb_settings (setting, value) VALUES ('allowed_languages', ?) ON DUPLICATE KEY UPDATE value=?"); 63 | if (false === $stmt) { 64 | header("Location: $redirect_url/?type=display&page=server_settings&return=sql_error&phase=E1&sql=$stmt->error"); 65 | exit(); 66 | } 67 | 68 | $rs = $stmt->bind_param("ss", $languages, $languages); 69 | if (false === $rs) { 70 | header("Location: $redirect_url/?type=display&page=server_settings&return=sql_error&phase=E2&sql=$stmt->error"); 71 | exit(); 72 | } 73 | 74 | $rs = $stmt->execute(); 75 | if (false === $rs) { 76 | header("Location: $redirect_url/?type=display&page=server_settings&return=sql_error&phase=E3&sql=$stmt->error"); 77 | exit(); 78 | } 79 | 80 | header("Location: $redirect_url?type=display&page=server_settings&return=success_update_settings"); 81 | exit(); 82 | 83 | 84 | include "./action_error.php"; 85 | 86 | -------------------------------------------------------------------------------- /img/nav/raid.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 35 | 36 | -------------------------------------------------------------------------------- /js/functions.js: -------------------------------------------------------------------------------- 1 | 2 | function areas(type) { 3 | var distance = "distance_".concat(type); 4 | var label = "distance_label_".concat(type); 5 | var value = document.querySelector('input[id="use_areas_' + type + '"]:checked').value; 6 | if(value == "areas"){ 7 | document.getElementById(distance).style.display = "none"; 8 | document.getElementById(label).style.display = "none"; 9 | document.getElementById(distance).value = 0; 10 | } else { 11 | document.getElementById(distance).style.display = "block"; 12 | document.getElementById(label).style.display = "block"; 13 | } 14 | } 15 | 16 | function areas_add() { 17 | var value = document.querySelector('input[name="use_areas"]:checked').value; 18 | if(value == "areas"){ 19 | document.getElementById('distance').style.display = "none"; 20 | document.getElementById('distance_label').style.display = "none"; 21 | document.getElementById('distance').value = 0; 22 | } else { 23 | document.getElementById('distance').style.display = "block"; 24 | document.getElementById('distance_label').style.display = "block"; 25 | } 26 | } 27 | 28 | function setnoiv(type) { 29 | var min_iv = "min_iv_".concat(type); 30 | if(document.getElementById("noiv_".concat(type)).checked){ 31 | document.getElementById(min_iv).disabled = true; 32 | document.getElementById(min_iv).value = ""; 33 | } else { 34 | document.getElementById(min_iv).disabled = false; 35 | } 36 | } 37 | 38 | function setpvp(type) { 39 | var value = document.querySelector('input[id="league_' + type + '"]:checked').value; 40 | var divblock = "pvp_league_".concat(type); 41 | 42 | switch(value) { 43 | case '500': var min = document.querySelector('input[id="pvpFilterLittleMinCP"]').value; break; 44 | case '1500': var min = document.querySelector('input[id="pvpFilterGreatMinCP"]').value; break; 45 | case '2500': var min = document.querySelector('input[id="pvpFilterUltraMinCP"]').value; break; 46 | } 47 | 48 | document.getElementById("pvp_ranking_best_".concat(type)).value = ""; 49 | document.getElementById("pvp_ranking_worst_".concat(type)).value = ""; 50 | document.getElementById("pvp_ranking_min_cp_".concat(type)).value = ""; 51 | document.getElementById("pvp_ranking_min_cp_".concat(type)).setAttribute("min", min); 52 | document.getElementById("pvp_ranking_min_cp_".concat(type)).setAttribute("max", value); 53 | 54 | if(value == "0"){ 55 | document.getElementById(divblock).style.display = "none"; 56 | } else { 57 | document.getElementById(divblock).style.display = "block"; 58 | } 59 | } 60 | 61 | 62 | $(document).ready(function() { 63 | $("input[type='checkbox']").change(function() { 64 | var maxAllowed = 100; 65 | var cnt = $("input[type='checkbox']:checked").length; 66 | if (cnt > maxAllowed) { 67 | $(this).prop("checked", ""); 68 | alert('Sorry, you cannot select more than ' + maxAllowed + ' Pokemons at a time!'); 69 | } 70 | }); 71 | }); 72 | 73 | $(document).ready(function() { 74 | $(window).keydown(function(event) { 75 | if (event.keyCode == 13) { 76 | event.preventDefault(); 77 | return false; 78 | } 79 | }); 80 | }); 81 | 82 | $(function() { 83 | $("#mon_0").click(function() { 84 | if ($(this).is(":checked")) { 85 | $("#dvSearchBox").hide(); 86 | $("#dvMonsList").hide(); 87 | $("#dvAlertTypeAll").hide(); 88 | } else { 89 | $("#dvSearchBox").show(); 90 | $("#dvMonsList").show(); 91 | $("#dvAlertTypeAll").show(); 92 | } 93 | }); 94 | }); 95 | 96 | -------------------------------------------------------------------------------- /admin_connect.php: -------------------------------------------------------------------------------- 1 | connect_errno) { 31 | echo "Failed to connect to MySQL: " . $conn->connect_error; 32 | exit(); 33 | } 34 | 35 | $stmt = $conn->prepare("SELECT * from humans WHERE id = ?"); 36 | $stmt->bind_param("s", $search_id); 37 | $stmt->execute(); 38 | $stmt->store_result(); 39 | 40 | if ( $stmt->num_rows > 0 ) { 41 | $_SESSION['dbname'] = $db; 42 | } 43 | 44 | $stmt->close(); 45 | 46 | } 47 | 48 | $conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $_SESSION['dbname']); 49 | $stmt = $conn->prepare("SELECT id, name, type, notes FROM humans WHERE id = ?"); 50 | $stmt->bind_param("s", $search_id); 51 | $stmt->execute(); 52 | $result = $stmt->get_result(); 53 | 54 | if ($result->num_rows == 0) { 55 | header("Location: $redirect_url?return=user_not_found"); 56 | exit(); 57 | } 58 | 59 | while ($row = $result->fetch_assoc()) { 60 | $_SESSION['id'] = $row['id']; 61 | $_SESSION['username'] = $row['name']; 62 | $_SESSION['type']=$row['type']; 63 | $_SESSION['notes']=$row['notes']; 64 | } 65 | $stmt->close(); 66 | 67 | // Get Config Items from API and Store in Session Variables 68 | 69 | $opts = array( 70 | 'http'=>array( 71 | 'method'=>"GET", 72 | 'header'=>"Accept-language: en\r\n" . 73 | "X-Poracle-Secret: $api_secret\r\n" 74 | ) 75 | ); 76 | 77 | $context = stream_context_create($opts); 78 | 79 | // Update Areas to Match New User ID 80 | 81 | $areas = file_get_contents("$api_address/api/humans/".rawurlencode($_SESSION['id']), false, $context); 82 | $json = json_decode($areas, true); 83 | 84 | if ( $json['status']="ok" ) { 85 | $_SESSION['areas'] = $json['areas']; 86 | } else { 87 | session_destroy(); 88 | header("Location: $redirect_url?return=error_api_nok"); 89 | exit(); 90 | } 91 | 92 | // Reset Admin Account 93 | 94 | if ( isset($_SESSION['admin_id']) && $_SESSION['id'] == $_SESSION['admin_id'] ) 95 | { 96 | $_SESSION['username'] = $_SESSION['username']; 97 | $_SESSION['type']=$_SESSION['admin_type']; 98 | $_SESSION['dbname']=$_SESSION['admin_dbname']; 99 | $_SESSION['notes']=''; 100 | } 101 | 102 | // Reset Delegated Account 103 | 104 | if ( isset($_SESSION['delegated_id']) && $_SESSION['id'] == $_SESSION['delegated_id'] ) 105 | { 106 | $_SESSION['username'] = $_SESSION['username']; 107 | $_SESSION['type']=$_SESSION['delegated_type']; 108 | $_SESSION['dbname']=$_SESSION['delegated_dbname']; 109 | $_SESSION['notes']=''; 110 | } 111 | 112 | // Switch to active Profile 113 | 114 | $stmt = $conn->prepare("SELECT current_profile_no FROM humans WHERE id = ?"); 115 | $stmt->bind_param("s", $_SESSION['id']); 116 | $stmt->execute(); 117 | $result = $stmt->get_result(); 118 | while ($row = $result->fetch_assoc()) { 119 | $_SESSION['profile'] = $row['current_profile_no']; 120 | } 121 | $stmt->close(); 122 | 123 | header("Location: $redirect_url"); 124 | 125 | ?> 126 | -------------------------------------------------------------------------------- /pages/display/manage_roles.php: -------------------------------------------------------------------------------- 1 | '; 4 | echo ''.i8ln("Role Management").''; 5 | echo ''; 6 | 7 | #$roles = @file_get_contents("roles.json", false); 8 | $roles= @file_get_contents("$api_address/api/humans/".$_SESSION['id']."/roles", false, $context); 9 | $json = json_decode($roles, true); 10 | 11 | if ( count($json) == 0 ) { 12 | echo ''; 15 | } 16 | else { 17 | 18 | ?> 19 | 20 |
    21 |
    22 | 37 |
    38 |
    39 |
    40 | 41 | $value) { 46 | if ( $value['name'] == $_SESSION['guild'] ) { 47 | foreach ($value['roles']['exclusive'] as $key => $value) { 48 | echo "
    "; 49 | echo "
    "; 50 | echo "
    "; 51 | echo "

    ".i8ln("Select Max 1 option")."

    "; 52 | $exclusive_id = $key; 53 | foreach ($value as $key => $value) { 54 | if ( $value['set'] == "True" ) { 55 | echo ""; 56 | echo ""; 57 | echo ""; 58 | } else { 59 | echo ""; 60 | echo ""; 61 | echo ""; 62 | } 63 | } 64 | echo "
    "; 65 | echo "
    "; 66 | echo "
    "; 67 | } 68 | } 69 | } 70 | 71 | // General 72 | 73 | 74 | foreach ($json['guilds'] as $key => $value) { 75 | if ( $value['name'] == $_SESSION['guild'] ) { 76 | if (count($value['roles']['general']) > 0 ) { 77 | echo "
    "; 78 | echo "
    "; 79 | echo "
    "; 80 | echo "

    ".i8ln("Select multiple options")."

    "; 81 | foreach ($value['roles']['general'] as $key => $value) { 82 | if ( $value['set'] == "True" ) { 83 | echo ""; 84 | echo ""; 85 | echo ""; 86 | } else { 87 | echo ""; 88 | echo ""; 89 | echo ""; 90 | } 91 | } 92 | print_r($value['roles']['general']); 93 | echo "
    "; 94 | echo "
    "; 95 | echo "
    "; 96 | } 97 | } 98 | } 99 | 100 | } 101 | 102 | ?> 103 | -------------------------------------------------------------------------------- /modal/edit_lures_modal.php: -------------------------------------------------------------------------------- 1 | 5 | "; 6 | 7 | echo "
    "; 8 | if ($row['lure_id'] == "0") { 9 | echo "".i8ln("ALL")."
    "; 10 | } else { 11 | echo "
    "; 12 | echo "
    ".i8ln(get_lure_name($row['lure_id']))."
    "; 13 | } 14 | echo "
    "; 15 | 16 | ?> 17 | 18 | 84 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /pages/display/profiles.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 | 5 | 6 | "True") { ?> 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 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 1 ) { ?> 57 | 58 | 59 | 60 | 61 | 62 | 63 |
    64 |
    65 |
    66 |
    67 |
    68 | 69 | 70 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /discord_auth.php: -------------------------------------------------------------------------------- 1 | OAUTH2_CLIENT_ID, 27 | 'redirect_uri' => $redirect_url."/discord_auth.php", 28 | 'response_type' => 'code', 29 | 'scope' => 'identify guilds' 30 | ); 31 | 32 | // Redirect the user to Discord's authorization page 33 | header('Location: https://discordapp.com/api/oauth2/authorize' . '?' . http_build_query($params)); 34 | die(); 35 | } 36 | 37 | 38 | // When Discord redirects the user back here, there will be a "code" and "state" parameter in the query string 39 | if(get('code')) { 40 | 41 | // Exchange the auth code for a token 42 | $token = apiRequest($tokenURL, array( 43 | "grant_type" => "authorization_code", 44 | 'client_id' => OAUTH2_CLIENT_ID, 45 | 'client_secret' => OAUTH2_CLIENT_SECRET, 46 | 'redirect_uri' => $redirect_url."/discord_auth.php", 47 | 'code' => get('code') 48 | )); 49 | $logout_token = $token->access_token; 50 | $_SESSION['access_token'] = $token->access_token; 51 | 52 | 53 | header('Location: ' . $_SERVER['PHP_SELF']); 54 | } 55 | 56 | if(session('access_token')) { 57 | $user = apiRequest($apiURLBase); 58 | 59 | $_SESSION['username']=$user->username; 60 | $_SESSION['type']="discord:user"; 61 | $_SESSION['id']=$user->id; 62 | $_SESSION['avatar_id']=$user->avatar; 63 | $_SESSION['avatar'] = "https://cdn.discordapp.com/avatars/" . $_SESSION['id'] . "/" . $_SESSION['avatar_id'] . ".png"; 64 | 65 | include_once "./session.php"; 66 | 67 | if (isset($no_api) && $no_api == "True") 68 | { 69 | header("Location: $redirect_url?type=display&page=server_settings"); 70 | } 71 | else if ( version_compare($_SESSION['poracleVersion'], $min_poracle_version) < 0 ) 72 | { 73 | header("Location: $redirect_url?type=display&page=server_settings"); 74 | } 75 | else 76 | { 77 | header("Location: $redirect_url"); 78 | } 79 | 80 | } else { 81 | echo '

    Not logged in

    '; 82 | echo '

    Log In

    '; 83 | } 84 | 85 | 86 | if(get('action') == 'logout') { 87 | // This must to logout you, but it didn't worked( 88 | 89 | $params = array( 90 | 'access_token' => $logout_token 91 | ); 92 | 93 | // Redirect the user to Discord's revoke page 94 | header('Location: https://discordapp.com/api/oauth2/token/revoke' . '?' . http_build_query($params)); 95 | die(); 96 | } 97 | 98 | function apiRequest($url, $post=FALSE, $headers=array()) { 99 | $ch = curl_init($url); 100 | curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); 101 | curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); 102 | 103 | $response = curl_exec($ch); 104 | 105 | 106 | if($post) 107 | curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); 108 | 109 | $headers[] = 'Accept: application/json'; 110 | 111 | if(session('access_token')) 112 | $headers[] = 'Authorization: Bearer ' . session('access_token'); 113 | 114 | curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 115 | 116 | $response = curl_exec($ch); 117 | return json_decode($response); 118 | } 119 | 120 | function get($key, $default=NULL) { 121 | return array_key_exists($key, $_GET) ? $_GET[$key] : $default; 122 | } 123 | 124 | function session($key, $default=NULL) { 125 | return array_key_exists($key, $_SESSION) ? $_SESSION[$key] : $default; 126 | } 127 | -------------------------------------------------------------------------------- /actions/set_location.php: -------------------------------------------------------------------------------- 1 | prepare("UPDATE monsters set distance = 0 WHERE id = ? AND profile_no = ?"); 14 | $stmt->bind_param("si", $_SESSION['id'], $_SESSION['profile']); 15 | $stmt->execute(); 16 | $stmt->close(); 17 | $stmt = $conn->prepare("UPDATE raid set distance = 0 WHERE id = ? AND profile_no = ?"); 18 | $stmt->bind_param("si", $_SESSION['id'], $_SESSION['profile']); 19 | $stmt->execute(); 20 | $stmt->close(); 21 | $stmt = $conn->prepare("UPDATE egg set distance = 0 WHERE id = ? AND profile_no = ?"); 22 | $stmt->bind_param("si", $_SESSION['id'], $_SESSION['profile']); 23 | $stmt->execute(); 24 | $stmt->close(); 25 | $stmt = $conn->prepare("UPDATE quest set distance = 0 WHERE id = ? AND profile_no = ?"); 26 | $stmt->bind_param("si", $_SESSION['id'], $_SESSION['profile']); 27 | $stmt->execute(); 28 | $stmt->close(); 29 | $stmt = $conn->prepare("UPDATE invasion set distance = 0 WHERE id = ? AND profile_no = ?"); 30 | $stmt->bind_param("si", $_SESSION['id'], $_SESSION['profile']); 31 | $stmt->execute(); 32 | $stmt->close(); 33 | 34 | } else if ( isset($_GET['lat']) && isset($_GET['lon']) ) { 35 | 36 | $lat = $_GET['lat']; 37 | $lon = $_GET['lon']; 38 | 39 | } else { 40 | 41 | $street = str_replace(" ", "%20", $_POST['street']); 42 | $city = str_replace(" ", "%20", $_POST['city']); 43 | 44 | $filepath=$_SESSION['providerURL']."/?addressdetails=1&q=".$street."%20".$city."&format=json&limit=1"; 45 | if ( strlen($_SESSION['staticKey']) == 32 ) { 46 | $filepath.="&key=".$_SESSION['staticKey']; 47 | } 48 | 49 | $request = file_get_contents($filepath); 50 | 51 | if ( $request == "[]" ) { 52 | header("Location: $redirect_url?type=display&page=area&return=error_update_location"); 53 | exit(); 54 | } 55 | 56 | $json = json_decode($request, true); 57 | 58 | foreach ($json as $key => $value) { 59 | foreach ($value as $key => $value2) { 60 | if ($key == "lat") { $lat = $value2; } 61 | if ($key == "lon") { $lon = $value2; } 62 | } 63 | } 64 | 65 | } 66 | 67 | // Update Lat and Lon from Humans if current profile is active 68 | 69 | $stmt = $conn->prepare("UPDATE humans set latitude = ?, longitude = ? WHERE id = ? AND current_profile_no = ?"); 70 | if (false === $stmt) { 71 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=ESLH1&sql=$stmt->error"); 72 | exit(); 73 | } 74 | $rs = $stmt->bind_param("sssi", $lat, $lon, $_SESSION['id'], $_SESSION['profile']); 75 | if (false === $rs) { 76 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=ESLH2&sql=$stmt->error"); 77 | exit(); 78 | } 79 | $rs = $stmt->execute(); 80 | if (false === $rs) { 81 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=ESLH3&sql=$stmt->error"); 82 | exit(); 83 | } 84 | 85 | // Update Lat and Lon from Profile if exist 86 | 87 | $stmt = $conn->prepare("UPDATE profiles set latitude = ?, longitude = ? WHERE id = ? AND profile_no = ?"); 88 | if (false === $stmt) { 89 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=ESLP1&sql=$stmt->error"); 90 | exit(); 91 | } 92 | $rs = $stmt->bind_param("sssi", $lat, $lon, $_SESSION['id'], $_SESSION['profile']); 93 | if (false === $rs) { 94 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=ESLP2&sql=$stmt->error"); 95 | exit(); 96 | } 97 | $rs = $stmt->execute(); 98 | if (false === $rs) { 99 | header("Location: $redirect_url?type=display&page=area&return=sql_error&phase=ESLP3&sql=$stmt->error"); 100 | exit(); 101 | } 102 | 103 | 104 | if ( isset($_POST['delete']) ) { 105 | header("Location: $redirect_url?type=display&page=area&return=success_delete_location"); 106 | exit(); 107 | } else { 108 | header("Location: $redirect_url?type=display&page=area&return=success_update_location"); 109 | exit(); 110 | } 111 | 112 | 113 | ?> 114 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PoracleWeb 2 | 3 | 4 | [![Contributors][contributors-shield]][contributors-url] 5 | [![Forks][forks-shield]][forks-url] 6 | [![Stargazers][stars-shield]][stars-url] 7 | [![Issues][issues-shield]][issues-url] 8 | 9 | --- 10 | 11 | REQUIRES MYSQL ! 12 | 13 | This tool is an add-on to [PoracleJS](https://github.com/KartulUdus/PoracleJS) 14 | 15 | It requires a working webserver (typically Apache or nginx) + PHP. 16 | Alternatively it can be run out of Docker (Dockerfile is provided). 17 | 18 | --- 19 | 20 | **PoracleWeb handles:** 21 | - [x] Monsters 22 | - [x] Raids & Eggs 23 | - [x] Quests 24 | - [x] Invasions 25 | - [x] Lures 26 | - [x] Nests 27 | 28 | Any other suggestions are welcome, please use [GitHub Issues][issues-url] for your suggestions. 29 | 30 | --- 31 | 32 | ### Prerequisites 33 | 34 | * [NodeJS & NPM](https://nodejs.org/en/download/) 35 | * [Composer](https://getcomposer.org/download/) 36 | 37 | --- 38 | 39 | ### Installation 40 | 41 | 1. Clone the repo 42 | ```sh 43 | git clone https://github.com/bbdoc/PoracleWeb.git 44 | ``` 45 | 2. Install NPM packages 46 | ```sh 47 | npm install 48 | ``` 49 | 3. Copy `config_example.php` to `config.php` and adapt to your needs 50 | 4. Have a Web Server pointing to your install directory (This tool doesn't include any standalone WebServer) 51 | 52 | 5. You will need to configure your some basic settings in config.php: 53 | - Access Parameters to your Poracle DB 54 | - Admin ID. From discord, right click on your avatar and use "Copy ID". This defines the ID of the administrator who will be able to perform further configuration tasks. 55 | - Discord Bot. If you use PMSF, you can reuse the same parameters for `discordBotClientId` and `discordBotClientSecret` or find them on the [Discord application Portal](https://discord.com/developers/applications). `redirect_url` should point to your PoracleWeb base directory and should be configured as a Redirects in your Discord bot. 56 | 57 | For those parameters go to : 58 | - [Discord application Portal](https://discord.com/developers/applications) 59 | - Select your Bot (or create a new one). 60 | - Go to OAuth2 and add your `https://yourdomain.com/discord_auth.php` (`https://yourdomain.com`) being your `redirect_url` 61 | - Client ID can be found under "General Information" 62 | - Client Secret can be found under "General Information" by clicking the "Click to reveal" link.A 63 | 64 | 6. Go to your PoracleWeb site and head to Admin Tools / Server Settings for additional configuration steps and parameters. You need to be logged in as an admin (as defined by `admin_id` par 65 | ameter to be able to access this page. 66 | 67 | 68 | ### Setting Up Telegram Authentication 69 | 70 | You can enable Telegram authentication from the Server Settings page. You'll need to indicate a Bot Name for it to work. 71 | 72 | This means you first need to [create a bot] (https://core.telegram.org/bots#3-how-do-i-create-a-bot) 73 | Once you have chosen/created a bot, send the /setdomain command to @Botfather to link your website's domain to the bot. 74 | 75 | --- 76 | 77 | ## Contributing 78 | 79 | 1. Fork the Project 80 | 2. Clone your forked project 81 | ```sh 82 | git clone https://github.com/YourUserName/PoracleWeb.git 83 | ``` 84 | 3. Create your New Feature branch (`git checkout -b new_feature`) 85 | 4. Create a new remote for the upstream repo with the command: 86 | ```sh 87 | git remote add upstream https://github.com/bbdoc/PoracleWeb 88 | ``` 89 | 3. Commit your Changes 90 | ```sh 91 | git commit -m 'Add some New Feature' 92 | ``` 93 | 4. Push to the Branch 94 | ```sh 95 | git push origin new_feature 96 | ``` 97 | 98 | [contributors-shield]: https://img.shields.io/github/contributors/bbdoc/PoracleWeb.svg?style=for-the-badge 99 | [contributors-url]: https://github.com/bbdoc/PoracleWeb/graphs/contributors 100 | [forks-shield]: https://img.shields.io/github/forks/bbdoc/PoracleWeb.svg?style=for-the-badge 101 | [forks-url]: https://github.com/bbdoc/PoracleWeb/network/members 102 | [stars-shield]: https://img.shields.io/github/stars/bbdoc/PoracleWeb.svg?style=for-the-badge 103 | [stars-url]: https://github.com/bbdoc/PoracleWeb/stargazers 104 | [issues-shield]: https://img.shields.io/github/issues/bbdoc/PoracleWeb.svg?style=for-the-badge 105 | [issues-url]: https://github.com/bbdoc/PoracleWeb/issues 106 | -------------------------------------------------------------------------------- /include/db_mad.php: -------------------------------------------------------------------------------- 1 | 0 AND quest_reward_type = 7 order by quest_pokemon_id;"; 12 | $result = $scan_conn->query($sql); 13 | 14 | $mons=array(); 15 | while($row = $result->fetch_assoc()) { 16 | array_push($mons, $row['id']."_".$row['form']); 17 | } 18 | 19 | if (isset($additional_quest_mons) && !empty($additional_quest_mons)) { 20 | $add_mons = explode(",", $additional_quest_mons); 21 | foreach ($add_mons as &$mon) { 22 | array_push($mons, $mon); 23 | } 24 | } 25 | 26 | $mons=array_unique($mons); 27 | sort($mons); 28 | return $mons; 29 | 30 | } 31 | 32 | function get_gym_list() { 33 | 34 | global $scan_conn; 35 | $sql = "SELECT gym_id, name FROM gymdetails WHERE name IS NOT NULL ORDER BY name;"; 36 | $result = $scan_conn->query($sql); 37 | 38 | $gyms=array(); 39 | while($row = $result->fetch_assoc()) { 40 | array_push($gyms, $row['gym_id']."_".$row['name']); 41 | } 42 | 43 | return $gyms; 44 | 45 | } 46 | 47 | function get_quest_items() { 48 | 49 | global $scan_conn; 50 | $sql = "SELECT distinct quest_item_id id FROM trs_quest WHERE quest_item_id > 0 order by quest_item_id;"; 51 | $result = $scan_conn->query($sql); 52 | 53 | $items=array(); 54 | while($row = $result->fetch_assoc()) { 55 | array_push($items, $row['id']); 56 | } 57 | 58 | return $items; 59 | 60 | } 61 | 62 | function get_quest_energy() { 63 | 64 | global $scan_conn; 65 | $sql = "SELECT distinct(quest_pokemon_id) id FROM trs_quest WHERE quest_reward_type = 12 ORDER BY quest_pokemon_id;"; 66 | $result = $scan_conn->query($sql); 67 | 68 | $mons=array(); 69 | while($row = $result->fetch_assoc()) { 70 | array_push($mons, $row['id']); 71 | } 72 | 73 | return $mons; 74 | 75 | } 76 | 77 | function get_quest_candy() { 78 | 79 | global $scan_conn; 80 | $sql = "SELECT distinct(quest_pokemon_id) id FROM trs_quest WHERE quest_reward_type = 4 ORDER BY quest_pokemon_id;"; 81 | $result = $scan_conn->query($sql); 82 | 83 | $mons=array(); 84 | while($row = $result->fetch_assoc()) { 85 | array_push($mons, $row['id']); 86 | } 87 | 88 | return $mons; 89 | 90 | } 91 | 92 | 93 | function get_raid_bosses() { 94 | 95 | global $scan_conn; 96 | $sql = "SELECT level, pokemon_id, form, evolution, costume FROM raid 97 | WHERE pokemon_id is not null and last_scanned > now() - INTERVAL 1 DAY 98 | GROUP BY level, pokemon_id, form, evolution, costume ORDER BY level, pokemon_id;"; 99 | $result = $scan_conn->query($sql); 100 | 101 | $bosses=array(); 102 | while($row = $result->fetch_assoc()) { 103 | $pokemon_id=$row['pokemon_id']; 104 | $form=$row['form']; 105 | $costume=$row['costume']; 106 | $evolution=$row['evolution']; 107 | if ( $evolution <> '0' ) { $boss = $pokemon_id."_".$form."_".$evolution; } 108 | else { $boss = $pokemon_id."_".$form."_".$costume; } 109 | array_push($bosses, $boss); 110 | } 111 | 112 | return $bosses; 113 | 114 | } 115 | 116 | function get_gym_by_id($id) { 117 | 118 | global $scan_conn; 119 | $stmt = $scan_conn->prepare("SELECT name from gymdetails where gym_id = ?"); 120 | $stmt->bind_param("s", $id); 121 | $stmt->execute(); 122 | $result = $stmt->get_result(); 123 | 124 | while($row = $result->fetch_assoc()) { 125 | $gym_name = $row['name']; 126 | } 127 | $stmt->close(); 128 | 129 | return $gym_name; 130 | 131 | } 132 | 133 | function get_gym_url($id) { 134 | 135 | global $scan_conn; 136 | $stmt = $scan_conn->prepare("SELECT url from gymdetails where gym_id = ?"); 137 | $stmt->bind_param("s", $id); 138 | $stmt->execute(); 139 | $result = $stmt->get_result(); 140 | 141 | while($row = $result->fetch_assoc()) { 142 | $gym_url = $row['url']; 143 | } 144 | $stmt->close(); 145 | 146 | return $gym_url; 147 | 148 | } 149 | 150 | -------------------------------------------------------------------------------- /unregistered.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | <?php echo $title; ?> - <?php echo i8ln("NOT REGISTERED");?> 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | 27 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
    37 | 38 | 39 |
    40 | 41 | 42 |
    43 | 44 | 45 | 74 | 75 | 76 | 77 |
    78 | 79 | 82 |

    83 | .

    84 | 85 |
    86 | 87 |
    88 | 89 | 90 |
    91 | 92 | 93 |
    94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /modal/areas_modal.php: -------------------------------------------------------------------------------- 1 | prepare("SELECT area FROM humans WHERE id = ?"); 7 | $stmt->bind_param("s", $_SESSION['id']); 8 | } 9 | else { 10 | $stmt = $conn->prepare("SELECT area FROM profiles WHERE id = ? AND profile_no = ?"); 11 | $stmt->bind_param("si", $_SESSION['id'], $_SESSION['profile']); 12 | } 13 | 14 | $stmt->execute(); 15 | $result = $stmt->get_result(); 16 | 17 | while ($row = $result->fetch_assoc()) { 18 | $existing_area = $row['area']; 19 | $existing_area = json_decode($row['area']); 20 | } 21 | $stmt->close(); 22 | 23 | echo " 24 |
    25 |
    26 | "; 27 | 28 | 29 | echo "\n"; 30 | $areas = get_areas(); 31 | 32 | $collapsedState = 'collapsed'; 33 | 34 | // Show no accordions when there is only one list of areas (likely a user with no grouping) 35 | if(count(array_keys($areas)) === 1){ 36 | $collapsedState = ''; 37 | $areaList = $areas[array_keys($areas)[0]]; 38 | echo "
      \n"; 39 | sort($areaList); 40 | foreach ($areaList as $i => $area) { 41 | $area_var = str_replace(' ', '%20', $area); 42 | $hash = $geo_hash[$area]; 43 | 44 | if (in_array(strtolower($area), $existing_area)) { 45 | $checked = 'checked'; 46 | } else { 47 | $checked = ''; 48 | }; 49 | echo "
    • \n"; 50 | echo "\n"; 56 | echo "
    • \n"; 57 | } 58 | 59 | } else { 60 | echo "
      "; 61 | 62 | foreach ($areas as $group => $areaList) { 63 | // Check if $group is empty or null, and set the default text accordingly 64 | $buttonText = !empty($group) ? $group : "No group"; 65 | $updatedGroup = str_replace(' ', '_', $group); 66 | 67 | echo "
      68 |
      69 |
      70 | 73 |
      74 |
      75 | 76 |
      77 |
      "; 78 | sort($areaList); 79 | echo "
        \n"; 80 | foreach ($areaList as $i => $area) { 81 | $area_var = str_replace(' ', '%20', $area); 82 | $hash = $geo_hash[$area]; 83 | 84 | if (in_array(strtolower($area), $existing_area)) { 85 | $checked = 'checked'; 86 | } else { 87 | $checked = ''; 88 | }; 89 | echo "
      • \n"; 90 | echo "\n"; 96 | echo "
      • \n"; 97 | } 98 | echo "
      \n
      "; 99 | echo "
      "; 100 | echo "
      "; 101 | } 102 | echo "
      "; 103 | } 104 | echo " 105 |
      106 |
      107 | 108 | 109 | 110 |
      111 | 112 |
    113 | "; 114 | -------------------------------------------------------------------------------- /modal/edit_quests_modal.php: -------------------------------------------------------------------------------- 1 | 5 | "; 6 | 7 | echo "
    "; 8 | if ( $row['reward_type'] == "7") { 9 | if ($row['form'] <> 0 ) { $addform = "_f".$row['form']; } else { $addform = ""; } 10 | echo "
    "; 11 | } elseif ( $row['reward_type'] == "2") { 12 | echo "
    "; 13 | } elseif ( $row['reward_type'] == "12") { 14 | echo "
    "; 15 | } elseif ( $row['reward_type'] == "4") { 16 | echo ""; 17 | if ( $row['reward'] <> 0 ) { 18 | echo ""; 19 | } 20 | echo "
    "; 21 | } 22 | echo "
    "; 23 | 24 | ?> 25 | 26 | 92 | 103 | 104 | 105 | -------------------------------------------------------------------------------- /include/db_rdm.php: -------------------------------------------------------------------------------- 1 | 0 AND quest_reward_type = 7 order by quest_pokemon_id;"; 13 | $result = $scan_conn->query($sql); 14 | 15 | $mons=array(); 16 | while($row = $result->fetch_assoc()) { 17 | array_push($mons, $row['id']."_".$row['form']); 18 | } 19 | 20 | if (isset($additional_quest_mons) && !empty($additional_quest_mons)) { 21 | $add_mons = explode(",", $additional_quest_mons); 22 | foreach ($add_mons as &$mon) { 23 | array_push($mons, $mon); 24 | } 25 | } 26 | 27 | $mons=array_unique($mons); 28 | sort($mons); 29 | return $mons; 30 | 31 | } 32 | 33 | function get_gym_list() { 34 | 35 | global $scan_conn; 36 | $sql = "SELECT id, name FROM gym WHERE name IS NOT NULL ORDER BY name;"; 37 | $result = $scan_conn->query($sql); 38 | 39 | $gyms=array(); 40 | while($row = $result->fetch_assoc()) { 41 | array_push($gyms, $row['id']."_".$row['name']); 42 | } 43 | 44 | return $gyms; 45 | 46 | } 47 | 48 | function get_quest_items() { 49 | 50 | global $scan_conn; 51 | $sql = "SELECT distinct quest_item_id id FROM pokestop WHERE quest_item_id > 0 order by quest_item_id;"; 52 | $result = $scan_conn->query($sql); 53 | 54 | $items=array(); 55 | while($row = $result->fetch_assoc()) { 56 | array_push($items, $row['id']); 57 | } 58 | 59 | return $items; 60 | 61 | } 62 | 63 | function get_quest_energy() { 64 | 65 | global $scan_conn; 66 | $sql = "SELECT distinct json_extract(json_extract(`quest_rewards`,'$[*].info.pokemon_id'),'$[0]') AS id 67 | FROM pokestop WHERE quest_reward_type = 12;"; 68 | $result = $scan_conn->query($sql); 69 | 70 | $mons=array(); 71 | while($row = $result->fetch_assoc()) { 72 | array_push($mons, $row['id']); 73 | } 74 | 75 | return $mons; 76 | 77 | } 78 | 79 | function get_quest_candy() { 80 | 81 | global $scan_conn; 82 | $sql = "SELECT distinct json_extract(json_extract(`quest_rewards`,'$[*].info.pokemon_id'),'$[0]') AS id 83 | FROM pokestop WHERE quest_reward_type = 4;"; 84 | $result = $scan_conn->query($sql); 85 | 86 | $mons=array(); 87 | while($row = $result->fetch_assoc()) { 88 | array_push($mons, $row['id']); 89 | } 90 | 91 | return $mons; 92 | 93 | } 94 | 95 | 96 | function get_raid_bosses() { 97 | 98 | global $scan_conn; 99 | $sql = "SELECT raid_level, raid_pokemon_id, raid_pokemon_form, raid_pokemon_evolution, raid_pokemon_costume FROM gym 100 | WHERE raid_pokemon_id <> 0 AND raid_end_timestamp > UNIX_TIMESTAMP(DATE_SUB(now(), INTERVAL 1 DAY)) 101 | GROUP BY raid_level, raid_pokemon_id, raid_pokemon_form, raid_pokemon_evolution, raid_pokemon_costume ORDER BY raid_level, raid_pokemon_id;"; 102 | $result = $scan_conn->query($sql); 103 | 104 | $bosses=array(); 105 | while($row = $result->fetch_assoc()) { 106 | $pokemon_id=$row['raid_pokemon_id']; 107 | $form=$row['raid_pokemon_form']; 108 | $costume=$row['raid_pokemon_costume']; 109 | $evolution=$row['raid_pokemon_evolution']; 110 | if ( $evolution <> '0' ) { $boss = $pokemon_id."_".$form."_".$evolution; } 111 | else { $boss = $pokemon_id."_".$form."_".$costume; } 112 | array_push($bosses, $boss); 113 | } 114 | 115 | return $bosses; 116 | 117 | } 118 | 119 | function get_gym_by_id($id) { 120 | 121 | global $scan_conn; 122 | $stmt = $scan_conn->prepare("SELECT name from gym where id = ?"); 123 | $stmt->bind_param("s", $id); 124 | $stmt->execute(); 125 | $result = $stmt->get_result(); 126 | 127 | while($row = $result->fetch_assoc()) { 128 | $gym_name = $row['name']; 129 | } 130 | $stmt->close(); 131 | 132 | return $gym_name; 133 | 134 | } 135 | 136 | function get_gym_url($id) { 137 | 138 | global $scan_conn; 139 | $stmt = $scan_conn->prepare("SELECT url from gym where id = ?"); 140 | $stmt->bind_param("s", $id); 141 | $stmt->execute(); 142 | $result = $stmt->get_result(); 143 | 144 | while($row = $result->fetch_assoc()) { 145 | $gym_url = $row['url']; 146 | } 147 | $stmt->close(); 148 | 149 | return $gym_url; 150 | 151 | } 152 | 153 | -------------------------------------------------------------------------------- /modal/edit_raids_modal.php: -------------------------------------------------------------------------------- 1 | 5 | "; 6 | 7 | echo "
    "; 8 | if ($row['level'] == "9000") { 9 | echo ""; 10 | } else { 11 | echo ""; 12 | } 13 | 14 | if ( !is_null($row['gym_id']) ) { 15 | echo ""; 16 | } 17 | 18 | echo "
    "; 19 | if ( $row['level'] <> 90 && $row['level'] <> 9000) { 20 | echo i8ln("Raids")." ".$row['level']; 21 | } else if ( $row['level'] == 9000 ) { 22 | echo i8ln("Raids")." ".$pokemon_name." ".$form_name; 23 | } else { 24 | echo i8ln("All Raids"); 25 | } 26 | 27 | echo "
    "; 28 | 29 | echo "
    "; 30 | 31 | ?> 32 | 33 | 105 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /modal/edit_eggs_modal.php: -------------------------------------------------------------------------------- 1 | 5 | "; 6 | 7 | echo "
    "; 8 | 9 | if ( $row['level'] == 90 ) { 10 | echo ""; 11 | echo ""; 12 | echo ""; 13 | echo ""; 14 | } else { 15 | echo ""; 16 | } 17 | 18 | if ( !is_null($row['gym_id']) ) { 19 | echo '
    '; 20 | } 21 | 22 | echo "
    "; 23 | if ( $row['level'] <> 90 ) { 24 | echo i8ln("Eggs Level")." " . $row['level']; 25 | } else { 26 | echo i8ln("All Eggs"); 27 | } 28 | echo "
    "; 29 | echo "
    "; 30 | 31 | ?> 32 | 33 | 107 | 118 | 119 | 120 | -------------------------------------------------------------------------------- /pages/display/manage_users.php: -------------------------------------------------------------------------------- 1 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | $_SESSION['id']) { ?> 25 | 26 |
    27 |
    28 | 29 | 32 | 33 |
    34 | 35 | $_SESSION['id']) { ?> 36 | 37 |
    38 |
    39 | 40 | 43 | 44 |
    45 | 46 | 47 | 48 | 49 | 50 | 51 |
    52 |
    53 |
    54 | 56 |
    57 |
    58 | 60 |
    61 |
    62 | 63 | 64 | 65 | "True" ) { 68 | 69 | $dbnames = explode(",", $dbname); 70 | foreach ($dbnames as &$db) { 71 | 72 | // Get Discord Users 73 | 74 | $conn = new mysqli($dbhost.":".$dbport, $dbuser, $dbpass, $db); 75 | $sql = "select id, name, type FROM humans WHERE type like 'discord:user' ORDER by type,name"; 76 | $result = $conn->query($sql); 77 | ?> 78 | 79 | num_rows <> 0) { ?> 80 | 81 |
    82 | 83 | 84 |
    85 |
    86 | 90 |
    91 |
    92 | 93 |
    94 | 95 | fetch_assoc()) { ?> 96 | btn-icon-split m-1"> 98 | 99 | 100 | 101 | 102 | 103 |
    104 | 105 | query($sql); 112 | ?> 113 | 114 | num_rows <> 0) { ?> 115 | 116 |
    117 | 118 | 119 |
    120 |
    121 | 125 |
    126 |
    127 | 128 |
    129 | 130 | fetch_assoc()) { ?> 131 | btn-icon-split m-1"> 133 | 134 | 135 | 136 | 137 | 138 |
    139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /modal/edit_nests_modal.php: -------------------------------------------------------------------------------- 1 | 5 | "; 6 | 7 | echo "
    "; 8 | if ($row['pokemon_id'] == "0") { 9 | echo "".i8ln("ALL")."
    "; 10 | } else { 11 | if ($row['form'] <> 0 ) { $addform = "_f".$row['form']; } else { $addform = ""; } 12 | $PkmnImg = "$uicons_pkmn/pokemon/" . $row['pokemon_id'] . $addform . ".png"; 13 | echo "
    "; 14 | echo "
    ".i8ln(get_mons($row['pokemon_id']))."
    "; 15 | } 16 | echo "
    "; 17 | 18 | ?> 19 | 20 | 103 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | 19 | "; 25 | } 26 | ?> 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | <?php echo $title; ?> 35 | 36 | 37 | 38 | 39 | 40 | 43 | 44 | 45 | 46 | 47 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 |
    74 | 75 | 76 |
    77 | 78 | 79 |
    80 | 81 | 82 |
    83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
    93 | 94 |
    95 | 96 | 97 |
    98 | 99 | 100 |
    101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 135 | 136 | -------------------------------------------------------------------------------- /pages/display/migrate.php: -------------------------------------------------------------------------------- 1 | "True" ) { 6 | header("Location: $redirect_url"); 7 | exit(); 8 | } 9 | 10 | # Only Allow Migration if SESSION type is set to User 11 | 12 | if ( $_SESSION['type'] <> "discord:user" && $_SESSION['type'] <> "telegram:user") { 13 | header("Location: $redirect_url"); 14 | exit(); 15 | } 16 | 17 | ?> 18 | 19 | 20 | 21 | 26 |
    27 | 28 |
    29 | 30 | 31 | 32 |

    33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | prepare("SELECT * from humans WHERE id = ?"); 52 | $stmt->bind_param("s", $_GET['id']); 53 | $stmt->execute(); 54 | $stmt->store_result(); 55 | if ( $stmt->num_rows > 0 ) { 56 | ?> 57 | 58 |

    61 | 64 | 65 | 66 | 67 | 68 |

    69 | 70 | 78 | 79 |


    80 |

    !

    81 |

    82 | 83 | '> 84 | '> 85 | '> 86 | '> 87 | 88 |
    89 | 90 | 91 | 92 | close(); ?> 93 | 94 | 95 |
    96 |
    97 |

    98 | 104 | 105 | 106 | 107 | 108 | 109 |
    110 | . 111 | 112 | 113 | 114 | 115 |
    116 | 117 | -------------------------------------------------------------------------------- /include/toplinks.php: -------------------------------------------------------------------------------- 1 | 2 | prepare($sql); 25 | $stmt->bind_param("sisisisisisisisi", $user_id, $profile_id, $user_id, $profile_id, $user_id, $profile_id, $user_id, $profile_id, $user_id, $profile_id, $user_id, $profile_id, $user_id, $profile_id, $user_id, $profile_id); 26 | $stmt->execute(); 27 | $result = $stmt->get_result(); 28 | while ($row = $result->fetch_assoc()) { 29 | switch ($row['Type']) { 30 | case 'monsters': 31 | $num_mon_tracked = $row['Total']; 32 | break; 33 | case 'raid': 34 | $num_raid_tracked = $row['Total']; 35 | break; 36 | case 'egg': 37 | $num_raid_tracked += $row['Total']; 38 | break; 39 | case 'quest': 40 | $num_quest_tracked = $row['Total']; 41 | break; 42 | case 'invasion': 43 | $num_invasion_tracked = $row['Total']; 44 | break; 45 | case 'lures': 46 | $num_lure_tracked = $row['Total']; 47 | break; 48 | case 'nests': 49 | $num_nest_tracked = $row['Total']; 50 | break; 51 | case 'gym': 52 | $num_gym_tracked = $row['Total']; 53 | break; 54 | }; 55 | } 56 | $stmt->close(); 57 | 58 | ?> 59 | 60 | 61 | 62 | "True") { ?> 63 | 71 | 72 | "True") { ?> 73 | 81 | 82 | "True") { ?> 83 | 91 | 92 | "True") { ?> 93 | 101 | 102 | "True") { ?> 103 | 111 | 112 | "True") { ?> 113 | 121 | 122 | "True") { ?> 123 | 131 | 132 | 133 |
    64 | 65 | 69 | 70 | 74 | 75 | 79 | 80 | 84 | 85 | 89 | 90 | 94 | 95 | 99 | 100 | 104 | 105 | 109 | 110 | 114 | 115 | 119 | 120 | 124 | 125 | 129 | 130 |
    134 |
    135 | -------------------------------------------------------------------------------- /actions/channel_sync.php: -------------------------------------------------------------------------------- 1 | $value) { 9 | if (substr($key, 0, 7) == "target_") { 10 | $target = ltrim($key, 'target_'); 11 | $target_fields = explode("|", $target); 12 | $target_db=$target_fields[0]; 13 | $target_id=$target_fields[1]; 14 | $target_id=str_replace("_com", ".com", $target_id); 15 | 16 | // Database names cannot be parameterized in prepared statements (they are identifiers, not values) 17 | // so we use a whitelist to validate the database name before using string interpolation 18 | $allowed_dbs = explode(",", $dbname); 19 | if (!in_array($target_db, $allowed_dbs)) { 20 | die("Invalid database"); 21 | } 22 | 23 | // Delete All Previous Trackings 24 | $stmt = $conn->prepare("DELETE FROM ".$target_db.".monsters WHERE id = ?"); 25 | $rs = $stmt->bind_param("s", $target_id); 26 | $rs = $stmt->execute(); 27 | $stmt->close(); 28 | 29 | $stmt = $conn->prepare("DELETE FROM ".$target_db.".egg WHERE id = ?"); 30 | $rs = $stmt->bind_param("s", $target_id); 31 | $rs = $stmt->execute(); 32 | $stmt->close(); 33 | 34 | $stmt = $conn->prepare("DELETE FROM ".$target_db.".raid WHERE id = ?"); 35 | $rs = $stmt->bind_param("s", $target_id); 36 | $rs = $stmt->execute(); 37 | $stmt->close(); 38 | 39 | $stmt = $conn->prepare("DELETE FROM ".$target_db.".quest WHERE id = ?"); 40 | $rs = $stmt->bind_param("s", $target_id); 41 | $rs = $stmt->execute(); 42 | $stmt->close(); 43 | 44 | // Insert New Monsters Tracking 45 | 46 | $stmt = $conn->prepare("INSERT INTO ".$target_db.".monsters 47 | (id, ping, clean, pokemon_id, distance, 48 | min_iv, max_iv, 49 | min_cp, max_cp, 50 | min_level, max_level, 51 | atk, def, sta, 52 | template, min_weight, max_weight, form, max_atk, 53 | max_def, max_sta, gender, 54 | pvp_ranking_worst, pvp_ranking_best, pvp_ranking_min_cp, pvp_ranking_league, pvp_ranking_cap, 55 | profile_no, min_time, rarity, max_rarity, 56 | size, max_size 57 | ) 58 | SELECT REPLACE(id, ?, ? ), 59 | ping, clean, pokemon_id, distance, 60 | min_iv, max_iv, 61 | min_cp, max_cp, 62 | min_level, max_level, 63 | atk, def, sta, 64 | template, min_weight, max_weight, form, max_atk, 65 | max_def, max_sta, gender, 66 | pvp_ranking_worst, pvp_ranking_best, pvp_ranking_min_cp, pvp_ranking_league, pvp_ranking_cap, 67 | profile_no, min_time, rarity, max_rarity, 68 | size, max_size 69 | FROM monsters 70 | WHERE id = ? 71 | "); 72 | 73 | $rs = $stmt->bind_param("sss", $_SESSION['id'], $target_id, $_SESSION['id']); 74 | $rs = $stmt->execute(); 75 | $stmt->close(); 76 | 77 | // Insert New Eggs Tracking 78 | 79 | $stmt = $conn->prepare("INSERT INTO ".$target_db.".egg 80 | (id,ping, clean, exclusive, template, distance, team, level, profile_no) 81 | SELECT REPLACE(id, ?, ? ), 82 | ping, clean, exclusive, template, distance, team, level, profile_no 83 | FROM egg 84 | WHERE id = ? 85 | "); 86 | 87 | $rs = $stmt->bind_param("sss", $_SESSION['id'], $target_id, $_SESSION['id']); 88 | $rs = $stmt->execute(); 89 | $stmt->close(); 90 | 91 | // Insert New Raids Tracking 92 | 93 | $stmt = $conn->prepare("INSERT INTO ".$target_db.".raid 94 | (id, ping, clean, pokemon_id, exclusive, template, distance, team, level, form, profile_no) 95 | SELECT REPLACE(id, ?, ? ), 96 | ping, clean, pokemon_id, exclusive, template, distance, team, level, form, profile_no 97 | FROM raid 98 | WHERE id = ? 99 | "); 100 | 101 | $rs = $stmt->bind_param("sss", $_SESSION['id'], $target_id, $_SESSION['id']); 102 | $rs = $stmt->execute(); 103 | $stmt->close(); 104 | 105 | // Insert New Quests Tracking 106 | 107 | $stmt = $conn->prepare("INSERT INTO ".$target_db.".quest 108 | (id, ping, clean, reward, template, shiny, reward_type, distance, profile_no) 109 | SELECT REPLACE(id, ?, ? ), 110 | ping, clean, reward, template, shiny, reward_type, distance, profile_no 111 | FROM quest 112 | WHERE id = ? 113 | "); 114 | 115 | $rs = $stmt->bind_param("sss", $_SESSION['id'], $target_id, $_SESSION['id']); 116 | $rs = $stmt->execute(); 117 | $stmt->close(); 118 | 119 | } 120 | } 121 | 122 | header("Location: $redirect_url?return=success_channel_sync"); 123 | exit(); 124 | 125 | } 126 | 127 | include "./action_error.php"; 128 | 129 | -------------------------------------------------------------------------------- /modal/edit_invasions_modal.php: -------------------------------------------------------------------------------- 1 | 5 | "; 6 | 7 | echo "
    "; 8 | 9 | if ( $row['gender'] <> 0 ) { 10 | echo ""; 11 | } else { 12 | if ( isset($grunt_id_male) ) { 13 | echo ""; 14 | } 15 | if ( isset($grunt_id_female) ) { 16 | echo ""; 17 | } 18 | } 19 | 20 | 21 | echo "
    "; 22 | 23 | ?> 24 | 25 | 126 | 137 | 138 | 139 | -------------------------------------------------------------------------------- /login.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | <?php echo $title; ?> - Login 14 | 15 | 16 | 17 | 18 | 19 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 |
    31 | 32 | 35 | 41 | 44 | 45 | 48 | 54 | 57 | 58 | 61 | 67 | 70 | 71 | 74 | 80 | 83 | 84 | 85 |
    86 | 87 |
    88 | 89 |
    90 |
    91 | 92 |
    93 |
    94 |
    95 |
    96 |

    97 |
    98 |

    99 | 100 | 'False' ){ ?> 101 |

    102 | 103 | 104 | 105 | 106 | 107 | 108 |
    109 |

    110 | 116 | 117 |
    118 | 119 |
    120 |
    121 |
    122 |
    123 |
    124 | 125 |
    126 | 127 |
    128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /include/cache_handler.php: -------------------------------------------------------------------------------- 1 | array( 54 | 'method'=>"GET", 55 | 'header'=>"Accept-language: en\r\n" . 56 | "X-Poracle-Secret: $api_secret\r\n" 57 | ) 58 | ); 59 | $context = stream_context_create($opts); 60 | 61 | // Cache Monsters.json 62 | 63 | global $monsters_json; 64 | if (file_exists($file_monsters) && (filemtime($file_monsters) > (time() - 60 * 60 * $repo_MasterData_cache ))) { 65 | $monsters_json = file_get_contents($file_monsters); 66 | } else { 67 | $MasterData_json = file_get_contents($repo_MasterData); 68 | $json = json_decode($MasterData_json, true); 69 | $monsters_json = json_encode($json['monsters'],JSON_PRETTY_PRINT); 70 | file_put_contents($file_monsters, $monsters_json); 71 | } 72 | 73 | // Cache Items.json 74 | 75 | global $items_json; 76 | if (file_exists($file_items) && (filemtime($file_items) > (time() - 60 * 60 * $repo_MasterData_cache ))) { 77 | $items_json = file_get_contents($file_items); 78 | } else { 79 | $MasterData_json = file_get_contents($repo_MasterData); 80 | $json = json_decode($MasterData_json, true); 81 | $items_json = json_encode($json['items'],JSON_PRETTY_PRINT); 82 | file_put_contents($file_items, $items_json); 83 | } 84 | 85 | 86 | // Cache Util.json 87 | 88 | global $grunts_json; 89 | if (file_exists($file_grunts) && (filemtime($file_grunts) > (time() - 60 * 60 * $repo_poracle_cache ))) { 90 | $grunts_json = file_get_contents($file_grunts); 91 | 92 | } else { 93 | $grunts_api_json = file_get_contents("$api_address/api/masterdata/grunts", false, $context); 94 | $json = json_decode($grunts_api_json, true); 95 | $grunts_json = json_encode($json,JSON_PRETTY_PRINT); 96 | file_put_contents($file_grunts, $grunts_json); 97 | } 98 | 99 | // Cache raid-bosses.json 100 | 101 | global $bosses_json; 102 | if (file_exists($file_raid_bosses) && (filemtime($file_raid_bosses) > (time() - 60 * 60 * $repo_pogoinfo_cache ))) { 103 | $bosses_json = file_get_contents($file_raid_bosses); 104 | 105 | } else { 106 | #$bosses_json = file_get_contents($repo_pogoinfo."/info/raid-bosses.json"); 107 | $bosses_json = file_get_contents($repo_pogoinfo."/v2/active/raids.json"); 108 | file_put_contents($file_raid_bosses, $bosses_json); 109 | } 110 | 111 | // Cache nest_species.json 112 | 113 | global $nest_species_json; 114 | if (file_exists($file_nest_species) && (filemtime($file_nest_species) > (time() - 60 * 60 * $repo_pogoinfo_cache ))) { 115 | $nest_species_json = file_get_contents($file_nest_species); 116 | 117 | } else { 118 | $nest_species_json = file_get_contents($repo_pogoinfo."/v2/nests/species-ids.json"); 119 | file_put_contents($file_nest_species, $nest_species_json); 120 | } 121 | 122 | // Cache pokemonNames locale file 123 | 124 | global $localePkmnData_json; 125 | if (file_exists($file_localePkmnData) && (filemtime($file_localePkmnData) > (time() - 60 * 60 * $repo_locales_cache ))) { 126 | $localePkmnData_json = file_get_contents($file_localePkmnData); 127 | } else if ( @fopen($repo_locales."/pokemon_".$locale.".json", 'r') ) { 128 | $localePkmnData_json = file_get_contents($repo_locales."/pokemon_".$locale.".json"); 129 | file_put_contents($file_localePkmnData, $localePkmnData_json); 130 | } else if (isset($locale)) { 131 | $localePkmnData_json = file_get_contents($repo_locales."pokemon_en.json"); 132 | } 133 | 134 | // Cache FormsNames locale file 135 | 136 | global $localeFormsData_json; 137 | if (file_exists($file_localeFormsData) && (filemtime($file_localeFormsData) > (time() - 60 * 60 * $repo_locales_cache ))) { 138 | $localeFormsData_json = file_get_contents($file_localeFormsData); 139 | } else if ( @fopen($repo_locales."/forms_".$locale.".json", 'r') ) { 140 | $localeFormsData_json = file_get_contents($repo_locales."/forms_".$locale.".json"); 141 | file_put_contents($file_localeFormsData, $localeFormsData_json); 142 | } else if (isset($locale)) { 143 | $localeFormsData_json = file_get_contents($repo_locales."forms_en.json"); 144 | } 145 | 146 | 147 | // Cache itemNames locale file 148 | 149 | global $localeItemsData_json; 150 | if (file_exists($file_localeItemsData) && (filemtime($file_localeItemsData) > (time() - 60 * 60 * $repo_locales_cache ))) { 151 | $localeItemsData_json = file_get_contents($file_localeItemsData); 152 | } else if ( @fopen($repo_locales."/items_".$locale.".json", 'r') ) { 153 | $localeItemsData_json = file_get_contents($repo_locales."/items_".$locale.".json"); 154 | file_put_contents($file_localeItemsData, $localeItemsData_json); 155 | } else if (isset($locale)) { 156 | $localeItemsData_json = file_get_contents($repo_locales."items_en.json"); 157 | } 158 | 159 | 160 | ?> 161 | -------------------------------------------------------------------------------- /actions/lures.php: -------------------------------------------------------------------------------- 1 | $value) { 11 | if (substr($value, 0, 6) === "clean_") { 12 | $clean = ltrim($value, 'clean_'); 13 | } 14 | } 15 | $template = !empty($_POST['template']) ? $_POST['template'] : $_SESSION['defaultTemplateName']; 16 | 17 | $stmt = $conn->prepare(" 18 | UPDATE lures 19 | SET distance = ?, clean = ?, template = ?, ping = ? 20 | WHERE uid = ?"); 21 | 22 | if (false === $stmt) { 23 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=UL1&sql=$stmt->error"); 24 | exit(); 25 | } 26 | 27 | $rs = $stmt->bind_param( 28 | "iissi", 29 | $_POST['distance'], 30 | $clean, 31 | $template, 32 | $_POST['content'], 33 | $_POST['uid'] 34 | ); 35 | 36 | if (false === $rs) { 37 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=UL2&sql=$stmt->error"); 38 | exit(); 39 | } 40 | 41 | $rs = $stmt->execute(); 42 | 43 | if (false === $rs) { 44 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=UL3&sql=$stmt->error"); 45 | exit(); 46 | } 47 | 48 | $stmt->close(); 49 | header("Location: $redirect_url?type=display&page=lure&return=success_update_lure"); 50 | exit(); 51 | } 52 | 53 | 54 | // DELETE LURES 55 | 56 | if (isset($_POST['delete']) && isset($_POST['type']) && $_POST['type'] == 'lures') { 57 | 58 | $stmt = $conn->prepare(" 59 | DELETE FROM lures 60 | WHERE uid = ?"); 61 | 62 | if (false === $stmt) { 63 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=DL1&sql=$stmt->error"); 64 | exit(); 65 | } 66 | 67 | $rs = $stmt->bind_param( 68 | "i", 69 | $_POST['uid'] 70 | ); 71 | 72 | if (false === $rs) { 73 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=DL2&sql=$stmt->error"); 74 | exit(); 75 | } 76 | 77 | $rs = $stmt->execute(); 78 | 79 | if (false === $rs) { 80 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=DL3&sql=$stmt->error"); 81 | exit(); 82 | } 83 | 84 | $stmt->close(); 85 | header("Location: $redirect_url?type=display&page=lure&return=success_delete_lure"); 86 | exit(); 87 | } 88 | 89 | 90 | // ADD LURE 91 | 92 | if (isset($_POST['add_lures'])) { 93 | 94 | foreach ($_POST as $key => $value) { 95 | if (substr($value, 0, 6) === "clean_") { 96 | $clean = ltrim($value, 'clean_'); 97 | } 98 | } 99 | $template = !empty($_POST['template']) ? $_POST['template'] : $_SESSION['defaultTemplateName']; 100 | 101 | foreach ($_POST as $key => $value) { 102 | if (substr($key, 0, 5) === "lure_") { 103 | $lure = substr($key, 5); 104 | 105 | $stmt = $conn->prepare("INSERT INTO lures ( id, ping, clean, distance, template, lure_id, profile_no) 106 | VALUES ( ?, ?, ? , ?, ?, ?, ?)"); 107 | if (false === $stmt) { 108 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=AL1&sql=$stmt->error"); 109 | exit(); 110 | } 111 | $rs = $stmt->bind_param("ssiisii", $_SESSION['id'], $_POST['content'], $clean, $_POST['distance'], $template, $lure, $_SESSION['profile']); 112 | if (false === $rs) { 113 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=AL2&sql=$stmt->error"); 114 | exit(); 115 | } 116 | $rs = $stmt->execute(); 117 | if (false === $rs) { 118 | if ( stristr($stmt->error, "Duplicate") ) { 119 | header("Location: $redirect_url?type=display&page=lure&return=duplicate"); 120 | exit(); 121 | } 122 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=AL3&sql=$stmt->error"); 123 | exit(); 124 | } 125 | $stmt->close(); 126 | } 127 | } 128 | 129 | header("Location: $redirect_url?type=display&page=lure&return=success_added_lures"); 130 | exit(); 131 | } 132 | 133 | // DELETE ALL LURES 134 | 135 | if (isset($_GET['action']) && $_GET['action'] == 'delete_all_lures') { 136 | 137 | $stmt = $conn->prepare("DELETE FROM lures WHERE id = ? AND profile_no = ?"); 138 | if (false === $stmt) { 139 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=DAL1&sql=$stmt->error"); 140 | exit(); 141 | } 142 | $rs = $stmt->bind_param("si", $_SESSION['id'], $_SESSION['profile']); 143 | if (false === $rs) { 144 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=DAL2&sql=$stmt->error"); 145 | exit(); 146 | } 147 | $rs = $stmt->execute(); 148 | if (false === $rs) { 149 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=DAL3&sql=$stmt->error"); 150 | exit(); 151 | } 152 | $stmt->close(); 153 | 154 | header("Location: $redirect_url?type=display&page=lure&return=success_delete_lures"); 155 | exit(); 156 | } 157 | 158 | 159 | // UPDATE ALL LURES DISTANCE 160 | 161 | if (isset($_GET['action']) && $_GET['action'] == 'update_lures_distance') { 162 | 163 | $stmt = $conn->prepare("UPDATE lures set distance = ? WHERE id = ? AND profile_no = ?"); 164 | if (false === $stmt) { 165 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=ULD1&sql=$stmt->error"); 166 | exit(); 167 | } 168 | $rs = $stmt->bind_param("isi", $_POST['distance'], $_SESSION['id'], $_SESSION['profile']); 169 | if (false === $rs) { 170 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=ULD2&sql=$stmt->error"); 171 | exit(); 172 | } 173 | $rs = $stmt->execute(); 174 | if (false === $rs) { 175 | header("Location: $redirect_url?type=display&page=lure&return=sql_error&phase=ULD3&sql=$stmt->error"); 176 | exit(); 177 | } 178 | $stmt->close(); 179 | 180 | header("Location: $redirect_url?type=display&page=lure&return=success_update_lures_distance"); 181 | exit(); 182 | 183 | } 184 | 185 | include "./action_error.php"; 186 | 187 | -------------------------------------------------------------------------------- /actions/nests.php: -------------------------------------------------------------------------------- 1 | $value) { 11 | if (substr($value, 0, 6) === "clean_") { 12 | $clean = ltrim($value, 'clean_'); 13 | } 14 | } 15 | $template = !empty($_POST['template']) ? $_POST['template'] : $_SESSION['defaultTemplateName']; 16 | 17 | $stmt = $conn->prepare(" 18 | UPDATE nests 19 | SET distance = ?, clean = ?, min_spawn_avg = ?, template = ?, ping = ? 20 | WHERE uid = ?"); 21 | 22 | if (false === $stmt) { 23 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=UN1&sql=$stmt->error"); 24 | exit(); 25 | } 26 | 27 | $rs = $stmt->bind_param( 28 | "iiissi", 29 | $_POST['distance'], 30 | $clean, 31 | $_POST['min_spawns'], 32 | $template, 33 | $_POST['content'], 34 | $_POST['uid'] 35 | ); 36 | 37 | if (false === $rs) { 38 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=UN2&sql=$stmt->error"); 39 | exit(); 40 | } 41 | 42 | $rs = $stmt->execute(); 43 | 44 | if (false === $rs) { 45 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=UN3&sql=$stmt->error"); 46 | exit(); 47 | } 48 | 49 | $stmt->close(); 50 | header("Location: $redirect_url?type=display&page=nest&return=success_update_nest"); 51 | exit(); 52 | } 53 | 54 | 55 | // DELETE NESTS 56 | 57 | if (isset($_POST['delete']) && isset($_POST['type']) && $_POST['type'] == 'nests') { 58 | 59 | $stmt = $conn->prepare(" 60 | DELETE FROM nests 61 | WHERE uid = ?"); 62 | 63 | if (false === $stmt) { 64 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=DN1&sql=$stmt->error"); 65 | exit(); 66 | } 67 | 68 | $rs = $stmt->bind_param( 69 | "i", 70 | $_POST['uid'] 71 | ); 72 | 73 | if (false === $rs) { 74 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=DN2&sql=$stmt->error"); 75 | exit(); 76 | } 77 | 78 | $rs = $stmt->execute(); 79 | 80 | if (false === $rs) { 81 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=DN3&sql=$stmt->error"); 82 | exit(); 83 | } 84 | 85 | $stmt->close(); 86 | header("Location: $redirect_url?type=display&page=nest&return=success_delete_nest"); 87 | exit(); 88 | } 89 | 90 | 91 | // ADD NEST 92 | 93 | if (isset($_POST['add_nests'])) { 94 | 95 | foreach ($_POST as $key => $value) { 96 | if (substr($value, 0, 6) === "clean_") { 97 | $clean = ltrim($value, 'clean_'); 98 | } 99 | } 100 | $template = !empty($_POST['template']) ? $_POST['template'] : $_SESSION['defaultTemplateName']; 101 | 102 | foreach ($_POST as $key => $value) { 103 | if (substr($key, 0, 5) === "nest_") { 104 | $nest = substr($key, 5); 105 | 106 | $stmt = $conn->prepare("INSERT INTO nests ( id, ping, clean, distance, template, pokemon_id, min_spawn_avg, form, profile_no) 107 | VALUES ( ?, ?, ? , ?, ?, ?, ?, 0, ?)"); 108 | if (false === $stmt) { 109 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=AN1&sql=$stmt->error"); 110 | exit(); 111 | } 112 | $rs = $stmt->bind_param("ssiisiii", $_SESSION['id'], $_POST['content'], $clean, $_POST['distance'], $template, $nest, $_POST['min_spawns'], $_SESSION['profile']); 113 | if (false === $rs) { 114 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=AN2&sql=$stmt->error"); 115 | exit(); 116 | } 117 | $rs = $stmt->execute(); 118 | if (false === $rs) { 119 | if ( stristr($stmt->error, "Duplicate") ) { 120 | header("Location: $redirect_url?type=display&page=nest&return=duplicate"); 121 | exit(); 122 | } 123 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=AN3&sql=$stmt->error"); 124 | exit(); 125 | } 126 | $stmt->close(); 127 | } 128 | } 129 | 130 | header("Location: $redirect_url?type=display&page=nest&return=success_added_nests"); 131 | exit(); 132 | } 133 | 134 | // DELETE ALL NESTS 135 | 136 | if (isset($_GET['action']) && $_GET['action'] == 'delete_all_nests') { 137 | 138 | $stmt = $conn->prepare("DELETE FROM nests WHERE id = ? AND profile_no = ?"); 139 | if (false === $stmt) { 140 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=DAN1&sql=$stmt->error"); 141 | exit(); 142 | } 143 | $rs = $stmt->bind_param("si", $_SESSION['id'], $_SESSION['profile']); 144 | if (false === $rs) { 145 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=DAN2&sql=$stmt->error"); 146 | exit(); 147 | } 148 | $rs = $stmt->execute(); 149 | if (false === $rs) { 150 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=DAN3&sql=$stmt->error"); 151 | exit(); 152 | } 153 | $stmt->close(); 154 | 155 | header("Location: $redirect_url?type=display&page=nest&return=success_delete_nests"); 156 | exit(); 157 | } 158 | 159 | 160 | // UPDATE ALL NESTS DISTANCE 161 | 162 | if (isset($_GET['action']) && $_GET['action'] == 'update_nests_distance') { 163 | 164 | $stmt = $conn->prepare("UPDATE nests set distance = ? WHERE id = ? AND profile_no = ?"); 165 | if (false === $stmt) { 166 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=UND1&sql=$stmt->error"); 167 | exit(); 168 | } 169 | $rs = $stmt->bind_param("isi", $_POST['distance'], $_SESSION['id'], $_SESSION['profile']); 170 | if (false === $rs) { 171 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=UND2&sql=$stmt->error"); 172 | exit(); 173 | } 174 | $rs = $stmt->execute(); 175 | if (false === $rs) { 176 | header("Location: $redirect_url?type=display&page=nest&return=sql_error&phase=UND3&sql=$stmt->error"); 177 | exit(); 178 | } 179 | $stmt->close(); 180 | 181 | header("Location: $redirect_url?type=display&page=nest&return=success_update_nests_distance"); 182 | exit(); 183 | 184 | } 185 | 186 | include "./action_error.php"; 187 | 188 | --------------------------------------------------------------------------------