Gazelle/sections/requests/new_edit.php

417 lines
16 KiB
PHP
Raw Normal View History

2013-05-30 08:00:30 +00:00
<?php
2011-03-28 14:21:28 +00:00
/*
* Yeah, that's right, edit and new are the same place again.
* It makes the page uglier to read but ultimately better as the alternative means
2013-02-18 08:00:22 +00:00
* maintaining 2 copies of almost identical files.
2011-03-28 14:21:28 +00:00
*/
2013-09-13 08:00:53 +00:00
$NewRequest = $_GET['action'] === 'new';
2011-03-28 14:21:28 +00:00
2013-04-19 08:00:55 +00:00
if (!$NewRequest) {
2011-03-28 14:21:28 +00:00
$RequestID = $_GET['id'];
2013-04-19 08:00:55 +00:00
if (!is_number($RequestID)) {
2011-03-28 14:21:28 +00:00
error(404);
}
}
2013-04-19 08:00:55 +00:00
if ($NewRequest && ($LoggedUser['BytesUploaded'] < 250 * 1024 * 1024 || !check_perms('site_submit_requests'))) {
2011-03-28 14:21:28 +00:00
error('You do not have enough uploaded to make a request.');
}
2013-04-19 08:00:55 +00:00
if (!$NewRequest) {
if (empty($ReturnEdit)) {
2013-02-18 08:00:22 +00:00
2013-09-13 08:00:53 +00:00
$Request = Requests::get_request($RequestID);
if ($Request === false) {
2011-03-28 14:21:28 +00:00
error(404);
}
2013-02-18 08:00:22 +00:00
2013-09-13 08:00:53 +00:00
// Define these variables to simplify _GET['groupid'] requests later on
$CategoryID = $Request['CategoryID'];
$Title = $Request['Title'];
$Year = $Request['Year'];
$Image = $Request['Image'];
$ReleaseType = $Request['ReleaseType'];
$GroupID = $Request['GroupID'];
2013-05-13 08:00:33 +00:00
$VoteArray = Requests::get_votes_array($RequestID);
2011-03-28 14:21:28 +00:00
$VoteCount = count($VoteArray['Voters']);
2013-02-18 08:00:22 +00:00
2013-09-13 08:00:53 +00:00
$LogCue = $Request['LogCue'];
2013-04-19 08:00:55 +00:00
$NeedCue = (strpos($LogCue, 'Cue') !== false);
$NeedLog = (strpos($LogCue, 'Log') !== false);
if ($NeedLog) {
2013-06-24 08:00:28 +00:00
if (strpos($LogCue, '%') !== false) {
2013-04-19 08:00:55 +00:00
preg_match('/\d+/', $LogCue, $Matches);
2013-09-13 08:00:53 +00:00
$MinLogScore = (int)$Matches[0];
2011-03-28 14:21:28 +00:00
}
}
2013-02-18 08:00:22 +00:00
2013-09-13 08:00:53 +00:00
$IsFilled = !empty($Request['TorrentID']);
2011-03-28 14:21:28 +00:00
$CategoryName = $Categories[$CategoryID - 1];
2013-02-18 08:00:22 +00:00
2013-09-13 08:00:53 +00:00
$ProjectCanEdit = (check_perms('project_team') && !$IsFilled && ($CategoryID === '0' || ($CategoryName === 'Music' && $Request['Year'] === '0')));
$CanEdit = ((!$IsFilled && $LoggedUser['ID'] === $Request['UserID'] && $VoteCount < 2) || $ProjectCanEdit || check_perms('site_moderate_requests'));
2013-02-18 08:00:22 +00:00
2013-04-19 08:00:55 +00:00
if (!$CanEdit) {
2011-03-28 14:21:28 +00:00
error(403);
}
2013-02-18 08:00:22 +00:00
2013-07-11 08:00:55 +00:00
if ($CategoryName === 'Music') {
2013-05-13 08:00:33 +00:00
$ArtistForm = Requests::get_artists($RequestID);
2013-02-18 08:00:22 +00:00
2011-03-28 14:21:28 +00:00
$BitrateArray = array();
2013-09-13 08:00:53 +00:00
if ($Request['BitrateList'] == 'Any') {
2011-03-28 14:21:28 +00:00
$BitrateArray = array_keys($Bitrates);
} else {
2013-09-13 08:00:53 +00:00
$BitrateArray = array_keys(array_intersect($Bitrates, explode('|', $Request['BitrateList'])));
2011-03-28 14:21:28 +00:00
}
2013-02-18 08:00:22 +00:00
2011-03-28 14:21:28 +00:00
$FormatArray = array();
2013-09-13 08:00:53 +00:00
if ($Request['FormatList'] == 'Any') {
2011-03-28 14:21:28 +00:00
$FormatArray = array_keys($Formats);
} else {
foreach ($Formats as $Key => $Val) {
2013-09-13 08:00:53 +00:00
if (strpos($Request['FormatList'], $Val) !== false) {
2011-03-28 14:21:28 +00:00
$FormatArray[] = $Key;
}
}
}
2013-02-18 08:00:22 +00:00
2011-03-28 14:21:28 +00:00
$MediaArray = array();
2013-09-13 08:00:53 +00:00
if ($Request['MediaList'] == 'Any') {
2011-03-28 14:21:28 +00:00
$MediaArray = array_keys($Media);
} else {
2013-09-13 08:00:53 +00:00
$MediaTemp = explode('|', $Request['MediaList']);
2011-03-28 14:21:28 +00:00
foreach ($Media as $Key => $Val) {
2013-04-19 08:00:55 +00:00
if (in_array($Val, $MediaTemp)) {
2011-03-28 14:21:28 +00:00
$MediaArray[] = $Key;
}
}
}
}
2013-02-18 08:00:22 +00:00
2013-05-30 08:00:30 +00:00
$Tags = implode(', ', $Request['Tags']);
2011-03-28 14:21:28 +00:00
}
}
2013-04-19 08:00:55 +00:00
if ($NewRequest && !empty($_GET['artistid']) && is_number($_GET['artistid'])) {
2013-05-30 08:00:30 +00:00
$DB->query("
SELECT Name
FROM artists_group
WHERE artistid = ".$_GET['artistid']."
LIMIT 1");
2011-03-28 14:21:28 +00:00
list($ArtistName) = $DB->next_record();
$ArtistForm = array(
1 => array(array('name' => trim($ArtistName))),
2 => array(),
3 => array()
);
2013-04-19 08:00:55 +00:00
} elseif ($NewRequest && !empty($_GET['groupid']) && is_number($_GET['groupid'])) {
2012-10-11 08:00:15 +00:00
$ArtistForm = Artists::get_artist($_GET['groupid']);
2013-05-30 08:00:30 +00:00
$DB->query("
SELECT
tg.Name,
tg.Year,
tg.ReleaseType,
tg.WikiImage,
GROUP_CONCAT(t.Name SEPARATOR ', '),
tg.CategoryID
FROM torrents_group AS tg
2013-06-24 08:00:28 +00:00
JOIN torrents_tags AS tt ON tt.GroupID = tg.ID
JOIN tags AS t ON t.ID = tt.TagID
2013-05-30 08:00:30 +00:00
WHERE tg.ID = ".$_GET['groupid']);
2013-04-19 08:00:55 +00:00
if (list($Title, $Year, $ReleaseType, $Image, $Tags, $CategoryID) = $DB->next_record()) {
2012-02-03 08:00:22 +00:00
$GroupID = trim($_REQUEST['groupid']);
}
2011-03-28 14:21:28 +00:00
}
2013-07-16 08:00:49 +00:00
View::show_header(($NewRequest ? 'Create a request' : 'Edit a request'), 'requests,form_validate');
2011-03-28 14:21:28 +00:00
?>
<div class="thin">
2012-08-19 08:00:19 +00:00
<div class="header">
2013-05-30 08:00:30 +00:00
<h2><?=($NewRequest ? 'Create a request' : 'Edit a request')?></h2>
2012-08-19 08:00:19 +00:00
</div>
2013-02-18 08:00:22 +00:00
2011-03-28 14:21:28 +00:00
<div class="box pad">
<form action="" method="post" id="request_form" onsubmit="Calculate();">
<div>
2013-05-30 08:00:30 +00:00
<? if (!$NewRequest) { ?>
2013-02-18 08:00:22 +00:00
<input type="hidden" name="requestid" value="<?=$RequestID?>" />
2013-05-30 08:00:30 +00:00
<? } ?>
2011-03-28 14:21:28 +00:00
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
2013-05-30 08:00:30 +00:00
<input type="hidden" name="action" value="<?=($NewRequest ? 'takenew' : 'takeedit')?>" />
2011-03-28 14:21:28 +00:00
</div>
2013-02-18 08:00:22 +00:00
2012-09-01 08:00:24 +00:00
<table class="layout">
2011-03-28 14:21:28 +00:00
<tr>
<td colspan="2" class="center">Please make sure your request follows <a href="rules.php?p=requests">the request rules!</a></td>
</tr>
2013-04-19 08:00:55 +00:00
<? if ($NewRequest || $CanEdit) { ?>
2011-03-28 14:21:28 +00:00
<tr>
<td class="label">
Type
</td>
<td>
<select id="categories" name="type" onchange="Categories()">
2013-04-30 18:18:07 +00:00
<? foreach (Misc::display_array($Categories) as $Cat) { ?>
2013-07-11 08:00:55 +00:00
<option value="<?=$Cat?>"<?=(!empty($CategoryName) && ($CategoryName === $Cat) ? ' selected="selected"' : '')?>><?=$Cat?></option>
2011-03-28 14:21:28 +00:00
<? } ?>
</select>
</td>
</tr>
<tr id="artist_tr">
2013-02-18 08:00:22 +00:00
<td class="label">Artist(s)</td>
2011-03-28 14:21:28 +00:00
<td id="artistfields">
2013-02-09 08:01:01 +00:00
<p id="vawarning" class="hidden">Please use the multiple artists feature rather than adding "Various Artists" as an artist; read <a href="wiki.php?action=article&amp;id=369">this</a> for more information.</p>
2011-03-28 14:21:28 +00:00
<?
2013-04-19 08:00:55 +00:00
if (!empty($ArtistForm)) {
2011-03-28 14:21:28 +00:00
$First = true;
2013-04-30 18:18:07 +00:00
foreach ($ArtistForm as $Importance => $ArtistNames) {
foreach ($ArtistNames as $Artist) {
2011-03-28 14:21:28 +00:00
?>
2013-07-14 08:00:49 +00:00
<input type="text" id="artist" name="artists[]" <? Users::has_autocomplete_enabled('other'); ?> size="45" value="<?=display_str($Artist['name']) ?>" />
2011-03-28 14:21:28 +00:00
<select id="importance" name="importance[]" >
2013-08-12 08:00:44 +00:00
<option value="1"<?=($Importance == '1' ? ' selected="selected"' : '')?>>Main</option>
<option value="2"<?=($Importance == '2' ? ' selected="selected"' : '')?>>Guest</option>
<option value="4"<?=($Importance == '4' ? ' selected="selected"' : '')?>>Composer</option>
<option value="5"<?=($Importance == '5' ? ' selected="selected"' : '')?>>Conductor</option>
<option value="6"<?=($Importance == '6' ? ' selected="selected"' : '')?>>DJ / Compiler</option>
<option value="3"<?=($Importance == '3' ? ' selected="selected"' : '')?>>Remixer</option>
<option value="7"<?=($Importance == '7' ? ' selected="selected"' : '')?>>Producer</option>
2011-03-28 14:21:28 +00:00
</select>
2013-07-11 08:00:55 +00:00
<? if ($First) { ?><a href="#" onclick="AddArtistField(); return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField(); return false;" class="brackets">&minus;</a><? } $First = false; ?>
2011-03-28 14:21:28 +00:00
<br />
<? }
}
} else {
2013-07-14 08:00:49 +00:00
?> <input type="text" id="artist" name="artists[]" <? Users::has_autocomplete_enabled('other'); ?>size="45" onblur="CheckVA();" />
2011-03-28 14:21:28 +00:00
<select id="importance" name="importance[]" >
2011-11-20 08:00:18 +00:00
<option value="1">Main</option>
<option value="2">Guest</option>
<option value="4">Composer</option>
<option value="5">Conductor</option>
<option value="6">DJ / Compiler</option>
<option value="3">Remixer</option>
2013-05-05 08:00:31 +00:00
<option value="7">Producer</option>
2011-03-28 14:21:28 +00:00
</select>
2013-02-18 08:00:22 +00:00
<a href="#" onclick="AddArtistField();return false;" class="brackets">+</a> <a href="#" onclick="RemoveArtistField();return false;" class="brackets">&minus;</a>
2011-03-28 14:21:28 +00:00
<?
}
2013-02-18 08:00:22 +00:00
?>
2011-03-28 14:21:28 +00:00
</td>
</tr>
<tr>
<td class="label">Title</td>
<td>
2013-09-13 08:00:53 +00:00
<input type="text" name="title" size="45" value="<?=(!empty($Title) ? $Title : '')?>" />
2011-03-28 14:21:28 +00:00
</td>
</tr>
2013-09-13 08:00:53 +00:00
<tr id="recordlabel_tr">
2013-02-18 08:00:22 +00:00
<td class="label">Record label</td>
2012-02-03 08:00:22 +00:00
<td>
2013-09-13 08:00:53 +00:00
<input type="text" name="recordlabel" size="45" value="<?=(!empty($Request['RecordLabel']) ? $Request['RecordLabel'] : '')?>" />
2012-02-03 08:00:22 +00:00
</td>
</tr>
2011-03-28 14:21:28 +00:00
<tr id="cataloguenumber_tr">
2013-02-18 08:00:22 +00:00
<td class="label">Catalogue number</td>
2011-03-28 14:21:28 +00:00
<td>
2013-09-13 08:00:53 +00:00
<input type="text" name="cataloguenumber" size="15" value="<?=(!empty($Request['CatalogueNumber']) ? $Request['CatalogueNumber'] : '')?>" />
2011-03-28 14:21:28 +00:00
</td>
</tr>
2012-06-02 08:00:16 +00:00
<tr id="oclc_tr">
<td class="label">WorldCat (OCLC) ID</td>
<td>
2013-09-13 08:00:53 +00:00
<input type="text" name="oclc" size="15" value="<?=(!empty($Request['OCLC']) ? $Request['OCLC'] : '')?>" />
2012-06-02 08:00:16 +00:00
</td>
</tr>
2011-03-28 14:21:28 +00:00
<? } ?>
<tr id="year_tr">
<td class="label">Year</td>
<td>
2013-09-13 08:00:53 +00:00
<input type="text" name="year" size="5" value="<?=(!empty($Year) ? $Year : '')?>" />
2011-03-28 14:21:28 +00:00
</td>
</tr>
2013-04-19 08:00:55 +00:00
<? if ($NewRequest || $CanEdit) { ?>
2011-03-28 14:21:28 +00:00
<tr id="image_tr">
<td class="label">Image</td>
<td>
<input type="text" name="image" size="45" value="<?=(!empty($Image) ? $Image : '')?>" />
</td>
</tr>
<? } ?>
<tr>
<td class="label">Tags</td>
<td>
<?
$GenreTags = $Cache->get_value('genre_tags');
2013-04-19 08:00:55 +00:00
if (!$GenreTags) {
2013-05-30 08:00:30 +00:00
$DB->query('
SELECT Name
FROM tags
2013-06-24 08:00:28 +00:00
WHERE TagType = \'genre\'
2013-05-30 08:00:30 +00:00
ORDER BY Name');
$GenreTags = $DB->collect('Name');
$Cache->cache_value('genre_tags', $GenreTags, 3600 * 6);
2011-03-28 14:21:28 +00:00
}
?>
<select id="genre_tags" name="genre_tags" onchange="add_tag();return false;" >
<option>---</option>
2013-04-30 18:18:07 +00:00
<? foreach (Misc::display_array($GenreTags) as $Genre) { ?>
2013-06-24 08:00:28 +00:00
<option value="<?=$Genre?>"><?=$Genre?></option>
2011-03-28 14:21:28 +00:00
<? } ?>
</select>
2013-07-04 08:00:56 +00:00
<input type="text" id="tags" name="tags" size="45" value="<?=(!empty($Tags) ? display_str($Tags) : '')?>"<? Users::has_autocomplete_enabled('other'); ?> />
2011-03-28 14:21:28 +00:00
<br />
2013-06-15 08:00:45 +00:00
Tags should be comma-separated, and you should use a period (".") to separate words inside a tag&#8202;&mdash;&#8202;e.g. "<strong class="important_text_alt">hip.hop</strong>".
2011-03-28 14:21:28 +00:00
<br /><br />
2013-02-18 08:00:22 +00:00
There is a list of official tags to the left of the text box. Please use these tags instead of "unofficial" tags (e.g. use the official "<strong class="important_text_alt">drum.and.bass</strong>" tag, instead of an unofficial "<strong class="important_text">dnb</strong>" tag.).
2011-03-28 14:21:28 +00:00
</td>
</tr>
2013-04-19 08:00:55 +00:00
<? if ($NewRequest || $CanEdit) { ?>
2011-03-28 14:21:28 +00:00
<tr id="releasetypes_tr">
2013-02-18 08:00:22 +00:00
<td class="label">Release type</td>
2011-03-28 14:21:28 +00:00
<td>
<select id="releasetype" name="releasetype">
2013-04-19 08:00:55 +00:00
<option value="0">---</option>
2013-02-18 08:00:22 +00:00
<?
2011-03-28 14:21:28 +00:00
foreach ($ReleaseTypes as $Key => $Val) {
//echo '<h1>'.$ReleaseType.'</h1>'; die();
2013-02-18 08:00:22 +00:00
?> <option value="<?=$Key?>"<?=(!empty($ReleaseType) ? ($Key == $ReleaseType ? ' selected="selected"' : '') : '') ?>><?=$Val?></option>
<?
2011-03-28 14:21:28 +00:00
}
?>
</select>
</td>
</tr>
<tr id="formats_tr">
2013-02-18 08:00:22 +00:00
<td class="label">Allowed formats</td>
2011-03-28 14:21:28 +00:00
<td>
2013-07-11 08:00:55 +00:00
<input type="checkbox" name="all_formats" id="toggle_formats" onchange="Toggle('formats', <?=($NewRequest ? 1 : 0)?>);"<?=(!empty($FormatArray) && (count($FormatArray) === count($Formats)) ? ' checked="checked"' : '')?> /><label for="toggle_formats"> All</label>
2011-03-28 14:21:28 +00:00
<span style="float: right;"><strong>NB: You cannot require a log or cue unless FLAC is an allowed format</strong></span>
<? foreach ($Formats as $Key => $Val) {
2013-07-11 08:00:55 +00:00
if ($Key % 8 === 0) {
2013-04-19 08:00:55 +00:00
echo '<br />';
} ?>
<input type="checkbox" name="formats[]" value="<?=$Key?>" onchange="ToggleLogCue(); if (!this.checked) { $('#toggle_formats').raw().checked = false; }" id="format_<?=$Key?>"
2012-09-19 08:00:35 +00:00
<?=(!empty($FormatArray) && in_array($Key, $FormatArray) ? ' checked="checked"' : '')?> /><label for="format_<?=$Key?>"> <?=$Val?></label>
2013-04-19 08:00:55 +00:00
<? } ?>
2011-03-28 14:21:28 +00:00
</td>
</tr>
<tr id="bitrates_tr">
2013-02-18 08:00:22 +00:00
<td class="label">Allowed bitrates</td>
2011-03-28 14:21:28 +00:00
<td>
2013-07-11 08:00:55 +00:00
<input type="checkbox" name="all_bitrates" id="toggle_bitrates" onchange="Toggle('bitrates', <?=($NewRequest ? 1 : 0)?>);"<?=(!empty($BitrateArray) && (count($BitrateArray) === count($Bitrates)) ? ' checked="checked"' : '')?> /><label for="toggle_bitrates"> All</label>
2011-03-28 14:21:28 +00:00
<? foreach ($Bitrates as $Key => $Val) {
2013-07-11 08:00:55 +00:00
if ($Key % 8 === 0) {
2013-04-19 08:00:55 +00:00
echo '<br />';
} ?>
2013-02-18 08:00:22 +00:00
<input type="checkbox" name="bitrates[]" value="<?=$Key?>" id="bitrate_<?=$Key?>"
2011-03-28 14:21:28 +00:00
<?=(!empty($BitrateArray) && in_array($Key, $BitrateArray) ? ' checked="checked" ' : '')?>
2013-04-19 08:00:55 +00:00
onchange="if (!this.checked) { $('#toggle_bitrates').raw().checked = false; }" /><label for="bitrate_<?=$Key?>"> <?=$Val?></label>
<? } ?>
2011-03-28 14:21:28 +00:00
</td>
</tr>
<tr id="media_tr">
2013-02-18 08:00:22 +00:00
<td class="label">Allowed media</td>
2011-03-28 14:21:28 +00:00
<td>
2013-07-11 08:00:55 +00:00
<input type="checkbox" name="all_media" id="toggle_media" onchange="Toggle('media', <?=($NewRequest ? 1 : 0)?>);"<?=(!empty($MediaArray) && (count($MediaArray) === count($Media)) ? ' checked="checked"' : '')?> /><label for="toggle_media"> All</label>
2013-02-18 08:00:22 +00:00
<? foreach ($Media as $Key => $Val) {
2013-07-11 08:00:55 +00:00
if ($Key % 8 === 0) {
2013-04-19 08:00:55 +00:00
echo '<br />';
} ?>
2013-02-18 08:00:22 +00:00
<input type="checkbox" name="media[]" value="<?=$Key?>" id="media_<?=$Key?>"
2011-03-28 14:21:28 +00:00
<?=(!empty($MediaArray) && in_array($Key, $MediaArray) ? ' checked="checked" ' : '')?>
2013-04-19 08:00:55 +00:00
onchange="if (!this.checked) { $('#toggle_media').raw().checked = false; }" /><label for="media_<?=$Key?>"> <?=$Val?></label>
<? } ?>
2011-03-28 14:21:28 +00:00
</td>
</tr>
<tr id="logcue_tr" class="hidden">
2013-02-07 08:00:47 +00:00
<td class="label">Log / Cue (CD FLAC only)</td>
2011-03-28 14:21:28 +00:00
<td>
2013-02-18 08:00:22 +00:00
<input type="checkbox" id="needlog" name="needlog" onchange="ToggleLogScore()" <?=(!empty($NeedLog) ? 'checked="checked" ' : '')?>/><label for="needlog"> Require log</label>
<span id="minlogscore_span" class="hidden">&nbsp;<input type="text" name="minlogscore" id="minlogscore" size="4" value="<?=(!empty($MinLogScore) ? $MinLogScore : '')?>" /> Minimum log score</span>
2011-03-28 14:21:28 +00:00
<br />
2013-02-18 08:00:22 +00:00
<input type="checkbox" id="needcue" name="needcue" <?=(!empty($NeedCue) ? 'checked="checked" ' : '')?>/><label for="needcue"> Require cue</label>
2011-03-28 14:21:28 +00:00
<br />
</td>
</tr>
<? } ?>
<tr>
<td class="label">Description</td>
<td>
2013-09-13 08:00:53 +00:00
<textarea name="description" cols="70" rows="7"><?=(!empty($Request['Description']) ? $Request['Description'] : '')?></textarea> <br />
2011-03-28 14:21:28 +00:00
</td>
</tr>
2013-04-19 08:00:55 +00:00
<? if (check_perms('site_moderate_requests')) { ?>
2012-02-03 08:00:22 +00:00
<tr>
2013-02-18 08:00:22 +00:00
<td class="label">Torrent group</td>
2012-02-03 08:00:22 +00:00
<td>
2013-04-19 08:00:55 +00:00
https://<?=SSL_SITE_URL?>/torrents.php?id=<input type="text" name="groupid" value="<?=$GroupID?>" size="15" /><br />
2012-02-03 08:00:22 +00:00
If this request matches a torrent group <span style="font-weight: bold;">already existing</span> on the site, please indicate that here.
</td>
</tr>
2013-07-11 08:00:55 +00:00
<? } elseif ($GroupID && ($CategoryID == 1)) { ?>
2012-02-03 08:00:22 +00:00
<tr>
2013-02-18 08:00:22 +00:00
<td class="label">Torrent group</td>
2012-02-03 08:00:22 +00:00
<td>
2013-04-19 08:00:55 +00:00
<a href="torrents.php?id=<?=$GroupID?>">https://<?=SSL_SITE_URL?>/torrents.php?id=<?=$GroupID?></a><br />
2013-06-24 08:00:28 +00:00
This request <?=($NewRequest ? 'will be' : 'is')?> associated with the above torrent group.
2013-07-11 08:00:55 +00:00
<? if (!$NewRequest) { ?>
2012-09-09 08:00:26 +00:00
If this is incorrect, please <a href="reports.php?action=report&amp;type=request&amp;id=<?=$RequestID?>">report this request</a> so that staff can fix it.
2012-02-03 08:00:22 +00:00
<? } ?>
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
</td>
</tr>
<? }
2013-04-19 08:00:55 +00:00
if ($NewRequest) { ?>
2011-03-28 14:21:28 +00:00
<tr id="voting">
<td class="label">Bounty (MB)</td>
<td>
<input type="text" id="amount_box" size="8" value="<?=(!empty($Bounty) ? $Bounty : '100')?>" onchange="Calculate();" />
<select id="unit" name="unit" onchange="Calculate();">
2013-07-11 08:00:55 +00:00
<option value="mb"<?=(!empty($_POST['unit']) && $_POST['unit'] === 'mb' ? ' selected="selected"' : '') ?>>MB</option>
<option value="gb"<?=(!empty($_POST['unit']) && $_POST['unit'] === 'gb' ? ' selected="selected"' : '') ?>>GB</option>
2011-03-28 14:21:28 +00:00
</select>
2012-09-19 08:00:35 +00:00
<input type="button" value="Preview" onclick="Calculate();" />
2011-03-28 14:21:28 +00:00
<strong><?=($RequestTax * 100)?>% of this is deducted as tax by the system.</strong>
</td>
</tr>
<tr>
<td class="label">Post request information</td>
<td>
<input type="hidden" id="amount" name="amount" value="<?=(!empty($Bounty) ? $Bounty : '100')?>" />
<input type="hidden" id="current_uploaded" value="<?=$LoggedUser['BytesUploaded']?>" />
<input type="hidden" id="current_downloaded" value="<?=$LoggedUser['BytesDownloaded']?>" />
2013-07-10 00:08:53 +00:00
Bounty after tax: <strong><span id="bounty_after_tax">90.00 MB</span></strong><br />
2013-01-15 08:00:37 +00:00
If you add the entered <strong><span id="new_bounty">100.00 MB</span></strong> of bounty, your new stats will be: <br />
2013-07-10 00:08:53 +00:00
Uploaded: <span id="new_uploaded"><?=Format::get_size($LoggedUser['BytesUploaded'])?></span><br />
2013-06-24 08:00:28 +00:00
Ratio: <span id="new_ratio"><?=Format::get_ratio_html($LoggedUser['BytesUploaded'], $LoggedUser['BytesDownloaded'])?></span>
2011-03-28 14:21:28 +00:00
</td>
</tr>
<tr>
<td colspan="2" class="center">
<input type="submit" id="button" value="Create request" disabled="disabled" />
</td>
</tr>
2013-02-18 08:00:22 +00:00
<? } else { ?>
2011-03-28 14:21:28 +00:00
<tr>
<td colspan="2" class="center">
<input type="submit" id="button" value="Edit request" />
</td>
</tr>
<? } ?>
</table>
</form>
2013-07-10 00:08:53 +00:00
<script type="text/javascript">ToggleLogCue();<?=$NewRequest ? " Calculate();" : '' ?></script>
2011-03-28 14:21:28 +00:00
<script type="text/javascript">Categories();</script>
</div>
</div>
<?
2013-02-18 08:00:22 +00:00
View::show_footer();
2011-03-28 14:21:28 +00:00
?>