Ejemplo n.º 1
0
* For some reason when the array index starts with 0 the text box search works well but the asc/desc on the header does not
* So $aColumns array is used for text search and adding a new array $ahColumns for header sort
*/
$aColumns = array();
$col_count = 0;
foreach ($fields_info as $field_name => $info) {
    $aColumns[$col_count++] = $field_name;
}
$ahColumns = array();
$hcol_count = 1;
foreach ($fields_info as $field_name => $info) {
    $ahColumns[$hcol_count++] = $field_name;
}
if (isset($_GET["iDisplayStart"]) && $_GET["iDisplayLength"] != '-1') {
    $do_data_display->set_ds_sql_start($_GET["iDisplayStart"]);
    $do_data_display->set_ds_sql_max($_GET["iDisplayLength"]);
}
$sOrder = "";
if (isset($_GET['iSortCol_0'])) {
    $sOrder = "ORDER BY  ";
    for ($i = 0; $i < intval($_GET['iSortingCols']); $i++) {
        if ($_GET['bSortable_' . intval($_GET['iSortCol_' . $i])] == "true") {
            $sort_order = strtolower($_GET['sSortDir_' . $i]) == 'desc' ? 'desc' : 'asc';
            if ($fields_info[$ahColumns[intval($_GET['iSortCol_' . $i])]]["field_type"] == 131) {
                if ($mid == 6) {
                    $sOrder .= " organization_member_of " . $sort_order . ", ";
                } else {
                    $sOrder .= " organization_name " . $sort_order . ", ";
                }
            } elseif ($fields_info[$ahColumns[intval($_GET['iSortCol_' . $i])]]["field_type"] == 130) {
                if ($mid == 4) {