/**
 * Metodo responsavel por formatar um Texto
 *
 * @param String $string
 *            Texto
 * @param Integer $max
 *            Tamanho Maximo
 * @param Integer $min
 *            Tamanho Minimo
 * @param Boolean $completa
 *            Se é para completar com espacos
 * @param Boolean $removeAcentos
 *          Remove os Acentos
 * @return string Texto formatado
 */
function formataTX($string, $min, $max, $completa = false, $removeAcentos = true)
{
    $str = $string;
    if ($string != "") {
        $str = trim($string);
        if ($completa) {
            $t = strlen($str) < $min ? $min : $max;
            $str = str_pad($str, $t, "0", STR_PAD_LEFT);
        } else {
            if (strlen($str) > $max) {
                $str = substr($str, 0, $max);
            }
            if (strlen($str) < $min) {
                $str = str_pad($str, $min, "0", STR_PAD_LEFT);
            }
        }
        if ($removeAcentos) {
            // Caso esteja em utf8
            $strTmp = removeAcentos(utf8_decode($str));
            if ($strTmp == "") {
                // Caso nao esteja em utf8
                $strTmp = removeAcentos($str);
            }
            $str = $strTmp;
        }
    }
    return $str;
}
 public function categories($name)
 {
     $providerImages = ProviderImage::get();
     $categories = Category::find($name);
     removeAcentos();
     return view('site/produtos', ['title' => 'Pechinchador.com.br | Venha ser um Pechinchador!', 'description' => 'Os melhores produtos do mercado.', 'categories' => $categories, 'providerImages' => $providerImages]);
 }
