Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once 'ajudante.php';
- $host = 'mysql02.edgelifesports.hospedagemdesites.ws';
- $user = 'edgelifesports1';
- $pass = 's60riS3l1t38';
- $db = 'edgelifesports1';
- //Conecta banco de dados
- $link = mysql_conecta($host, $user, $pass, $db);
- //retorna select tipo aulas
- $return = buscaTipoAulas();
- $return_salas = buscaSalas();
- //montar array horarios
- $horarios = array( '1' => 'MANHÃ', '2' => 'ALMOÇO', '3' => 'TARDE', '4' => 'NOITE' );
- //montar array atividades
- //montar array salas
- for ($x = 0, $y = 1; $x < count($return_salas); $x++, $y++ ){
- $salas[$y] = $return_salas[$x][0];
- }
- if(isset($_POST['aula']) && isset($_POST['horario'])){
- $busca_ret = buscaGeral($_POST['aula'], $_POST['horario']);
- //montar array perfeito
- for( $x = 0; $x < count($busca_ret); $x++ ) {
- $final[$x][0] = $busca_ret[$x][0]. '<br>';
- $final[$x][1] = $busca_ret[$x][1]. '<br>';
- $final[$x][2] = $busca_ret[$x][2]. '<br>';
- $final[$x][3] = $busca_ret[$x][3]. '<br>';
- }
- //substitui for com valores reais
- for( $v = 0; $v < count($busca_ret); $v++ ) {
- $final_real[$v][0] = dias($final[$v][0]); //DIA ID
- $final_real[$v][1] = horarioId($final[$v][1]); //horario ID
- $final_real[$v][2] = atividades($final[$v][2]); //atividade ID
- $final_real[$v][3] = salas($final[$v][3]); //sala ID
- }
- }
- ?>
- Gostaria de procurar aulas de:
- <form method="post" action="horarios.php" name="form_horarios" id="">
- <select name="aula" value="">
- <?php
- $vv = 1;
- $xx = 2;
- foreach($return as $key => $value) {
- if(!$vv == 0){
- ?>
- <option value="<?php echo $vv; ?>"><?php echo $value[0]; ?></option>
- <?php
- }
- $vv++;
- }
- ?>
- </select>
- no periodo:
- <select name="horario" value="" >
- <option value="15">Manha</option>
- <option value="23">Almoco</option>
- <option value="31">Tarde</option>
- <option value="46">Noite</option>
- </select>
- <input type="submit"></button>
- </form>
- <?php
- for( $v = 0; $v < count($final_real); $v++ ) {
- echo "Dia : " .$final_real[$v][0].'<br>';
- echo "Horario : " .$final_real[$v][1].'<br>';
- echo "Atividade : " .$final_real[$v][2].'<br>';
- echo "Sala : " .$final_real[$v][3].'<br>';
- echo '<br>';
- }
- mysql_close($link);
- ?>
Add Comment
Please, Sign In to add comment