<?php
#############################################################################
#                              Site@School
# Site@School is a website management system designed for schools.
#
# demodata_DE.php 
#$Id: demodata_DE.php,v 1.2 2006/10/15 19:08:53 fstuurman Exp $
############################################################################
if ($q == 1)
{
$modtable_news_categories = "$dbprefix" . "m_news_cat";
$modtable_news_articles = "$dbprefix" . "m_news_articles";
$modtable_ads = "$dbprefix" . "adtext";
$modtable_guestbook = "$dbprefix" . "m_gbook";
$table_prot_pages = $dbprefix."prot_pages";
$table_prot_sections = $dbprefix."prot_sections";
mysql_query("INSERT INTO $modtable_ads (ad_id, email, ad_text, date, name)
VALUES( '1', 'info@172-grundschule.local', 'Wir suchen dringend ordentliche Computer für unsere Schule!', '2004-11-13', '172. Schule')");
mysql_query("INSERT INTO $table_classes (id, name, teachers, project) VALUES( '2', 'Testklasse','' ,'0')");
mysql_query("INSERT INTO $table_classes (id, name, teachers, project) VALUES( '3', 'Testprojekt','' ,'1')");
mysql_query("INSERT INTO $modtable_guestbook (id, name, email, homepage, date, message) VALUES( '1', 'Heins Mustermann', '', 'http://www.meine-seite.de', '2005-11-13 22:40:49', 'Liebe Mitstreiter, das ist ein Testeintrag. Viel Erfolg bei der Arbeit mit Site@School! H. Mustermann')");
mysql_query("INSERT INTO $modtable_news_categories (id, title) VALUES( '1', 'Schule')");
mysql_query("INSERT INTO $modtable_news_articles (id, title, date, category, content, archive) VALUES( '1', 'Die Installation war erfolgreich', '13-11-2005', '1', 'Es hat geklappt!!!', '0')");
mysql_query("INSERT INTO $table_studentpages (studentid, content, newcontent, pcheck, approved, send_email, title, dir_number)
VALUES( '1', 'Das ist meine erste Seite','', '0', '0', '0', 'Meine erste Seite', '1')");
mysql_query("INSERT INTO $table_studentpages (studentid, content, newcontent, pcheck, approved, send_email, title, dir_number)
VALUES( 2, 'Das ist meine erste Seite.\r\n', '', 2, 0, 0, 'Meine erste Seite', 2)");
mysql_query("INSERT INTO $table_studentpages (studentid, content, newcontent, pcheck, approved, send_email, title, dir_number)
VALUES( 3, 'Das ist die Projekt Seite.\r\n', '', 0, 0, 0, 'Projekt Seite', 3)");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '1', '1', 'Willkommen','', '
Das ist die Startseite','', '1', '8', '2004-11-13', '2003-12-02','', '2003-11-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '2', '5', 'Gästebuch','','', 'sn_gbook/gbook.php', '1', '12', '2003-11-28', '2003-12-02','', '2003-11-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '3', '4', 'Lehrerbereich','','', 'sn_studentpages/user_login.php', '1', '2', '2003-11-28', '2003-12-02','', '2003-11-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '4', '2', 'Aktuelles','','', 'sn_news/frontpage.php', '1', '5', '2003-11-28', '2003-12-02','', '2003-11-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '5', '5', 'Kleinanzeigen','','', 'sn_ads/view_ads.php', '2', '4', '2003-11-28', '2003-12-02','', '2003-11-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '7', '3', 'Schülerseiten','','', 'sn_studentpages/viewpage.php', '1', '9', '2003-11-28', '2003-12-02','', '2003-11-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '8', '3', 'Schülerbereich','','', 'sn_studentpages/user_login.php', '2', '4', '2003-11-28', '2003-12-01','', '2003-11-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '9', '6', 'Suchseite','','', 'dgs_search/search.php', '1', '4', '2003-11-28', '2003-12-01','', '2003-11-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '10', '6', 'Sitemap','','', 'sn_sitemap/view_sitemap.php', '2', '2', '2003-11-28', '2003-12-01','', '2003-11-28')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '1', 'Unsere Schule','', '1','', '1')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '2', 'Aktuelles','', '4','', '2')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '3', 'Schüler','', '7','', '3')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '4', 'Lehrer','', '3','', '4')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '5', 'Eltern','', '2','', '5')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '6', 'Finden','', '9','', '5')");
mysql_query("INSERT INTO $table_users (username, name, password, email, class, type, access, highvisibility, project)
VALUES('schüler', 'Ottokar', md5('schüler'),'', '2', '1', '000000000000,000000000000', '2','3')");
mysql_query("INSERT INTO $table_users (username, name, password, email, class, type, access, highvisibility, project)
VALUES('lehrer', 'Frau Streng', md5('lehrer'), ' ','3', '2', '000000000000,000000000000', '2','3')");
mysql_query("INSERT INTO $table_users (username, name, password, email, class, type, access, highvisibility, project)
VALUES('testproject', md5('testproject'), 'testproject', ' ','3', '0', '000000000000,000000000000', '2','0')");
mysql_query("INSERT INTO $table_prot_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '1', '1', 'Download','','', 'sn_downloads/download_cat.php', '2', '0', '2003-12-02', '0000-00-00','', '2003-12-02')");
mysql_query("INSERT INTO $table_prot_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '2', '1', 'Startpage','', 'Das ist die Startseite für den geschlossenen Bereich.
','', '1', '0', '2004-11-13', '0000-00-00','', '2003-12-02')");
mysql_query("INSERT INTO $table_prot_sections (id, name, invisible, frontpage, parent, sort) VALUES( '1', 'Intranet','', '2','', '1')");
mysql_query("UPDATE $table_configuration SET config_value='editable' where config_key='protected_theme'");
#

}
else
{
// fill sections and pages with some initial data
include("../configuration/database.inc.php");                  // connecting to database
mysql_connect("$db_server", "$db_username", "$db_password");
mysql_select_db("$db_name");
$d = date("Y-m-d");
mysql_query("INSERT INTO $table_sections  VALUES (NULL, 'Erster Abschnitt', '', '1', '', 1)");
mysql_query("INSERT INTO $table_pages VALUES (NULL, '1', 'Erste Seite', '', 'Hier ist die Startseite' , '', '1', '0', '$d', '0000-00-00', ' ', '$d')");

}
?>