Esempio n. 1
0
            }
        }
    } elseif ($dataGet['nivel'] == "admin") {
        $dado = usuarioBO::getUsuarios($dataGet['nid']);
        $token = FUNCOES::cryptografar($dataGet['nid'] . $dado->senha);
        if ($token !== $dataGet['token']) {
            throw new Exception('Parâmetros incorretos !!!');
        }
    } elseif ($dataGet['nivel'] == "revenda") {
        $dado = revendedorBO::getRevendedor($dataGet['nid']);
        $token = FUNCOES::cryptografar($dataGet['nid'] . $dado['senha']);
        if ($token !== $dataGet['token']) {
            throw new Exception('Parâmetros incorretos !!!');
        }
    } elseif ($dataGet['nivel'] == "usuario") {
        $dado = usuarioBO::getUsuario($dataGet['nid']);
        $token = FUNCOES::cryptografar($dataGet['nid'] . $dado->passwlogin);
        if ($token !== $dataGet['token']) {
            throw new Exception('Parâmetros incorretos !!!');
        }
    } else {
        throw new Exception('Parâmetros incorretos !!!');
    }
} catch (Exception $e) {
    $response['error'][] = $e->getMessage();
}
//}
if (FUNCOES::isAjax()) {
    print json_encode($response);
    exit;
}
Esempio n. 2
0
                $data['data_vencimento'] = FUNCOES::formatarDatatoHTML($data['data_vencimento']);
            }
        } catch (Exception $err) {
            $response['error'][] = $err->getMessage();
        }
    }
    /**
     * BOT TELEGRAM   ---- 255747822:AAFM7ZzxOeHbSRTn2_EapG4wCdIrQ-8dmQM
     */
    if ($data_telegram['bot_token'] && empty($response['error'])) {
        if (empty($data_telegram['users_bots_id'])) {
            $data_telegram['users_id'] = $datauser['id'];
            $data_telegram['canal'] = "telegram";
            usuarioBO::salvarUsuario($data_telegram, 'users_bots');
        } else {
            usuarioBO::salvarUsuario($data_telegram, 'users_bots', $data_telegram['users_bots_id']);
        }
    }
} catch (Exception $ex) {
    $response['error'][] = $ex->getMessage();
}
if (FUNCOES::isAjax()) {
    print json_encode($response);
    exit;
}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title><?php 
echo TITLE;
<?php

include_once '../sealed/init.php';
require_once '../sealed/BO/usuarioBO.php';
require_once '../sealed/BO/plano_assinaturaBO.php';
require_once '../sealed/controler/paginador.php';
include_once "../lib/utils/funcoes.php";
/**
 * autenticações 
 */
if (isset($_SESSION['admin_id'])) {
    require_once '../sealed/BO/usuarioBO.php';
    usuarioBO::checkExpireLogin();
    usuarioBO::checkSession();
} elseif (isset($_SESSION['revenda_id'])) {
    require_once '../sealed/BO/revendedorBO.php';
    revendedorBO::checkExpireLogin();
    revendedorBO::checkSession();
} else {
    header("Location:login.php");
}
/**
 * autenticações 
 */
