<?php
/*
*----------------------------phpMyBitTorrent V 2.0.4---------------------------*
*--- The Ultimate BitTorrent Tracker and BMS (Bittorrent Management System) ---*
*--------------   Created By Antonio Anzivino (aka DJ Echelon)   --------------*
*-------------               http://www.p2pmania.it               -------------*
*------------ Based on the Bit Torrent Protocol made by Bram Cohen ------------*
*-------------              http://www.bittorrent.com             -------------*
*------------------------------------------------------------------------------*
*------------------------------------------------------------------------------*
*--   This program is free software; you can redistribute it and/or modify   --*
*--   it under the terms of the GNU General Public License as published by   --*
*--   the Free Software Foundation; either version 2 of the License, or      --*
*--   (at your option) any later version.                                    --*
*--                                                                          --*
*--   This program is distributed in the hope that it will be useful,        --*
*--   but WITHOUT ANY WARRANTY; without even the implied warranty of         --*
*--   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          --*
*--   GNU General Public License for more details.                           --*
*--                                                                          --*
*--   You should have received a copy of the GNU General Public License      --*
*--   along with this program; if not, write to the Free Software            --*
*-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA --*
*--                                                                          --*
*------------------------------------------------------------------------------*
*------              ©2005 phpMyBitTorrent Development Team              ------*
*-----------               http://phpmybittorrent.com               -----------*
*------------------------------------------------------------------------------*
*-----------------   Sunday, September 14, 2008 9:05 PM   ---------------------*
*/
if (defined('IN_PMBT'))die ("You can't include this file");
define("IN_PMBT",true);
include ("header.php");
global $db, $db_prefix;
$errmsg = Array();
$id = $_GET["id"];
if(!checkaccess("requests"))$errmsg[] = str_replace("**page**",_btrequest,_btnoautherized);
if($id == ""||!isset($id))$errmsg[] = _btrequest_filled_errmsg2;
if (count($errmsg) > 0)
        bterror($errmsg,_bterror);
OpenTable(_btrequestdetails);
$res = $db->sql_query("SELECT * FROM ".$db_prefix."_requests WHERE id = $id") or sqlerr();
$num = $db->sql_fetchrow($res);
								$text = format_comment($num["descr"], false, true);
                                parse_smiles($text);

$s = $num["request"];
OpenTable2("$s");
print("<div align=center>");
print("<h1>"._btrequestdetails_request." $num[request]</h1>\n");
print("<table width=\"500\" border=\"1\" cellspacing=\"0\" cellpadding=\"5\">\n");
print("<tr><td align=left><b>"._btrequestdetails_request."</b></td><td width=90% align=left >$num[request]</td></tr>");
if ($num["descr"])
echo"<tr><td align=left>"._btdescriptionsemple."</td><td width=90% align=left colspan=2>". $text."</td></tr>";
print("<tr><td align=left><b>"._btrequestdetails_date."</b></td><td width=90% align=left >$num[added]</td></tr>");
$cres = $db->sql_query("SELECT username FROM ".$db_prefix."_users WHERE id='".$num['userid']."'")or die(mysql_error());
if ($db->sql_numrows($cres) == 1)
{
  $carr = $db->sql_fetchrow($cres);
  $username = "$carr[username]";
}
$url = "offedit.php?id=$id";
if (isset($_GET["returnto"])) {
$addthis = "&amp;returnto=" . urlencode($_GET["returnto"]);
$url .= $addthis;
$keepget .= $addthis;
}
$editlink = "a href=\"$url\" class=\"sublink\"";
print("<tr><td align=left><b>"._btrequestdetails_req."</b></td><td width=90% align=left >$username");
if ($user->id != $num["userid"] && ($user->admin)) {
print(" ");}
else{
print("");}
print("</td></tr>");
if ($user->id != $num["userid"])
{
print("<tr><td align=left>"._btrequestdetails_vote."</td><td width=50% align=left ><b><a href=addrequest.php?id=$id>"._btrequestdetails_vote."</a></b></td></tr>");
}
print("<tr><td align=left><b>"._btrequestdetails_reqs."</b></td><td width=70% align=left>$num[request]</td></tr>");
if ($num["descr"])
print("<tr><td align=left><B>"._btrequestdetails_comments."</B></td><td width=70% align=left>". $text."</td></tr>");
print("<tr><td align=left><B>"._btrequestdetails_dateadded."</B></td><td width=70% align=left>$num[added]</td></tr>");

$cres = $db->sql_query("SELECT username FROM ".$db_prefix."_users WHERE id=$num[userid]");
   if ($db->sql_numrows($cres) == 1)
   {
     $carr = $db->sql_fetchrow($cres);
     $username = "$carr[username]";
   }
print("<tr><td align=left><B>"._btrequestdetails_addedby."</B></td><td width=70% align=left>$username</td></tr>");


if ($num["filled"] == NULL)
{
print("<form method=get action=reqfilled.php>");
print("<tr><td align=left>"._btrequestdetails_tofill."</td></tr>");
print("</table>");

print("<input type=text size=80 name=filledurl value="._btrequestdetails_url.">\n");
print("<input type=hidden value=$id name=requestid>");
print("<input type=submit value="._btrequestdetails_fill." >\n</form>");
}
if ($num["filled"] != NULL)print("</table>");

//echo'</div>';
print("<p><hr></p><form method=get action=requests.php#add>"._btrequestdetails_or." <input type=submit value=\""._btrequestdetails_add."\"></form>");
echo'</div>';

CloseTable();

include ("footer.php")

?>