Example #1
0
include_once '../core.header.php';
if ($key) {
    $user_id = get_entry('access_keys', 'account_id', 'key_id', $key, $db);
} else {
    $user_id = $_SESSION['user']['account_id'];
}
$statement_id = $_REQUEST['statement_id'];
$statement_info = URIinfo('S' . $statement_id, $user_id, $key, $db);
if (!$statement_info['delete']) {
    echo "User cannot delete this statement";
    exit;
} else {
    $project_info = get_info('project', $statement_info['project_id'], $db);
    $instance_info = get_info('instance', $statement_info['resource_id'], $db);
    $statements[0] = $statement_info;
    $statements = include_rule_info($statements, $project_id, $db);
    $statements = include_button_notes($statements, $project_id, $db);
    $statements = Values2Links($statements);
    $statement_info = $statements[0];
    #echo '<pre>';print_r($statement_info);
    if ($_POST['delete_statement'] != '') {
        $s3ql = compact('db', 'user_id');
        $s3ql['delete'] = 'statement';
        $s3ql['where']['statement_id'] = $statement_id;
        $s3ql['flag'] = 'all';
        #$s3ql['format']='html';
        #$s3ql['where']['project_id'] = $project_id;
        #$s3ql['where']['confirm'] = 'yes';
        $done = S3QLaction($s3ql);
        $done = html2cell($done);
        #echo '<pre>';print_r($done);
Example #2
0
        }
    } else {
        echo "User does not have access to this project";
        exit;
    }
}
if ($ruleAcl == '1' || $ruleAcl == '2' || $ruleAcl == '3' || $ruleOnProject || $classAcl == '1' || $classAcl == '2' || $classAcl == '3') {
    $s3ql = compact('db', 'user_id');
    if ($rule_info != '' && $class_id == '') {
        $s3ql['select'] = '*';
        $s3ql['from'] = 'statements';
        $s3ql['where']['rule_id'] = $rule_info['rule_id'];
        $s3ql['where']['project_id'] = $project_id;
        $data = S3QLaction($s3ql);
        if (is_array($data)) {
            $data = include_rule_info($data, $project_id, $db);
            $data = Values2Links($data);
            $data = array_unique(array_map('grab_value', $data));
        }
        #echo '<pre>';print_r($data);
        $formName = 'queryresource';
    } else {
        $s3ql['select'] = 'resource_id,notes';
        $s3ql['from'] = 'instances';
        $s3ql['where']['class_id'] = $class_info['resource_id'];
        $formName = 'queryresource';
        $data = S3QLaction($s3ql);
    }
    $out = sprintf("%s\n", "<html>");
    $out .= sprintf("%s\n", "<head>");
    $out .= sprintf("%s\n", "<title>Existing values</title>");