Beispiel #1
0
<?php

require_once "../config/conf.php";
require_once '../model/Model.php';
require_once '../model/Debat.php';
$debatClass = new Debat();
if (isset($_POST['id'])) {
    $debat_id = $_POST['id'];
    $debatsArg = $debatClass->getListArgByDebatId($debat_id);
    echo json_encode($debatsArg);
}
Beispiel #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;