<?php
	class cCourseListPage extends cStudentPage
	{  	 
    function Process()
    {
			return true;
    }

    function Draw()
    {
      if ( !$this->bLoggedIn )
      {
        $this->smarty->display("login.tpl");
      }
      else
      {
	      // vyber z databazy vsetky skusky aktualneho studenta
	      $query = "SELECT C.id, C.name FROM tCourse AS C 
									INNER JOIN tCourseToUser AS CU ON CU.id_course = C.id 
									INNER JOIN tUser AS U ON U.id=CU.id_user 
									WHERE U.id='".$_SESSION['userId']."';";
				$this->AssignQueryResult($query,'course','array');
	
	      $this->smarty->assign("content", "courseList.tpl");
	      parent::Draw();
	    }
    }
	}
?>
