public function post_update_redirect($url_to_go = "../../", $do_redirect = TRUE) { if (!empty($this->update_perfomed)) { /** * Merge the ROW KEYS with all the possible keys on the POST array */ $merged_key_array = array_merge($this->db_table_data_keys[1], \k1lib\sql\get_keys_array_from_row_data($this->post_incoming_array, $this->db_table->get_db_table_config())); $row_key_text = \k1lib\sql\table_keys_to_text($merged_key_array, $this->db_table->get_db_table_config()); if (!empty($url_to_go)) { $this->set_auth_code($row_key_text); $this->set_auth_code_personal($row_key_text); $url_to_go = str_replace("--rowkeys--", $row_key_text, $url_to_go); $url_to_go = str_replace("--authcode--", $this->get_auth_code(), $url_to_go); } if ($do_redirect) { \k1lib\html\html_header_go($url_to_go); exit; return TRUE; } else { return $url_to_go; } } else { return ""; } }
public function get_data_keys() { if ($this->generate_sql_query('keys')) { $query_result = \k1lib\sql\sql_query($this->db, $this->query_sql_keys, TRUE, TRUE); $just_keys_result = []; foreach ($query_result as $row => $data) { if ($row === 0) { continue; } $just_keys_result[$row] = \k1lib\sql\get_keys_array_from_row_data($query_result[$row], $this->db_table_config); } if (!empty($just_keys_result)) { return $just_keys_result; } else { return FALSE; } } else { return FALSE; } }
public function get_inserted_keys() { if ($this->inserted && $this->inserted_result !== FALSE) { $last_inserted_id = []; if (is_numeric($this->inserted_result)) { foreach ($this->db_table->get_db_table_config() as $field => $config) { if ($config['extra'] == 'auto_increment') { $last_inserted_id[$field] = $this->inserted_result; } } } $new_keys_array = \k1lib\sql\get_keys_array_from_row_data(array_merge($last_inserted_id, $this->post_incoming_array, $this->db_table->get_constant_fields()), $this->db_table->get_db_table_config()); return $new_keys_array; } else { return FALSE; } }