示例#1
0
<?php

require 'common.inc.php';
$regraPersonagem = new Personagem();
$regraProfissao = new Profissao();
$personagem = $regraPersonagem->pegar(ID_PERSONAGEM);
$GLOBALS['_personagem'] = $personagem;
$urlPersonagem = WEB_PATH . '/' . strtolower(sanitize_slug($personagem->nome)) . '_' . $personagem->id_personagem;
$profissoes = $regraProfissao->listarElevivel($personagem);
require 'header.inc.php';
require 'menu-principal.inc.php';
require 'personagem-modal.inc.php';
?>
<div class="container" style="margin-top: 80px">
    <div class="row">
        <div class="col-md-3">
            <?php 
require 'login.inc.php';
?>
        </div>
        <div class="col-md-7">
            <div class="panel panel-default">
                <div class="panel-body">
                    <table class="table table-condensed table-hover table-striped">
                        <thead>
                            <?php 
$categoria = null;
?>
                            <?php 
foreach ($profissoes as $id_profissao => $profissao) {
    ?>
示例#2
0
<?php

require 'common.inc.php';
$regraPersonagem = new Personagem();
$regraProfissao = new Profissao();
//$personagem = $regraPersonagem->pegar(ID_PERSONAGEM);
//$GLOBALS['_personagem'] = $personagem;
$personagem = $regraPersonagem->pegarAtual();
$id_profissao = intval($_GET['profissao']);
$urlPersonagem = WEB_PATH . '/' . strtolower(sanitize_slug($personagem->nome)) . '_' . $personagem->id_personagem;
$urlPersonagem .= "/crafting/{$id_profissao}";
$mensagem = $regraProfissao->executar($personagem, $id_profissao);
$personagem = $regraPersonagem->pegar(ID_PERSONAGEM);
$GLOBALS['_personagem'] = $personagem;
require 'header.inc.php';
require 'menu-principal.inc.php';
require 'personagem-modal.inc.php';
?>
<div class="container" style="margin-top: 80px">
    <div class="row">
        <div class="col-md-3">
            <?php 
require 'login.inc.php';
?>
        </div>
        <div class="col-md-9">
            <div class="panel panel-default">
                <div class="panel-body">
                    <div class="pull-right">
                        <a class="btn btn-success" href="<?php 
echo $urlPersonagem;
示例#3
0
文件: novo.php 项目: jhmachado/erp
<?
$profissao = new Profissao();
if($_POST['salvar']){

    $_POST['ativo'] = $_POST['ativo'] | 0;
    $_POST['areaProfissao'] = (int) $_POST['areaProfissao'] | 0;
    $_POST['superior'] = (int) $_POST['superior'] | 0;

    $profissao->serializeArray("Profissao", $_POST);
    $retorno = $profissaoService->salvar($profissao);
    mensagem($retorno);
}

?>
<div id="content" class="right">
    <div class="charts">

        <div class="breadcrumbs clearfix">
            <ul class="breadcrumbs left">
                <li><a href="<?php 
echo PATH;
?>
configuracoes/">CONFIGURAÇÕES</a></li>
                <li><i class="fa fa-angle-right"></i></li>
                <li>
                    <a href="<?php 
echo PATH;
?>
configuracoes/profissao/listaProfissoes.html">PROFISSÕES</a>
                </li>
                <li><i class="fa fa-angle-right"></i></li>
示例#4
0
 public static function inscricao()
 {
     header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
     header('Cache-Control: no-store, no-cache, must-revalidate');
     header('Cache-Control: pre-check=0, post-check=0, max-age=0');
     header('Pragma: no-cache');
     if (!empty($_POST)) {
         $participante = new Participante();
         if (empty($_POST['nome'])) {
             $erro .= 'nr|';
         }
         if (empty($_POST['email'])) {
             $erro .= 'er|';
         }
         if (!preg_match('/^[a-zA-Z0-9][a-zA-Z0-9\\._-]+@([a-zA-Z0-9\\._-]+\\.)[a-zA-Z-0-9]{2}/', $_POST['email']) && !empty($_POST['email'])) {
             $erro .= 'ei|';
         }
         if ($participante->count('email = \'' . $_POST['email'] . '\'') > 0 && !empty($_POST['email'])) {
             $erro .= 'ee|';
         }
         if (empty($_POST['telefone'])) {
             $erro .= 'tr|';
         }
         if (empty($_POST['data_nascimento'])) {
             $erro .= 'dnr|';
         }
         if (!empty($_POST['data_nascimento'])) {
             $data_nascimento = explode("/", $_POST['data_nascimento']);
             if ($data_nascimento[1] == 2 && $data_nascimento[0] > 29 || in_array($data_nascimento[1], array(4, 6, 9, 11)) && $data_nascimento[0] > 30 || $data_nascimento[0] > 31 || $data_nascimento[1] > 12 || $data_nascimento[2] . $data_nascimento[1] . $data_nascimento > date('Ymd')) {
                 $erro .= 'dni|';
             }
         }
         if (empty($_POST['sexo'])) {
             $erro .= 'sr|';
         }
         if (empty($_POST['cpf'])) {
             $erro .= 'cr|';
         }
         if (!preg_match('/\\d{3}[\\.]\\d{3}[\\.]\\d{3}[\\-]\\d{2}/', $_POST['cpf']) && !empty($_POST['cpf'])) {
             $erro .= 'ci|';
         }
         if ($participante->count('cpf = \'' . $_POST['cpf'] . '\'') > 0 && !empty($_POST['cpf'])) {
             $erro .= 'ce|';
         }
         if (!empty($_POST['cep']) && !preg_match('/\\d{5}[\\-]\\d{3}/', $_POST['cep'])) {
             $erro .= 'cei|';
         }
         if (!isset($_POST['estado']) || empty($_POST['estado'])) {
             $erro .= 'esr|';
         }
         if (!isset($_POST['cidade']) || empty($_POST['cidade'])) {
             $erro .= 'cir|';
         }
         if (!isset($_POST['bairro']) || empty($_POST['bairro'])) {
             $erro .= 'br|';
         }
         if (!isset($_POST['logradouro']) || empty($_POST['logradouro'])) {
             $erro .= 'lr|';
         }
         if (!isset($_POST['numero']) || empty($_POST['numero'])) {
             $erro .= 'nr|';
         }
         if (!empty($_POST['numero']) && !preg_match('/\\d+/', $_POST['numero'])) {
             $erro .= 'ni|';
         }
         if (!isset($_POST['instituicao']) || empty($_POST['instituicao'])) {
             $erro .= 'ir|';
         }
         if (!isset($_POST['area_atuacao']) || empty($_POST['area_atuacao'])) {
             $erro .= 'ar|';
         }
         if (!isset($_POST['profissao']) || empty($_POST['profissao'])) {
             $erro .= 'pr|';
         }
         if ($_POST['profissao'] == 770 && (!isset($_POST['outra_profissao']) || empty($_POST['outra_profissao']))) {
             $erro .= 'opr|';
         }
         if (!isset($_POST['grau_instrucao']) || empty($_POST['grau_instrucao'])) {
             $erro .= 'gir|';
         }
         if (!isset($_POST['tamanho_camisa']) || empty($_POST['tamanho_camisa'])) {
             $erro .= 'tcr|';
         }
         if (isset($_POST['voucher']) && !empty($_POST['voucher'])) {
             //TODO Voucher
             $voucher = new Voucher();
             $listaDeVouchers = $voucher->listar("hash LIKE '" . trim($_POST['voucher']) . "'");
             if (count($listaDeVouchers) <= 0) {
                 $erro .= 'vch|';
             }
             //Testa se ja foi usado
             $voucher2 = new Voucher();
             $listaDeVouchers2 = $voucher2->listar("hash LIKE '" . trim($_POST['voucher']) . "' AND usado = 0 ");
             if (count($listaDeVouchers2) <= 0) {
                 $erro .= 'vch2|';
             }
         }
         if (!empty($erro)) {
             $_SESSION['dados'] = $_POST;
             if (strpos($_SERVER['HTTP_REFERER'], '?') !== false) {
                 $caminho = explode("?", $_SERVER['HTTP_REFERER']);
                 $caminho = $caminho[0];
             } else {
                 $caminho = $_SERVER['HTTP_REFERER'];
             }
             header('Location: ' . Configuracao::$baseUrl . 'inscricao' . Configuracao::$extensaoPadrao . '?e=' . $erro);
             exit;
         }
         $participante->nome = trim($_POST['nome']);
         $participante->funcao = trim($_POST['funcao']);
         $participante->email = trim($_POST['email']);
         $participante->sexo = trim($_POST['sexo']);
         $participante->data_nascimento = trim($_POST['data_nascimento']);
         $participante->cpf = trim($_POST['cpf']);
         $participante->rg = trim($_POST['rg']);
         $participante->orgao_emissor = trim($_POST['orgao_emissor']);
         $participante->cep = trim($_POST['cep']);
         $participante->telefone = trim($_POST['telefone']);
         $participante->estado = $_POST['estado'];
         $participante->cidade = $_POST['cidade'];
         $participante->bairro = trim($_POST['bairro']);
         $participante->logradouro = trim($_POST['logradouro']);
         $participante->numero = trim($_POST['numero']);
         $participante->profissao = trim($_POST['profissao']);
         $participante->outra_profissao = trim($_POST['outra_profissao']);
         $participante->grau_instrucao = trim($_POST['grau_instrucao']);
         $participante->instituicao = trim($_POST['instituicao']);
         $participante->area_atuacao = trim($_POST['area_atuacao']);
         $participante->tamanho_camisa = trim($_POST['tamanho_camisa']);
         if (isset($_POST['voucher']) && !empty($_POST['voucher'])) {
             $participante->voucher = $_POST['voucher'];
         }
         /*
         TODO BOLETO POR WEBSERVICE
         */
         if ($participante->funcao == 'participante') {
             $cURL = curl_init('url do ws');
             curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
             $post = array('post' => array('nome' => $participante->nome, 'cpf' => $participante->cpf, 'cep' => $participante->cep, 'logradouro' => $participante->logradouro, 'num' => $participante->numero, 'bairro' => $participante->bairro, 'cidade' => $participante->getCidade()->nome, 'estado' => $participante->getEstado()->nome, 'complemento' => $participante->complemento, 'voucher' => @$listaDeVouchers[0]->desconto, 'email' => $participante->email), 1 => 1);
             curl_setopt($cURL, CURLOPT_POST, true);
             curl_setopt($cURL, CURLOPT_POSTFIELDS, http_build_query($post));
             $resposta = curl_exec($cURL);
             curl_close($cURL);
             $resposta = json_decode($resposta);
             $participante->nossonumero = $resposta->nossonumero;
         }
         if ($participante->salvar() && $participante->funcao == 'participante') {
             if (isset($_POST['voucher']) && !empty($_POST['voucher'])) {
                 $voucher3 = new Voucher();
                 $voucher3->selecionarPorId(@$listaDeVouchers[0]->id);
                 $voucher3->usado = 1;
                 $voucher3->salvar();
             }
             echo '<meta charset="UTF-8">';
             echo "<script>alert('Você cadastrou-se com sucesso!'); document.location.href='" . Configuracao::$baseUrl . 'confirmacaoCadastro' . Configuracao::$extensaoPadrao . '?nn=' . $participante->nossonumero . "';</script>";
             exit;
         } else {
             echo '<meta charset="UTF-8">';
             echo "<script>alert('Você cadastrou-se com sucesso!'); document.location.href='" . Configuracao::$baseUrl . 'confirmacaoCadastro' . Configuracao::$extensaoPadrao . "';</script>";
             exit;
         }
     }
     $listaFuncoes = Listas::getFuncao();
     $listaSexos = Listas::getSexo();
     $listaAreasAtuacao = Listas::getAreaAtuacao();
     $listaGrausIntrucao = Listas::getGrauInstrucao();
     $listaTamanhosCamisa = Listas::getTamanhoCamisa();
     $profissao = new Profissao();
     $listaProfissoes = $profissao->listar(null, 'nome');
     $estado = new Estado();
     $listaEstados = $estado->listar(null, 'nome');
     $texto = new Texto();
     $texto->selecionarPorId(10);
     self::$corpo = "inscricao";
     self::$variaveis = array('texto' => $texto, 'listaFuncoes' => $listaFuncoes, 'listaSexos' => $listaSexos, 'listaAreasAtuacao' => $listaAreasAtuacao, 'listaGrausInstrucao' => $listaGrausIntrucao, 'listaTamanhosCamisa' => $listaTamanhosCamisa, 'listaProfissoes' => $listaProfissoes, 'listaEstados' => $listaEstados);
     self::renderizar(self::$viewController);
 }
示例#5
0
 public function getProfissao()
 {
     if (!empty($this->profissao)) {
         $profissao = new Profissao();
         $profissao->selecionarPorId($this->profissao);
         return $profissao;
     } else {
         return $this->profissao;
     }
 }
示例#6
0
 public function alterar(Profissao $profissao)
 {
     $profissao->setUltimaModificacao();
     return $this->profissaoRepository->update($profissao);
 }
 public static function editar()
 {
     header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
     header('Cache-Control: no-store, no-cache, must-revalidate');
     header('Cache-Control: pre-check=0, post-check=0, max-age=0');
     header('Pragma: no-cache');
     $participante = new Participante();
     $participante->selecionarPorId($_GET['id']);
     if (!empty($_POST)) {
         $participante->nome = trim($_POST['nome']);
         $participante->funcao = trim($_POST['funcao']);
         $participante->email = trim($_POST['email']);
         $participante->sexo = trim($_POST['sexo']);
         $participante->data_nascimento = trim($_POST['data_nascimento']);
         $participante->cpf = trim($_POST['cpf']);
         $participante->rg = trim($_POST['rg']);
         $participante->orgao_emissor = trim($_POST['orgao_emissor']);
         $participante->cep = trim($_POST['cep']);
         $participante->telefone = trim($_POST['telefone']);
         $participante->estado = $_POST['estado'];
         $participante->cidade = $_POST['cidade'];
         $participante->bairro = trim($_POST['bairro']);
         $participante->logradouro = trim($_POST['logradouro']);
         $participante->numero = trim($_POST['numero']);
         $participante->profissao = trim($_POST['profissao']);
         $participante->outra_profissao = trim($_POST['outra_profissao']);
         $participante->grau_instrucao = trim($_POST['grau_instrucao']);
         $participante->instituicao = trim($_POST['instituicao']);
         $participante->area_atuacao = trim($_POST['area_atuacao']);
         $participante->tamanho_camisa = trim($_POST['tamanho_camisa']);
         if (isset($_POST['voucher']) && !empty($_POST['voucher'])) {
             //TODO Voucher
             $voucher = new Voucher();
             $listaDeVouchers = $voucher->listar("hash LIKE '" . trim($_POST['voucher']) . "'");
             if (count($listaDeVouchers) <= 0) {
                 echo "N&uacute;mero do Voucher errado.";
                 exit;
             }
             //Testa se ja foi usado
             $voucher2 = new Voucher();
             $listaDeVouchers2 = $voucher2->listar("hash LIKE '" . trim($_POST['voucher']) . "' AND usado = 0 ");
             if (count($listaDeVouchers2) <= 0) {
                 echo "N&uacute;mero do Voucher j&aacute; usado.";
                 exit;
             }
             $participante->voucher = trim($_POST['voucher']);
         }
         if ($participante->funcao == 'participante' && empty($participante->nossonumero)) {
             $cURL = curl_init('http://www.anid.com.br/aniderp/jsonWsBoleto.php');
             curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
             $post = array('post' => array('nome' => $participante->nome, 'cpf' => $participante->cpf, 'cep' => $participante->cep, 'logradouro' => $participante->logradouro, 'num' => $participante->numero, 'bairro' => $participante->bairro, 'cidade' => $participante->getCidade()->nome, 'estado' => $participante->getEstado()->nome, 'voucher' => $participante->voucher, 'complemento' => $participante->complemento, 'email' => $participante->email), 1 => 1);
             curl_setopt($cURL, CURLOPT_POST, true);
             curl_setopt($cURL, CURLOPT_POSTFIELDS, http_build_query($post));
             $resposta = curl_exec($cURL);
             curl_close($cURL);
             $resposta = json_decode($resposta);
             $participante->nossonumero = $resposta->nossonumero;
         } else {
             $participante->nossonumero = 'NULL';
         }
         $participante->salvar();
         if (isset($_POST['voucher']) && !empty($_POST['voucher'])) {
             $voucher3 = new Voucher();
             $voucher3->selecionarPorId(@$listaDeVouchers[0]->id);
             $voucher3->usado = 1;
             $voucher3->salvar();
         }
         self::redirecionar(Configuracao::$baseUrl . self::$viewController . '/listar' . Configuracao::$extensaoPadrao);
     }
     $listaFuncoes = Listas::getFuncao();
     $listaSexos = Listas::getSexo();
     $listaAreasAtuacao = Listas::getAreaAtuacao();
     $listaGrausIntrucao = Listas::getGrauInstrucao();
     $listaTamanhosCamisa = Listas::getTamanhoCamisa();
     $profissao = new Profissao();
     $listaProfissoes = $profissao->listar(null, 'nome');
     $estado = new Estado();
     $listaEstados = $estado->listar(null, 'nome');
     $cidade = new Cidade();
     $listaCidades = $cidade->listar('estado = ' . $participante->estado, 'nome');
     self::$corpo = "editar";
     self::$variaveis = array('listaFuncoes' => $listaFuncoes, 'listaSexos' => $listaSexos, 'listaAreasAtuacao' => $listaAreasAtuacao, 'listaGrausInstrucao' => $listaGrausIntrucao, 'listaTamanhosCamisa' => $listaTamanhosCamisa, 'listaProfissoes' => $listaProfissoes, 'listaEstados' => $listaEstados, 'listaCidades' => $listaCidades, 'participante' => $participante);
     self::renderizar(self::$viewController);
 }