<?
if (!defined('INSTALL_MODULES')) {
	die ("You can't access this file directly...");
}

if ((!is_god($admin)) && (!is_user($user)) && (!is_admin($admin))) { 
redirect_url("".$admin_file.".php?op=modules"); }


$numbertables = 3;


$result1 = $db2->sql_query("CREATE TABLE ".$prefix_install."_nsngrept_config(
  `config_name` varchar(255) NOT NULL default '',
  `config_value` text NOT NULL,
  PRIMARY KEY  (`config_name`))");

$db2->sql_query("INSERT INTO ".$prefix_install."_nsngrept_config VALUES ('version_number', '1.1.1')");
################################################################################

$result2 = $db2->sql_query("CREATE TABLE ".$prefix_install."_nsngrept_petitions(
  `ePetitionId` int(11) NOT NULL auto_increment,
  `view` int(11) NOT NULL default '0',
  `name` varchar(255) default NULL,
  `hometext` text,
  `bodytext` text,
  `language` varchar(100) default NULL,
  `validation` int(1) NOT NULL default '0',
  `hidesigner` int(11) NOT NULL default '0',
  `enabled` int(11) default '0',
  `timestart` datetime default '0000-00-00 00:00:00',
  `timeend` datetime default '0000-00-00 00:00:00',
  `aid` varchar(30) NOT NULL default '',
  `createdtime` datetime NOT NULL default '0000-00-00 00:00:00',
  `voters` int(11) NOT NULL default '0',
  `hideemail` int(11) NOT NULL default '0',
  `modifynotes` int(11) NOT NULL default '2',
  `notestext` text,
  `mailinglist` int(11) NOT NULL default '0',
  PRIMARY KEY  (`ePetitionId`))");


$db2->sql_query("INSERT INTO ".$prefix_install."_nsngrept_petitions VALUES (1, 0, 'petition de demonstration', '<br /><br />LOL n''''oubliez pas de lire les lisez moi dans le dossier, ceci pourra vous aider en cas de problemes<br /><br />Merci!!!', '', NULL, 0, 0, 1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', '$username', '2005-05-05 20:59:30', 0, 0, 0, '', 0)");

################################################################################

$result3 = $db2->sql_query("CREATE TABLE ".$prefix_install."_nsngrept_signers(
  `ePetitionSignerId` int(11) NOT NULL auto_increment,
  `ePetitionId` int(11) NOT NULL default '0',
  `userId` int(11) default '0',
  `validationString` varchar(255) default '',
  `userName` varchar(255) NOT NULL default '',
  `city` varchar(255) NOT NULL default '',
  `eMailAddress` varchar(255) NOT NULL default '',
  `comment` varchar(255) default NULL,
  `timesigned` datetime NOT NULL default '0000-00-00 00:00:00',
  `mailinglist` int(1) NOT NULL default '0',
  PRIMARY KEY  (`ePetitionSignerId`),
  KEY `ePetitionId` (`ePetitionId`),
  KEY `validationString` (`validationString`),
  KEY `eMailAddress` (`validationString`))");


?>