Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($sql->rowCount() > 0){
- $array = $sql->fetchAll();
- foreach($array as $aulaChave => $aula){
- if($aula['tipo'] == 'video'){
- $sql = "SELECT nome FROM videos WHERE id_aula = '" . ($aula['id']) . "'";
- $sql = $this->db->query($sql)->fetch();
- $array[$aulaChave]['nome'] = $sql['nome'];
- $sql = "SELECT * FROM historico WHERE id_aluno = '" . $_SESSION['lgaluno'] . "' and id_aula = '" . $aula['id'] . "'";
- $sql = $this->db->query($sql);
- if($sql->rowCount() > 0){
- $array[$aulaChave]['assistido'] = '1';
- }else{
- $array[$aulaChave]['assistido'] = '0';
- }
- }else if($aula['tipo'] == 'questionario'){
- $array[$aulaChave]['nome'] = "Questionário";
- $sql = "SELECT * FROM resposta_questionario WHERE id_aluno = '" . $_SESSION['lgaluno'] . "' and id_aula = '" . $aula['id'] . "'";
- $sql = $this->db->query($sql);
- if($sql->rowCount() > 0){
- $array[$aulaChave]['respondido'] = '1';
- }else{
- $array[$aulaChave]['respondido'] = '0';
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement