Changeset 220 for quests/action.php


Ignore:
Timestamp:
Jan 13, 2008, 11:25:19 AM (17 years ago)
Author:
maron
Message:

Různé opravy

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quests/action.php

    r212 r220  
    2222    if (($vote > 5) OR ($vote < 1)) die ('Spadná známka');
    2323   
    24   //TODO:  if (Licence(0)) die('Hlasovat mùžou jenom registrovaní!');
     24  //TODO:  if (Licence(0)) die('Hlasovat mù¾ou jenom registrovaní!');
    2525
    2626
    27     $Line = mysql_fetch_row($Database->SQLCommand("SELECT * FROM vote WHERE IDuser = '$IDuser' AND IDquest = '$questID'"));
     27    $Line = mysql_fetch_row($Database->SQLCommand("SELECT * FROM quests_vote WHERE IDuser = '$IDuser' AND IDquest = '$questID'"));
    2828    if (!$Line) { 
    2929      $Line = mysql_fetch_array($Database->SQLCommand("SELECT Vote,CountVote FROM quests WHERE ID = '$questID'"));
     
    3232      $NewVote = ($OldVote+$vote)/$CountVote;
    3333     
    34       echo $NewVote;
    35 
    3634      $Database->SQLCommand("UPDATE quests SET Vote = '$NewVote', CountVote = '$CountVote' WHERE ID = '$questID'");
    3735   
    38       $Database->SQLCommand("INSERT INTO `vote` ( `IDquest` , `IDuser` , `vote` ) VALUES ( '$questID', '$IDuser', '$vote');");
    39       echo 'Hlas byl ulo¾en!';   
     36      $Database->SQLCommand("INSERT INTO `quests_vote` ( `IDquest` , `IDuser` , `vote` ) VALUES ( '$questID', '$IDuser', '$vote');");
     37      echo 'Hlas byl ulo¾en! Hlasoval jste: '.$vote.'<br /> Nyní je známka questu '.$NewVote;   
    4038   
    4139    } else echo 'Ji¾ jste hlasoval!';
Note: See TracChangeset for help on using the changeset viewer.