SHARE
TWEET

Untitled

a guest Jun 19th, 2017 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $vote = new Vote;
  3. //$vote->get();
  4. $canVote = $vote->canVote($_SESSION['pseudo']); // En fait, on obtiens Can vote (true/false) ici
  5. //echo $canVote;
  6.  
  7. $vote1 = $vote->getValue($_SESSION['pseudo'],'vote1');
  8. //echo $vote1;
  9.  
  10. $vote2 = $vote->getValue($_SESSION['pseudo'],'vote2');
  11.  
  12. $vote3 = $vote->getValue($_SESSION['pseudo'],'vote3');
  13.  
  14. $vote4 = $vote->getValue($_SESSION['pseudo'],'vote4');
  15.  
  16. $votedTime = $_SESSION['vote'];
  17.  
  18. echo " vote  => " . $votedTime;
  19.  
  20. echo " CanVote => " . $canVote;
  21.  
  22. if($votedTime == "vote1")
  23. {
  24.     $vote1 = $_SESSION['pseudo'];
  25. if ($vote1 == 0 || $vote1 == '' || $vote1 == NULL)
  26. {
  27.     $vote->addDarkPoint($_SESSION['pseudo'], 'vote1_time'); // Ligne ajoutée
  28.     //return;
  29. }
  30. else
  31. {
  32.     $vote->update($_SESSION['pseudo'], 'vote1_time');
  33. }
  34. }
  35.  
  36. if($votedTime == "vote2")
  37. {
  38.     $vote2 = $_SESSION['pseudo'];
  39. if($vote2 != null)
  40. {
  41.    
  42.     echo " vote 2 => " . $vote2;
  43.     $vote->update($_SESSION['pseudo'], 'vote2_time');
  44.     //return;
  45. }
  46. else
  47. {
  48.     $vote->addDarkPoint($_SESSION['pseudo'], 'vote2_time'); // Ligne ajoutée// Ligne ajoutée
  49.     //return;
  50. }
  51. }
  52.  
  53.  
  54. if($votedTime == "vote3")
  55. {
  56. $vote3 = $_SESSION['pseudo'];
  57. if ($vote3 != null)
  58. {
  59.     $vote->update($_SESSION['pseudo'], 'vote3_time');
  60.     //return;
  61. }
  62. else
  63. {
  64.     $vote->addDarkPoint($_SESSION['pseudo'], 'vote3_time'); // Ligne ajoutée// Ligne ajoutée
  65.     //return;
  66. }
  67. }
  68.  
  69. if($votedTime == "vote4")
  70. {
  71. $vote4 = $_SESSION['pseudo'];
  72. echo " vote 4 => " . $vote4;
  73.  
  74. if ($vote4 != null)
  75. {
  76.     $vote->update($_SESSION['pseudo'], 'vote4_time');
  77.    
  78. }
  79. else
  80. {
  81.     $vote->addDarkPoint($_SESSION['pseudo'], 'vote4_time'); // Ligne ajoutée// Ligne ajoutée
  82. }
  83. }
  84. ?>
RAW Paste Data
Top