Boa noite galera, eu não entendo nada de PHP/mysql, não sou programador, mais sou fuça. Bom solicitei a um profissional da area que fizesse um site pra mim, com algumas funções e o mesmo fiz exatamente como eu queria. Porem depois de alguns dias, descobri que há um problema no campo número, onde eu informo peso liquido e peso bruto. Eu tinha um sistema em access do qual tenho um conhecimento basico que já me ajudar a criar pequenos sistemas, então queria que fosse levado para um site esse sistema onde eu informasse alguns dados . Vou exemplificar o que anda acontecendo: Peso liquido : 2,568.00000 Peso bruto : 3,895.35600 Os campos acima em meu formulário precisa ter 5 casas decimais, ai se eu informar conforme acima e salvar fica de boa, do jeitinho que está, diferente do access que posso informar numeros conforme escrevemos no brasil , onde a virgula vem por ultimo. Aí eu clico em um botao GERAR CAPA, onde tem algumas outras informações e tambem esse peso liquido/bruto e fica tudo na boa, o que acontece é que se eu sair desse registro e for para outro e voltar nesse posteriormente , já muda tudo. Primeiro ele muda para: Peso liquido : 2.568,00000 Peso bruto : 3.895,35600 Porem se clicar no botao GERAR CAPA, já ira aparecer apenas 2 tanto para liquido como 3 para bruto e se sair desse registro e voltar mais uma vez já aparece assim: Peso liquido : 2,00000 Peso bruto : 3,00000 ---------------------------------------------------------------------------------PARTE DO CODIGO --------------------------------------------------------------------- <? if ( !$_SESSION[sESSIONADMIN]['logado'] ) die(); if ( $_GET['op'] ) { $nref = trata_var($_POST['nref'], string); $sref = trata_var($_POST['sref'], string); $id_empresa = trata_var($_POST['id_empresa'], int); $mawb = trata_var($_POST['mawb'], string); $hawb = trata_var($_POST['hawb'], string); $fatura = trata_var($_POST['fatura'], string); $id_fabexp = trata_var($_POST['id_fabexp'], int); $dire = trata_var($_POST['dire'], string); $dire_data = trata_var($_POST['dire_data'], string); $dde = trata_var($_POST['dde'], string); $termo = trata_var($_POST['termo'], string); $termo_data = trata_var($_POST['termo_data'], string); $peso_liq = trata_var($_POST['peso_liq'], double); $peso_bruto = trata_var($_POST['peso_bruto'], double); $nf = trata_var($_POST['nf'], int); $embarque = trata_var($_POST['embarque'], string); $ag_registro = trata_var($_POST['ag_registro'], string); $ag_originais = trata_var($_POST['ag_originais'], string); $ag_icms = trata_var($_POST['ag_icms'], string); $lib_federal = trata_var($_POST['lib_federal'], string); $lib_estadual = trata_var($_POST['lib_estadual'], string); $faturamento = trata_var($_POST['faturamento'], string); $impexp = trata_var($_POST['impexp'], string); $followup = trata_var($_POST['followup'], string); $li = trata_var($_POST['li'], string); $cor = trata_var($_POST['cor'], string); $ag_descricao = trata_var($_POST['ag_descricao'], string); $descricao_ok = trata_var($_POST['descricao_ok'], string); $registro_ok = trata_var($_POST['registro_ok'], string); $obs = trata_var($_POST['obs'], string); // Validações $dire_data = !empty($dire_data) ? data_br_to_eua($dire_data) : "0000-00-00"; $termo_data = !empty($termo_data) ? data_br_to_eua($termo_data) : "0000-00-00"; $ag_registro = !empty($ag_registro) ? 'S' : 'N'; $ag_originais = !empty($ag_originais) ? 'S' : 'N'; $ag_icms = !empty($ag_icms) ? 'S' : 'N'; $lib_federal = !empty($lib_federal) ? 'S' : 'N'; $lib_estadual = !empty($lib_estadual) ? 'S' : 'N'; $faturamento = !empty($faturamento) ? 'S' : 'N'; $ag_descricao = !empty($ag_descricao) ? 'S' : 'N'; $descricao_ok = !empty($descricao_ok) ? 'S' : 'N'; $registro_ok = !empty($registro_ok) ? 'S' : 'N'; $inv = explode("-", $nref); $nref_inv = $inv[1] . "-" . $inv[0]; switch ( $_GET['op'] ) { case 'nova' : $sql = "INSERT INTO $TPROCESSOS (data, nref, nref_inv, sref, id_empresa, mawb, hawb, fatura, id_fabexp, dire, dire_data, dde, termo, termo_data, peso_liq, peso_bruto, nf, embarque, ag_registro, ag_originais, ag_icms, lib_federal, lib_estadual, faturamento, impexp, followup, li, cor, ag_descricao, descricao_ok, registro_ok, obs) VALUES ('".time()."', '$nref', '$nref_inv', '$sref', '$id_empresa', '$mawb', '$hawb', '$fatura', '$id_fabexp', '$dire', '$dire_data', '$dde', '$termo', '$termo_data', '$peso_liq', '$peso_bruto', '$nf', '$embarque', '$ag_registro', '$ag_originais', '$ag_icms', '$lib_federal', '$lib_estadual', '$faturamento', '$impexp', '$followup', '$li', '$cor', '$ag_descricao', '$descricao_ok', '$registro_ok', '$obs')"; if ( mysql_query($sql) or die(mysql_error()) ) { cria_log ("INSERIU PROCESSO: $nref"); $msgalerta = "Processo Inserido com Sucesso!"; $sel_id = mysql_query("SELECT id FROM $TPROCESSOS WHERE nref = '$nref' AND sref = '$sref' ORDER BY id DESC LIMIT 1"); $_GET['id'] = mysql_result($sel_id, 0, "id"); } else { $msgalerta = "Falha ao Inserir o Processo!"; } break; } } $capa = false; if ( $_GET['id'] ) { $id = trata_var($_GET['id'], int); $sel = mysql_query("SELECT * FROM $TPROCESSOS WHERE id = '$id'"); if ( mysql_num_rows($sel) ) { $n = mysql_fetch_assoc($sel); $data_dire = ( $n['dire_data'] != "0000-00-00" ) ? data_eua_to_br($n['dire_data']) : ""; $data_termo = ( $n['termo_data'] != "0000-00-00" ) ? data_eua_to_br($n['termo_data']) : ""; $n['peso_liq'] = number_format($n['peso_liq'], 5); $n['peso_bruto'] = number_format($n['peso_bruto'], 5); $abertura = $n['data']; $capa = true; } else { $msgalerta = $modulo_name." não cadastrada."; exit(); } $action = "includes/".$me."/ajax.php?jac=evento_edita&id=$id"; $tit = "Atualizar ".$modulo_name; $ident = "id=f".$me."'"; } else { $action = "index.php?ac=add_".$me."&op=nova"; $tit = "Adicionar ".$modulo_name; $ident = "id='fnew".$me."'"; $sel = mysql_query("SELECT nref FROM $TPROCESSOS ORDER BY nref_inv DESC"); $nref = ( mysql_num_rows($sel) > 0 ) ? mysql_result($sel, 0) : "0000-".date("y"); $inv = explode("-", $nref); $nref_inv = $inv[1] . "-" . $inv[0]; $ref = (int) $inv[0]; $ref++; $nref = ""; for ($i = strlen($ref); $i < 4; $i++) $nref .= "0"; $nref .= $ref; $n = array(); $n['nref] = $nref . "-" . date("y"); //$data_dire = date("d/m/Y"); //$data_termo = date("d/m/Y"); $abertura = time(); } $dire_dis = ( $data_dire == "" ) ? 'disabled="disabled"' : ""; $termo_dis = ( $data_termo == "" ) ? 'disabled="disabled"' : ""; ?> <div id="alerta"> <div style="text-align: right;"><a href="#" id="close" title="Ocultar"><img src="images/icon_close.png" border="0"></a></div> <div id="msg"><?=$msgalerta;?></div> </div> <? if ( empty($msgalerta) ) { ?> <script type="text/javascript"> $("#alerta").fadeOut(); </script> <? } ?> <!-- FORMULÁRIO DE ADICIONAR/ATUALIZAR --> <form action='<?=$action;?>' method='post' enctype='multipart/form-data' <?=$ident;?>> <table width='99%' align='center' cellpadding="0" cellspacing="0" class='tab_main'> <tr> <td colspan='2' align='center' class='tit'><?=$tit;?></td> </tr> <? if ( $capa ) { ?> <tr> <td colspan="2" align="right"> <button onclick="window.open('includes/<?=$me;?>/capa.php?proc=<?=$n['id'];?>', 'Capa<?=$n['id'];?>');"> <img src="includes/<?=$me;?>/icon_zoom.png"> Gerar Capa ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Desde já agradeço a atenção de todos.