Hora e ultimo log

OLa, fiz umas alterações num gerenciador de noticias, coloquei pra aparecer o nome do usuario logado, o IP da maquina, mas gostaria de colocar o seu log, tipo a data e a hora do seu ultimo login, komo possso fazer isso, e outra coisa…o sistema puxa a hora sempre uma hora a mais, tipo agora são 18:23 ai ele puxa sempre 19:23, komo faço pra poder deixar ele puxando a hora correta, estou no mato grosso do sul, e aqui a hora é sempre uma hora a menos que Brasilia, algem pode ajudar

Esse gerenciador de notícias é próprio ou é um open-source ou um proprietário? Se for construído por vocês aí mesmo, poste o código, ou fragmento dele, no qual você fez as alterações… e onde deseja fazer essas alterações. Sobre o horário, normalmente, é fácil resolver essa hora extra mostre o código.

[size=24]este é o codigooo da pagina onde cadastro as noticias…[/size]

<? require "verifica.php";?> <? $variables=(strtolower($_SERVER['REQUEST_METHOD'])== 'GET') ? $_GET : $_POST; foreach ($variables as $k=> $v) $$k=$v; $palavra = "Notícia(s)"; $palavra2 = "Categorias"; $tabela = "noticias"; $tabela2 = $tabela."_cat"; $tabela3 = $tabela."_capa"; $file = "$tabela"; // iniçio da acao INSERI NO BD if($acao== "insertbd"){ $data = "$ano-$mes-$dia $hora"; $sql = "INSERT INTO $tabela VALUES ('', '$usuario', '$id_capa', '$id_cat', '$id_col', '$data', '$data2', '$chapeu', '$titulo', '$subtitulo', '$texto', '', '$fotos_extras', '$autor', '$creditos_fotos', '$legenda_fotos', '$alinhamento_foto', '$largura_foto', '$altura_foto', 'S')"; $sql2 = mysql_query($sql); $id_recuperado = mysql_insert_id(); $dir = "../images/$tabela/$id_recuperado"; //echo "$dir"; // inicia criação de pasta $pasta = @mkdir("$dir", 0777); @chmod("$dir", 0777); // fim da criação da pasta $uploaddir = "$dir/"; if(is_dir("$dir")){ if($foto != "none") { if (@copy($_FILES['foto']['tmp_name'], $uploaddir . $_FILES['foto']['name'])) { $foto1 = $_FILES['foto']['name']; //echo "$foto1 enviada com sucesso!
"; $var1 = mysql_query("update $tabela set foto='$foto1' where id='$id_recuperado'"); } else { echo ""; } } } else { echo ""; } $mgs = "$palavra Inserido com Sucesso!"; echo "
 $mgs

"; //echo ""; } // fim da acao INSERI NO BD // iniçio da acao UPDATE NO BD if($acao== "updatebd"){ $data = "$ano-$mes-$dia $hora"; if($nova_foto == "S"){ $dir = "../images/$tabela/$id"; $uploaddir = "$dir/"; if(is_dir("$dir")){ if($foto != "none") { if (@copy($_FILES['foto']['tmp_name'], $uploaddir . $_FILES['foto']['name'])) { $foto1 = $_FILES['foto']['name']; //echo "$foto1 enviada com sucesso!
"; } else { echo ""; } } } else { echo ""; } @unlink("$dir/$foto_antiga"); } else { $foto1 = "$foto_antiga"; } $sql = "UPDATE $tabela SET id_user='$usuario', id_capa='$id_capa', id_cat='$id_cat', id_col='$id_col', data='$data', data2='$data2', chapeu='$chapeu', titulo='$titulo', subtitulo='$subtitulo', texto='$texto', foto='$foto1', fotos_extras='$fotos_extras', autor='$autor', creditos_fotos='$creditos_fotos', legenda_fotos='$legenda_fotos', alinhamento_foto='$alinhamento_foto', largura_foto='$largura_foto', altura_foto='$altura_foto' WHERE id='$id'"; $sql2 = mysql_query($sql); $mgs = "$palavra Alterada com Sucesso!"; echo "
 $mgs

"; //echo ""; } // fim da acao UPDATE NO BD // iniçio da acao STATUS NO BD if($acao == "status"){ $sql = "UPDATE $tabela SET status='$status' WHERE id='$id'"; $sql2 = mysql_query($sql); $mgs = "Status Alterado com Sucesso!"; echo "
 $mgs

