*
 * PHP Version 5.3.3
 *
 * @category General
 * @package  ArchiWiki
 * @author   Pierre Rudloff <*****@*****.**>
 * @license  GNU GPL v3 https://www.gnu.org/licenses/gpl.html
 * @link     http://archi-wiki.org/
 *
 * */
require_once "includes/framework/config.class.php";
require_once "modules/archi/includes/archiEvenement.class.php";
$config = new ArchiConfig();
$req = "\n    SELECT idPersonne, description\n    FROM personne";
$res = $config->connexionBdd->requete($req);
$e = new archiEvenement();
while ($person = mysql_fetch_object($res)) {
    $req2 = "\n    SELECT *\n    FROM _personneEvenement\n    WHERE idPersonne = " . $person->idPersonne;
    if (!mysql_fetch_object($config->connexionBdd->requete($req2))) {
        $idEvenement = $e->getNewIdEvenement();
        $idSousEvenement = $idEvenement + 1;
        $req3 = "\n        INSERT INTO `historiqueEvenement` (\n            `idEvenement`,\n            `dateCreationEvenement`,\n            `idTypeEvenement`\n        )\n        VALUES (\n            '" . $idEvenement . "',\n            now(),\n            '" . $e->getIdTypeEvenementGroupeAdresse() . "'\n        )";
        $config->connexionBdd->requete($req3);
        $req3 = "\n        INSERT INTO `historiqueEvenement` (\n            `idEvenement`, `description`,\n            `dateCreationEvenement`\n        )\n        VALUES (\n            '" . $idSousEvenement . "',\n            '" . mysql_escape_string($person->description) . "',\n            now()\n        )";
        $config->connexionBdd->requete($req3);
        $req3 = "\n        INSERT INTO `_personneEvenement` (\n            `idPersonne`, `idEvenement`\n        )\n        VALUES (\n            '" . $person->idPersonne . "',\n            " . $idEvenement . "\n        )";
        $config->connexionBdd->requete($req3);
        $req3 = "\n            insert into _evenementEvenement (idEvenement,idEvenementAssocie)\n            values ('" . $idEvenement . "','" . $idSousEvenement . "');\n        ";
        $config->connexionBdd->requete($req3);
    }
}