$filterGET = array('action' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^(excluir|imprimir)\$/")), 'id' => array('filter' => FILTER_VALIDATE_INT), 'page' => array('filter' => FILTER_VALIDATE_INT), 'revenda_id' => array('filter' => FILTER_VALIDATE_INT));
$argsPost = array('action' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^(excluir|imprimir|exportar_xls)\$/")), 'ids' => array('filter' => FILTER_VALIDATE_INT, 'flags' => FILTER_REQUIRE_ARRAY), 'page' => array('filter' => FILTER_VALIDATE_INT));
$inputPOST = filter_input_array(INPUT_POST, $argsPost);
$dataGet = filter_input_array(INPUT_GET, $filterGET);
try {
    $count = plano_assinaturaBO::getListaCount();
    if (!$dataGet['page']) {
Esempio n. 4
0
$dataGet = filter_input_array(INPUT_GET, $filterGET);
try {
    $count = financeiroBO::getFinanceiroCount("vencidos");
    if (!$dataGet['page']) {
        $dataGet['page'] = 1;
    }
    $paginador = new paginador($dataGet['page'], $count, 20, '', array('pesquisa' => $inputGET['pesquisa']));
    $dados_atraso = financeiroBO::getFinanceiro("vencidos", $paginador->getPage());
    /**
     * action via post EXCLUIR
     */
    if (isset($dataGet['action'])) {
        if ($dataGet['action'] == 'excluir') {
            if (isset($dataGet['id'])) {
                try {
                    $result = usuarioBO::deletar($dataGet['id']);
                    if ($result == true) {
                        $response['success'][] = 'Usuário excluído com sucesso!';
                        $response['link'] = 'usuario.php?page=' . $dataGet['page'];
                    } else {
                        //$response['error'][] = "Revenda já está vinculado a uma cotação !!";
                    }
                } catch (Exception $err) {
                    $response['error'][] = $err->getMessage();
                }
            }
        }
    }
} catch (Exception $e) {
    $response['error'][] = $e->getMessage();
}
                <span style="color: red;font-weight: bold;font-style: italic;" >
                    Erro: <?php 
            echo substr(" erro no Mysql !!! )" . $ex->getMessage(), 0, 50);
            ?>
 
                </span>
                <?php 
            echo str_ireplace($request, '<strong>' . $request . '</strong>', $request);
            ?>
            </li>
            <?php 
        }
        break;
    case '_phone':
        try {
            $dados = usuarioBO::ajax_autocomplete_usuarios_phone($request);
            if ($dados) {
                foreach ($dados as $campo) {
                    $id = $campo->id;
                    $phone = $campo->phone;
                    ?>
                    <li onselect="this.setText('<?php 
                    echo $phone;
                    ?>
', '').setValue('<?php 
                    echo $phone;
                    ?>
')"><?php 
                    echo str_ireplace($request, '<strong>' . $request . '</strong>', $phone);
                    ?>
</li>
Esempio n. 6
0
        $relatorio = "usuarios_atraso";
        $dadosExportarPDF = financeiroBO::getFinanceiro("vencidos", LIMIT_REGISTROS_RELATORIOS);
        require_once '../sealed/controler/pdf.php';
        exit;
    } elseif ($dataGet['action'] == 'usuarios_bloqueados') {
        require_once '../lib/fpdf/fpdf.php';
        //require_once('../sealed/BO/financeiroBO.php');
        $relatorio = "usuarios_bloqueados";
        $dadosExportarPDF = usuarioBO::getListaUsuariosBloqueados(LIMIT_REGISTROS_RELATORIOS);
        require_once '../sealed/controler/pdf.php';
        exit;
    } elseif ($dataGet['action'] == 'usuarios_expirado') {
        require_once '../lib/fpdf/fpdf.php';
        //require_once('../sealed/BO/financeiroBO.php');
        $relatorio = "usuarios_expirados";
        $dadosExportarPDF = usuarioBO::getUsuariosExpirar(LIMIT_REGISTROS_RELATORIOS);
        require_once '../sealed/controler/pdf.php';
        exit;
    } elseif ($dataGet['action'] == 'usuarios_novos') {
        require_once '../lib/fpdf/fpdf.php';
        //require_once('../sealed/BO/financeiroBO.php');
        $relatorio = "usuarios_novos";
        $dadosExportarPDF = usuarioDAO::getUsuariosNovos(LIMIT_REGISTROS_RELATORIOS);
        require_once '../sealed/controler/pdf.php';
        exit;
    }
} catch (Exception $ex) {
    $response['error'][] = $ex->getMessage();
    exit;
}
if (FUNCOES::isAjax()) {
Esempio n. 7
0
<?php

error_reporting(E_ALL ^ E_NOTICE);
include_once "../sealed/BO/usuarioBO.php";
include_once "../sealed/BO/revendedorBO.php";
include_once "../lib/utils/funcoes.php";
$filter = array('email' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^[\\w\\W]{1,255}\$/")), 'senha' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^[\\w\\W]{1,255}\$/")), 'tipo' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^[\\w\\W]{1,30}\$/")));
$dataPost = filter_input_array(INPUT_POST, $filter);
if ($dataPost) {
    $tipo = $dataPost['tipo'];
    unset($dataPost['tipo']);
    try {
        if ($tipo == "admin") {
            usuarioBO::getLoginAdmin($dataPost);
            $response['success'][] = "aguarde...";
            $response['link'][] = "index.php";
        } elseif ($tipo == "revenda") {
            revendedorBO::getLoginRevenda($dataPost);
            $response['success'][] = "aguarde...";
            $response['link'][] = "index.php";
        } else {
            $response['error'][] = "a fazer !!!";
        }
    } catch (Exception $e) {
        $response['error'][] = $e->getMessage();
    }
}
if (FUNCOES::isAjax()) {
    print json_encode($response);
    exit;
}
    revendedorBO::checkSession();
} else {
    header("Location:login.php");
}
/**
 * autenticações 
 */
$filter = array('data_vencimento' => array('filter' => FILTER_SANITIZE_STRING), 'valor' => array('filter' => FILTER_SANITIZE_STRING), 'users_id' => array('filter' => FILTER_VALIDATE_INT), 'financeiro_id' => array('filter' => FILTER_VALIDATE_INT), 'page' => array('filter' => FILTER_VALIDATE_INT));
$filterGET = array('action' => array('filter' => FILTER_VALIDATE_REGEXP, 'options' => array("regexp" => "/^(excluir|imprimir)\$/")), 'page' => array('filter' => FILTER_VALIDATE_INT), 'id' => array('filter' => FILTER_VALIDATE_INT), 'pgname' => array('filter' => FILTER_SANITIZE_STRING));
//
$data_org = filter_input_array(INPUT_POST);
$data = filter_input_array(INPUT_POST, $filter);
$dataGet = filter_input_array(INPUT_GET, $filterGET);
//
try {
    $usuarios = usuarioBO::getListaCombo();
    if ($data) {
        $response = array();
        $data['valor'] = FUNCOES::formatoDecimal($data['valor']);
        if (empty($data['valor']) || $data['valor'] == 0.0) {
            $response['error'][] = 'Preencher valor';
        } elseif (empty($data['data_vencimento'])) {
            $response['error'][] = 'Preencher data de vencimento';
        } elseif (empty($data['users_id'])) {
            $response['error'][] = 'Preencher usuário';
        } else {
            /**
             * salvar plano
             */
            if (!$dataGet['page']) {
                $page = 1;