more bulk sanity

This commit is contained in:
f0o
2016-02-10 16:02:13 +00:00
parent f606369309
commit c767a26732
16 changed files with 89 additions and 89 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ else {
// FIXME: missing email field here on the form
if (adduser($_POST['new_username'], $_POST['new_password'], $_POST['new_level'], $_POST['new_email'], $_POST['new_realname'], $_POST['can_modify_passwd'])) {
echo '<span class=info>User '.$_POST['username'].' added!</span>';
echo '<span class=info>User '.$vars['username'].' added!</span>';
}
}
else {
+3 -3
View File
@@ -51,7 +51,7 @@ foreach (get_all_devices() as $hostname) {
$device_id = getidbyname($hostname);
if (device_permitted($device_id)) {
echo '"<option value=\"'.$device_id.'\""+';
if (getidbyname($hostname) == $_POST['device_id']) {
if (getidbyname($hostname) == $vars['device_id']) {
echo '" selected "+';
}
@@ -69,7 +69,7 @@ foreach (get_all_devices() as $hostname) {
{
return {
id: "alertlog",
device_id: '<?php echo htmlspecialchars($_POST['device_id']); ?>'
device_id: '<?php echo $vars['device_id']; ?>'
};
},
url: "ajax_table.php"
@@ -81,7 +81,7 @@ foreach (get_all_devices() as $hostname) {
max = high - low;
search = $('.search-field').val();
$(".pdf-export").html("<a href='pdf.php?report=alert-log&device_id=<?php echo $_POST['device_id']; ?>&string="+search+"&results="+max+"&start="+low+"'><img src='images/16/pdf.png' width='16' height='16' alt='Export to pdf'> Export to pdf</a>");
$(".pdf-export").html("<a href='pdf.php?report=alert-log&device_id=<?php echo $vars['device_id']; ?>&string="+search+"&results="+max+"&start="+low+"'><img src='images/16/pdf.png' width='16' height='16' alt='Export to pdf'> Export to pdf</a>");
grid.find(".incident-toggle").each( function() {
$(this).parent().addClass('incident-toggle-td');
+4 -4
View File
@@ -13,8 +13,8 @@
*/
if ($_SESSION['userlevel'] >= '10') {
if (empty($_POST['token'])) {
$_POST['token'] = bin2hex(openssl_random_pseudo_bytes(16));
if (empty($vars['token'])) {
$vars['token'] = bin2hex(openssl_random_pseudo_bytes(16));
}
?>
@@ -65,7 +65,7 @@ foreach (dbFetchRows("SELECT user_id,username FROM `users` WHERE `level` >= '10'
<div class="form-group">
<label for="token" class="col-sm-2 control-label">Token: </label>
<div class="col-sm-8">
<input type="text" class="form-control" id="token" name="token" value="<?php echo $_POST['token']; ?>" readonly>
<input type="text" class="form-control" id="token" name="token" value="<?php echo $vars['token']; ?>" readonly>
</div>
<div class="col-sm-2">
</div>
@@ -73,7 +73,7 @@ foreach (dbFetchRows("SELECT user_id,username FROM `users` WHERE `level` >= '10'
<div class="form-group">
<label for="description" class="col-sm-2 control-label">Descr: </label>
<div class="col-sm-10">
<input type="text" class="form-control" id="description" name="description" value="<?php echo $_POST['description']; ?>">
<input type="text" class="form-control" id="description" name="description" value="<?php echo $vars['description']; ?>">
</div>
</div>
</div>
+1 -1
View File
@@ -9,7 +9,7 @@
Bills
</div>
<div class="form-group">
<input type="text" name="hostname" id="hostname" class="form-control input-sm" value="<?php echo $_POST['hostname']; ?>" />
<input type="text" name="hostname" id="hostname" class="form-control input-sm" value="<?php echo $vars['hostname']; ?>" />
</div>
<div class="form-group">
<select name='os' id='os' class="form-control input-sm">
+6 -6
View File
@@ -12,16 +12,16 @@ if ($_SESSION['userlevel'] == 11) {
}
else {
if (is_numeric($_REQUEST['id'])) {
if (is_numeric($vars['id'])) {
echo('
<div class="row">
<div class="col-sm-offset-2 col-sm-7">
');
if ($_REQUEST['confirm']) {
print_message(nl2br(delete_device(mres($_REQUEST['id'])))."\n");
if ($vars['confirm']) {
print_message(nl2br(delete_device(mres($vars['id'])))."\n");
}
else {
$device = device_by_id_cache($_REQUEST['id']);
$device = device_by_id_cache($vars['id']);
print_error("Are you sure you want to delete device " . $device['hostname'] . "?");
?>
<br />
@@ -30,9 +30,9 @@ else {
<br>
<form name="form1" method="post" action="" class="form-horizontal" role="form">
<div class="form-group">
<input type="hidden" name="id" value="<?php echo $_REQUEST['id'] ?>" />
<input type="hidden" name="id" value="<?php echo $vars['id'] ?>" />
<input type="hidden" name="confirm" value="1" />
<!--<input type="hidden" name="remove_rrd" value="<?php echo $_POST['remove_rrd']; ?>">-->
<!--<input type="hidden" name="remove_rrd" value="<?php echo $vars['remove_rrd']; ?>">-->
<button type="submit" class="btn btn-danger">Confirm host deletion</button>
</div>
</form>
+1 -1
View File
@@ -58,7 +58,7 @@ else {
echo(generate_link($text,$link_array,array('section'=>$type)));
# echo("<a href='device/".$device['device_id']."/edit/" . $type . ($_GET['optd'] ? "/" . $_GET['optd'] : ''). "/'> " . $text ."</a>");
# echo("<a href='device/".$device['device_id']."/edit/" . $type . ($vars['optd'] ? "/" . $vars['optd'] : ''). "/'> " . $text ."</a>");
if ($vars['section'] == $type) {
echo("</span>");
}
+1 -1
View File
@@ -2,7 +2,7 @@
<form method="post" action="">
<div class="row">
<div class="col-md-4">
<input type="text" name="string" placeholder="Search" class="form-control" id="string" value="<?php echo $_POST['string']; ?>" required/>
<input type="text" name="string" placeholder="Search" class="form-control" id="string" value="<?php echo $vars['string']; ?>" required/>
</div>
<div class="col-md-4">
<select name="type" class="form-control" id="type">
+1 -1
View File
@@ -3,7 +3,7 @@
<form method="post" action="">
<label><strong>Search</strong>
<input type="text" name="string" id="string" value="<?php echo $_POST['string']; ?>" />
<input type="text" name="string" id="string" value="<?php echo $vars['string']; ?>" />
</label>
<label>
<strong>Program</strong>
+8 -8
View File
@@ -29,7 +29,7 @@ var grid = $("#inventory").bootgrid({
header: "<div id=\"{{ctx.id}}\" class=\"{{css.header}}\"><div class=\"row\">"+
"<div class=\"col-sm-9 actionBar\"><span class=\"pull-left\"><form method=\"post\" action=\"\" class=\"form-inline\" role=\"form\">"+
"<div class=\"form-group\">"+
"<input type=\"text\" name=\"string\" id=\"string\" value=\"<?php echo $_POST['string']; ?>\" placeholder=\"Description\" class=\"form-control input-sm\" />"+
"<input type=\"text\" name=\"string\" id=\"string\" value=\"<?php echo $vars['string']; ?>\" placeholder=\"Description\" class=\"form-control input-sm\" />"+
"</div>"+
"<div class=\"form-group\">"+
"<strong>&nbsp;Part No&nbsp;</strong>"+
@@ -48,7 +48,7 @@ foreach (dbFetchRows('SELECT `entPhysicalModelName` FROM `entPhysical` GROUP BY
"</select>"+
"</div>"+
"<div class=\"form-group\">"+
"<input type=\"text\" name=\"serial\" id=\"serial\" value=\"<?php echo $_POST['serial']; ?>\" placeholder=\"Serial\" class=\"form-control input-sm\"/>"+
"<input type=\"text\" name=\"serial\" id=\"serial\" value=\"<?php echo $vars['serial']; ?>\" placeholder=\"Serial\" class=\"form-control input-sm\"/>"+
"</div>"+
"<div class=\"form-group\">"+
"<strong>&nbsp;Device&nbsp;</strong>"+
@@ -72,7 +72,7 @@ foreach (dbFetchRows('SELECT * FROM `devices` ORDER BY `hostname`') as $data) {
"<input type=\"text\" size=24 name=\"device_string\" id=\"device_string\" value=\""+
<?php
if ($_POST['device_string']) {
echo $_POST['device_string'];
echo $vars['device_string'];
};
?>
"\" placeholder=\"Description\" class=\"form-control input-sm\"/>"+
@@ -85,11 +85,11 @@ foreach (dbFetchRows('SELECT * FROM `devices` ORDER BY `hostname`') as $data) {
{
return {
id: "inventory",
device: '<?php echo htmlspecialchars($_POST['device']); ?>',
string: '<?php echo mres($_POST['string']); ?>',
device_string: '<?php echo mres($_POST['device_string']); ?>',
part: '<?php echo mres($_POST['part']); ?>',
serial: '<?php echo mres($_POST['serial']); ?>'
device: '<?php echo $vars['device']; ?>',
string: '<?php echo $vars['string']; ?>',
device_string: '<?php echo $vars['device_string']; ?>',
part: '<?php echo $vars['part']; ?>',
serial: '<?php echo $vars['serial']; ?>'
};
},
url: "ajax_table.php"
+31 -31
View File
@@ -1,84 +1,84 @@
<?php
if ($_SESSION['userlevel'] >= '5') {
if (!isset($_GET['optb'])) {
$_GET['optb'] = 'all';
if (!isset($vars['optb'])) {
$vars['optb'] = 'all';
}
if (!isset($_GET['optc'])) {
$_GET['optc'] = 'basic';
if (!isset($vars['optc'])) {
$vars['optc'] = 'basic';
}
print_optionbar_start();
echo '<span style="font-weight: bold;">VRF</span> &#187; ';
if ($_GET['opta'] == 'vrf' && $_GET['optb'] == 'all') {
if ($vars['opta'] == 'vrf' && $vars['optb'] == 'all') {
echo "<span class='pagemenu-selected'>";
}
echo '<a href="routing/vrf/all/'.$_GET['optc'].'/">All</a>';
if ($_GET['opta'] == 'vrf' && $_GET['optb'] == 'all') {
echo '<a href="routing/vrf/all/'.$vars['optc'].'/">All</a>';
if ($vars['opta'] == 'vrf' && $vars['optb'] == 'all') {
echo '</span>';
}
echo ' | ';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'basic') {
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'basic') {
echo "<span class='pagemenu-selected'>";
}
echo '<a href="routing/vrf/'.$_GET['optb'].'/basic/">Basic</a>';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'basic') {
echo '<a href="routing/vrf/'.$vars['optb'].'/basic/">Basic</a>';
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'basic') {
echo '</span>';
}
echo ' | ';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'details') {
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'details') {
echo "<span class='pagemenu-selected'>";
}
echo '<a href="routing/vrf/'.$_GET['optb'].'/details/">Details</a>';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'details') {
echo '<a href="routing/vrf/'.$vars['optb'].'/details/">Details</a>';
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'details') {
echo '</span>';
}
echo ' | Graphs: ( ';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'bits') {
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'bits') {
echo "<span class='pagemenu-selected'>";
}
echo '<a href="routing/vrf/'.$_GET['optb'].'/bits/">Bits</a>';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'bits') {
echo '<a href="routing/vrf/'.$vars['optb'].'/bits/">Bits</a>';
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'bits') {
echo '</span>';
}
echo ' | ';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'upkts') {
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'upkts') {
echo "<span class='pagemenu-selected'>";
}
echo '<a href="routing/vrf/'.$_GET['optb'].'/upkts/">Packets</a>';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'upkts') {
echo '<a href="routing/vrf/'.$vars['optb'].'/upkts/">Packets</a>';
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'upkts') {
echo '</span>';
}
echo ' | ';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'nupkts') {
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'nupkts') {
echo "<span class='pagemenu-selected'>";
}
echo '<a href="routing/vrf/'.$_GET['optb'].'/nupkts/">NU Packets</a>';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'nupkts') {
echo '<a href="routing/vrf/'.$vars['optb'].'/nupkts/">NU Packets</a>';
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'nupkts') {
echo '</span>';
}
echo ' | ';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'errors') {
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'errors') {
echo "<span class='pagemenu-selected'>";
}
echo '<a href="routing/vrf/'.$_GET['optb'].'/errors/">Errors</a>';
if ($_GET['opta'] == 'vrf' && $_GET['optc'] == 'errors') {
echo '<a href="routing/vrf/'.$vars['optb'].'/errors/">Errors</a>';
if ($vars['opta'] == 'vrf' && $vars['optc'] == 'errors') {
echo '</span>';
}
@@ -86,7 +86,7 @@ if ($_SESSION['userlevel'] >= '5') {
print_optionbar_end();
if ($_GET['optb'] == 'all') {
if ($vars['optb'] == 'all') {
// Pre-Cache in arrays
// That's heavier on RAM, but much faster on CPU (1:40)
// Specifying the fields reduces a lot the RAM used (1:4) .
@@ -123,7 +123,7 @@ if ($_SESSION['userlevel'] >= '5') {
}
echo "<tr valign=top bgcolor='$bg_colour'>";
echo "<td width=240><a class=list-large href='routing/vrf/".$vrf['mplsVpnVrfRouteDistinguisher'].'/'.$_GET['optc']."/'>".$vrf['vrf_name'].'</a><br /><span class=box-desc>'.$vrf['mplsVpnVrfDescription'].'</span></td>';
echo "<td width=240><a class=list-large href='routing/vrf/".$vrf['mplsVpnVrfRouteDistinguisher'].'/'.$vars['optc']."/'>".$vrf['vrf_name'].'</a><br /><span class=box-desc>'.$vrf['mplsVpnVrfDescription'].'</span></td>';
echo '<td width=100 class=box-desc>'.$vrf['mplsVpnVrfRouteDistinguisher'].'</td>';
// echo("<td width=200 class=box-desc>" . $vrf['mplsVpnVrfDescription'] . "</td>");
echo '<td><table border=0 cellspacing=0 cellpadding=5 width=100%>';
@@ -158,7 +158,7 @@ if ($_SESSION['userlevel'] >= '5') {
foreach ($ports[$device['vrf_id']][$device['device_id']] as $port) {
$port = array_merge($device, $port);
switch ($_GET['optc']) {
switch ($vars['optc']) {
case 'bits':
case 'upkts':
case 'nupkts':
@@ -168,7 +168,7 @@ if ($_SESSION['userlevel'] >= '5') {
$port['from'] = $config['time']['day'];
$port['to'] = $config['time']['now'];
$port['bg'] = '#'.$bg;
$port['graph_type'] = 'port_'.$_GET['optc'];
$port['graph_type'] = 'port_'.$vars['optc'];
echo "<div style='display: block; padding: 3px; margin: 3px; min-width: 135px; max-width:135px; min-height:75px; max-height:75px;
text-align: center; float: left; background-color: ".$list_colour_b_b.";'>
<div style='font-weight: bold;'>".makeshortif($port['ifDescr']).'</div>';
@@ -196,9 +196,9 @@ if ($_SESSION['userlevel'] >= '5') {
}
else {
echo "<div style='background: $list_colour_a; padding: 10px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>";
$vrf = dbFetchRow('SELECT * FROM `vrfs` WHERE mplsVpnVrfRouteDistinguisher = ?', array($_GET['optb']));
$vrf = dbFetchRow('SELECT * FROM `vrfs` WHERE mplsVpnVrfRouteDistinguisher = ?', array($vars['optb']));
echo "<tr valign=top bgcolor='$bg_colour'>";
echo "<td width=200 class=list-large><a href='routing/vrf/".$vrf['mplsVpnVrfRouteDistinguisher'].'/'.$_GET['optc']."/'>".$vrf['vrf_name'].'</a></td>';
echo "<td width=200 class=list-large><a href='routing/vrf/".$vrf['mplsVpnVrfRouteDistinguisher'].'/'.$vars['optc']."/'>".$vrf['vrf_name'].'</a></td>';
echo '<td width=100 class=box-desc>'.$vrf['mplsVpnVrfRouteDistinguisher'].'</td>';
echo '<td width=200 class=box-desc>'.$vrf['mplsVpnVrfDescription'].'</td>';
echo '</table></div>';
+1 -1
View File
@@ -28,7 +28,7 @@ foreach ($sections as $type => $texttype) {
echo "<span class='pagemenu-selected'>";
}
// echo('<a href="search/' . $type . ($_GET['optb'] ? '/' . $_GET['optb'] : ''). '/">' . $texttype .'</a>');
// echo('<a href="search/' . $type . ($vars['optb'] ? '/' . $vars['optb'] : ''). '/">' . $texttype .'</a>');
echo generate_link($texttype, array('page' => 'search', 'search' => $type));
if ($vars['search'] == $type) {
+4 -4
View File
@@ -73,7 +73,7 @@ if ($_POST['searchby'] == 'ip') {
"<div class=\"form-group\">"+
"<input type=\"text\" name=\"searchPhrase\" id=\"address\" value=\""+
<?php
echo '"'.$_POST['searchPhrase'].'"+';
echo '"'.$vars['searchPhrase'].'"+';
?>
"\" class=\"form-control input-sm\" placeholder=\"Address\" />"+
@@ -86,9 +86,9 @@ echo '"'.$_POST['searchPhrase'].'"+';
{
return {
id: "arp-search",
device_id: '<?php echo htmlspecialchars($_POST['device_id']); ?>',
searchby: '<?php echo mres($_POST['searchby']); ?>',
searchPhrase: '<?php echo mres($_POST['searchPhrase']); ?>'
device_id: '<?php echo $vars['device_id']; ?>',
searchby: '<?php echo $vars['searchby']; ?>',
searchPhrase: '<?php echo $vars['searchPhrase']; ?>'
};
},
url: "ajax_table.php"
+4 -4
View File
@@ -70,7 +70,7 @@ if ($_POST['interface'] == 'Vlan%') {
"</select>"+
"</div>&nbsp;"+
"<div class=\"form-group\">"+
"<input type=\"text\" name=\"address\" id=\"address\" size=40 value=\"<?php echo $_POST['address']; ?>\" class=\"form-control input-sm\" placeholder=\"IPv4 Address\"/>"+
"<input type=\"text\" name=\"address\" id=\"address\" size=40 value=\"<?php echo $vars['address']; ?>\" class=\"form-control input-sm\" placeholder=\"IPv4 Address\"/>"+
"</div>&nbsp;"+
"<button type=\"submit\" class=\"btn btn-default input-sm\">Search</button>"+
"</form></span></div>"+
@@ -81,9 +81,9 @@ if ($_POST['interface'] == 'Vlan%') {
return {
id: "address-search",
search_type: "ipv4",
device_id: '<?php echo htmlspecialchars($_POST['device_id']); ?>',
interface: '<?php echo mres($_POST['interface']); ?>',
address: '<?php echo mres($_POST['address']); ?>'
device_id: '<?php echo $vars['device_id']; ?>',
interface: '<?php echo $vars['interface']; ?>',
address: '<?php echo $vars['address']; ?>'
};
},
url: "ajax_table.php"
+4 -4
View File
@@ -71,7 +71,7 @@ if ($_POST['interface'] == 'Vlan%') {
"</select>"+
"</div>"+
"<div class=\"form-group\">"+
"<input type=\"text\" name=\"address\" id=\"address\" size=40 value=\"<?php echo $_POST['address']; ?>\" class=\"form-control input-sm\" placeholder=\"IPv6 Address\"/>"+
"<input type=\"text\" name=\"address\" id=\"address\" size=40 value=\"<?php echo $vars['address']; ?>\" class=\"form-control input-sm\" placeholder=\"IPv6 Address\"/>"+
"</div>"+
"<button type=\"submit\" class=\"btn btn-default input-sm\">Search</button>"+
"</form></span></div>"+
@@ -82,9 +82,9 @@ if ($_POST['interface'] == 'Vlan%') {
return {
id: "address-search",
search_type: "ipv6",
device_id: '<?php echo htmlspecialchars($_POST['device_id']); ?>',
interface: '<?php echo mres($_POST['interface']); ?>',
address: '<?php echo mres($_POST['address']); ?>'
device_id: '<?php echo $vars['device_id']; ?>',
interface: '<?php echo $vars['interface']; ?>',
address: '<?php echo $vars['address']; ?>'
};
},
url: "ajax_table.php"
+4 -4
View File
@@ -69,7 +69,7 @@ if ($_POST['interface'] == 'Vlan%') {
"<div class=\"form-group\">"+
"<input type=\"text\" name=\"address\" id=\"address\" value=\""+
<?php
echo '"'.$_POST['address'].'"+';
echo '"'.$vars['address'].'"+';
?>
"\" class=\"form-control input-sm\" placeholder=\"Mac Address\"/>"+
@@ -83,9 +83,9 @@ echo '"'.$_POST['address'].'"+';
return {
id: "address-search",
search_type: "mac",
device_id: '<?php echo htmlspecialchars($_POST['device_id']); ?>',
interface: '<?php echo mres($_POST['interface']); ?>',
address: '<?php echo mres($_POST['address']); ?>'
device_id: '<?php echo $vars['device_id']; ?>',
interface: '<?php echo $vars['interface']; ?>',
address: '<?php echo $vars['address']; ?>'
};
},
url: "ajax_table.php"
+15 -15
View File
@@ -28,23 +28,23 @@ print_optionbar_start(28);
<form method="post" action="" class="form-inline" role="form">
<div class="form-group">
<label for="package">Package</label>
<input type="text" name="package" id="package" size=20 value="<?php echo($_POST['package']); ?>" class="form-control input-sm" placeholder="Any" />
<input type="text" name="package" id="package" size=20 value="<?php echo($vars['package']); ?>" class="form-control input-sm" placeholder="Any" />
</div>
<div class="form-group">
<label for="version">Version</label>
<input type="text" name="version" id="version" size=20 value="<?php echo($_POST['version']); ?>" class="form-control input-sm" placeholder="Any" />
<input type="text" name="version" id="version" size=20 value="<?php echo($vars['version']); ?>" class="form-control input-sm" placeholder="Any" />
</div>
<div class="form-group">
<label for="version">Arch</label>
<input type="text" name="arch" id="arch" size=20 value="<?php echo($_POST['arch']); ?>" class="form-control input-sm" placeholder="Any" />
<input type="text" name="arch" id="arch" size=20 value="<?php echo($vars['arch']); ?>" class="form-control input-sm" placeholder="Any" />
</div>
<button type="submit" class="btn btn-default input-sm">Search</button>
</form>
<?php
print_optionbar_end();
if(isset($_POST['results_amount']) && $_POST['results_amount'] > 0) {
$results = $_POST['results'];
if(isset($vars['results_amount']) && $vars['results_amount'] > 0) {
$results = $vars['results'];
}
else {
$results = 50;
@@ -81,15 +81,15 @@ if (is_admin() === FALSE && is_read() === FALSE) {
$param[] = $_SESSION['user_id'];
}
$query .= " WHERE packages.device_id = devices.device_id AND packages.name LIKE '%".mres($_POST['package'])."%' $sql_where GROUP BY packages.name";
$query .= " WHERE packages.device_id = devices.device_id AND packages.name LIKE '%".mres($vars['package'])."%' $sql_where GROUP BY packages.name";
$where = '';
$ver = "";
$opt = "";
if( !empty($_POST['arch']) ) {
if( !empty($vars['arch']) ) {
$where .= ' AND packages.arch = ?';
$param[] = mres($_POST['arch']);
$param[] = mres($vars['arch']);
}
if( is_numeric($_REQUEST['device_id']) ) {
@@ -102,11 +102,11 @@ $count_query .= $query." ) sub";
$query .= $where." ORDER BY packages.name, packages.arch, packages.version";
$count = dbFetchCell($count_query,$param);
if( !isset($_POST['page_number']) && $_POST['page_number'] < 1 ) {
if( !isset($vars['page_number']) && $vars['page_number'] < 1 ) {
$page_number = 1;
}
else {
$page_number = $_POST['page_number'];
$page_number = $vars['page_number'];
}
$start = ($page_number - 1) * $results;
@@ -134,8 +134,8 @@ foreach( dbFetchRows($full_query, $param) as $entry ) {
}
}
if( !empty($_POST['version']) ) {
list($opt, $ver) = explode(" ",$_POST['version']);
if( !empty($vars['version']) ) {
list($opt, $ver) = explode(" ",$vars['version']);
}
foreach( $ordered as $name=>$entry ) {
@@ -178,9 +178,9 @@ if( (int) ($count / $results) > 0 && $count != $results ) {
</table>
<input type="hidden" name="page_number" id="page_number" value="<?php echo $page_number; ?>">
<input type="hidden" name="results_amount" id="results_amount" value="<?php echo $results; ?>">
<input type="hidden" name="package" id="results_packages" value="<?php echo $_POST['package']; ?>">
<input type="hidden" name="version" id="results_version" value="<?php echo $_POST['version']; ?>">
<input type="hidden" name="arch" id="results_arch" value="<?php echo $_POST['arch']; ?>">
<input type="hidden" name="package" id="results_packages" value="<?php echo $vars['package']; ?>">
<input type="hidden" name="version" id="results_version" value="<?php echo $vars['version']; ?>">
<input type="hidden" name="arch" id="results_arch" value="<?php echo $vars['arch']; ?>">
</form>
<script type="text/javascript">
function updateResults(results) {