#include <stdio.h>
#include <stdlib.h>

#include "global.h"
#include "survey.h"

#include "manhat-lib/shared_util.h"
#include "manhat-lib/shared_survey_util.h"
#include "manhat-lib/shared_survey_deliver_list.h"
#include "manhat-lib/shared_cs_util.h"

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

int main()
{
    char key[MAX_KEY +1];
    char count[MAX_PATH +1];
    SESSION user;
  
    cs_cgi_init(); 
    read_parameters(key, count);
    validate_server_key(key,&user);

    remove_this_survey_from_deliver_info(user.username,  count);
    printf("Location: %s?id=%s\n\n", "mymanhattan", key);
    cs_cgi_destroy();
    return 0;
}
