// end if } // end if break; case "search": // $page if index.php is called without parameters (the first time DaDaBIK is launched) if (!isset($page)) { $page = 0; $_SESSION['page_' . $table_name] = $page; } // end if // build the select query if (isset($execute_search) && $execute_search === '1') { // it's a search result, the user has just filled the search form, so we have to build the select query //if (!isset($where_clause)){ // it's a search result, the user has just filled the search form, so we have to build the select query $where_clause = build_where_clause($fields_labels_ar, $table_name); $page = 0; $_SESSION['page_' . $table_name] = $page; } elseif (!isset($where_clause)) { // when I call index for the first time $where_clause = ''; } // end else // save the where_clause without the user part to pass $where_clause_to_pass = $where_clause; $_SESSION['where_clause_' . $table_name] = $where_clause; if ($enable_authentication === 1 && $enable_browse_authorization === 1) { // $ID_user_field_name = '$current_user' where clause part in order to select only the records the current user owns $ID_user_field_name = get_ID_user_field_name($fields_labels_ar); if ($ID_user_field_name !== false) { // no ID_user fields available, don't use authorization
case "search": if ($details == "1") { echo "<br><h3>" . $normal_messages_ar["details_of_record"] . "</h3>"; } if (!isset($page)) { $page = 0; if ($details != "1") { $_SESSION['page_archive__' . $table_name] = $page; } } // end if // build the select query if (isset($execute_search) && $execute_search === '1') { // it's a search result, the user has just filled the search form, so we have to build the select query //if (!isset($where_clause)){ // it's a search result, the user has just filled the search form, so we have to build the select query $where_clause = build_where_clause($fields_labels_ar, "archive__" . $table_name); $page = 0; $_SESSION['page_archive__' . $table_name] = $page; } elseif (!isset($where_clause)) { // when I call index for the first time $where_clause = ''; } // end else // save the where_clause without the user part to pass $where_clause_to_pass = $where_clause; if ($details != "1") { $_SESSION['where_clause_archive__' . $table_name] = $where_clause; } $sql = "SELECT COUNT(*) FROM archive__{$table_name}"; if ($where_clause != "") { $sql .= " WHERE {$where_clause}";