Fala galera! estou com um problema que não consigo resolver e peço a ajuda de todos, estou tentando pegar o valor do select aluno do código abaixo que é gerado por uma outra página .php, é um combo dinâmico onde o select turma gera o aluno, e abaixo eu tenho o código pra imprimir as notas do aluno, mas o valor do select aluno nunca é obtido na página, gostaria que vocês dessem uma olhada. Desde já agradeço.
Código (PHP):
Código :
Código (PHP):
<div class="container">
<div class="span12">
<h1><img src="images/nota.png" width="70" height="70" /> Notas</h1>
<p>Buscar Notas de Aluno</p>
<div class="hero-unit">
<form method="post" action="" name="lista">
Selecione a Turma do Aluno:<br />
<select name="turma" id="turma">
<option value="0">Selecione a turma...</option>
<?php
mysql_connect('localhost','root','');
mysql_selectdb('softacademico');
$result = mysql_query("select * from turma");
while($row = mysql_fetch_array($result) ){
echo "<option value='".$row['id']."'>".utf8_encode($row['serie'])."</option>";
}
?>
</select>
<br />
Aluno:<br />
<select name="aluno" id="aluno">
<option value="0">Selecione a aluno...</option>
</select><br/>
<button type="submit" class="btn btn btn-primary">Buscar Notas >></button>
</form>
<?php
$aluno_id = 0;
if(isset($_POST['lista'])){
$aluno_id = $_POST['aluno'];// não consigo pegar esse valor
}
if($aluno_id != 0){?>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="span1"><center>Aluno</center></th>
<th class="span2"><center>Valor</center></th>
<th class="span2"><center>Turma</center></th>
<th class="span3"><center>Disciplina</center></th>
<th class="span1"><center>Bimestre</center></th>
<th class="span1"><center>Feedback</center></th>
<th class="span1"><center>Editar</center></th>
<th class="span1"><center>Apagar</center></th>
</tr>
</thead>
<tbody>
<?php
$lista = $daonotas->listaNotas($aluno_id);
for($i = 0; $i < sizeof($lista); $i++){
$nome = $daoalunos->buscaNome($lista[$i]->aluno_id);
$turma = $daoturmas->buscaNome($lista[$i]->turma_id);
$disciplina = $daodisciplinas->buscaNome($lista[$i]->disciplina_id);
?>
<tr>
<td><center><h6><?php echo $nome ?></h6></center></td>
<td><center><h6><?php echo $lista[$i]->valor ?></h6></center></td>
<td><center><h6><?php echo $turma ?></h6></center></td>
<td><center><h6><?php echo $disciplina ?></h6></center></td>
<td><center><h6><?php echo $lista[$i]->bimestre ?></h6></center></td>
<td><center><h6><?php echo $lista[$i]->feedback ?></h6></center></td>
<td>
<a class="btn btn-block btn-info" href="<?php echo 'editar_nota.php?id=' . $lista[$i]->id;?>">
<i class="icon-pencil icon-white"></i>
</a>
</td>
<td>
<a class="btn btn-block btn-info" href="<?php echo 'excluir_nota.php?id=' . $lista[$i]->id;?>">
<i class="icon-remove icon-white"></i>
</a>
</td>
</tr>
<?php } ?><!--fechamento do for-->
</tbody>
</table>
<?php } else{echo "Nada Consta!";}?><!--fechamento do if-->
Código :<div class="span12">
<h1><img src="images/nota.png" width="70" height="70" /> Notas</h1>
<p>Buscar Notas de Aluno</p>
<div class="hero-unit">
<form method="post" action="" name="lista">
Selecione a Turma do Aluno:<br />
<select name="turma" id="turma">
<option value="0">Selecione a turma...</option>
<?php
mysql_connect('localhost','root','');
mysql_selectdb('softacademico');
$result = mysql_query("select * from turma");
while($row = mysql_fetch_array($result) ){
echo "<option value='".$row['id']."'>".utf8_encode($row['serie'])."</option>";
}
?>
</select>
<br />
Aluno:<br />
<select name="aluno" id="aluno">
<option value="0">Selecione a aluno...</option>
</select><br/>
<button type="submit" class="btn btn btn-primary">Buscar Notas >></button>
</form>
<?php
$aluno_id = 0;
if(isset($_POST['lista'])){
$aluno_id = $_POST['aluno'];// não consigo pegar esse valor
}
if($aluno_id != 0){?>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="span1"><center>Aluno</center></th>
<th class="span2"><center>Valor</center></th>
<th class="span2"><center>Turma</center></th>
<th class="span3"><center>Disciplina</center></th>
<th class="span1"><center>Bimestre</center></th>
<th class="span1"><center>Feedback</center></th>
<th class="span1"><center>Editar</center></th>
<th class="span1"><center>Apagar</center></th>
</tr>
</thead>
<tbody>
<?php
$lista = $daonotas->listaNotas($aluno_id);
for($i = 0; $i < sizeof($lista); $i++){
$nome = $daoalunos->buscaNome($lista[$i]->aluno_id);
$turma = $daoturmas->buscaNome($lista[$i]->turma_id);
$disciplina = $daodisciplinas->buscaNome($lista[$i]->disciplina_id);
?>
<tr>
<td><center><h6><?php echo $nome ?></h6></center></td>
<td><center><h6><?php echo $lista[$i]->valor ?></h6></center></td>
<td><center><h6><?php echo $turma ?></h6></center></td>
<td><center><h6><?php echo $disciplina ?></h6></center></td>
<td><center><h6><?php echo $lista[$i]->bimestre ?></h6></center></td>
<td><center><h6><?php echo $lista[$i]->feedback ?></h6></center></td>
<td>
<a class="btn btn-block btn-info" href="<?php echo 'editar_nota.php?id=' . $lista[$i]->id;?>">
<i class="icon-pencil icon-white"></i>
</a>
</td>
<td>
<a class="btn btn-block btn-info" href="<?php echo 'excluir_nota.php?id=' . $lista[$i]->id;?>">
<i class="icon-remove icon-white"></i>
</a>
</td>
</tr>
<?php } ?><!--fechamento do for-->
</tbody>
</table>
<?php } else{echo "Nada Consta!";}?><!--fechamento do if-->
<center><a href="cadastro_form_nota.php"><img src="images/nota2.png" width="80" height="80"/></a></center>
<center><a href="cadastro_form_nota.php">Cadastrar Nova Nota</a></center><br/>
<center><a href="cadastro_form_nota.php">Cadastrar Nova Nota</a></center><br/>