Datenbank	CREATE DATABASE `$db_name` DEFAULT CHARACTER SET $db_caracter_set COLLATE $db_collation;
ACCESSKEYS	CREATE TABLE `$db_name`.`accesskeys` (   `bttn_name` varchar(150) NOT NULL,   `access_key` varchar(1) NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
ADRESSEN	CREATE TABLE `$db_name`.`adressen` (   `adr_id` int(15) UNSIGNED NOT NULL,   `anrede` varchar(20) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `vorname` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `nachname` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `plz` varchar(15) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `ort` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `strasse` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `web1` varchar(100) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `mail1` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `web2` varchar(100) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `mail2` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `geburtstag` varchar(15) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `telefon1` varchar(20) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `handy1` varchar(20) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `abteilung` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `beruf` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `branche` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `fax` varchar(20) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `filter_id` varchar(15) CHARACTER SET utf8 COLLATE $db_collation NOT NULL DEFAULT '1',   `urgend_id` varchar(15) CHARACTER SET utf8 COLLATE $db_collation NOT NULL DEFAULT '1',   `user_sperre` varchar(1) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `user_id` int(15) NOT NULL,   `infos` text CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `hupsi` enum('2','3','4','5') DEFAULT NULL,   `hopsi` set('1','2','3','4') NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
AD_INST	CREATE TABLE `$db_name`.`ad_inst` (   `id` int(10) UNSIGNED NOT NULL,   `timestamp` varchar(15) NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
AUTO_BACKUP	CREATE TABLE `$db_name`.`auto_backup` (   `id` int(15) UNSIGNED NOT NULL,   `time1` int(10) UNSIGNED NOT NULL,   `time2` int(10) UNSIGNED NOT NULL,   `todo` smallint(5) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set  COLLATE=$db_collation;
BAIKAL_CALDAV	CREATE TABLE `$db_name`.`baikal_caldav` (   `id` int(15) UNSIGNED NOT NULL,   `uidics` text COLLATE $db_collation NOT NULL,   `uid` text COLLATE $db_collation NOT NULL,   `start` varchar(15) COLLATE $db_collation NOT NULL,   `ende` varchar(15) COLLATE $db_collation NOT NULL,   `user_id` int(15) UNSIGNED NOT NULL,   `user_mail` varchar(100) COLLATE $db_collation NOT NULL,   `text` text COLLATE $db_collation NOT NULL,   `param_1` int(15) UNSIGNED NOT NULL,   `param_2` mediumblob NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
BERICHTE	CREATE TABLE `$db_name`.`berichte` (   `id` int(15) UNSIGNED NOT NULL,   `bericht_name` varchar(100) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `bericht_sql` mediumtext CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set  COLLATE=$db_collation;
BER_PARAM	CREATE TABLE `$db_name`.`ber_param` (   `param_id` int(15) NOT NULL,   `ber_name` varchar(20) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `ber_anzeigename` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
ADRESSEN	CREATE TABLE `$db_name`.`ber_param_adressen` (   `adr_id` int(15) NOT NULL,   `ber_param` int(15) NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
BEWERTUNG	CREATE TABLE `$db_name`.`bewertung` (   `auto_id` int(15) UNSIGNED NOT NULL,   `id` int(15) UNSIGNED NOT NULL,   `bewertung` smallint(6) NOT NULL,   `datum` int(10) UNSIGNED NOT NULL,   `user_id` int(15) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set  COLLATE=$db_collation;
CONFIG	CREATE TABLE `$db_name`.`config` (   `id` int(10) UNSIGNED NOT NULL,   `parameter` varchar(100) NOT NULL,   `einstellung` varchar(250) NOT NULL,   `kennung` smallint(1) UNSIGNED NOT NULL,   `gruppe` smallint(2) UNSIGNED NOT NULL,   `info` varchar(254) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `info_en` varchar(254) CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
CONFIG	CREATE TABLE `$db_name`.`config_groups` (   `id` int(15) UNSIGNED NOT NULL,   `group_name` varchar(100) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `group_id` smallint(2) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
CONN_ADR	CREATE TABLE `$db_name`.`conn_adr` (   `adrid_a` int(15) UNSIGNED NOT NULL,   `adrid_b` int(15) UNSIGNED NOT NULL,   `datum` int(10) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
EVENTS	CREATE TABLE `$db_name`.`events` (   `jahr` smallint(4) NOT NULL,   `monat` smallint(2) NOT NULL,   `tag` smallint(2) NOT NULL,   `stunde` smallint(2) NOT NULL,   `minute` smallint(2) NOT NULL,   `ymdhm` varchar(17) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `id` int(15) UNSIGNED NOT NULL,   `text` text CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `user_id` int(15) NOT NULL,   `zusatz` varchar(3) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `adr_id` int(15) NOT NULL,   `geburtstag` varchar(15) NOT NULL,   `wiederholen` smallint(1) NOT NULL,   `ymdhm_ende` varchar(17) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `head_long` varchar(100) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `head_short` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
FILTER	CREATE TABLE `$db_name`.`filter` (   `filter_id` int(15) NOT NULL,   `name` varchar(20) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `anzeigename` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
FIL_PROTOKOLL	CREATE TABLE `$db_name`.`fil_protokoll` (   `timestamp` varchar(11) NOT NULL,   `sq_l` text CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
MAILARCHIV	CREATE TABLE `$db_name`.`mailarchiv` (   `aid` int(15) UNSIGNED NOT NULL,   `an` varchar(100) COLLATE $db_collation NOT NULL,   `von` varchar(100) COLLATE $db_collation NOT NULL,   `betreff` varchar(100) COLLATE $db_collation NOT NULL,   `anhang` varchar(100) COLLATE $db_collation NOT NULL,   `text` mediumtext COLLATE $db_collation NOT NULL,   `time` int(15) NOT NULL,   `sonst` varchar(100) COLLATE $db_collation NOT NULL,   `user_id` int(15) NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
ONLINE	CREATE TABLE `$db_name`.`online` (   `id` int(10) UNSIGNED NOT NULL,   `timestamp` int(10) UNSIGNED NOT NULL,   `user_id` int(15) UNSIGNED NOT NULL,   `def1` int(11) NOT NULL,   `def2` varchar(30) NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set  COLLATE=$db_collation;
PHOTO	CREATE TABLE `$db_name`.`photo` (   `adr_id` int(15) UNSIGNED NOT NULL,   `path` varchar(100) CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set  COLLATE=$db_collation;
PROTO_KOLL	CREATE TABLE `$db_name`.`proto_koll` (   `timestamp` varchar(11) NOT NULL,   `sq_l` text CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set  COLLATE=$db_collation;
RECHTE	CREATE TABLE `$db_name`.`rechte` (   `user_id` int(15) UNSIGNED NOT NULL,   `r1` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r2` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r3` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r4` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r5` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r6` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r7` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r8` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r9` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r10` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r11` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r12` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r13` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r14` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r15` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r16` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r17` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r18` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r19` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r20` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r21` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r22` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r23` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r24` int(1) UNSIGNED NOT NULL DEFAULT '1',   `r25` int(1) UNSIGNED NOT NULL DEFAULT '1' ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
SERBRIEF	CREATE TABLE `$db_name`.`serbrief` (   `serid` int(15) UNSIGNED NOT NULL,   `serbez` varchar(150) CHARACTER SET utf8 NOT NULL,   `sertext` text CHARACTER SET utf8 NOT NULL,   `user_id` int(15) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
SERBRIEF	CREATE TABLE `$db_name`.`serbrief_sql` (   `id` int(15) UNSIGNED NOT NULL,   `sersql_name` varchar(100) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `sersql_sql` mediumtext CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
STATISTIK	CREATE TABLE `$db_name`.`statistik` (   `timestamp` varchar(15) NOT NULL,   `adr_id` int(15) NOT NULL,   `user_id` int(15) NOT NULL,   `edit` varchar(2) NOT NULL,   `kill` varchar(2) NOT NULL,   `new` varchar(2) NOT NULL,   `info` text CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
TERMINE	CREATE TABLE `$db_name`.`termine` (   `jahr` smallint(4) NOT NULL,   `monat` smallint(2) NOT NULL,   `tag` smallint(2) NOT NULL,   `stunde` smallint(2) NOT NULL,   `minute` smallint(2) NOT NULL,   `ymdhm` varchar(17) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `id` int(15) UNSIGNED NOT NULL,   `text` text CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `user_id` int(15) NOT NULL,   `zusatz` varchar(3) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `adr_id` int(15) NOT NULL,   `geburtstag` varchar(15) NOT NULL,   `wiederholen` smallint(1) NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
TMANAGE	CREATE TABLE `$db_name`.`tmanage` (   `id` int(15) UNSIGNED NOT NULL,   `jahr` smallint(4) NOT NULL,   `monat` smallint(2) NOT NULL,   `tag` smallint(2) NOT NULL,   `timestamp` varchar(17) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `user_id` int(15) NOT NULL,   `text` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
TRIGGER	CREATE TABLE `$db_name`.`trigger` (   `triggerid` int(10) UNSIGNED NOT NULL,   `timestamp` varchar(11) CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
USER	CREATE TABLE `$db_name`.`user` (   `user_id` int(15) UNSIGNED NOT NULL,   `anmeldename` varchar(20) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `vorname` varchar(25) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `nachname` varchar(25) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `passwort` varchar(255) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `is_admin` int(2) NOT NULL,   `zusatz` text CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `einstellung` varchar(70) DEFAULT NULL,   `l_login` varchar(12) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `e_mail` varchar(100) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `language` varchar(2) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `readonly` int(1) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_artikel` (   `wawi_artnr` int(7) UNSIGNED NOT NULL,   `wawi_bez` varchar(100) NOT NULL,   `wawi_preis` decimal(15,2) NOT NULL,   `wawi_einheit` varchar(50) NOT NULL,   `wawi_zusatz` varchar(255) NOT NULL,   `wawi_ust` smallint(2) UNSIGNED NOT NULL,   `wawi_gewicht` decimal(5,2) UNSIGNED NOT NULL,   `wawi_ean` bigint(13) UNSIGNED NOT NULL,   `wawi_minbe` int(5) UNSIGNED NOT NULL,   `adr_id` int(15) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_auftrag` (   `wawi_auftnr` int(20) UNSIGNED NOT NULL,   `wawi_adresse` int(15) UNSIGNED NOT NULL,   `wawi_sum` decimal(15,2) NOT NULL,   `wawi_time` int(15) NOT NULL,   `wawi_is_re` smallint(1) UNSIGNED NOT NULL,   `wawi_minusau` int(20) UNSIGNED NOT NULL,   `wawi_is_li` smallint(1) UNSIGNED NOT NULL,   `readr_id` int(15) UNSIGNED NOT NULL,   `lieadr_id` int(15) UNSIGNED NOT NULL,   `auadr_id` int(15) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_auft_pos` (   `wawi_auftnr` int(20) UNSIGNED NOT NULL,   `wawi_artnr` int(7) UNSIGNED NOT NULL,   `wawi_menge` int(10) NOT NULL,   `wawi_preis` decimal(15,2) NOT NULL,   `wawi_aufbez` varchar(100) NOT NULL,   `wawi_time` int(15) UNSIGNED NOT NULL,   `wawi_skonto` decimal(15,2) NOT NULL,   `wawi_ustcode` smallint(2) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_base` (   `wawi_id` int(15) UNSIGNED NOT NULL,   `wawi_basefa` smallint(3) NOT NULL,   `wawi_baseust` smallint(2) NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_bestellung` (   `wawi_best_date` int(15) UNSIGNED NOT NULL,   `wawi_artnr` int(7) UNSIGNED NOT NULL,   `wawi_bez` varchar(100) COLLATE $db_collation NOT NULL,   `wawi_minbe` int(5) UNSIGNED NOT NULL,   `wawi_beme` int(5) UNSIGNED NOT NULL,   `adr_id` int(15) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_firma` (   `wawi_fa` smallint(3) UNSIGNED NOT NULL,   `wawi_fa_adr` text NOT NULL,   `wawi_fa_ust` smallint(2) UNSIGNED NOT NULL,   `wawi_fa_zusatz` text NOT NULL,   `wawi_uid` varchar(100) NOT NULL,   `wawi_fa_kto` varchar(50) NOT NULL,   `wawi_fa_blz` int(10) UNSIGNED NOT NULL,   `wawi_fa_iban` varchar(50) NOT NULL,   `wawi_fa_bic` varchar(50) NOT NULL,   `wawi_fa_sitz` varchar(100) NOT NULL,   `wawi_geschbed` text NOT NULL,   `wawi_fa_break` smallint(5) UNSIGNED NOT NULL,   `wawi_ziel` smallint(10) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_lager` (   `wawi_artnr` int(7) UNSIGNED NOT NULL,   `wawi_auft` int(20) UNSIGNED NOT NULL,   `wawi_renr` int(20) UNSIGNED NOT NULL,   `wawi_inout` int(7) NOT NULL,   `wawi_time` int(15) UNSIGNED NOT NULL,   `wawi_zuab` smallint(1) UNSIGNED NOT NULL,   `wawi_liefauf` int(15) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_lief` (   `wawi_linr` int(20) UNSIGNED NOT NULL,   `wawi_auftnr` int(20) UNSIGNED NOT NULL,   `wawi_litime` int(15) UNSIGNED NOT NULL,   `wawi_li_isexp` smallint(1) NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_plusadr` (   `lfd_id` int(15) UNSIGNED NOT NULL,   `adr_id` int(15) UNSIGNED NOT NULL,   `adr_txt` text CHARACTER SET utf8 NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_rechn` (   `wawi_renr` int(20) UNSIGNED NOT NULL,   `wawi_auftnr` int(20) UNSIGNED NOT NULL,   `wawi_retime` int(15) UNSIGNED NOT NULL,   `wawi_re_isexp` smallint(1) NOT NULL,   `wawi_reintime` int(15) UNSIGNED NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WAWI_	CREATE TABLE `$db_name`.`wawi_re_num` (   `wawi_renr` int(20) UNSIGNED NOT NULL,   `wawi_lastinid` int(20) UNSIGNED NOT NULL,   `wawi_retime` int(15) UNSIGNED NOT NULL,   `wawi_renr_id` varchar(30) COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
WICHTIGKEIT	CREATE TABLE `$db_name`.`wichtigkeit` (   `urgend_id` int(15) UNSIGNED NOT NULL,   `bez` varchar(25) CHARACTER SET utf8 COLLATE $db_collation NOT NULL,   `zusatz` varchar(50) CHARACTER SET utf8 COLLATE $db_collation NOT NULL ) ENGINE=$db_engine DEFAULT CHARSET=$db_caracter_set COLLATE=$db_collation;
ALTER ACCESSKEYS	ALTER TABLE `$db_name`.`accesskeys`   ADD UNIQUE KEY `bttn_name` (`bttn_name`);
ALTER ADRESSEN	ALTER TABLE `$db_name`.`adressen`   ADD PRIMARY KEY (`adr_id`),   ADD KEY `nachname` (`nachname`),   ADD KEY `vorname` (`vorname`),   ADD KEY `ort` (`ort`),   ADD KEY `strasse` (`strasse`);
ALTER AD_INST	ALTER TABLE `$db_name`.`ad_inst`   ADD PRIMARY KEY (`id`);
ALTER AUTO_BACKUP	ALTER TABLE `$db_name`.`auto_backup`   ADD PRIMARY KEY (`id`);
ALTER BAIKAL_CALDAV	ALTER TABLE `$db_name`.`baikal_caldav`   ADD PRIMARY KEY (`id`);
ALTER BERICHTE	ALTER TABLE `$db_name`.`berichte`   ADD PRIMARY KEY (`id`);
ALTER BER_PARAM	ALTER TABLE `$db_name`.`ber_param`   ADD PRIMARY KEY (`param_id`);
ALTER ADRESSEN	ALTER TABLE `$db_name`.`ber_param_adressen`   ADD PRIMARY KEY (`adr_id`,`ber_param`);
ALTER BEWERTUNG	ALTER TABLE `$db_name`.`bewertung`   ADD PRIMARY KEY (`auto_id`);
ALTER CONFIG	ALTER TABLE `$db_name`.`config`   ADD PRIMARY KEY (`id`);
ALTER CONFIG	ALTER TABLE `$db_name`.`config_groups`   ADD PRIMARY KEY (`id`);
ALTER CONN_ADR	ALTER TABLE `$db_name`.`conn_adr`   ADD PRIMARY KEY (`adrid_a`,`adrid_b`);
ALTER EVENTS	ALTER TABLE `$db_name`.`events`   ADD PRIMARY KEY (`id`);
ALTER FILTER	ALTER TABLE `$db_name`.`filter`   ADD PRIMARY KEY (`filter_id`);
ALTER MAILARCHIV	ALTER TABLE `$db_name`.`mailarchiv`   ADD PRIMARY KEY (`aid`);
ALTER ONLINE	ALTER TABLE `$db_name`.`online`   ADD PRIMARY KEY (`id`);
ALTER PHOTO	ALTER TABLE `$db_name`.`photo`   ADD PRIMARY KEY (`adr_id`);
ALTER RECHTE	ALTER TABLE `$db_name`.`rechte`   ADD PRIMARY KEY (`user_id`);
ALTER SERBRIEF	ALTER TABLE `$db_name`.`serbrief`   ADD PRIMARY KEY (`serid`);
ALTER SERBRIEF	ALTER TABLE `$db_name`.`serbrief_sql`   ADD PRIMARY KEY (`id`);
ALTER TERMINE	ALTER TABLE `$db_name`.`termine`   ADD PRIMARY KEY (`id`);
ALTER TMANAGE	ALTER TABLE `$db_name`.`tmanage`   ADD PRIMARY KEY (`id`);
ALTER TRIGGER	ALTER TABLE `$db_name`.`trigger`   ADD PRIMARY KEY (`triggerid`);
ALTER USER	ALTER TABLE `$db_name`.`user`   ADD PRIMARY KEY (`user_id`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_artikel`   ADD PRIMARY KEY (`wawi_artnr`),   ADD KEY `wawi_bez` (`wawi_bez`),   ADD KEY `wawi_ean` (`wawi_ean`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_auftrag`   ADD PRIMARY KEY (`wawi_auftnr`,`wawi_adresse`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_auft_pos`   ADD PRIMARY KEY (`wawi_auftnr`,`wawi_artnr`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_base`   ADD PRIMARY KEY (`wawi_id`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_bestellung`   ADD PRIMARY KEY (`wawi_best_date`,`wawi_artnr`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_lager`   ADD PRIMARY KEY (`wawi_artnr`,`wawi_auft`,`wawi_liefauf`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_lief`   ADD PRIMARY KEY (`wawi_linr`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_plusadr`   ADD PRIMARY KEY (`lfd_id`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_rechn`   ADD PRIMARY KEY (`wawi_renr`);
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_re_num`   ADD UNIQUE KEY `wawi_renr` (`wawi_renr`);
ALTER WICHTIGKEIT	ALTER TABLE `$db_name`.`wichtigkeit`   ADD PRIMARY KEY (`urgend_id`);
ALTER ADRESSEN	ALTER TABLE `$db_name`.`adressen`   MODIFY `adr_id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
ALTER AD_INST	ALTER TABLE `$db_name`.`ad_inst`   MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER AUTO_BACKUP	ALTER TABLE `$db_name`.`auto_backup`   MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
ALTER BAIKAL_CALDAV	ALTER TABLE `$db_name`.`baikal_caldav`   MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT;
ALTER BERICHTE	ALTER TABLE `$db_name`.`berichte`   MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
ALTER BER_PARAM	ALTER TABLE `$db_name`.`ber_param`   MODIFY `param_id` int(15) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
ALTER BEWERTUNG	ALTER TABLE `$db_name`.`bewertung`   MODIFY `auto_id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
ALTER CONFIG	ALTER TABLE `$db_name`.`config`   MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=167;
ALTER CONFIG	ALTER TABLE `$db_name`.`config_groups`   MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
ALTER EVENTS	ALTER TABLE `$db_name`.`events`   MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;
ALTER FILTER	ALTER TABLE `$db_name`.`filter`   MODIFY `filter_id` int(15) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
ALTER MAILARCHIV	ALTER TABLE `$db_name`.`mailarchiv`   MODIFY `aid` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=82;
ALTER ONLINE	ALTER TABLE `$db_name`.`online`   MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
ALTER SERBRIEF	ALTER TABLE `$db_name`.`serbrief`   MODIFY `serid` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
ALTER SERBRIEF	ALTER TABLE `$db_name`.`serbrief_sql`   MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
ALTER TERMINE	ALTER TABLE `$db_name`.`termine`   MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
ALTER TMANAGE	ALTER TABLE `$db_name`.`tmanage`   MODIFY `id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=441;
ALTER TRIGGER	ALTER TABLE `$db_name`.`trigger`   MODIFY `triggerid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
ALTER USER	ALTER TABLE `$db_name`.`user`   MODIFY `user_id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_auftrag`   MODIFY `wawi_auftnr` int(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=121;
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_base`   MODIFY `wawi_id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_lief`   MODIFY `wawi_linr` int(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=47;
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_plusadr`   MODIFY `lfd_id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
ALTER WAWI_	ALTER TABLE `$db_name`.`wawi_rechn`   MODIFY `wawi_renr` int(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=96;
ALTER WICHTIGKEIT	ALTER TABLE `$db_name`.`wichtigkeit`   MODIFY `urgend_id` int(15) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
***
Standarduser-Daten	INSERT INTO `$db_name`.`user` (`user_id`, `anmeldename`, `vorname`, `nachname`, `passwort`, `is_admin`, `zusatz`, `einstellung`, `l_login`,`e_mail`, `language`, `readonly`) VALUES (1, 'Keine_Anmeldung', 'Keine', '--', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabababababaxxx8976q', 0, '', NULL, '', '', 'de', 0), (2, 'admin', 'Administrator', 'Erstzugang', '$first_conn_passwd', 1, 'Erstzugang', '20,2,3,4,5,6,7,8,9*6,8', '', '', 'de', 0);
Admin Rechte	INSERT INTO `$db_name`.`rechte` (`user_id` ,`r1` ,`r2` ,`r3` ,`r4` ,`r5` ,`r6` ,`r7` ,`r8` ,`r9` ,`r10` ,`r11` ,`r12` ,`r13` ,`r14`) VALUES ('2', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1', '1');
Standardfilter-Daten	INSERT INTO `$db_name`.`filter` (`filter_id`, `name`, `anzeigename`) VALUES (1, 'alle', 'Alle');
Status-Daten	INSERT INTO `$db_name`.`wichtigkeit` (`urgend_id`, `bez`, `zusatz`) VALUES (1, 'normal', 'Normal'), (2, 'wichtig', 'Wichtig'), (3, 'sehr_wichtig', 'Sehr Wichtig');
Config-Groupdaten	INSERT INTO `$db_name`.`config_groups` (`id`, `group_name`, `group_id`) VALUES (1, 'Allgemein', '1'), (2, 'Ansicht', '2'), (3, 'Script-Tools', '3'), (4, 'Formate', '4'), (5, 'Dimensionen', '5'), (6, 'Standards', '6'), (7, 'Konverter', '7'), (8, 'Uploads', '8'), (9, 'Mail', '9'), (10, 'Editor', '10'),(11, 'Zeichen_und_Symbole', '11'), (12, 'Sicherheit', '12'),(13, 'Pfade', '13'),(14, 'Style_und_Farbangaben', '14'),(15, 'Adminfenster', '15');
Demo Datensatz	INSERT INTO `$db_name`.`adressen` (`adr_id` ,`anrede` ,`vorname` ,`nachname` ,`plz` ,`ort` ,`strasse` ,`web1` ,`mail1` ,`web2` ,`mail2` ,`geburtstag` ,`telefon1` ,`handy1` ,`abteilung` ,`beruf` ,`branche` ,`fax` ,`filter_id` ,`urgend_id` ,`user_sperre` ,`user_id` ,`infos`, `hupsi`, `hopsi`) VALUES (NULL , 'Anrede', 'Vorname', 'Nachname', 'PLZ', 'Ort', 'Strasse', '', '', '', '', '', '', '', '', '', '', '', '1', '1', '', 0, '', 2, 1);
Demo Parameter	INSERT INTO `$db_name`.`ber_param` (`param_id` ,`ber_name` ,`ber_anzeigename`) VALUES (NULL , 'parameter_1', 'Parameter 1');
Demo Parameter-Zuweisung	INSERT INTO `$db_name`.`ber_param_adressen` (`adr_id` ,`ber_param`) VALUES ('1', '1');
Demo-Bericht	INSERT INTO `$db_name`.`berichte` (`id` ,`bericht_name`, `bericht_sql`) VALUES (NULL , 'Adressen mit Parameter 1', 'SELECT `adressen`.`adr_id`, \r\n`adressen`.`anrede`, \r\n`adressen`.`vorname`, \r\n`adressen`.`nachname`, \r\n`adressen`.`plz`, \r\n`adressen`.`ort`, \r\n`adressen`.`strasse`, \r\n`ber_param_adressen`.`ber_param` \r\nFROM `ber_param_adressen` AS `ber_param_adressen`, `adressen` AS `adressen` \r\nWHERE `ber_param_adressen`.`adr_id` = `adressen`.`adr_id`\r\nAND `ber_param` = 1')
Statistik-Korrektur fuer Demodatensatz	INSERT INTO `$db_name`.`statistik` (`timestamp` ,`adr_id` ,`user_id` ,`edit` ,`kill` ,`new` ,`info`) VALUES ('$time', '1', '2', '', '', '1', '2,Anrede,Vorname,Nachname,PLZ,Ort,Strasse,,,,,,,,,,,,1,1,0,2');
Demotext Serienbnrief	INSERT INTO `$db_name`.`serbrief` VALUES (1,'Demotext','<p>{ADRESSON}<br />{anrede} {vorname} {nachname}<br />{plz} {ort}<br />{strasse}<br />{DIVOFF}</p><p>{DATEON}Wien am: <em><strong>{DATE}</strong></em>{DIVOFF}</p><p><br />{TEXTON}<br />Sehr geehrte(r) {anrede} {nachname}<br /><br />Dies ist ein Probetext, zum Serienbrief!!.<br />Dies ist ein Zeilenumbruch</p><p>Dies ist ein neuer Absatz<br />{DIVOFF}</p>',0);
Wawi Probeartikel	INSERT INTO `$db_name`.`wawi_artikel` (`wawi_artnr`, `wawi_bez`, `wawi_preis`, `wawi_einheit`, `wawi_zusatz`, `wawi_ust`, `wawi_gewicht`, `wawi_ean`, `wawi_minbe`, `adr_id`) VALUES ('845', 'Testartikel', '10.20', 'Stk', 'Zusatzinfo Artikel', '20', '0.00', '0', '0', '0');
Wawi Basedata	INSERT INTO `$db_name`.`wawi_base` (`wawi_id`, `wawi_basefa`, `wawi_baseust`) VALUES ('1', '1', '20');
Wawi Firmendata	INSERT INTO `$db_name`.`wawi_firma` (`wawi_fa`, `wawi_fa_adr`, `wawi_fa_ust`, `wawi_fa_zusatz`, `wawi_uid`, `wawi_fa_kto`, `wawi_fa_blz`, `wawi_fa_iban`, `wawi_fa_bic`, `wawi_fa_sitz`, `wawi_geschbed`, `wawi_fa_break`, `wawi_ziel`) VALUES ('1', 'Ihre Firmenadresse', '20', 'Zusatzinformation am Ende eines Ausdrucks', 'Ihre UID/ATU Nummer', 'Ihre Kto-Nummer', '0000', 'Ihre Firmen-IBAN', 'Ihre Firmen-BIC', 'Ihr Firmensitz', 'Es gelten unsere AGB', '35', '30');
Wawi Bericht1	INSERT INTO `$db_name`.`berichte` (`id`,`bericht_name`,`bericht_sql`) VALUES (NULL, 'Offene Auftrg&auml;ge', 'SELECT \r\n`wawi_auftrag`.`wawi_auftnr` AS `AuftNr`, \r\n`wawi_auftrag`.`wawi_minusau` AS `StornoAuftNr`,\r\n`wawi_auftrag`.`wawi_sum` AS `Summe`, \r\n`adressen`.`anrede` AS `Anrede`, \r\n`adressen`.`vorname` AS `Vorname`, \r\n`adressen`.`nachname` AS `Nachname`, \r\n`adressen`.`plz` AS `Plz`, \r\n`adressen`.`ort` AS `Ort`,\r\n `adressen`.`strasse` AS `Strasse`\r\nFROM `wawi_auftrag` AS `wawi_auftrag` \r\nLEFT OUTER JOIN `adressen` AS `adressen` \r\nON `wawi_auftrag`.`wawi_adresse` = `adressen`.`adr_id` \r\nWHERE `wawi_auftrag`.`wawi_is_re` = 0\r\nAND `wawi_auftrag`.`wawi_is_re` = 0');
Wawi Bericht2	INSERT INTO `$db_name`.`berichte` (`id`,`bericht_name`,`bericht_sql`) VALUES (NULL, 'Stornierte Auftr&auml;ge', 'SELECT \r\n`wawi_auftrag`.`wawi_auftnr` AS `AuftNr`, \r\n`wawi_auftrag`.`wawi_minusau` AS `StornoAuftNr`, \r\n`adressen`.`anrede` AS `Anrede`, \r\n`adressen`.`vorname` AS `Vorname`, \r\n`adressen`.`nachname` AS `Nachname`, \r\n`adressen`.`plz` AS `Plz`, \r\n`adressen`.`ort` AS `Ort`, \r\n`adressen`.`strasse` AS `Strasse`\r\nFROM `wawi_auftrag` AS `wawi_auftrag` \r\nLEFT OUTER JOIN `adressen` AS `adressen` \r\nON `wawi_auftrag`.`wawi_adresse` = `adressen`.`adr_id`\r\nWHERE `wawi_auftrag`.`wawi_is_re` = 2');
Wawi Bericht3	INSERT INTO `$db_name`.`berichte` (`id`,`bericht_name`,`bericht_sql`) VALUES (NULL, 'Offene Rechnungen', 'SELECT \r\n`a`.`wawi_renr` , \r\n`a`.`wawi_retime` , \r\n`a`.`wawi_reintime` , \r\n`p`.`wawi_auftnr` , \r\n`p`.`wawi_sum` , \r\n`p`.`wawi_adresse` , \r\n`adressen`.`anrede`, \r\n`adressen`.`vorname`, \r\n`adressen`.`nachname`, \r\n`adressen`.`plz`, \r\n`adressen`.`ort`, \r\n`adressen`.`strasse`\r\nFROM `adressen` AS `adressen`\r\nLEFT OUTER JOIN `wawi_auftrag` AS `p`\r\nLEFT OUTER JOIN `wawi_rechn` AS `a` \r\nON `p`.`wawi_auftnr` = `a`.`wawi_auftnr` \r\nON `adressen`.`adr_id` = `p`.`wawi_adresse`\r\nWHERE `a`.`wawi_reintime` = 0 AND `p`.`wawi_is_re` = 1');
Wawi Bericht4	INSERT INTO `$db_name`.`berichte` (`id`,`bericht_name`,`bericht_sql`) VALUES (NULL, 'Adressen Anlagedatum', 'SELECT * FROM `statistik` WHERE `new` = 1 OR `new` = 3');