"; //echo ""; } // fim da acao STATUS NO BD // iniçio da acao EXCLUIR SELECIONADOS if($acao == "excluir_selecionados"){ $listas = implode("|", $listas); // echo "$planos
"; $lista = explode("|", $listas); $total = count($lista); // echo $total; for($i=0; $i<$total; $i++){ $sql = "delete from $tabela WHERE id='$lista[$i]'"; $sql2 = mysql_query($sql); //echo "$sql
"; $dir = "../images/noticias/$lista[$i]/"; $dir1 = opendir("$dir"); while ($res =readdir($dir1)){ if ($res!='' && $res!='.' && $res!='..'){ $url = "$dir/$res"; @unlink("$url"); } } @rmdir ("$dir"); } $mgs = "$palavra Excluído com Sucesso!"; echo "
 $mgs

"; //echo ""; } // fim da acao EXCLUIR SELECIONADOS // iniçio da acao FORM DE CADASTRO E ALTERAR //if($acao== "FORM"){ $form1 = "FORMULARIO"; $sql=mysql_query("SELECT * FROM $tabela WHERE id='$id'"); $dados=mysql_fetch_array($sql); $dh = explode(" ", $dados[data]); $data = explode("-", $dh[0]); $hora = $dh[1]; ?>

<input name=“acao” type=“hidden” value="<?=(empty($id))?"insertbd":"updatebd";?>">

Inserir Novo Registro | Listar Registros









Data / Hora Noticias:
  " size="1" maxlength="2"?> " size="1" maxlength="2"?> " size="4" maxlength="4"?> " size="5" maxlength="5"?> "?>
Chapéu:
 
Título:
 
Subtítulo Capa:
 
Texto Noticias:


  <?

include("…/editor/fckeditor.php");

$oFCKeditor = new FCKeditor(‘texto’) ;

$oFCKeditor->BasePath = “…/editor/”;

$oFCKeditor->Value = “$dados[texto]”;

$oFCKeditor->Create() ;

?>




















Autor Noticias:









  <input name=‘autor’ type=‘text’ style=“width:350px; height:20px;“value=”<? echo $dados[autor]?>” size=55 class=“input” onBlur=“this.className=‘input’;” onFocus=“this.className=‘inputon’;”>






Categoria
Noticias:





 


