#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_modify.h"
#include "manhat-lib/shared_survey_read_param.h"
#include "manhat-lib/shared_survey_path_util.h"
#include "manhat-lib/shared_cs_util.h"


int 
main()
{
   int is_admin;
   char key[MAX_KEY +1];
   char count[MAX_PATH +1];
   int  delete_id;
   SESSION user;
   int before_me;
    
   cs_cgi_init();              					/* shared_cs_util.c */
   read_com_parameters(&is_admin, key, count, &delete_id); 	/* shared_survey_read_param.c */
   verify_key_path(&user, key, is_admin);  			/* shared_survey_path_util.c */

   delete_action( &user, count, delete_id, &before_me); 	/* shared_survey_modify.c */ 

   printf("Location: %s?admin=%d&id=%s&count=%s#%d\n\n", "survey_new", is_admin, key, count, before_me);
   cs_cgi_destroy();  						/* shared_cs_util.c */

   return 0;
}
