public function editar()
 {
     //Aca se manda a la funcion editarItem de la clase Item
     //y se queda con la respuesta para redirigir cual sea el caso
     $respuesta = Texto::editar(Input::all());
     if ($respuesta['error'] == true) {
         return Redirect::to('admin/item')->with('mensaje', $respuesta['mensaje'])->with('error', true);
     } else {
         $menu = $respuesta['data']->item()->seccionItem()->menuSeccion()->lang()->url;
         $ancla = '#' . $respuesta['data']->item()->seccionItem()->estado . $respuesta['data']->item()->seccionItem()->id;
         return Redirect::to($this->array_view['prefijo'] . '/' . $menu)->with('mensaje', $respuesta['mensaje'])->with('ancla', $ancla)->with('ok', true);
     }
 }
Example #2
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Texto($info[self::ID]);
         parent::resgatarObjetos($info);
         $temp->titulo = $info[self::TITULO];
         $temp->subTitulo = $info[self::SUBTITULO];
         $temp->textoPequeno = $info[self::TEXTOPEQUENO];
         $temp->texto = $info[self::TEXTO];
         $temp->ordem = $info[self::ORDEM];
         if (!empty($info[self::IMAGEM])) {
             $lI = new ListaImagens();
             $lI->caminhoEscrita = Sistema::$caminhoDiretorio . Sistema::$caminhoDataTextos;
             $lI->caminhoLeitura = Sistema::$caminhoURL . Sistema::$caminhoDataTextos;
             $lI->condicoes('', $info[self::IMAGEM], ListaImagens::ID);
             if ($lI->getTotal() > 0) {
                 $temp->setImagem($lI->listar());
             }
         }
         $temp->setURL($info[parent::URL]);
         return $temp;
     }
 }
 public function vistaListado()
 {
     $items_borrados = Item::where('estado', 'B')->lists('id');
     if (count($items_borrados) > 0) {
         $noticias = Texto::whereNotIn('item_id', $items_borrados)->get();
     } else {
         $noticias = Noticia::all();
     }
     $categorias = Categoria::where('estado', 'A')->get();
     $secciones = Seccion::where('estado', 'A')->get();
     $this->array_view['noticias'] = $noticias;
     $this->array_view['categorias'] = $categorias;
     $this->array_view['secciones'] = $secciones;
     //Hace que se muestre el html lista.blade.php de la carpeta item
     //con los parametros pasados por el array
     return View::make($this->folder_name . '.lista', $this->array_view);
 }
Example #4
0
<?php

importar("Geral.Lista.ListaTextos");
$tituloPagina = 'Utilidades > Textos > Cadastrar';
$iCT = new IFAdmin(new Arquivos(Sistema::$adminLayoutCaminhoDiretorio . "/SistemaUtilidades/texto.html"));
$lI = new ListaIdiomas();
if (!empty($_POST)) {
    $erro = '';
    if (empty($_POST['titulo'])) {
        $erro = "<b>Titulo</b> não preenchido!<br><br>";
    }
    if (empty($_POST['url'])) {
        $erro = "<b>URL</b> não preenchido!<br><br>";
    }
    if (empty($erro)) {
        $tx = new Texto();
        $tx->titulo = $_POST['titulo'];
        $tx->subTitulo = $_POST['subTitulo'];
        $tx->ordem = $_POST['ordem'];
        $tx->getURL()->setURL($_POST['url']);
        $tx->textoPequeno = $_POST['textoPequeno'];
        $tx->texto = $_POST['texto'];
        if (!empty($_FILES['imagem']['name'])) {
            $tx->getImagem()->setImage(new Image(Arquivos::__OpenArquivoByTEMP($_FILES['imagem'])));
        }
        $lT = new ListaTextos();
        $lT->inserir($tx);
        while ($i = $lI->listar()) {
            $t = new Traducao();
            $t->setIdConteudo($tx->getId());
            $t->setCampoConteudo(ListaTextos::TITULO);
Example #5
0
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $texto = Texto::join('texto_lang', 'texto_lang.texto_id', '=', 'texto.id')->where('texto_lang.lang_id', $lang->id)->where('texto.id', $this->id)->first();
     if (is_null($texto)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $texto = Texto::join('texto_lang', 'texto_lang.texto_id', '=', 'texto.id')->where('texto_lang.lang_id', $lang->id)->where('texto.id', $this->id)->first();
     }
     return $texto;
 }
Example #6
0
 public static function excluir()
 {
     $texto = new Texto();
     $texto->selecionarPorId($_POST['id']);
     $texto->excluir();
 }
		<?php 
//echo $form->textField($model,'tipousuario'); >
echo $form->dropDownList($model, 'idiomaid', CHtml::listData(Idiomas::model()->findAll(), 'id', 'nombre'), array('empty' => 'Seleccione'));
?>
		<?php 
echo $form->error($model, 'idiomaid');
?>
	</div>

	<div class="row">
		<?php 
echo $form->labelEx($model, 'textoid');
?>
		<?php 
//echo $form->textField($model,'tipousuario'); >
echo $form->dropDownList($model, 'textoid', CHtml::listData(Texto::model()->findAll(), 'idtexto', 'lugar'), array('empty' => 'Seleccione'));
?>
		<?php 
echo $form->error($model, 'textoid');
?>
	</div>

	<div class="row">
<?php 
$this->widget('ext.ExtEditMe', array('model' => $model, 'attribute' => 'texto', 'width' => '460', 'height' => '250', 'toolbar' => array(array('Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat'), array('NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock'), array('Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo'), array('Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe'), array('Styles', 'Format', 'FontSize'))));
?>

	</div>


	<div class="row buttons">
 public static function generateTRABALHO2($block_trabalho)
 {
     $p_agro = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "P_AGRO");
     //P_AGRO
     $p_extr = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "P_EXTR");
     //P_EXTR
     $p_transf = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "P_TRANSF");
     //P_TRANSF
     $p_constr = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "P_CONSTR");
     //P_CONSTR
     $p_siup = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "P_SIUP");
     //P_SIUP
     $p_com = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "P_COM");
     //P_COM
     $p_serv = TextBuilder::getVariaveis_table(TextBuilder::$idMunicipio, "P_SERV");
     //P_SERV
     $block_trabalho->setData("titulo", "");
     $block_trabalho->setData("canvasContent", "");
     $block_trabalho->setData("subtitulo", "");
     $block_trabalho->setData("info", "");
     //@Translate
     $str2 = TextBuilder::$aba->getTexto2();
     $texto2 = new Texto($str2);
     $texto2->replaceTags("p_agro_10", Formulas::getPAgro10($p_agro));
     $texto2->replaceTags("p_extr_10", Formulas::getPExtr10($p_extr));
     $texto2->replaceTags("p_transf_10", Formulas::getPTransf10($p_transf));
     $texto2->replaceTags("p_constr_10", Formulas::getPConstr10($p_constr));
     $texto2->replaceTags("p_siup_10", Formulas::getPSiup10($p_siup));
     $texto2->replaceTags("p_com_10", Formulas::getPCom10($p_com));
     $texto2->replaceTags("p_serv_10", Formulas::getPServ10($p_serv));
     $block_trabalho->setData("text2", $texto2->getTexto());
     $block_trabalho->setData("text1", "");
 }
