Changeset 220 for quests/action.php
- Timestamp:
- Jan 13, 2008, 11:25:19 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
quests/action.php
r212 r220 22 22 if (($vote > 5) OR ($vote < 1)) die ('Spadná známka'); 23 23 24 //TODO: if (Licence(0)) die('Hlasovat mù ou jenom registrovaní!');24 //TODO: if (Licence(0)) die('Hlasovat mù¾ou jenom registrovaní!'); 25 25 26 26 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'")); 28 28 if (!$Line) { 29 29 $Line = mysql_fetch_array($Database->SQLCommand("SELECT Vote,CountVote FROM quests WHERE ID = '$questID'")); … … 32 32 $NewVote = ($OldVote+$vote)/$CountVote; 33 33 34 echo $NewVote;35 36 34 $Database->SQLCommand("UPDATE quests SET Vote = '$NewVote', CountVote = '$CountVote' WHERE ID = '$questID'"); 37 35 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; 40 38 41 39 } else echo 'Ji¾ jste hlasoval!';
Note:
See TracChangeset
for help on using the changeset viewer.