Exemple #3
0
 public static function fixNome($str)
 {
     $str = (string) $str;
     $str = empty($str) ? "VARIAVEL VAZIA" : $str;
     $str = removeAcentos($str);
     $str = strtoupper($str);
     $str = trim($str);
     $arrayErrado = array(' ', '.', '-', '(', ')');
     $arrayCerto = array('_', '', '', '', '');
     $str = str_replace($arrayErrado, $arrayCerto, $str);
     $str = str_replace("__", "_", $str);
     $str = str_replace("__", "_", $str);
     $str = str_replace("__", "_", $str);
     $str = str_replace("__", "_", $str);
     return $str;
 }
    function detalhar($id_categoria = null, $busca = 'sem_busca', $de_paginacao = '0')
    {
        if (!($dados['categoria'] = $this->Model_categorias->getCategoria($id_categoria))) {
            show_404();
        }
        $this->load->helper('form');
        if ($this->input->post('busca')) {
            redirect('categorias/detalhar/' . $id_categoria . '/' . custom_urlencode(str_replace(array('%', "'"), array('', ''), $this->input->post('busca'))), 'refresh');
        }
        // Nao permite página menor que 0 e permite somente inteiros
        if ($de_paginacao < 0 or !is_numeric($de_paginacao)) {
            redirect('categorias', 'redirect');
        }
        // Biblioteca da paginação
        $this->load->library('pagination');
        // Paginação
        $busca_tratado = removeAcentos(custom_urldecode($busca));
        $config_paginacao['base_url'] = site_url('categorias/detalhar/' . $id_categoria . '/' . $busca);
        $config_paginacao['total_rows'] = $this->Model_categorias->countCategoriaNoticias($id_categoria, $busca_tratado);
        $dados['total_rows'] = $config_paginacao['total_rows'];
        $config_paginacao['per_page'] = 5;
        $config_paginacao['uri_segment'] = 5;
        // Nao permite pagina que nao existe (maior do que existe)
        if ($de_paginacao > $config_paginacao['total_rows']) {
            redirect('home', 'redirect');
        }
        // Estilo paginacao
        include_once './assets/pagination/estilo.php';
        $this->pagination->initialize($config_paginacao);
        $dados['html_paginacao'] = $this->pagination->create_links();
        if ($busca != 'sem_busca') {
            $dados['busca'] = TRUE;
        }
        // Listagem de dados
        $dados['lista'] = '';
        foreach ($this->Model_categorias->getCategoriaNoticias($id_categoria, $busca_tratado, (int) $de_paginacao, $config_paginacao['per_page']) as $noticia) {
            $dados['lista'] .= '<div class="news-box">
							<h2><a href="' . base_url('noticia/detalhes/' . $noticia->id_noticia) . '" title="Ver notícia completa">' . $noticia->titulo . '</a></h2>
							<p class="news-datetime">Em ' . date('d/m/Y \\à\\s H:i', $noticia->publicada_em) . '</p>
							<p>' . limita_caracteres($noticia->texto, 600, FALSE) . '</p>
						 </div>';
        }
        $dados['usuario'] = $this->_usuario;
        $this->load->view('categoria_noticias_listar', $dados);
    }
						if($banner["size"] > $tamanho) {

							$erros[4] = "A imagem deve ter no máximo ".$tamanho." Mb";

						}

				 

						// Se não houver nenhum erro

						if (empty($erros)) {

							// Gera um nome único para a imagem

						$bn = removeAcentos($banner['name']);

						$ne = str_replace(" ","_",$bn);

						$nome_imagem = uniqid().$ne;	 

						// Caminho de onde ficará a imagem

						$caminho_imagem = "../../arquivos/dicas/fotos/".$nome_imagem;

						$caminho_imagem2 = "arquivos/dicas/fotos/".$nome_imagem;

						// Faz o upload da imagem para seu respectivo caminho		

						if (!file_exists("../../arquivos/")) {
Exemple #6
0
    }
}
$colunas = array('A' => 'CAMPUS', 'B' => 'CURSO', 'C' => 'LOCAL DE PROVA', 'D' => 'INSCRITO', 'E' => 'N. INSCRICAO', 'F' => 'CPF', 'G' => 'RG', 'H' => 'ORGAO EXPEDIDOR', 'I' => 'UF', 'J' => 'DATA DE EXPEDICAO', 'K' => 'NACIONALIDADE', 'L' => 'DATA DE NASCIMENTO', 'M' => 'SEXO', 'N' => 'ENDERECO', 'O' => 'CEP', 'P' => 'CIDADE', 'Q' => 'ESTADO', 'R' => 'TELEFONE', 'S' => 'CELULAR', 'T' => 'EMAIL', 'U' => 'ESTADO CIVIL', 'V' => 'NECESSIDADE ESPECIAL', 'W' => 'DESCRICAO NECESSIDADE ESPECIAL', 'X' => 'ISENCAO DE TAXA', 'Y' => 'CONDICOES ESPECIAIS PARA REALIZACAO DA PROVA', 'Z' => 'DESCRICAO CONDICOES ESPECIAIS PARA REALIZACAO DA PROVA', 'AA' => 'CONCORRE AS VAGAS DESTINADAS A CANDIDATOS COM NECESSIDADES ESPECIAIS');
$query = $banco->ExecutaQueryGenerica($sql);
$numResults = mysql_num_rows($query);
$linha = 2;
$campus_id = null;
while ($row = mysql_fetch_assoc($query)) {
    $val = array_values($row);
    if ($campus_id != $val[0]) {
        $campus_id = $val[0];
        if ($campus_id > 1 && $numResults > 1) {
            $objPHPExcel->createSheet();
            $objPHPExcel->setActiveSheetIndex($objPHPExcel->getActiveSheetIndex() + 1);
        }
        $objPHPExcel->getActiveSheet()->setTitle(removeAcentos($val[1]));
        setCabecalho($objPHPExcel, $colunas);
        $linha = 2;
    }
    $col = 1;
    foreach ($colunas as $coluna => $valor) {
        if ($val[$col] == null) {
            $objPHPExcel->getActiveSheet()->SetCellValue($coluna . $linha, '---');
        } else {
            $objPHPExcel->getActiveSheet()->SetCellValue($coluna . $linha, utf8_encode($val[$col]));
        }
        $col++;
    }
    $linha++;
}
//$objPHPExcel->setActiveSheetIndex(0);
Exemple #7
0
foreach ($valores as $valor) {
    if ($linha == 1) {
        $linha++;
        continue;
    }
    $campo = explode("\t", $valor);
    echo "--";
    $codigo = strtoupper($campo[0]);
    $nomePaciente = removeAcentos(strtoupper($campo[1]));
    $numeroAtendimento = strtoupper($campo[2]);
    $convenio = strtoupper($campo[3]);
    $prescricao = strtoupper($campo[4]);
    $cirurgia = strtoupper($campo[5]);
    $hrInicio = strtoupper($campo[6]);
    $hrFim = strtoupper($campo[7]);
    $anestesia = removeAcentos(strtoupper($campo[8]));
    $nomeCirurgiao = strtoupper($campo[9]);
    $nomeAnestesista2 = strtoupper($campo[10]);
    $primeiroAuxiliar = strtoupper($campo[13]);
    $segundoAuxiliar = strtoupper($campo[14]);
    $carteirinha = strtoupper($campo[17]);
    $urgencia = 0;
    $dataDoAtendimento = change_data_from_Br_to_bd($cirurgia);
    $sqlProcRealizado = "select p from Entities\\ProcedimentoExecutado p where p.nroAtendimento = :nroAtendimento and p.dataAtendimento = '" . $dataDoAtendimento . "'";
    $q = $em->createQuery($sqlProcRealizado);
    $q->setParameter("nroAtendimento", $numeroAtendimento);
    $arrAtAntigos = array_search($numeroAtendimento, $arrHistory);
    $procRealizado = "";
    $procs = $q->getResult();
    foreach ($procs as $procRealizado) {
        break;
Exemple #8
0
 public function checarEmail()
 {
     if ($this->params["id_usuario"] && $this->params["email_usuario"]) {
         $modelUsuario = new ModelUsuario_Sistema(array("email" => removeAcentos(strtolower($this->params["email_usuario"])), "id" => $this->params["id_usuario"]));
     } else {
         if ($this->params["email_usuario"]) {
             $modelUsuario = new ModelUsuario_Sistema(array("email" => removeAcentos(strtolower($this->params["email_usuario"]))));
         }
     }
     $usuario = Usuario_SistemaDAO::consultarEmailUsuario($modelUsuario);
     if (!$usuario) {
         return true;
     } else {
         return false;
     }
 }
    echo "Arquivo n&atilde;o definido";
    exit;
}
if (isset($_FILES['i3GEOuploadshp']['name'])) {
    require_once dirname(__FILE__) . "/../../ms_configura.php";
    if (isset($logExec) && $logExec["upload"] == true) {
        i3GeoLog("prog: metaestat_uploadshp_submit filename:" . $_FILES['i3GEOuploadshp']['name'], $dir_tmp);
    }
    echo "<p class='paragrafo' >Carregando o arquivo...</p>";
    ob_flush();
    flush();
    sleep(1);
    $arqshp = $_FILES['i3GEOuploadshp']['tmp_name'];
    //verifica nomes e sobe arquivo
    verificaNome($_FILES['i3GEOuploadshp']['name'], "shp");
    $nomePrefixo = str_replace(" ", "_", removeAcentos(str_replace(".shp", "", $_FILES['i3GEOuploadshp']['name'])));
    $nomePrefixo = str_replace(".", "", $nomePrefixo);
    $nomePrefixo = strip_tags($nomePrefixo);
    $nomePrefixo = htmlspecialchars($nomePrefixo, ENT_QUOTES);
    $nomePrefixo = $nomePrefixo . md5(uniqid(rand(), true));
    $Arquivo = $_FILES['i3GEOuploadshp']['tmp_name'];
    $status = move_uploaded_file($Arquivo, $dir_tmp . "/" . $nomePrefixo . ".shp");
    if ($status != 1) {
        echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo SHP";
        exit;
    }
    $Arquivo = $_FILES['i3GEOuploadshx']['tmp_name'];
    $status = move_uploaded_file($Arquivo, $dir_tmp . "/" . $nomePrefixo . ".shx");
    if ($status != 1) {
        echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo SHX";
        exit;
Exemple #10
0
<?php

set_time_limit(1000 * 60 * 5);
error_reporting(E_ALL ^ E_NOTICE);
require_once '../excel-reader/excel_reader2.php';
require_once '../config.php';
$tabela = new Spreadsheet_Excel_Reader("../resources/others/TUSSnomes.xls");
$linha = 0;
$t = $em->find("Entities\\Tabela", 1);
for ($linha = 3; $linha < 4781; $linha++) {
    $codigo = removeAcentos($tabela->val($linha, 1));
    $descricao = strtoupper(removeAcentos($tabela->val($linha, 5)));
    $procedimento = new Entities\Procedimento();
    $procedimento->setCodigo($codigo);
    $procedimento->setDescricao($descricao);
    $procedimento->addTabela($t);
    $em->persist($procedimento);
    echo "Codigo: {$codigo} ; Descricao: {$descricao}<br />";
}
try {
    $em->flush();
} catch (Exception $e) {
    echo $e->getMessage();
}
Exemple #11
0
}
if (isset($_GET['url'])) {
    /************************* categoria **************************/
    $bd = new MySQL();
    $bd->Query('SELECT CATEGORIA_NOME,CATEGORIA_CDG FROM CATEGORIA');
    if ($bd->RowCount() > 0) {
        while ($row = mysqli_fetch_array($bd->last_result, MYSQLI_ASSOC)) {
            $cats[] = array("cdg" => $row['CATEGORIA_CDG'], "url" => removeAcentos(utf8_decode($row['CATEGORIA_NOME']), '-'));
        }
    }
    foreach ($cats as $C => $c) {
        //echo $c['cdg'].' - '.$c['url'].'<br>';
        $bd->Query('UPDATE CATEGORIA SET CATEGORIA_URL = "' . $c['url'] . '" 
                   WHERE CATEGORIA_CDG = ' . $c['cdg'] . ' ');
    }
    echo 'urls tabela CATEGORIA ok.<br>';
    /************************* noticia **************************/
    $bd = new MySQL();
    $bd->Query('SELECT NOTICIA_TITULO,NOTICIA_CDG FROM NOTICIA');
    if ($bd->RowCount() > 0) {
        while ($row = mysqli_fetch_array($bd->last_result, MYSQLI_ASSOC)) {
            $cats[] = array("cdg" => $row['NOTICIA_CDG'], "url" => removeAcentos(utf8_decode($row['NOTICIA_TITULO']), '-'));
        }
    }
    foreach ($cats as $C => $c) {
        //echo $c['cdg'].' - '.$c['url'].'<br>';
        $bd->Query('UPDATE NOTICIA SET NOTICIA_URL = "' . $c['url'] . '" 
                   WHERE NOTICIA_CDG = ' . $c['cdg'] . ' ');
    }
    echo 'urls tabela NOTICIA ok.<br>';
}
Exemple #12
0
function get_get($name)
{
    return trim(removeAcentos($_GET[$name]));
}
Exemple #13
0
					}

				} // fecha o while raiz

				//cria a pasta

				if (!file_exists('menus/')) {

					mkdir('menus/');	

				}

				include('../sistema/php/functionRemoveAcentos.php');

				$nomeArq = removeAcentos($_SESSION['usuario']);

				$nomeArq = str_replace(" ","_",$nomeArq);

				//cria o arquivo dos nenus

				$arquivo = fopen("menus/menu".$nomeArq.".txt","w");

				// grava o texto

				fwrite($arquivo,$txt);

				// fecha o arquivo

				fclose($arquivo);
Exemple #14
0
 if ($idioma == "pt") {
     $coluna = "nome_tema";
 } else {
     $coluna = $idioma;
 }
 $q = pegaDados("select link_tema,tags_tema,codigo_tema,{$coluna} as nome_tema from " . $esquemaadmin . "i3geoadmin_temas");
 $temas = array();
 $temaExiste = array();
 foreach ($q as $row) {
     $ts = html_entity_decode($row['tags_tema']);
     $i = $row['codigo_tema'];
     $nome = $row['nome_tema'];
     $link = $row['link_tema'];
     $tags = explode(" ", $ts);
     foreach ($tags as $t) {
         if (removeAcentos($t) == $tag) {
             if (!isset($temaExiste[$i])) {
                 $temas[] = array("codigoMap" => $i, "nome" => $nome, "link" => $link);
                 $temaExiste[$i] = 0;
             }
         }
     }
 }
 retornaJSON($temas);
 exit;
 break;
 /*
 Valor: PEGAPERFIS
 
 Lista de perfis
 
		$html .= "</td>";
	$html .= "</tr>";
	$html .= "<tr><td >&nbsp;</td></tr>";
	$html .= "<tr>";
		$html .= "<td>";
			$html .= " <strong>CL&Aacute;USULA 3&ordf;</strong> - Permanecem inalteradas";
			$html .= " todas as demais disposi&ccedil;&otilde;es do Termo de Compromisso do qual este Termo Aditivo possa a fazer parte integrante.";
		$html .= "</td>";
	$html .= "</tr>";
				
}
if ($_POST ['modelo'] == '3') {
	$html .= "<tr>";
		$html .= "<td>";
			$html .= "<strong>CL&Aacute;USULA 1&ordf;</strong> -";
			$html .= removeAcentos($_POST ['modelo3_clausula1']);
		$html .= "</td>";
	$html .= "</tr>";
	$html .= "<tr><td >&nbsp;</td></tr>";
	$html .= "<tr>";
		$html .= "<td>";
			$html .= "<strong>CL&Aacute;USULA 2&ordf;</strong> - Permanecem inalteradas";
			$html .= "todas as demais disposi&ccedil;&otilde;es do Termo de Compromisso do qual este Termo Aditivo possa a fazer parte integrante.";
		$html .= "</td>";
	$html .= "</tr>";
}
	
	$html .= "<tr><td >&nbsp;</td></tr>";
	$html .= "<tr><td >&nbsp;</td></tr>";
	
	$html .= "<tr>";
Exemple #16
0
										</script>

										';

								} // fecha o else do erros

							} else {

								$b1 = 0;

								if (!empty($banner1['name'])) {

									// Gera um nome único para a imagem

									$bn1 = removeAcentos($banner1['name']);

									$ne1 = str_replace(" ","_",$bn1);

									$nome_imagem1 = uniqid().$ne1; 

									// Caminho de onde ficará a imagem

									$caminho_imagem1 = "../../arquivos/usuarios/curriculos/".$nome_imagem1;

									$caminho_imagem3 = "arquivos/usuarios/curriculos/".$nome_imagem1;

								} else {

									$b1++;	
Exemple #17
0
<?php

//use Entities;
$idAtendimento = get_request("idAtendimento");
$procedimentos = get_request("procedimentos");
$valor = get_request("valor");
$justificativa = str_replace("\n", "<br />", removeAcentos($_REQUEST["justificativa"]));
$idCredenciado = get_request("idCredenciado");
$status = $_REQUEST["status"];
$idRecurso = $_REQUEST['idRecurso'];
$em->getConnection()->beginTransaction();
$atendimento = $em->find('Entities\\ProcedimentoExecutado', $idAtendimento);
if ($status == "DEVIDA") {
    $s = $em->find("Entities\\StatusDigitacao", 5);
    $atendimento->setStatus($s);
}
$recurso = $em->find('Entities\\Recurso', $idRecurso);
if (empty($recurso)) {
    $recurso = new Entities\Recurso();
}
$recurso->setStatusRecurso($status);
$recurso->setProcedimentoExecutado($atendimento);
$recurso->setJustificativa($justificativa);
$data = new DateTime();
$recurso->setDataDigitacao($data);
$recurso->setValor($valor);
$recurso->setProcedimentos($procedimentos);
if ($idCredenciado != "0") {
    $medico = $em->find("Entities\\Medico", $idCredenciado);
    $recurso->setCredenciado($medico);
}
				$menu = $_POST['menu'];

				include("../../php/conexao.php");

				switch ($cat) {

					case "menu":

						include("functionRemoveAcentos.php");

						$raiz = $_POST['raiz'];

						$sub = $_POST['sub'];

						$sigla = removeAcentos($_POST['menu']);

						$sigla = str_replace(" ","_",$sigla);						

						$sql = "UPDATE menus SET menu='$menu',categoria='$cat',raiz='$raiz',submenu='$sub',sigla='$sigla' WHERE id='".$_POST['cod']."'";

						break;

					case "submenu":

						if (isset($_POST['validaMenu']) and $_POST['validaMenu'] == 'true') {

							$raiz = $_POST['raiz'];						

							$sql = "UPDATE menus SET menu='$menu',categoria='$cat',raiz='$raiz',submenu='',sigla='' WHERE id='".$_POST['cod']."'";	
Exemple #19
0
         $dirs[] = $d . "/wmts/" . $nome;
         foreach ($dirs as $dir) {
             rrmdir($dir);
         }
     }
     retornaJSON("ok");
     exit;
     break;
 case "CLONARMAPFILE":
     $codigo = $_POST["codigo"];
     $codigo = str_replace(" ", "", removeAcentos($codigo));
     $codigo = str_replace(".", "", $codigo);
     $codigo = strip_tags($codigo);
     $codigo = htmlspecialchars($codigo, ENT_QUOTES);
     $novocodigo = $_POST["novocodigo"];
     $novocodigo = str_replace(" ", "", removeAcentos($novocodigo));
     $novocodigo = str_replace(".", "", $novocodigo);
     $novocodigo = strip_tags($novocodigo);
     $novocodigo = htmlspecialchars($novocodigo, ENT_QUOTES);
     $arq = $locaplic . "/temas/" . $codigo . ".map";
     $arqnovo = $locaplic . "/temas/" . $novocodigo . ".map";
     if ($codigo == "" || !file_exists($arq)) {
         header("HTTP/1.1 400 arquivo nao existe");
         exit;
     }
     if ($novocodigo == "" || file_exists($arqnovo)) {
         header("HTTP/1.1 400 arquivo ja existe");
         exit;
     }
     //obtem os dados do banco do tema existente
     $dados = pegaDados("SELECT * from " . $esquemaadmin . "i3geoadmin_temas WHERE codigo_tema = '" . $codigo . "'", $dbh, false);
Exemple #20
0
 public function editarAction()
 {
     $form = new Application_Form_Produto();
     $form->setAction($this->_helper->url('editar'));
     $request = $this->getRequest();
     $dados = $this->getRequest()->getParams();
     $id = $this->getRequest()->getParam('id');
     $dados = $this->getRequest()->getParams();
     $form->setAction($this->_helper->url('editar/id/' . $id));
     /* Obtem um unico usuário através do id passado */
     $produto = $this->_produto->find($id)->current();
     $imagens = $this->_imagens->fetchAll("pro_id_fk='{$id}'", "ima_id DESC");
     $produto->pro_tamanhos = json_decode($produto->pro_tamanhos);
     $this->view->categoria = $produto->cat_id_fk;
     $this->view->imagens = $imagens;
     $produto->pro_valor = number_format($produto->pro_valor, 2, ',', '.');
     $form->populate($produto->toArray());
     if ($request->isPost() && $form->isValid($request->getPost())) {
         try {
             $numeros = $dados["pro_tamanhos"];
             foreach ($numeros as $key => $value) {
                 $numeracao[] = $value;
             }
             $json = json_encode($numeracao);
             $valor = str_replace('.', '', $dados["pro_valor"]);
             $valor = str_replace(',', '.', $valor);
             $produto->pro_nome = $dados["pro_nome"];
             $produto->pro_identificador = $dados["pro_identificador"];
             $produto->pro_descricao = $dados["pro_descricao"];
             $produto->pro_valor = $valor;
             $produto->cat_id_fk = $dados["select_categoria"];
             $produto->pro_tamanhos = $json;
             $produto->pro_pontos = $dados["pro_pontos"];
             $produto->save();
             /** 
                          Faz o upload das imagens
                          **/
             $dir = "./uploads/produtos/";
             $adapter = new Zend_File_Transfer_Adapter_Http();
             try {
                 $this->_imagens = new Application_Model_ImagensProdutos();
                 $form->getElement('imagens')->setDestination("{$dir}");
                 foreach ($adapter->getFileInfo() as $file => $info) {
                     if ($adapter->isUploaded($file)) {
                         $name = $adapter->getFileName($file);
                         require_once APPLICATION_PATH . '/../library/Tokem/Functions/functions.php';
                         $fileName = removeAcentos($info['name']);
                         $newFileName = strtolower(str_replace(' ', '', $fileName));
                         $img_nome = md5(microtime()) . '_' . $newFileName;
                         $fname = $dir . "/" . $img_nome;
                         $caminho = ltrim($dir, ".");
                         $image = array("ima_nome" => "{$img_nome}", "pro_id_fk" => $id);
                         $imagem = $this->_imagens->fetchRow("pro_id_fk='{$id}'");
                         if (!empty($imagem)) {
                             unlink("../public/uploads/produtos/" . $imagem->ima_nome);
                             $imagem->ima_nome = $img_nome;
                             $imagem->save();
                         } else {
                             $this->_imagens->insert($image);
                         }
                         /**
                          *  Let's inject the renaming filter
                          */
                         $adapter->addFilter(new Zend_Filter_File_Rename(array('target' => $fname, 'overwrite' => true)), null, $file);
                         /**
                          * And then we call receive manually
                          */
                         $adapter->receive($file);
                     }
                 }
                 $flashMessenger = $this->_helper->FlashMessenger;
                 $flashMessenger->addMessage('
                 <div class="alert alert-success alert-dismissible" role="alert">
                 <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                 <strong>Sucesso</strong> - Tudo ocorreu bem!
                 </div>
             ');
                 $this->_helper->redirector('index');
                 exit;
             } catch (Exception $e) {
                 echo $e->getMessage();
                 exit;
                 $flashMessenger = $this->_helper->FlashMessenger;
                 $flashMessenger->addMessage('<div class="alert alert-danger alert-dismissible" role="alert">
                 <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                 <strong>ERRO</strong> - Ocorreu um erro inesperado! se persistir entre em contato com o suporte!
             </div>');
                 $this->_helper->redirector('index');
                 exit;
             }
             /**
                         fim do upload de imagens
                         **/
             $flashMessenger = $this->_helper->FlashMessenger;
             $flashMessenger->addMessage('
                 <div class="alert alert-success alert-dismissible" role="alert">
                 <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                 <strong>Sucesso</strong> - Tudo ocorreu bem!
                 </div>
             ');
         } catch (Zend_Db_Exception $e) {
             echo $e->getMessage();
             exit;
             $flashMessenger = $this->_helper->FlashMessenger;
             $flashMessenger->addMessage('<div class="alert alert-danger alert-dismissible" role="alert">
                 <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                 <strong>ERRO</strong> - Ocorreu um erro inesperado! se persistir entre em contato com o suporte!
                 </div>');
         }
         $this->_helper->redirector('index');
         exit;
     }
     $this->view->form = $form;
 }
		<?php 
if ($_POST["tabelaDestinocsv"] == "") {
    echo "Nome da tabela n&atilde;o definido";
    exit;
}
if ($_FILES['i3GEOuploadcsv']['name'] == "") {
    echo "Arquivo n&atilde;o definido";
    exit;
}
if (isset($_FILES['i3GEOuploadcsv']['name'])) {
    echo "<p class='paragrafo' >Carregando o arquivo...</p>";
    ob_flush();
    flush();
    sleep(1);
    $arqcsv = $_FILES['i3GEOuploadcsv']['tmp_name'];
    $nomePrefixo = str_replace(" ", "_", removeAcentos($_FILES['i3GEOuploadcsv']['name']));
    $nomePrefixo = str_replace(".", "", $nomePrefixo);
    $nomePrefixo = strip_tags($nomePrefixo);
    $nomePrefixo = htmlspecialchars($nomePrefixo, ENT_QUOTES);
    $nomePrefixo = $nomePrefixo . md5(uniqid(rand(), true));
    $nomePrefixo = $nomePrefixo . "_" . nomeRandomico(4) . ".csv";
    $Arquivo = $_FILES['i3GEOuploadcsv']['tmp_name'];
    $status = move_uploaded_file($Arquivo, $dir_tmp . "/" . $nomePrefixo);
    if ($status != 1) {
        echo "<p class='paragrafo' >Ocorreu um erro no envio do arquivo";
        exit;
    }
    if (!file_exists($dir_tmp . "/" . $nomePrefixo)) {
        echo "<p class='paragrafo' >Ocorreu algum problema no envio do arquivo " . $dir_tmp . "/" . $nomePrefixo;
        paraAguarde();
        exit;
Exemple #22
0
<?php

$em->getConnection()->beginTransaction();
$id = get_request("idConsulta");
$idAnestesista = get_request("anestesista");
$idCirurgiao = get_request("cirurgiao");
$nome = removeAcentos(getProperUTF8Decode(trim($_REQUEST["nome"])));
$data = get_request("data");
$hrInicio = get_request("hrInicio");
$hrFim = get_request("hrFim");
$idConvenio = get_request("idConvenio");
$sexo = get_request("sexo");
$telefone = get_request("telefone");
$dataCirurgia = get_request("dataCirurgia");
$idade = get_request("idade");
$carteirinha = get_request("carteirinha");
$planoConvenio = get_request("planoConvenio");
$cid = get_request("cid");
$digitado = get_request("digitado");
$anestesista = $em->find("Entities\\Medico", $idAnestesista);
$cirurgiao = $em->find("Entities\\Medico", $idCirurgiao);
$convenio = $em->find("Entities\\Convenio", $idConvenio);
$consulta = $em->find("Entities\\ProcedimentoExecutado", $id);
$data = change_data_from_Br_to_bd($data);
if (empty($consulta)) {
    $consulta = new Entities\ProcedimentoExecutado();
    //	$hrInicio = getDateTimeFromHour($hrInicio);
}
//verifica se ha outra consulta no mesmo dia e hr
$dql = "select p from Entities\\ProcedimentoExecutado p where p.tipo='C' and p.dataAtendimento = :dataAtendimento and p.hrInicio = :hrInicio ";
$qP = $em->createQuery($dql);