<?
	  $sql5 = mysql_query("SELECT * FROM noticias_cat WHERE status='S' order by nome");

	  while($dados5=mysql_fetch_array($sql5)){

	  ?>
                  <option value='<?=$dados5[id]?>' <?=($dados[id_cat]==$dados5[id])?"selected":"";?>> 
                  <?=$dados5[nome]?>
                  </option>
                  <? }?>
                </select></td>
              <td width="15" align="right">&nbsp;</td>
            </tr>
          </table></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="100" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="35" bgcolor="#FFFFE1"> <div align="center"> 
              <table cellpadding="0" cellspacing="0" width="90" height="30">
                <!-- MSTableType="nolayout" -->
                <tr> 
                  <td height="30" bgcolor="#FFFFE1"> <div align="center"> 
                      <table cellpadding="0" cellspacing="0" width="90" height="30">
                        <!-- MSTableType="nolayout" -->
                        <tr> 
                          <td height="30"> <span style="font-weight: 700"> 
                            <font face="Arial" style="font-size: 9pt">Tipo 
                            de Destaque:</font></span></td>
                        </tr>
                      </table>
                    </div></td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" bgcolor="#FFFFE1" width="7">&nbsp;</td>
        <td height="37" bgcolor="#FFFFE1" width="634"><table border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td><select name="id_capa" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" >
                  <?

	  $sql5 = mysql_query("SELECT * FROM noticias_capa WHERE status='S' order by nome");

	  while($dados5=mysql_fetch_array($sql5)){

	  ?>
                  <option value='<?=$dados5[id]?>' <?=($dados[id_capa]==$dados5[id])?"selected":"";?>> 
                  <?=$dados5[nome]?>
                  </option>
                  <? }?>
                </select></td>
              <td width="15" align="right">&nbsp;</td>
            </tr>
          </table></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="90" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="30"> <span style="font-weight: 700"> <font face="Arial" style="font-size: 9pt">Colunista:</font></span></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" width="7">&nbsp;</td>
        <td height="37" width="634"><table cellpadding="0" cellspacing="0" width="204" height="30">
            <!-- MSTableType="nolayout" -->
            <tr> 
              <td width="154" height="30"> <span style="font-weight: 700"> 
                <select name="id_col" style="width:350px; height:20px;" class="input" onBlur="this.className='input';" onFocus="this.className='inputon';" >
                  <?

	  $sql5 = mysql_query("SELECT * FROM col WHERE status='S' order by id");

	  while($dados5=mysql_fetch_array($sql5)){

	  ?>
                  <option value='<?=$dados5[id]?>' <?=($dados[id_col]==$dados5[id])?"selected":"";?>> 
                  <?=$dados5[nome]?>
                  </option>
                  <? }?>
                </select>
                </span></td>
              <td width="48" height="30"><table border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td>&nbsp; </td>
                    <td width="15" align="right">&nbsp;</td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="100" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="35" bgcolor="#FFFFE1"> <div align="center"> 
              <table cellpadding="0" cellspacing="0" width="90" height="30">
                <!-- MSTableType="nolayout" -->
                <tr> 
                  <td height="30" bgcolor="#FFFFE1"> <div align="center"> 
                      <table cellpadding="0" cellspacing="0" width="90" height="30">
                        <!-- MSTableType="nolayout" -->
                        <tr> 
                          <td height="30"> <span style="font-weight: 700"> 
                            <font face="Arial" style="font-size: 9pt">Foto 
                            Capa:</font></span></td>
                        </tr>
                      </table>
                    </div></td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" bgcolor="#FFFFE1" width="7">&nbsp;</td>
        <td height="37" bgcolor="#FFFFE1" width="634"><table border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td width="156"> 
                <?

  if(empty($id)){

  echo "<img width='150' name='foto1' src='../images/layout/sem_foto.jpg' border='0'>";

  } else {

  	if(!empty($dados[foto])){

	echo "<img width='150' name='foto1' src='thumbs.php?w=150&imagem=../images/capa/$id/$dados[foto]' border='0'>";

	} else {

	echo "<font color='#FF0000'>Foto n&atilde;o dispon&iacute;vel</font>";

	}

}

?>
              </td>
              <td valign="middle"><table border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td valign="middle"> 
                      <? if(empty($id)){?>
                      <input class="inputon" onchange="document.images.foto1.src=this.value" name='foto24' type='file' size="16" onclick="javascript:alert('Todas as fotos devem ter o formato .jpg');" /> 
                      <? } else {?>
                      Trocar Foto?: 
                      <input name="nova_foto" type="radio" value="N2" onclick="javascript:DesabilitarFoto()" />
                      Não 
                      <input name="nova_foto" type="radio" value="S2" onclick="javascript: HabilitarFoto();" >
                      Sim<br /> <input class="inputon" onchange="document.images.foto1.src=this.value" name='foto2' type='file' size="16" disabled="disabled" onclick="javascript:alert('Todas as fotos devem ter o formato .jpg');" /> 
                      <? }?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="90" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="30"> <span style="font-weight: 700"> <font face="Arial" style="font-size: 9pt">Foto 
            Noticia:</font></span></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" width="7">&nbsp;</td>
        <td height="37" width="634"><table border="0" cellspacing="0" cellpadding="0">
            <tr> 
              <td width="156"> 
                <?

  if(empty($id)){

  echo "<img width='150' name='foto2' src='../images/layout/sem_foto.jpg' border='0'>";

  } else {

  	if(!empty($dados[foto])){

	echo "<img width='150' name='foto2' src='thumbs.php?w=150&imagem=../images/$tabela/$id/$dados[foto]' border='0'>";

	} else {

	echo "<font color='#FF0000'>Foto n&atilde;o dispon&iacute;vel</font>";

	}

}

