olá hutuh, obrigado pela força...mas não conheço quase nada de php...meu código tá assim:
<?php
header('Content-Type: text/html; charset=utf-8', true);
require("u_funcoes.php");
$xCon = pConecta();
$cod_key = $_POST["cod_key"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="jquery-1.7.1.js" type="text/javascript"></script>
<script src="jquery.maskedinput-1.3.js" type="text/javascript"></script>
<script src="u_funcoes.js" type="text/javascript">
</script>
<script>
$(document).ready(function(){
$('#sbotao').click(function(){
horacerta = $('#sbotao').val();
$('#colunaEsquerda').load('u_agendamento_exames.php',{sbotao:horacerta})
}
</script>
<style type="text/css">
<!--
body {
margin: 0;
padding: 0;
text-align: center;
color: #000000;
}
.twoColFixRt #principal {
width: 780px;
margin: 0 auto;
border: 1px solid #000000;
text-align: left;
}
.twoColFixRt #colunaDireita {
float: right; width: 30%;
margin-right:: 50%;
margin-top: inherit;
}
.twoColFixRt #colunaEsquerda {
float: left; width: 30%;
margin-left: inherit;
margin-top: inherit;
}
.fltrt {
float: right;
margin-left: 8px;
}
.fltlft {
float: left;
margin-right: 8px;
}
.clearfloat {
clear:both;
height:0;
line-height: 0px;
}
-->
</style><!--[if IE 5]>
<style type="text/css">
.twoColFixRt #sidebar1 { width: 220px; }
</style>
<![endif]--><!--[if IE]>
<style type="text/css">
.twoColFixRt #sidebar1 { padding-top: 30px; }
.twoColFixRt #mainContent { zoom: 1; }
</style>
<![endif]--></head>
<body class="twoColFixRt">
<div id="principal" >
<div id="colunaEsquerda" align="left">
<?
session_start();
$DataExame2 = $_GET["dataini"];
echo $DataExame2;
$_SESSION['DataExame'] = $_GET["dataini"];
?>
<h1 > Manhã </h1>
<form action="u_encaminhamento_exames.php?cod_key=1" method="post" enctype="application/x-www-form-urlencoded" name="fEnc" id="fEnc">
<?php
//cria sessão
$hora = '06:55';
date_default_timezone_set('Brazil/East');
$ibotao = 0;
for ($i = 0; $i < 60; $i++)
{ ?>
<div>
<tr>
<td>
<?php
$horaNova = strtotime("$hora + 5 minutes");
$horaNovaFormatada = date("H:i",$horaNova);
$hora = $horaNovaFormatada;
if ($hora == '12:00'){
$hora = '12:55';
$horaNova = strtotime("$hora + 5 minutes");
$horaNovaFormatada = date("H:i",$horaNova);
$hora = $horaNovaFormatada;
}
$ibotao++;
$sdt = substr($DataExame2,6,4)."-".substr($DataExame2,3,2)."-".substr($DataExame2,0,2);
$xSql = "select distinct a.data_cad, a.cod_id, a.cod_idfun, a.hora, a.nome_fun
from mv_exames_agenda a where (a.data_cad = '".$sdt."' ) and( a.hora = '".$hora."' )";
$xRes = $xCon->Execute($xSql);
if ($xRes->RecordCount() > 0) { ?>
<input type="submit" value=<?php print("$horaNovaFormatada");?> name="sbotao" disabled="disabled"
style='background-color: #FFFFFF ' />
<td align="left"> ---Indisponível--- </td>
<?php
}
else { ?>
<input type="button" name="snovobotao" value=<?php print("$horaNovaFormatada");?> id="colunaEsquerda"
style='background-color: #00ff00'
onclick=" <? session_start();
$_SESSION['sbotao'] = $horaNovaFormatada ?>;
fPegaDados('u_encaminhamento_exames.php','','none')"/></td>
<td align="left"> ----Disponível---- </td>
<?php }
?>
</td>
</tr>
</div>
<?php
} ?>
</form>
</div><!-- end #colunaEsquerda -->
</div>
</body>
</html>
Obs: Só tá levando via SESSION o conteúdo do último botão criado.