#include <stdio.h>
              
#include "global.h"

#include "manhat-lib/shared_util.h"
#include "manhat-lib/shared_cs_util.h"
#include "manhat-lib/shared_super_key.h"
#include "manhat-lib/shared_super_menu.h"



static void
read_parameters (char *key, char *group)
{
  cs_get_required_parameter("id", key, MAX_KEY);
  cs_get_required_parameter("subdir", group, MAX_FILENAME);
}


 
static void 
load_usage_report_data(char *group)
{
 char path[MAX_PATH + 1];


 snprintf(path, MAX_PATH + 1, "%s%s/%s", COURSE_PATH, group, USAGE_REPORT_FNAME);
 
 hdf_read_file(global_cgi->hdf, path);
}




 
int
main()
{
 char key[MAX_KEY + 1];
 char group[MAX_FILENAME + 1];
 SESSION user;

 cs_cgi_init();   
 read_parameters(key, group);


 validate_super_key(key, &user);
 set_admin_page(&user, key, 0, "super_list_usage_reports");  /* shared_super_menu.c */
 load_usage_report_data(group);
 
 cs_cgi_display ("super_view_usage_report", 1);    /* shared_cs_util.c */
 cs_cgi_destroy();

 return 0;

}

