<?php
#############################################################################
#                              Site@School
# Site@School is a website management system designed for schools.
#
# demodata_DA.php 
#$Id: demodata_DA.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@sesamestreet.org', 'Brugte tøjdyr til salg, se vores hjemmeside.', '2003-12-01', 'Sesamestreet')");
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', 'testproject','' ,'1')");
mysql_query("INSERT INTO $modtable_guestbook (id, name, email, homepage, date, message) VALUES( '1', 'James Bond','', 'http://www.jamesbond.com', '2003-12-01 22:40:49', 'Hello,
Great site you have here,

Kind regards , 007.')");
mysql_query("INSERT INTO $modtable_news_categories (id, title) VALUES( '1', 'Generelle nyheder')");
mysql_query("INSERT INTO $modtable_news_articles (id, title, date, category, content, archive) VALUES( '1', 'Hjemmesiden aktiveret', '1-04-2006', '1', 'Vi kan med glæde meddele at din hjemmeside er aktiveret med Site@School version 2.4', '0')");
mysql_query("INSERT INTO $table_studentpages (studentid, content, newcontent, pcheck, approved, send_email, title, dir_number) 
VALUES( '1', 'Her er min første side','', '0', '0', '0', 'Min første side', '1')");
mysql_query("INSERT INTO $table_studentpages (studentid, content, newcontent, pcheck, approved, send_email, title, dir_number) 
VALUES( 2, 'This is the teacher page.\r\n', '', 2, 0, 0, 'Min første side', 2)");
mysql_query("INSERT INTO $table_studentpages (studentid, content, newcontent, pcheck, approved, send_email, title, dir_number) 
VALUES( 3, 'This is the project page.\r\n', '', 0, 0, 0, 'Project page', 3)");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) VALUES( '1', '1', 'Generel info','', '
Her vil være din startside','', '1', '8', '2003-11-27', '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æstebog','','', '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', 'Lærer logind','','', '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', 'Nyheder','','', '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', 'Vis Annoncer','','', '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', 'Elevernes sider','','', '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', 'Elevernes logind','','', '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', 'Søg på hjemmesiden','','', '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', 'Siteoversigt','','', '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', 'Skole info','', '1','', '1')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '2', 'Nyheds sektion','', '4','', '2')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '3', 'Elever','', '7','', '3')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '4', 'Lærere','', '3','', '4')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '5', 'Forældre','', '2','', '5')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '6', 'Søg','', '9','', '5')");
mysql_query("INSERT INTO $table_users (username, name, password, email, class, type, access, highvisibility, project) 
VALUES('elev', 'Første Elev', md5('elev'),'', '2', '1', '000000000000,000000000000', '2','3')");
mysql_query("INSERT INTO $table_users (username, name, password, email, class, type, access, highvisibility, project) 
VALUES('lærer', 'Fru. Lærer', md5('lærer'), ' ','3', '2', '000000000000,000000000000', '2','3')");
mysql_query("INSERT INTO $table_users (username, name, password, email, class, type, access, highvisibility, project) 
VALUES('testproject', 'testproject', md5('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', 'Startside','', 'Dette er startsiden for intranettet.
','', '1', '0', '2003-12-02', '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, 'Første Sektion', '', '1', '', 1)");
mysql_query("INSERT INTO $table_pages VALUES (NULL, '1', 'Første side', '', 'Her kommer din startside' , '', '1', '0', '$d', '0000-00-00', ' ', '$d')");

}
?>