?>
              </td>
              <td valign="middle"><table border="0" cellspacing="0" cellpadding="0">
                  <tr> 
                    <td valign="middle"> 
                      <? if(empty($id)){?>
                      <input class="inputon" onchange="document.images.foto1.src=this.value" name='foto23' type='file' size="16" onclick="javascript:alert('Todas as fotos devem ter o formato .jpg');" /> 
                      <? } else {?>
                      Trocar Foto?: 
                      <input name="nova_foto" type="radio" value="N1" checked="checked" onclick="javascript:DesabilitarFoto()" />
                      Não 
                      <input name="nova_foto" type="radio" value="S1" onclick="javascript: HabilitarFoto();" >
                      Sim<br /> <input class="inputon" onchange="document.images.foto1.src=this.value" name='foto22' type='file' size="16" disabled="disabled" onclick="javascript:alert('Todas as fotos devem ter o formato .jpg');" /> 
                      <? }?>
                    </td>
                  </tr>
                </table></td>
            </tr>
          </table></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="100" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="35" bgcolor="#FFFFE1"> <div align="center"> 
              <table cellpadding="0" cellspacing="0" width="90" height="30">
                <!-- MSTableType="nolayout" -->
                <tr> 
                  <td height="30"> <span style="font-weight: 700"> <font face="Arial" style="font-size: 9pt"> 
                    Foto Extra:</font></span></td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" bgcolor="#FFFFE1" width="7">&nbsp;</td>
        <td height="37" bgcolor="#FFFFE1" width="634"> <input name='fotos_extras' type='radio' value='S' <?=($dados[fotos_extras]=="S")?"checked":""; checked?>>
          Sim 
          <input name='fotos_extras' type='radio' value='N' 
<? if(empty($id)){ echo "checked"; } else { if($dados[fotos_extras]=="N"){ echo "checked"; } } ?>>
          Não </td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="90" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="30"> <span style="font-weight: 700"> <font face="Arial" style="font-size: 9pt">Crédito 
            Foto:</font></span></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" width="7">&nbsp;</td>
        <td height="37" width="634"><input name='creditos_fotos' type='text' style="width:350px; height:20px;" value="<? echo $dados[creditos_fotos]?>" size=55 class="input" onBlur="this.className='input';" onFocus="this.className='inputon';"></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="100" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="35" bgcolor="#FFFFE1"> <div align="center"> 
              <table cellpadding="0" cellspacing="0" width="90" height="30">
                <!-- MSTableType="nolayout" -->
                <tr> 
                  <td height="30" bgcolor="#FFFFE1"> <div align="center"> 
                      <table cellpadding="0" cellspacing="0" width="90" height="30">
                        <!-- MSTableType="nolayout" -->
                        <tr> 
                          <td height="30"> <span style="font-weight: 700"> 
                            <font face="Arial" style="font-size: 9pt">Legenda 
                            Foto:</font></span></td>
                        </tr>
                      </table>
                    </div></td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" bgcolor="#FFFFE1" width="7">&nbsp;</td>
        <td height="37" bgcolor="#FFFFE1" width="634"><input name='legenda_fotos' style="width:350px; height:20px;" type='text' value="<? echo $dados[legenda_fotos]?>" size=55 class="input" onBlur="this.className='input';" onFocus="this.className='inputon';"></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="90" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="30"> <font face="Arial" style="font-size: 9pt; font-weight: 700"> 
            Alinhamento da Imagem:</font></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" width="7">&nbsp;</td>
        <td height="37" width="634"> <input name='alinhamento_foto' type='radio' value='L' 
<? if(empty($id)){ echo "checked"; } else { if($dados[alinhamento_foto]=="L"){ echo "checked"; } } ?>>
          Esquerda</td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="100" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="35" bgcolor="#FFFFE1"> <div align="center"> 
              <table cellpadding="0" cellspacing="0" width="90" height="30">
                <!-- MSTableType="nolayout" -->
                <tr> 
                  <td height="30" bgcolor="#FFFFE1"> <div align="center"> 
                      <table cellpadding="0" cellspacing="0" width="90" height="30">
                        <!-- MSTableType="nolayout" -->
                        <tr> 
                          <td height="30"> <span style="font-weight: 700"> 
                            <font face="Arial" style="font-size: 9pt">Largura 
                            da Foto Noticias:</font></span></td>
                        </tr>
                      </table>
                    </div></td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" bgcolor="#FFFFE1" width="7">&nbsp;</td>
        <td height="37" bgcolor="#FFFFE1" width="634"><strong> 
          <input name='largura_foto' type='text' value="<? echo $dados[largura_foto]?>" size="15" class="input" onBlur="this.className='input';" onFocus="this.className='inputon';" />
          <i>ex</i><em>: 320</em> </strong></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="39" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="100" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="35" bgcolor="#FFFFFF"> <div align="center"> 
              <table cellpadding="0" cellspacing="0" width="90" height="30">
                <!-- MSTableType="nolayout" -->
                <tr> 
                  <td height="30" bgcolor="#FFFFE1"> <div align="center"> 
                      <table cellpadding="0" cellspacing="0" width="90" height="30">
                        <!-- MSTableType="nolayout" -->
                        <tr> 
                          <td height="30" bgcolor="#FFFFFF"> <span style="font-weight: 700"> 
                            <font face="Arial" style="font-size: 9pt">Altura 
                            da Foto Noticias:</font></span></td>
                        </tr>
                      </table>
                    </div></td>
                </tr>
              </table>
            </div></td>
        </tr>
      </table>
    </div></td>
  <td height="39" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="37" width="7">&nbsp;</td>
        <td height="37" width="634"><strong> 
          <input name='altura_foto' type='text' value="<? echo $dados[altura_foto]?>" size="15" class="input" onBlur="this.className='input';" onFocus="this.className='inputon';" />
          <em>ex: 240 </em></strong></td>
      </tr>
    </table></td>
