db = new DB(); $this->db->connect(); $result = $this->db->query($query); $i = 0; while ($entry = $this->db->fetch_object($result)) { $list[$i]->code1 = $entry->code1; $list[$i]->text1 = $entry->text1; $list[$i]->code2 = $entry->code2; $list[$i]->text2 = $entry->text2; $list[$i]->code = $entry->code; $list[$i]->text = $entry->text; $i++; } return($list); } function get_html_header() { $header = ""; $header .= "Code 1"; $header .= "Text 1"; $header .= "Code 2"; $header .= "Text 2"; $header .= "Code"; $header .= "Text"; $header .= ""; return($header); } /** * Gibt den ATC-Code als HTML-Zeile aus */ function get_html_row($atc) { global $aml; $row = 0; $text_length = 25; $dots_text1 = (strlen($atc->text1) > $text_length) ? "..." : ""; $dots_text2 = (strlen($atc->text2) > $text_length) ? "..." : ""; $dots_text = (strlen($atc->text) > $text_length) ? "..." : ""; $atc->text1 = htmlentities($atc->text1); // Umlaute anpassen $atc->text2 = htmlentities($atc->text2); $atc->text = htmlentities($atc->text); $row = ""; $row .= "".$atc->code1."
"; $row .= "".substr($atc->text1,0,$text_length).$dots_text1."
"; $row .= "".$atc->code2."
"; $row .= "".substr($atc->text2,0,$text_length).$dots_text2."
"; $row .= "".$atc->code."
"; $row .= "".substr($atc->text,0,$text_length).$dots_text."
"; $row .= ""; return ($row); } function get_navigation($search = '') { global $aml_public; $aml_public->count_selection(); $from = ($aml_public->rows > 0) ? ($aml_public->page * $aml_public->pagelength + 1) : 0; $to = ($from + $aml_public->pagelength <= $aml_public->rows) ? $from + $aml_public->pagelength : $aml_public->rows; $navi = ""; $navi .= ""; $navi .= ""; $navi .= ""; $navi .= $from." bis ".$to." von ".$aml_public->rows." Codes"; $navi .= ""; $navi .= ""; $navi .= ""; $navi .= ""; $navi .= ""; $navi .= ""; return( $navi ); } /** * */ function get_code1_list() { global $db; $i = 0; $id = $db->query("SELECT DISTINCT code1 FROM atc_code ORDER BY code1"); while( $code = $db->fetch_object($id) ) { $liste[$i++] = $code->code1; } return($liste); } function get_code1_text($code1) // z.B. A { global $db; global $pdf_doku; $id = $db->query("SELECT DISTINCT text1 FROM atc_code WHERE code1 = '".$code1."'"); $code = $db->fetch_object($id); $text = $pdf_doku->umlaute($code->text1); return($text); } function get_code2_list($code1) // code1 ist z.B. "A" { global $db; $i = 0; $id = $db->query("SELECT DISTINCT atc_code.code2 FROM atc_code, aml WHERE code1 = '".$code1."' AND (atc_code.code = aml.atc_code) ORDER BY code2"); while( $code = $db->fetch_object($id) ) { $liste[$i++] = $code->code2; } return($liste); } function get_code2_text($code2) { global $db; global $pdf_doku; $id = $db->query("SELECT DISTINCT text2 FROM atc_code WHERE code2 = '".$code2."'"); $code = $db->fetch_object($id); $text = $pdf_doku->umlaute($code->text2); return($text); } function get_code_list($code2) // code2 ist z.B. "A01" { global $db; $i = 0; //$id = $db->query("SELECT DISTINCT code FROM atc_code WHERE code2 = '".$code2."' ORDER BY code"); $query = "SELECT DISTINCT atc_code.code FROM atc_code, aml WHERE (atc_code.code = aml.atc_code) AND (atc_code.code2 = '".$code2."') ORDER BY code"; $id = $db->query($query); while( $code = $db->fetch_object($id) ) { $liste[$i++] = $code->code; } return($liste); } function get_code_text($code) { global $db; global $pdf_doku; $id = $db->query("SELECT DISTINCT text FROM atc_code WHERE code = '".$code."'"); $code = $db->fetch_object($id); $text = $pdf_doku->umlaute($code->text); return($text); } } ?>