Exemple #1
0
echo gettext("RRD Profile");
?>
</label><br/>
                    <span><a href="../rrd_conf/new_rrd_conf_form.php"><?php 
echo gettext("Insert new profile");
?>
 ?</a></span>
                </th>
                <td class="left">
                    <select name="rrd_profile" id='rrd_profile' class='vfield'>
                        <option value="" selected='selected'><?php 
echo gettext("None");
?>
</option>
                        <?php 
foreach (RRD_Config::get_profile_list($conn) as $profile) {
    if (strcmp($profile, "global")) {
        $selected = $rrd_profile == $profile ? " selected='selected'" : '';
        echo "<option value=\"{$profile}\" {$selected}>{$profile}</option>\n";
    }
}
?>
                    </select>
                </td>
            </tr>

            <tr class="advanced" style="display:none;">
                <th><label for='threshold_c'><?php 
echo gettext("Threshold C");
?>
</label></th>
                ossim_valid(POST("{$attrib}#rrd_attrib"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#rrd_attrib"));
                ossim_valid(POST("{$attrib}#threshold"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#threshold"));
                ossim_valid(POST("{$attrib}#priority"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#priority"));
                ossim_valid(POST("{$attrib}#alpha"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#alpha"));
                ossim_valid(POST("{$attrib}#beta"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#beta"));
                ossim_valid(POST("{$attrib}#persistence"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#persistence"));
                if (ossim_error()) {
                    die(ossim_error());
                }
                RRD_Config::update($conn, $profile, POST("{$attrib}#rrd_attrib"), POST("{$attrib}#threshold"), POST("{$attrib}#priority"), POST("{$attrib}#alpha"), POST("{$attrib}#beta"), POST("{$attrib}#persistence"), $enable);
            }
        }
    }
}
echo "<h2>{$profile}</h2>";
$rrd_list = RRD_Config::get_list($conn, "WHERE profile = '{$profile}' ORDER BY {$order}");
$db->close($conn);
?>

  <table align="center">
    <tr>
      <th><a href="<?php 
echo $_SERVER["SCRIPT_NAME"];
?>
?order=<?php 
echo ossim_db::get_order("rrd_attrib", $order);
?>
&profile=<?php 
echo $profile;
?>
">
Exemple #3
0
        if (POST("{$attrib}#rrd_attrib")) {
            if (POST("{$attrib}#enable") == "on") {
                $enable = 1;
            } else {
                $enable = 0;
            }
            ossim_valid(POST("{$attrib}#rrd_attrib"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#rrd_attrib"));
            ossim_valid(POST("{$attrib}#threshold"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#threshold"));
            ossim_valid(POST("{$attrib}#priority"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#priority"));
            ossim_valid(POST("{$attrib}#alpha"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#alpha"));
            ossim_valid(POST("{$attrib}#beta"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#beta"));
            ossim_valid(POST("{$attrib}#persistence"), OSS_ALPHA, OSS_SPACE, OSS_PUNC, OSS_NULLABLE, 'illegal:' . _("{$attrib}#persistence"));
            if (ossim_error()) {
                die(ossim_error());
            }
            RRD_Config::insert($conn, $profile, POST("{$attrib}#rrd_attrib"), POST("{$attrib}#threshold"), POST("{$attrib}#priority"), POST("{$attrib}#alpha"), POST("{$attrib}#beta"), POST("{$attrib}#persistence"), $enable);
        }
    }
}
$db->close($conn);
?>
    <p> <?php 
echo gettext("RRD Config succesfully inserted");
?>
 </p>
<?php 
$location = "rrd_conf.php";
sleep(2);
echo "<script>\n///history.go(-1);\nwindow.location='{$location}';\n</script>\n";
?>
			<th><?php 
echo gettext("Beta");
?>
</th>
			<th><?php 
echo gettext("Persistence");
?>
</th>
			<th><?php 
echo gettext("Enable");
?>
</th>
		</tr>

		<?php 
if ($rrd_global_list = RRD_Config::get_list($conn, "WHERE profile = 'Default'")) {
    foreach ($rrd_global_list as $global) {
        $attrib = $global->get_rrd_attrib();
        $threshold = $global->get_threshold();
        $priority = $global->get_priority();
        $alpha = $global->get_alpha();
        $beta = $global->get_beta();
        $persistence = $global->get_persistence();
        ?>
		<tr>
			<th><?php 
        echo $attrib;
        ?>
</th>
			<input type="hidden" name="<?php 
        echo $attrib;