#include <stdio.h>
#include <string.h>
#include <time.h>


#include "global.h"

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


void
read_parameters (char *key, char *prog)
{
   cs_get_required_parameter ("id", key, MAX_KEY);
   cs_get_required_parameter ("prog", prog, MAX_PATH );
   cs_set_value("id", key);
}









void
set_form( char *key,  char *prog, SESSION *user)
{
   char url[MAX_PATH +1];
   snprintf(url, MAX_PATH +1, "%s?id=%s", "super_admin_page", key);
   cs_set_value("back_url", url);
   cs_set_search_form(prog,key,user->username);   /* shared_cs_course_search.c */
}







int
main()
{
  char key[MAX_KEY +1];
  char prog[MAX_PATH + 1];   /* from command line - which program to pass form selections to? */
  SESSION user;

  cs_cgi_init();
  read_parameters(key, prog);                
  validate_super_key(key, &user);   /* shared_super_util.c */

  set_admin_page(&user, key, 0, prog);   /* shared_super_menu.c */
  set_form(key, prog, &user);

  cs_cgi_display("super_course_search_form", 1);
  cs_cgi_destroy();
  return 0;
}