</tr>
<tr> 
  <td height="41" style="border: 1px solid #808080" width="98"> <div align="center"> 
      <table cellpadding="0" cellspacing="0" width="100" height="30">
        <!-- MSTableType="nolayout" -->
        <tr> 
          <td height="35" bgcolor="#FFFFE1"> <div align="center"> <span style="font-weight: 700"> 
              <font face="Arial" style="font-size: 9pt">Usuário:</font></span></div></td>
        </tr>
      </table>
    </div></td>
  <td height="41" style="border: 1px solid #808080" width="644"> <table cellpadding="0" cellspacing="0" width="641">
      <tr> 
        <td width="7" height="37">&nbsp;</td>
        <td width="634" height="37"><strong> 
          <select name="usuario" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" >
            <?

	  $sql5 = mysql_query("SELECT * FROM users WHERE status='S' order by nome");

	  while($dados5=mysql_fetch_array($sql5)){

	  ?>
            <option value='<?=$dados5[id]?>' <?=($dados[id_user]==$dados5[id])?>> 
            <?=$dados5[nome]?>
            </option>
            <? }?>
          </select>
          <option value='<?=$dados5[id]?>' <?=($dados[id_user]==$dados5[id])?>> 
          </option>
          </strong></td>
      </tr>
      <!-- MSTableType="nolayout" -->
    </table></td>
</tr>
<tr> 
  <td height="55" style="border: 1px solid #808080" width="742" colspan="2"> 
    <table cellpadding="0" cellspacing="0" width="178" height="53">
      <!-- MSTableType="nolayout" -->
      <tr> 
        <td height="30"> <div align="center"><span style="font-weight: 700"> 
            <input style="width:110px;" type="submit" class="input" onBlur="this.className='input';" onFocus="this.className='inputon';" name='btgravar' value="<?=(empty($id))?"Salvar":"Alterar";?>"?>
            </span></div></td>
      </tr>
    </table></td>
</tr>
<? //} // fim da acao FORM DE CADASTRO E ALTERAR ?>

JA esta parte aqui somente é onde busca a data, na hora que acesso a pagina

<input name=“dia” type=“text” class=“input” onblur=“this.className=‘input’;” onfocus=“this.className=‘inputon’;” value="<?=(!empty($dados[data]))?$data[2]:date("d");?>" size=“1” maxlength=“2”?>
<input name=“mes” type=“text” class=“input” onblur=“this.className=‘input’;” onfocus=“this.className=‘inputon’;” value="<?=(!empty($dados[data]))?$data[1]:date("m");?>" size=“1” maxlength=“2”?>
<input name=“ano” type=“text” class=“input” onblur=“this.className=‘input’;” onfocus=“this.className=‘inputon’;” value="<?=(!empty($dados[data]))?$data[0]:date("Y");?>" size=“4” maxlength=“4”?>
<input name=‘hora’ type=‘text’ class=“input” onfocus=“this.className=‘inputon’;” onblur=“this.className=‘input’;” value="<?=(!empty($dados[data]))?$hora:date("H:i");?>" size=“5” maxlength=“5”?>
<input type=“hidden” class=“input” name=‘data2’ value="<?=date("Y-m-d H:i");?>"?>

: ( acho que está no fórum errado (quando digo fórum, não digo o GUJ em sí mas o fórum especifico de desenvolvimento web, acho que pode ficar em outras linguagens), bem de qualquer maneira não sou muito bom de PHP.