Esempio n. 1
0
     //vote - pour une proposition
     $nb = $propClass->setProp($prop_id, intval($prop_rank) - 1);
     $user_histoClass->setUser_histo($user_mail, $prop_link_id, $prop_link_id, $vote_type . $vote, $user_ip);
     $_SESSION['message'] = htmlentities("Vote - pour la proposition enregistré");
 } else {
     if (isset($props) and $vote == "plus" and intval($prop_rank) >= $_SESSION['prop_arg_rank_validation'] and $prop_type == "arg") {
         //vote + et validation d'un argument
         $nb = $argClass->setNewArg($prop_link_id, $prop_lib_fr, intval($prop_rank) + 1);
         //ajouter le * user_rank
         $nb = $propClass->deletePropById($prop_id);
         $user_histoClass->setUser_histo($user_mail, $prop_link_id, $prop_link_id, $vote_type . $vote, $user_ip);
         $_SESSION['message'] = htmlentities("Vote + pour la proposition enregistré, la proposition ayant atteint un score suffisant, elle devient un argument");
     } else {
         if (isset($props) and $vote == "plus" and intval($prop_rank) >= $_SESSION['prop_arg_u_rank_validation'] and $prop_type == "arg_u") {
             //vote + et validation d'une reformulation d'argument
             $nb = $argClass->setArgByIdLibFr($prop_link_id, $prop_lib_fr, intval($prop_rank) + 1);
             //ajouter le * user_rank, le score de la nouvelle proposition remplace le score de l'ancien argument
             $nb = $propClass->deletePropById($prop_id);
             $user_histoClass->setUser_histo($user_mail, $prop_link_id, $prop_link_id, $vote_type . $vote, $user_ip);
             $_SESSION['message'] = htmlentities("Vote + pour la reformulation d'argument enregistré, la reformulation ayant atteint un score suffisant, elle remplace l'argument");
         } else {
             if (isset($props) and $vote == "plus" and intval($prop_rank) >= $_SESSION['prop_debat_rank_validation'] and $prop_type == "debat") {
                 //vote + et validation d'un debat
                 $nb = $debatClass->setDebat($prop_lib_fr, intval($prop_rank) + 1);
                 //ajouter le * user_rank
                 $nb = $propClass->deletePropById($prop_id);
                 $user_histoClass->setUser_histo($user_mail, $prop_link_id, $prop_link_id, $vote_type . $vote, $user_ip);
                 $_SESSION['message'] = htmlentities("Vote + pour la proposition enregistré, la proposition de débat ayant atteint un score suffisant, elle devient un débat");
             } else {
                 if (isset($props) and $vote == "moins" and intval($prop_rank) <= $_SESSION['prop_arg_rank_delete']) {
                     //vote - et suppression du débat ou de l'argument