Moodle lib/db ADODB XML Schema"; include_once('tohtml.inc.php'); include_once('adodb.inc.php'); include_once('adodb-xmlschema.inc.php'); $database = "oci8po"; $db = ADONewConnection("$database"); $db->debug = true; $server = "false"; $user = "scott"; $password = "tiger"; $db->Connect(false, $user, $password); $rs = $db->Execute('select * from dept'); print "
"; 
print_r($rs->GetRows()); 
print "
"; rs2html($rs,'border=2 cellpadding=3',array('Deptno','DName','Loc')); $dict = NewDataDictionary($db); echo "

schemaConfig.xml

"; $rs = $db->Execute('drop table config'); $rs = $db->Execute('drop sequence SEQ_config'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaConfig.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into config values (2,'2','2')"; $rs = $db->Execute($sql); $sql = "insert into config values (3,'3','3')"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from config'); rs2html($rs,'border=2 cellpadding=3',array('id','name','value')); echo "

schemaCourse.xml

"; $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaCourse.xml"); $rs = $db->Execute('drop table course'); $rs = $db->Execute('drop sequence SEQ_course'); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into course values (2,2,2,'2','2','2','2','2',2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into course values (3,3,3,'3','3','3','3','3',3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from course'); rs2html($rs,'border=2 cellpadding=3',array('id','category','sortorder','password','fullname','shortname','summary','format','showgrades','modinfo','newsitems','teacher','teachers','student','students','guest','startdate','numsections','showrecent','marker','maxbytes','showreports','visible','timecreated','timemodified')); echo "

schemaCourse_categories.xml

"; $rs = $db->Execute('drop table course_categories'); $rs = $db->Execute('drop sequence SEQ_course_categories'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaCourse_categories.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into Course_categories values (2,'2','2',2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into Course_categories values (3,'3','3',3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from Course_categories'); rs2html($rs,'border=2 cellpadding=3',array('id','name','description','parent','sortorder','coursecount','visible','timemodified')); echo "

schemaCourse_display.xml

"; $rs = $db->Execute('drop table course_display'); $rs = $db->Execute('drop sequence SEQ_course_display'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaCourse_display.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into Course_display values (2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into Course_display values (3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from Course_display'); rs2html($rs,'border=2 cellpadding=3',array('id','course','userid','display')); echo "

schemaCourse_modules.xml

"; $rs = $db->Execute('drop table course_modules'); $rs = $db->Execute('drop sequence SEQ_course_modules'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaCourse_modules.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into Course_modules values (2,2,2,2,2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into Course_modules values (3,3,3,3,3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from Course_modules'); rs2html($rs,'border=2 cellpadding=3',array('id','course','module','instance','section','added','deleted','score','indent','visible','groupmode')); echo "

schemaCourse_sections.xml

"; $rs = $db->Execute('drop table course_sections'); $rs = $db->Execute('drop sequence SEQ_course_sections'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaCourse_sections.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into Course_sections values (2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into Course_sections values (3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from Course_sections'); rs2html($rs,'border=2 cellpadding=3',array('id','course','section','summary','sequence','visible')); echo "

schemaEvent.xml

"; $rs = $db->Execute('drop table event'); $rs = $db->Execute('drop sequence SEQ_event'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaevent.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into event values (2,2,2,2,2,2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into event values (3,3,3,3,3,3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from event'); rs2html($rs,'border=2 cellpadding=3',array('id','name','description','courseid','groupid','userid','modulename','instance','eventtype','timestart','timeduration','timemodified')); echo "

schemaGroups.xml

"; $rs = $db->Execute('drop table Groups'); $rs = $db->Execute('drop sequence SEQ_Groups'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaGroups.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into Groups values (2,2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into Groups values (3,3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from Groups'); rs2html($rs,'border=2 cellpadding=3',array('id','courseid','name','description','lang','picture','timecreated','timemodified')); echo "

schemaGroups_members.xml

"; $rs = $db->Execute('drop table Groups_members'); $rs = $db->Execute('drop sequence SEQ_Groups_members'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaGroups_members.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into Groups_members values (2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into Groups_members values (3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from Groups_members'); rs2html($rs,'border=2 cellpadding=3',array('id','courseid','name','description','lang','picture','timecreated','timemodified')); echo "

schemaLog.xml

"; $rs = $db->Execute('drop table log'); $rs = $db->Execute('drop sequence SEQ_log'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaLog.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into log values (2,2,2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into log values (3,3,3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from log'); rs2html($rs,'border=2 cellpadding=3',array('id','time','userid','ip','course','module','action','url','info')); echo "

schemaLog_display.xml

"; $rs = $db->Execute('drop table log_display'); $rs = $db->Execute('drop sequence SEQ_log_display'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemalog_display.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into log_display values (2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into log_display values (3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from log_display'); rs2html($rs,'border=2 cellpadding=3',array('id','time','userid','ip','course','module','action','url','info')); echo "

schemaModules.xml

"; $rs = $db->Execute('drop table modules'); $rs = $db->Execute('drop sequence SEQ_modules'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemamodules.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into modules values (2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into modules values (3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from modules'); rs2html($rs,'border=2 cellpadding=3',array('id','name','version','cron','lastcron','search','visible')); echo "

schemaScale.xml

"; $rs = $db->Execute('drop table scale'); $rs = $db->Execute('drop sequence SEQ_scale'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaScale.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into scale values (2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into scale values (3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from scale'); rs2html($rs,'border=2 cellpadding=3',array('id','courseid','userid','name','scale','description','timemodified')); echo "

schemaUser.xml

"; $rs = $db->Execute('drop table m_user'); $rs = $db->Execute('drop sequence SEQ_m_user'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaUser.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into m_user values (2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into m_user values (3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from m_user'); rs2html($rs,'border=2 cellpadding=3',array('id','confirmed','deleted','m_username','password','idnumber','firstname','lastname','email','icq','phone1','phone2','institution','department','address','city','country','lang','timezone','firstaccess','lastaccess','lastlogin','currentlogin','lastIP','secret','picture','url','description','mailformat','maildisplay','htmleditor','autosubscribe','timemodified')); echo "

schemaUser_admins.xml

"; $rs = $db->Execute('drop table user_admins'); $rs = $db->Execute('drop sequence SEQ_user_admins'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaUser_admins.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into user_admins values (2,2)"; $rs = $db->Execute($sql); $sql = "insert into user_admins values (3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from user_admins'); rs2html($rs,'border=2 cellpadding=3',array('id','userid')); echo "

schemaUser_students.xml

"; $rs = $db->Execute('drop table user_students'); $rs = $db->Execute('drop sequence SEQ_user_students'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaUser_students.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into user_students values (2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into user_students values (3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from user_students'); rs2html($rs,'border=2 cellpadding=3',array('id','userid','course','timestart','timeend','time','timeaccess')); echo "

schemaUser_teachers.xml

"; $rs = $db->Execute('drop table user_teachers'); $rs = $db->Execute('drop sequence SEQ_user_teachers'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaUser_teachers.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into user_teachers values (2,2,2,2,2,2,2,2)"; $rs = $db->Execute($sql); $sql = "insert into user_teachers values (3,3,3,3,3,3,3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from user_teachers'); rs2html($rs,'border=2 cellpadding=3',array('id','userid','course','authority','role','editall','timemodified','timeaccess')); echo "

schemaUser_coursecreators.xml

"; $rs = $db->Execute('drop table user_coursecreators'); $rs = $db->Execute('drop sequence SEQ_user_coursecreators'); $schema = new adoSchema($db); $sql = $schema->ParseSchema("schemaUser_coursecreators.xml"); $result = $schema->ExecuteSchema( $sql ); $sql = "insert into user_coursecreators values (2,2)"; $rs = $db->Execute($sql); $sql = "insert into user_coursecreators values (3,3)"; $rs = $db->Execute($sql); $rs = $db->Execute('select * from user_coursecreators'); rs2html($rs,'border=2 cellpadding=3',array('id','userid')); ?>