Example #1
0
<?php

session_start();
// On démarre la session AVANT d'écrire du code HTML
require_once "../config/conf.php";
require_once '../model/Model.php';
require_once '../model/Prop.php';
$propClass = new Prop();
require_once '../model/User_histo.php';
$user_histoClass = new User_histo();
session_start();
// On démarre la session AVANT toute chose
if (isset($_SESSION["ip"])) {
    $user_ip = $_SESSION["ip"];
}
if (isset($_SESSION["user_mail"])) {
    $user_mail = $_SESSION["user_mail"];
}
$messageUpdate = "Tous les champs doivent être remplis.";
if (isset($_POST['id']) and isset($_POST['updated_arg'])) {
    $arg_id = $_POST['id'];
    $arg_action = "arg_u";
    $nb = $propClass->setNewProp($arg_id, $_POST['updated_arg'], $arg_action, $user_ip, $user_mail, $_SESSION['prop_arg_u_rank_default']);
    //proposition de modification pour un argument
    $user_histoClass->setUser_histo($user_mail, $debat_id, $arg_id, $arg_action, $user_ip);
    $_SESSION['message'] = htmlentities("Reformulation enregistrée. Pour le moment il s'agit d'une proposition. Si le score de la proposition devient suffisamment élevé, la reformulation remplacera l'argument");
} else {
    if (isset($_POST['id']) and isset($_POST['new_arg'])) {
        $debat_id = $_POST['id'];
        $arg_lib_fr = $_POST['new_arg'];
        $arg_action = "arg";
Example #2
0
<?php

require_once "../config/conf.php";
require_once '../model/Model.php';
require_once '../model/Prop.php';
$propClass = new Prop();
require_once '../model/Arg.php';
$argClass = new Arg();
require_once '../model/Debat.php';
$debatClass = new Debat();
require_once '../model/Log.php';
$logClass = new Log();
require_once '../model/User_histo.php';
$user_histoClass = new User_histo();
session_start();
// On démarre la session AVANT toute chose
if (isset($_SESSION["ip"])) {
    $user_ip = $_SESSION["ip"];
}
if (isset($_SESSION["user_mail"])) {
    $user_mail = $_SESSION["user_mail"];
}
if (isset($_POST['vote']) and isset($_POST['vote_id']) and isset($_POST['vote_type'])) {
    $vote = $_POST['vote'];
    $vote_id = $_POST['vote_id'];
    $vote_type = $_POST['vote_type'];
    $messageUpdate = "Erreur technique lors de la mise à jour de la donnée.";
    if ($vote_type == "arg") {
        //			$logClass->setNewLog($vote." ".$vote_id." ".$vote_type,$user_ip);
        $args = $argClass->getArgById($vote_id);
        $arg_id = $args[0]->arg_id;