Exemplo n.º 1
0
 $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;
     $debat_id = $args[0]->debat_id;
     $arg_rank = $args[0]->arg_rank;
     $arg_type = $args[0]->arg_type;
     $arg_link_id = $args[0]->arg_link_id;
     $arg_lib_fr = $args[0]->arg_lib_fr;
     //			$arg_lib_fr = htmlentities($arg_lib_fr,ENT_QUOTES); //Convertit tous les caractères éligibles en entités HTML.
     //			$logClass->setNewLog($arg_id." ".$arg_rank." ".$arg_type." ".$arg_link_id." ".$arg_lib_fr, $user_ip);
     if (isset($args) and $vote == "plus") {
         //vote + pour un argument
         $nb = $argClass->setArgByIdForRank($arg_id, intval($arg_rank) + 1);
         //ajouter le * user_rank
         $user_histoClass->setUser_histo($user_mail, $debat_id, $arg_id, $vote_type . $vote, $user_ip);
         $_SESSION['message'] = htmlentities("Vote + pour l'argument enregistré");
     } else {
         if (isset($args) and $vote == "moins" and intval($arg_rank) > $_SESSION['prop_arg_rank_default']) {
             //vote - pour un argument
             $nb = $argClass->setArgByIdForRank($arg_id, intval($arg_rank) - 1);
             $user_histoClass->setUser_histo($user_mail, $debat_id, $arg_id, $vote_type . $vote, $user_ip);
             $_SESSION['message'] = htmlentities("Vote - pour l'argument enregistré");
         } else {
             if (isset($args) and $vote == "moins" and intval($arg_rank) <= $_SESSION['prop_arg_rank_default']) {
                 //vote - et suppression du débat ou de l'argument
                 //$logClass->setNewLog($arg_id." ".$arg_rank." ".$arg_type." ".$arg_link_id." ".$arg_lib_fr, $user_ip);
                 //$arg_lib_fr = $_POST['updated_arg'];
                 $arg_action = "arg";