/* setup variables */ $action = GetVariable("action"); $year = GetVariable("year"); $datestart = GetVariable("datestart"); $dateend = GetVariable("dateend"); $modality = GetVariable("modality"); $studysite = GetVariable("studysite"); switch ($action) { case 'yearstudy': DisplayMenu(); DisplayYear($year, "studies", $modality, $studysite); break; case 'viewreport': ViewReport($datestart, $dateend, $modality, $studysite); break; case 'menu': default: DisplayMenu(); break; } /* ----------------------------------------------- */ /* --------- DisplayMenu ------------------------- */ /* ----------------------------------------------- */ function DisplayMenu() { ?> <table width="100%">
<title>NiDB - Enrollment report</title> </head> <body> <div id="wrapper"> <?php require "functions.php"; require "includes.php"; require "menu.php"; /* setup variables */ $action = GetVariable("action"); $enrollmentid = GetVariable("enrollmentid"); $projectid = GetVariable("projectid"); switch ($action) { case 'viewreport': ViewReport($enrollmentid); break; case 'viewprojectreport': ViewProjectReport($projectid); break; default: DisplayMenu(); break; } /* ----------------------------------------------- */ /* --------- ViewReport -------------------------- */ /* ----------------------------------------------- */ function ViewReport($enrollmentid) { /* get enrollment information */ $sqlstring = "select a.project_id 'projectid', a.*, b.*, c.*, enroll_startdate, enroll_enddate from enrollment a left join projects b on a.project_id = b.project_id left join subjects c on a.subject_id = c.subject_id where a.enrollment_id = {$enrollmentid}";