<?php
#############################################################################
#                              Site@School
# Site@School is a website management system designed for schools.
#
# demodata_FR.php 
#$Id: demodata_ES.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', 'Used puppets for sale, see our website.', '2003-12-01', 'Sesamestreet')");
mysql_query("INSERT INTO $table_classes (id, name, teachers, project) VALUES( '2', 'testclass','','3')");
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', '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', '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', 'Guestbook','','', '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', 'Teacher login','','', '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', 'News','','', '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', 'View Ads','','', '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', 'Pupil\'s pages','','', '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', 'Pupil\'s login','','', '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', 'Search site','','', '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', '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','', '2','', '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', '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', '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', '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', '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','', 'This is the startpage for the intranet.
','', '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, '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')");

}
?>
