Permalink
Browse files

Added Up and Down rate

  • Loading branch information...
Yoshi- committed Apr 9, 2011
1 parent d74e3d1 commit 3c0d23c54d1aa8e9e7e085e6743f79e09330551f
Showing with 3 additions and 3 deletions.
  1. +3 −3 application/model/ratemodel.php
@@ -9,11 +9,11 @@ public function rate($rate) {
if(mysql_num_rows($res)) {
return "Only 1 Vote per Ip/Auth";
}
- if(isset($_GET['type']) AND $_GET['type'] = 'down') {
- mysql_query("UPDATE `auths` SET `working` = working -1 WHERE `authID` ='".$rate."'");
+ if(isset($_GET['type']) AND $_GET['type'] == 'uprate') {
+ mysql_query("UPDATE `auths` SET `working` = working +1 WHERE `authID` ='".$rate."'");
}
else {
- mysql_query("UPDATE `auths` SET `working` = working +1 WHERE `authID` ='".$rate."'");
+ mysql_query("UPDATE `auths` SET `working` = working -1 WHERE `authID` ='".$rate."'");
}
mysql_query("INSERT INTO `rate` (`rateID` ,`ip` ,`authID`)VALUES (NULL , '".$client_ip."', '".$rate."');");
return 'Rate accepted';

0 comments on commit 3c0d23c

Please sign in to comment.