Example #9
0
<?php

header('Content-Type: text/html; charset=utf-8');
define("PASTA", "d:/httpc/tcm/");
define("PATH", "http://localhost/tcm/");
date_default_timezone_set('UTC');
include PASTA . "admin/class/config/Autoload.php";
include PASTA . "admin/class/config/AutoloadEntidade.php";
$autoload = new AutoloadEntidade(PASTA);
$postdata = file_get_contents("php://input");
$request = json_decode($postdata, true);
$texto = new Texto();
$texto->serializeArray("Texto", (array) $request);
$textoService = new TextoService();
$method = $_GET['sub'];
call_user_func($method, $texto);
function carregaTextoComFotos($texto)
{
    global $textoService;
    $lista = $textoService->buscarComFotos($texto);
    echo json_encode($lista);
}
Example #10
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);
 }
Example #11
0
 public function alterar(Texto $texto)
 {
     $texto->setUltimaModificacao();
     $this->textoRepository->update($texto);
     return "Texto alterado com sucesso";
 }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Texto the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Texto::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
 public static function generateTRABALHO2($block_trabalho)
 {
     $p_agro = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "P_AGRO");
     //P_AGRO
     $p_extr = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "P_EXTR");
     //P_EXTR
     $p_transf = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "P_TRANSF");
     //P_TRANSF
     $p_constr = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "P_CONSTR");
     //P_CONSTR
     $p_siup = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "P_SIUP");
     //P_SIUP
     $p_com = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "P_COM");
     //P_COM
     $p_serv = TextBuilder_EN::getVariaveis_table(TextBuilder_EN::$idMunicipio, "P_SERV");
     //P_SERV
     $block_trabalho->setData("titulo", "");
     $block_trabalho->setData("canvasContent", "");
     $block_trabalho->setData("subtitulo", "");
     $block_trabalho->setData("info", "");
     //@Translate
     $str2 = "In 2010 [p_agro_10]% of the employed people aged 18 years or older were employed in the agricultural sector,\n            [p_extr_10]% in mining, [p_transf_10]% in manufacturing, [p_constr_10]% in the construction sector,\n            [p_siup_10]% in the public sector, [p_com_10]% in trade and [p_serv_10]%\n            in service sector. ";
     $texto2 = new Texto($str2);
     $texto2->replaceTags("p_agro_10", Formulas::getPAgro10($p_agro));
     $texto2->replaceTags("p_extr_10", Formulas::getPExtr10($p_extr));
     $texto2->replaceTags("p_transf_10", Formulas::getPTransf10($p_transf));
     $texto2->replaceTags("p_constr_10", Formulas::getPConstr10($p_constr));
     $texto2->replaceTags("p_siup_10", Formulas::getPSiup10($p_siup));
     $texto2->replaceTags("p_com_10", Formulas::getPCom10($p_com));
     $texto2->replaceTags("p_serv_10", Formulas::getPServ10($p_serv));
     $block_trabalho->setData("text2", $texto2->getTexto());
     $block_trabalho->setData("text1", "");
 }
 public static function generateTRABALHO2($block_trabalho)
 {
     $p_agro = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "P_AGRO");
     //P_AGRO
     $p_extr = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "P_EXTR");
     //P_EXTR
     $p_transf = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "P_TRANSF");
     //P_TRANSF
     $p_constr = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "P_CONSTR");
     //P_CONSTR
     $p_siup = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "P_SIUP");
     //P_SIUP
     $p_com = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "P_COM");
     //P_COM
     $p_serv = TextBuilder_ES::getVariaveis_table(TextBuilder_ES::$idMunicipio, "P_SERV");
     //P_SERV
     $block_trabalho->setData("titulo", "");
     $block_trabalho->setData("canvasContent", "");
     $block_trabalho->setData("subtitulo", "");
     $block_trabalho->setData("info", "");
     //@Translate
     $str2 = "En 2010, de las personas ocupadas de 18 años o más, un [p_agro_10]% trabajaba en el sector agropecuario, un [p_extr_10]%\n            en la industria extractiva, un [p_transf_10]% en la industria de transformación, un [p_constr_10]% en el sector de la construcción, un [p_siup_10]%\n            en sectores de utilidad pública, un [p_com_10]%\n            en el comercio y un [p_serv_10]% en el sector de servicios.";
     $texto2 = new Texto($str2);
     $texto2->replaceTags("p_agro_10", Formulas::getPAgro10($p_agro));
     $texto2->replaceTags("p_extr_10", Formulas::getPExtr10($p_extr));
     $texto2->replaceTags("p_transf_10", Formulas::getPTransf10($p_transf));
     $texto2->replaceTags("p_constr_10", Formulas::getPConstr10($p_constr));
     $texto2->replaceTags("p_siup_10", Formulas::getPSiup10($p_siup));
     $texto2->replaceTags("p_com_10", Formulas::getPCom10($p_com));
     $texto2->replaceTags("p_serv_10", Formulas::getPServ10($p_serv));
     $block_trabalho->setData("text2", $texto2->getTexto());
     $block_trabalho->setData("text1", "");
 }
