Esempio n. 1
0
        if ($statement === false) {
            return $query . "\n\n" . get_odbc_error();
        }
        $items = array();
        $items[] = (int) $rownum;
        $result = odbc_execute($statement, $items);
        if ($result === false) {
            return $query . "\n\n" . get_odbc_error();
        }
        return $statement;
    }
    $result = get_report($client, totally_escape($_POST["target"]), $_POST["show"], $_POST["rownum"]);
    if (is_string($result)) {
        echo "<div class=\"error_message\">" . $result . "</div>";
    } else {
        make_results_table($result, false, null);
    }
} else {
    //show form
    ?>

<div id="form_message" style="display: none;"></div>

<form action="" method="post" class="report_form" id="report_form">
	<p>Compose report of <input type='number' name='rownum' value='50' min='1'/> rows from table
	<select id="report_target" name="target" onchange="show_fields();">
		<option value="">&lt;select table&gt;</option>
	<?php 
    $query = "SELECT table_name FROM user_tables;";
    $result = odbc_exec($client->get_connection(), $query);
    if ($result === false) {
Esempio n. 2
0
}
// This search functionality is for OPERATORS only
if (!$user->isAllowed(CS_ACTION::ADMINISTER_MEMBERS, CS_CONTEXT_TYPE::MEMBER, null)) {
    exit;
}
$sa_url = get_first_service_of_type(SR_SERVICE_TYPE::SLICE_AUTHORITY);
$ma_url = get_first_service_of_type(SR_SERVICE_TYPE::MEMBER_AUTHORITY);
// Handle the request, determine if a search can be performed and which to be performed
if (array_key_exists('term', $_REQUEST)) {
    $term = $_REQUEST['term'];
    if (array_key_exists('search_type', $_REQUEST)) {
        $search_type = $_REQUEST['search_type'];
    } else {
        $search_type = "urn";
    }
    make_results_table(search_for_slices($term, $search_type, $user, $ma_url, $sa_url), $user, $ma_url, $sa_url);
} else {
    print "Couldn't complete empty search.";
}
function is_valid_urn($urn)
{
    $pattern = '/urn:publicid:IDN\\+([^\\+]+)\\+([^\\+]+)\\+([^\\+]+)$/';
    $match_count = preg_match($pattern, $urn, $matches);
    return $match_count == 1;
}
// Returns an array of slice detail objects from the SA for slices which match
// the $term for the $search_type
function search_for_slices($term, $search_type, $signer, $ma_url, $sa_url)
{
    if ($search_type == "urn") {
        if (is_valid_urn($term)) {
Esempio n. 3
0
File: view.php Progetto: Tkachov/POD
></a>
	<a class="button edit" href=<?php 
echo "\"?tables&action=edit&target=" . $target . "\"";
?>
></a>
	<a class="button add" href=<?php 
echo "\"?tables&action=add_entry&target=" . $target . "\"";
?>
><div class="plus-sign"></div></a>
</div>

<div id="save_message" style="display: none;"></div>
<?php 
$query = "select ROWID, a.* from " . $target . " a where rownum<50;";
$result = odbc_exec($client->get_connection(), $query);
make_results_table($result, false, $target);
?>

<script>
	var button_active = true;
	function delete_entry(rowid) {
		if(!button_active) return;
		button_active = false;
		message('save_message', "gray_message", "Deleting...");

		AJAX_POST(
			"ajax/delete_entry.php",
			{"target": <?php 
echo "\"" . $target . "\"";
?>
, "rowid": rowid},