- Fórum WMO
- → hefestos's Content
hefestos's Content
There have been 18 items by hefestos (Search limited from 26/04/2023)
#744247 Inserir Vários Registros Com Um Único Form
Posted by hefestos on 28/05/2006, 13:44 in PHP
mas isso não vem ao caso...
meu formulário vai ter os campos, compra (com o codigo da compra), o valor, e o vencimento de cada parcela.
só que para cada linha do formulário é necessário q seja inserido um novo registro no banco.
#686564 Função Para Ler Rss
Posted by hefestos on 10/01/2006, 18:37 in PHP
Estou desenvolvendo só por curiosidade, pra talvez utilizar em uma aplicação futura.
Gostaria de saber se alguém aí tem exemplo de código pra leitura de rss, até agora no fórum só vi tutorial pra montar o arquivo xml , mas não vi nenhum pra leitura ... me desculpem se eu estiver enganado.. se alguém puder me dar uma mão... agradeço mto
falow... abraço
#686260 Problemas Com Mysql
Posted by hefestos on 10/01/2006, 11:41 in PHP
por padrão em algumas instalações do mysql
as permissões de acesso estão setadas para o nome "localhost" e não para o ip 127.0.0.1 diretamente.
então, pelo menos no meu caso, o servidor não resolvia, o nome pelo ip. então bastou eu colocar ao invés do ip o nome localhost , que funcionou.
#675822 Classe Gd
Posted by hefestos on 19/12/2005, 12:52 in PHP
function Imagem($img,$logo){ $this -> Img = getimagesize($img); $type = $this -> Img[2]; if( $type==1 ){ $this -> Copia = imagecreatefromgif( $img ); }elseif( $type==3 ){ $this -> Copia = imagecreatefrompng( $img ); }elseif( $type==2 ){ $this -> Copia = imagecreatefromjpeg( $img ); } $this -> X = imagesx($this -> Copia); $this -> Y = imagesy($this -> Copia); $this -> Logo = imagecreatefromjpeg("imagens/$logo"); imagecopymerge($this->Copia , $this -> Logo , $this -> X - (imagesx($this -> Logo) + 5) , $this -> Y - ( imagesy($this -> Logo) + 5 ) , 0 , 0 , imagesx($this -> Logo) , imagesy($this -> Logo) , 100); header ("Content-type: image/jpeg"); imagepng($this -> Copia); @imagedestroy( $this->Copia ); @imagedestroy( $this->Logo ); } function Thumb($img,$dim){ $this -> Img = getimagesize($img); $type = $this -> Img[2]; if( $type==1 ){ $this -> Copia = imagecreatefromgif( $img ); }elseif( $type==3 ){ $this -> Copia = imagecreatefrompng( $img ); }elseif( $type==2 ){ $this -> Copia = imagecreatefromjpeg( $img ); } $this -> X = imagesx($this -> Copia); $this -> Y = imagesy($this -> Copia); if($this -> X > $this -> Y){ $this -> T_X = $dim; $this -> T_Y = floor( ($this -> Y * $dim) / $this -> X ); }elseif( $this -> Y > $this -> X ){ $this -> T_Y = $dim; $this -> T_X = floor( ($this -> X * $dim) / $this -> Y ); }else{ $this -> T_X = $dim; $this -> T_Y = $dim; } $this -> Thumb = imagecreatetruecolor( $this -> T_X , $this -> T_Y ); imagecopyresampled( $this -> Thumb , $this -> Copia, 0,0,0,0, $this -> T_X ,$this -> T_Y , $this -> X, $this -> Y ); header ("Content-type: image/jpeg"); imagejpeg($this -> Thumb); @imagedestroy( $this->Thumb ); @imagedestroy( $this->Copia ); }
ele ta gerando em PNG, e a imagem ta muito grande.. tpw.. ele pega a logo q tem 6kb mais a foto q tem 20kb e a foto fica com 200kb em png... queria gerar em jpg.. pra ver se diminui um pouco...
#647402 Dúvida Mysql
Posted by hefestos on 05/10/2005, 13:37 in MySQL
estou fazendo assim:
SELECT NOME, SUM(SAI_INTERVALO-ENTRADA), SUM(ENTRA_INTERVALO-SAIDA) FROM FUNCIONARIOS FUN INNER JOIN PONTO PON ON (FUN.FUNCOD=PON.FUNCOD) WHERE CODIGOFUNCIONARIO=@code, dia>=@datamin, dia<=@datamax GROUP BY NOME
alguém ai pode me ajudar a corrigir o select.... com esse ai... ele retorna valor zero para a soma das horas extras do período
#620858 Integração Com Ftp
Posted by hefestos on 01/08/2005, 11:17 in PHP
<?
//PEGA A VARIÁVEL DE SEÇÃO E MONTA VARIÁVEL PARA ACESSO A PASTA ESPECÍFICA
$usuario = $_SESSION['MM_Username'];
$pasta = "httpdocs/sigweb/ged/".$usuario;
//EXIBE OS ARQUIVOS DA RAIZ USANDO A FUNÇÃO FTP_NLIST()
$arr_arq = ftp_nlist($conn, $pasta);
for($i=0; $i<sizeof($arr_arq); $i++) { ?>
<tr>
<td height="30" width="5%" bgcolor="#EBEBEB">
<input type="checkbox" name="arquivo[]" value="<? echo $arr_arq[$i]; ?>"></td>
<td height="30" width="45%" bgcolor="#EBEBEB"> <? echo $arr_arq[$i]; ?></td>
</tr>
<?
}//FECHA FOR ?>
pra exibir os arquivos, só que ele exibe o caminho inteiro do arquivo, como faço pra exibir só o nome ?
#620818 Integração Com Ftp
Posted by hefestos on 01/08/2005, 09:54 in PHP
<?
//EXIBE OS ARQUIVOS DA RAIZ USANDO A FUNÇÃO FTP_NLIST()
$arr_arq = ftp_nlist($conn, "");
for($i=0; $i<sizeof($arr_arq); $i++) { ?>
<tr>
<td height="30" width="5%" bgcolor="#EBEBEB">
<input type="checkbox" name="arquivo[]" value="<? echo $arr_arq[$i]; ?>"></td>
<td height="30" width="45%" bgcolor="#EBEBEB"> <? echo $arr_arq[$i]; ?></td>
</tr>
<? }//FECHA FOR ?>
Para exibir os arquivos da raiz do ftp...
Desculpem minha ignorância, mas gostaria de saber o que devo alterar para exibir os arquivos do diretório:
raiz/variaveldeseção/
?
#602227 Acesso A Diretório
Posted by hefestos on 20/06/2005, 15:46 in PHP
<?php $listar = "empresas"; $diretorio= $_SESSION['MM_Username']."/downloads"; if ($dir=opendir("$listar/".$diretorio)){ while(($arquivos=readdir($dir)) !== false){ if ($arquivos <> "." && $arquivos <> ".." ){ $tamanho[] = filesize ("$listar/".$diretorio."/".$arquivos); $data_hora[] = filemtime ("$listar/".$diretorio."/".$arquivos); $nome_arquivo[] = $arquivos; } } closedir($dir); } $n_arquivos = count($data_hora); arsort($data_hora); reset($data_hora); while (list ($chave, $valor) = each ($data_hora)){ ?><tr><td class="ved_x_bold"><div align="center"> <a href="<?php echo "$listar".$diretorio."/".$nome_arquivo[$chave]; ?>"></a> <a target="_blank" href="<?php echo "$listar"."/".$diretorio."/".$nome_arquivo[$chave]; ?>"> <?php $arquivo= $nome_arquivo[$chave]; $limite=35; $arquivo = substr($arquivo, 0,$limite); echo $arquivo."..."; ?> </a></div></td> <td align="center" class="ved_x_sgl"> <?php echo number_format (($tamanho[$chave]/1024),2)."k"; ?> </td></tr> <?php } clearstatcache(); ?>
Só que tem um problemão.... quando não tem arquivos no diretório, ele da o seguinte erro :
Warning: arsort() expects parameter 1 to be array, null given in /home/racional/public_html/funcionarios.php on line 119
Warning: reset(): Passed variable is not an array or object in /home/racional/public_html/funcionarios.php on line 120
Warning: Variable passed to each() is not an array or object in /home/racional/public_html/funcionarios.php on line 121
o que posso adicionar no código pra não aparecer o erro ? ou pra aparecer uma mensagem mais amigável
#599133 Conversão De Double
Posted by hefestos on 14/06/2005, 17:06 in PHP
Gostaria de saber o que tenho de alterar aqui para que o valor que for digitado (com virgula) seja convertido (para ponto), para poder ser tratado como double.
case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break;
Desculpem pelo post duplo ... o browser travou na hora
#593148 Listar Apagar Arquivos Do Servidor
Posted by hefestos on 01/06/2005, 20:39 in PHP
site.com.br/apagar?empresa=25&pasta=func
preciso que ele me liste os arquivos do diretorio 25/func/ . esta é a primeira etapa.
a segunda é que clicando em um link, ele apague este arquivo.
alguém me da um help ? não sei o comando pra apagar arquivos por php.
alguém me passa a sintaxe? e como passar e pegar essas variaveis ?
- Fórum WMO
- → hefestos's Content
- Privacy Policy
- Regras ·