Gazelle/sections/reportsv2/ajax_report.php

92 lines
2.7 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
/*
* The backend to changing the report type when making a report.
* It prints out the relevant report_messages from the array, then
* prints the relevant report_fields and whether they're required.
*/
authorize();
?>
<ul>
<?
$CategoryID = $_POST['categoryid'];
if(array_key_exists($_POST['type'], $Types[$CategoryID])) {
$ReportType = $Types[$CategoryID][$_POST['type']];
} else if(array_key_exists($_POST['type'],$Types['master'])) {
$ReportType = $Types['master'][$_POST['type']];
} else {
echo 'HAX IN REPORT TYPE';
die();
}
foreach($ReportType['report_messages'] as $Message) {
?>
<li><?=$Message?></li>
<?
}
?>
</ul>
<br />
2012-09-15 08:00:25 +00:00
<table class="layout border" cellpadding="3" cellspacing="1" border="0" width="100%">
2011-03-28 14:21:28 +00:00
<?
if(array_key_exists('image', $ReportType['report_fields'])) {
?>
<tr>
<td class="label">
2012-09-09 08:00:26 +00:00
Image(s)<?=($ReportType['report_fields']['image'] == '1' ? ' <strong class="important_text">(Required)</strong>' : '')?>
2011-03-28 14:21:28 +00:00
</td>
<td>
<input id="image" type="text" name="image" size="50" value="<?=(!empty($_POST['image']) ? display_str($_POST['image']) : '')?>" />
</td>
</tr>
<?
}
if(array_key_exists('track', $ReportType['report_fields'])) {
?>
<tr>
<td class="label">
2012-09-09 08:00:26 +00:00
Track Number(s)<?=($ReportType['report_fields']['track'] == '1' || $ReportType['report_fields']['track'] == '2' ? ' <strong class="important_text">(Required)</strong>' : '')?>
2011-03-28 14:21:28 +00:00
</td>
<td>
<input id="track" type="text" name="track" size="8" value="<?=(!empty($_POST['track']) ? display_str($_POST['track']) : '')?>" /><?=($ReportType['report_fields']['track'] == '1' ? '<input id="all_tracks" type="checkbox" onclick="AllTracks()" /> All' : '')?>
</td>
</tr>
<?
}
if(array_key_exists('link', $ReportType['report_fields'])) {
?>
<tr>
<td class="label">
2012-09-09 08:00:26 +00:00
Link(s) to external source<?=($ReportType['report_fields']['link'] == '1' ? ' <strong class="important_text">(Required)</strong>' : '')?>
2011-03-28 14:21:28 +00:00
</td>
<td>
<input id="link" type="text" name="link" size="50" value="<?=(!empty($_POST['link']) ? display_str($_POST['link']) : '')?>" />
</td>
</tr>
<?
}
if(array_key_exists('sitelink', $ReportType['report_fields'])) {
?>
<tr>
<td class="label">
2012-09-09 08:00:26 +00:00
Permalink to <strong>relevant other</strong> torrent(s)<?=($ReportType['report_fields']['sitelink'] == '1' ? ' <strong class="important_text">(Required)</strong>' : '')?>
2011-03-28 14:21:28 +00:00
</td>
<td>
<input id="sitelink" type="text" name="sitelink" size="50" value="<?=(!empty($_POST['sitelink']) ? display_str($_POST['sitelink']) : '')?>" />
</td>
</tr>
<?
}
?>
<tr>
<td class="label">
2012-09-09 08:00:26 +00:00
Comments <strong class="important_text">(Required)</strong>
2011-03-28 14:21:28 +00:00
</td>
<td>
<textarea id="extra" rows="5" cols="60" name="extra"><?=display_str($_POST['extra'])?></textarea>
</td>
</tr>
</table>