Example #15
0
<?php

require_once 'Texto.php';
$texto = "<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>";
$Classe = new Texto();
$arquivo = "teste.txt";
$Classe->texto = $texto;
$Classe->EncontraPalavrasMaisRepetidas($texto);
echo "<pre>";
print_r($Classe->palavrasChave);
echo "</pre>";
 /**
  * Displays the contact page
  */
 public function actionContacto()
 {
     $model = new ContactForm();
     if (isset($_POST['ContactForm'])) {
         $model->attributes = $_POST['ContactForm'];
         if ($model->validate()) {
             $name = '=?UTF-8?B?' . base64_encode($model->name) . '?=';
             $subject = '=?UTF-8?B?' . base64_encode($model->subject) . '?=';
             $headers = "From: {$name} <{$model->email}>\r\n" . "Reply-To: {$model->email}\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/plain; charset=UTF-8";
             mail(Yii::app()->params['adminEmail'], $subject, $model->body, $headers);
             Yii::app()->user->setFlash('contact', Yii::t('site', 'Gracias por contactarnos. Le daremos respuesta a la brevedad posible.'));
             $this->refresh();
         }
     }
     $idioma = Idiomas::model()->find('idioma=:idioma', array(':idioma' => Yii::app()->language));
     if ($idioma->idioma == Yii::app()->params->idiomas['Español']) {
         //español
         $criteria2 = new CDbCriteria();
         $criteria2->select = 't.*';
         $criteria2->condition = 't.lugar = :lugar';
         $criteria2->params = array(':lugar' => 'direcciones');
     } else {
         //ingles
         $criteria2 = new CDbCriteria();
         $criteria2->select = 't.*, tra_texto.*';
         $criteria2->join = 'LEFT JOIN tra_texto ON tra_texto.textoid = t.idtexto';
         $criteria2->condition = 'tra_texto.idiomaid =:id and t.lugar = :lugar';
         $criteria2->params = array(':id' => $idioma->id, ':lugar' => 'direcciones');
     }
     $direcciones = Texto::model()->find($criteria2);
     $this->render('contacto', array('model' => $model, 'direcciones' => $direcciones));
 }
Example #17
0
 public function texto()
 {
     return Texto::find($this->texto_id);
 }
Example #18
0
 public function texto()
 {
     return Texto::where('item_id', $this->id)->first();
 }