<?php
#############################################################################
#                              Site@School
# Site@School is a website management system designed for schools.
#
# demodata_EN.php 
#$Id: demodata_EN.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";
$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', 'Used puppets for sale, see our website.', '2004-12-01', 'Sesamestreet')");
mysql_query("INSERT INTO $table_classes (id, name, teachers, project) VALUES( '2', 'testclass','' ,'0')");
mysql_query("INSERT INTO $table_classes (id, name, teachers, project) VALUES( '3', 'testproject','' ,'1')");
mysql_query("INSERT INTO $modtable_news_categories (id, title) VALUES( '1', 'General news')");
mysql_query("INSERT INTO $modtable_news_articles (id, title, date, category, content, archive) VALUES( '1', 'Site operational', '1-04-2006', '1', 'We are happy to inform you that our site is operational with Site@School version 2.4', '0')");
mysql_query("INSERT INTO $table_studentpages (studentid, content, newcontent, pcheck, approved, send_email, title, dir_number) 
VALUES( '1', 'Here is my first page','', '0', '0', '0', 'My first page', '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, 'First page', 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', 'General info','', '
Here will be your start page','', '1', '8', '2004-12-27', '2004-12-02','', '2004-12-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) 
VALUES( '3', '4', 'Teacher login','','', 'sn_studentpages/user_login.php', '1', '2', '2004-12-28', '2004-12-02','', '2004-12-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) 
VALUES( '4', '2', 'News','','', 'sn_news/frontpage.php', '1', '5', '2004-12-28', '2004-12-02','', '2004-12-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) 
VALUES( '5', '5', 'View Ads','','', 'sn_ads/view_ads.php', '2', '4', '2004-12-28', '2004-12-02','', '2004-12-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) 
VALUES( '7', '3', 'Pupil\'s pages','','', 'sn_studentpages/viewpage.php', '1', '9', '2004-12-28', '2004-12-02','', '2004-12-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) 
VALUES( '8', '3', 'Pupil\'s login','','', 'sn_studentpages/user_login.php', '2', '4', '2004-12-28', '2004-12-01','', '2004-12-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) 
VALUES( '9', '6', 'Search site','','', 'dgs_search/search.php', '1', '4', '2004-12-28', '2004-12-01','', '2004-12-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', '2004-12-28', '2004-12-01','', '2004-12-28')");
mysql_query("INSERT INTO $table_pages (id, section, name, invisible, content, module, sort, count, createdate, lastvisitdate, category, lastupdate) 
VALUES( 12, '4', 'Teacher pages', '', '', 'sn_studentpages/teacher_page.php', 2, 4, '2005-03-04', '2005-03-04', '', '2005-03-04')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '1', 'School info','', '1','', '1')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '2', 'News section','', '4','', '2')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '3', 'Pupils','', '7','', '3')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '4', 'Teachers','', '3','', '4')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '5', 'Parents','', '5','', '5')");
mysql_query("INSERT INTO $table_sections (id, name, invisible, frontpage, parent, sort) VALUES( '6', 'Search','', '9','', '5')");
mysql_query("INSERT INTO $table_users (username, name, password, email, class, type, access, highvisibility, project) 
VALUES('pupil', 'First Pupil', md5('pupil'),'', '2', '1', '000000000000,000000000000', '2', '3')");
mysql_query("INSERT INTO $table_users (username, name, password, email, class, type, access, highvisibility, project) 
VALUES('teacher', 'Mr. Teacher', md5('teacher'), ' ','2', '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','3')");
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', '2004-12-02', '0000-00-00','', '2004-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','', 'This is the startpage for the intranet.
','', '1', '0', '2004-12-02', '0000-00-00','', '2004-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

$d = date("Y-m-d");
mysql_query("INSERT INTO $table_sections  VALUES (NULL, 'First Section', '', '1', '', 1)");
mysql_query("INSERT INTO $table_pages VALUES (NULL, '1', 'First page', '', 'Here will be your start page' , '', '1', '0', '$d', '0000-00-00', ' ', '$d')");

}
?>
