Файл: rating.php
Строк: 36
<?
session_set_cookie_params(86400);
session_start();
$full_home_path = dirname(__FILE__);
require_once($full_home_path."/_rootload.php");
mconnect();
validateUser();
if (!EnableLanguages()) { print "Error: Can not load languages."; mclose(); exit; }
if ($id and $userRating) {
$r = @mysql_query("select parentid from tickets where id='$id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
if (@mysql_num_rows($r) > 0) {
$r = @mysql_fetch_object($r);
$q = @mysql_query("select id from tickets where id='$r->parentid' and userid='".$_SESSION["userId"]."'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
if (@mysql_num_rows($q) > 0) {
@mysql_query("update tickets set rating='$userRating' where id='$id'") or die("File: ".__FILE__."<BR>Line: ".__LINE__."<BR>MySQL Error: ".mysql_error());
print $userRating;
} else {
print $_lang[Error].": ".$_lang[TicketsErrorNoTicket];
}
} else {
print $_lang[Error].": ".$_lang[TicketsErrorNoTicket];
}
} else {
print $_lang[Error].": ".$_lang[TicketsErrorNoParams];
}
mclose();
?>