示例#1
0
    $s3ql = compact('user_id', 'db');
    $s3ql['from'] = 'items';
    $s3ql['where']['collection_id'] = $class_id;
    #$s3ql['where']['project_id'] = $project_id;
    #echo '<pre>';print_r($s3ql);
    if ($_REQUEST['orderBy'] != '') {
        $s3ql['order_by'] = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
    }
    #$s3ql['limit']=$limit;
    #$s3ql['offset']=$offset;
    $instances = S3QLaction($s3ql);
} else {
    #find the rules in the class, these will be usefull for the query
    $S = compact('db', 'project_id', 'rule_id', 'resource_info', 'project_info', 'user_id');
    $orderBy = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
    $instances = search_resource(compact('rules', 'db', 'orderBy'));
    #echo '<pre>';print_r($instances);exit;
    $sqlquery = $instances['sqlquery'];
    if (is_array($instances)) {
        $instances = array_diff_key($instances, array('sqlquery' => ''));
        $instances = array_filter($instances);
    }
}
if (is_array($instances) && !empty($instances)) {
    $_SESSION['queryresult'] = '';
    #interpret user_acl on each instance
    $instances = replace_created_by($instances, $db);
    #now find the list of rules, make rule_id the key and append the rule info into the statement info
    if ($_REQUEST['statements'] != '' || count($instances) <= 50) {
        $instances = include_statements(compact('rules', 'instances', 'user_id', 'db', 'project_id'));
    } else {
示例#2
0
        #$where['value']=$value;
    }
}
$orderBy = $_REQUEST['orderBy'] . ' ' . $_REQUEST['direction'];
$format = $_REQUEST['format'] != '' ? $_REQUEST['format'] : 'html.pretty';
if (!is_array($rule_value_pairs)) {
    #query everything
    $s3ql = compact('user_id', 'db');
    $s3ql['from'] = 'items';
    $s3ql['where']['collection_id'] = $class_id;
    if ($_REQUEST['orderBy'] != '') {
        $s3ql['order_by'] = $orderBy;
    }
    $items = S3QLaction($s3ql);
} else {
    $data = search_resource(compact('rules', 'db', 'orderBy', 'rule_value_pairs'));
    $letter = 'I';
    $include_all = 0;
    $data = fillSlotACL(compact('letter', 'user_id', 'db', 'data', 'include_all'));
    $instances = $data;
    $cols = array('resource_id', 'notes');
    $D = compact('data', 'format', 'select', 'returnFields', 'letter', 'cols', 'db');
    echo array2str($D);
    #
    #$omit_button_notes=1;
    #echo '<pre>';print_r($rules);
    #$data = include_statements(compact('rules', 'instances', 'user_id', 'db', 'project_id', 'omit_button_notes'));
    #echo '<pre>';print_r($data);exit;
    #$D = compact('data','format', 'select','returnFields', 'letter','cols', 'db')
    #echo array2str($D);
}