Location: PHPKode > projects > QuickTicket > quickticket/quickticket/install/qti_setup_section.inc
<?php

// QuickTicket 1.9.0.3 build:20081001

switch(substr($oDB->type,0,5))
{

case 'mysql':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id int,
  type char(1) NOT NULL default "0",
  status char(1) NOT NULL default "0",
  notify char(1) NOT NULL default "1",
  domainid int NOT NULL default 0,
  title varchar(64) NOT NULL default "untitled",
  titleorder int NOT NULL default 255,
  moderator int NOT NULL default 0,
  moderatorname varchar(24) NOT NULL default "Administrator",
  topics int NOT NULL default 0,
  replies int NOT NULL default 0,
  titlefield char(1) NOT NULL default "0",
  numfield varchar(24) NOT NULL default " ",
  infofield varchar(24),
  wisheddate char(1) NOT NULL default "0",
  alternate char(1) NOT NULL default "0",
  prefix char(1),
  PRIMARY KEY (id)
  )';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id int NOT NULL CONSTRAINT pk_'.$qti_prefix.'qtiforum PRIMARY KEY,
  type char(1) NOT NULL default "0",
  status char(1) NOT NULL default "0",
  notify char(1) NOT NULL default "1",
  domainid int NOT NULL default 0,
  title varchar(64) NOT NULL default "untitled",
  titleorder int NOT NULL default 0,
  moderator int NOT NULL default 0,
  moderatorname varchar(24) NOT NULL default "Administrator",
  topics int NOT NULL default 0,
  replies int NOT NULL default 0,
  titlefield char(1) NOT NULL default "0",
  numfield varchar(24) NOT NULL default " ",
  infofield varchar(24) NULL,
  wisheddate char(1) NOT NULL default "0",
  alternate char(1) NOT NULL default "0",
  prefix char(1) NULL,
  )';
  break;

case 'pg':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id integer,
  type char(1) NOT NULL default "0",
  status char(1) NOT NULL default "0",
  notify char(1) NOT NULL default "1",
  domainid integer NOT NULL default 0,
  title varchar(64) NOT NULL default "untitled",
  titleorder integer NOT NULL default 255,
  moderator integer NOT NULL default 0,
  moderatorname varchar(24) NOT NULL default "Administrator",
  topics integer NOT NULL default 0,
  replies integer NOT NULL default 0,
  titlefield char(1) NOT NULL default "0",
  numfield varchar(24) NOT NULL default " ",
  infofield varchar(24) NULL,
  wisheddate char(1) NOT NULL default "0",
  alternate char(1) NOT NULL default "0",
  prefix char(1) NULL,
  PRIMARY KEY (id)
  )';
  break;

case 'sqlit':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id integer,
  type text NOT NULL default "0",
  status text NOT NULL default "0",
  notify text NOT NULL default "1",
  domainid integer NOT NULL default 0,
  title text NOT NULL default "untitled",
  titleorder integer NOT NULL default 255,
  moderator integer NOT NULL default 0,
  moderatorname text NOT NULL default "Administrator",
  topics integer NOT NULL default 0,
  replies integer NOT NULL default 0,
  titlefield text NOT NULL default "0",
  numfield text NOT NULL default " ",
  infofield text,
  wisheddate text NOT NULL default "0",
  alternate text NOT NULL default "0",
  prefix text,
  PRIMARY KEY (id)
  )';
  break;

case 'ibase':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id integer,
  type char(1) default "0",
  status char(1) default "0",
  notify char(1) default "1",
  domainid integer default 0,
  title varchar(64) default "untitled",
  titleorder integer default 255,
  moderator integer default 0,
  moderatorname varchar(24) default "Administrator",
  topics integer default 0,
  replies integer default 0,
  titlefield char(1) default "0",
  numfield varchar(24) default " ",
  infofield varchar(24),
  wisheddate char(1) default "0",
  alternate char(1) default "0",
  prefix char(1),
  PRIMARY KEY (id)
  )';
  break;

case 'acces':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id int CONSTRAINT pk_'.$qti_prefix.'qtiforum PRIMARY KEY,
  type char(1),
  status char(1),
  notify char(1),
  domainid int,
  title varchar(64),
  titleorder int,
  moderator int,
  moderatorname varchar(24),
  topics int,
  replies int,
  titlefield char(1),
  numfield varchar(24),
  infofield varchar(24),
  wisheddate char(1),
  alternate char(1),
  prefix char(1)
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id integer NOT NULL,
  type char(1) NOT NULL default "0",
  status char(1) NOT NULL default "0",
  notify char(1) NOT NULL default "1",
  domainid integer NOT NULL default 0,
  title varchar(64) NOT NULL default "untitled",
  titleorder integer NOT NULL default 255,
  moderator integer NOT NULL default 0,
  moderatorname varchar(24) NOT NULL default "Administrator",
  topics integer NOT NULL default 0,
  replies integer NOT NULL default 0,
  numfield varchar(24) NOT NULL default " ",
  titlefield char(1) NOT NULL default "0",
  infofield varchar(24),
  wisheddate char(1) NOT NULL default "0",
  alternate char(1) NOT NULL default "0",
  prefix char(1),
  PRIMARY KEY (id)
  )';
  break;

case 'ifx':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id integer,
  type char(1) default "0" NOT NULL,
  status char(1) default "0" NOT NULL,
  notify char(1) default "1" NOT NULL,
  domainid integer default 0 NOT NULL,
  title varchar(64) default "untitled" NOT NULL,
  titleorder integer default 255 NOT NULL,
  moderator integer default 0 NOT NULL,
  moderatorname varchar(24) default "Administrator" NOT NULL,
  topics integer default 0 NOT NULL,
  replies integer default 0 NOT NULL,
  numfield varchar(24) NOT NULL default " ",
  titlefield char(1) default "0" NOT NULL,
  infofield varchar(24),
  wisheddate char(1) default "0" NOT NULL,
  alternate char(1) default "0" NOT NULL,
  prefix char(1),
  PRIMARY KEY (id)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qti_prefix.'qtiforum (
  id number(32),
  type char(1) default "0" NOT NULL,
  status char(1) default "0" NOT NULL,
  notify char(1) default "1" NOT NULL,
  domainid number(32) default 0 NOT NULL,
  title varchar2(64) default "untitled" NOT NULL,
  titleorder number(32) default 255 NOT NULL,
  moderator number(32) default 0 NOT NULL,
  moderatorname varchar2(24) default "Administrator" NOT NULL,
  topics number(32) default 0 NOT NULL,
  replies number(32) default 0 NOT NULL,
  numfield varchar2(24) default " " NOT NULL,
  titlefield char(1) default "0" NOT NULL,
  infofield varchar2(24),
  wisheddate char(1) default "0" NOT NULL,
  alternate char(1) default "0" NOT NULL,
  prefix char(1),
  CONSTRAINT pk_'.$qti_prefix.'qtiforum PRIMARY KEY (id))';
  break;

default:
  die("Database type [{$oDB->type}] not supported... Must be mysql, mssql, pg, sqlite, firebird, db2, ifx or access");

}

echo '<div style="margin-left:20px; color:blue;">';
$b=$oDB->Query($strQ);
echo '</div>';

if ( !empty($oDB->error) || !$b )
{
  echo '<div class="div_setup_err">',sprintf ($L['E_install'],$qti_prefix.'qtiforum',$qti_database,$qti_user),'</div>';
  echo '<br/><table cellspacing="0" class="ta_button"><tr><td></td><td class="td_button" style="width:120px">&nbsp;<a href="qti_setup_1.php">',$L['Restart'],'</a>&nbsp;</td></tr></table>';
  exit;
}

$strQ='INSERT INTO '.$qti_prefix.'qtiforum (
id,type,status,notify,domainid,title,titleorder,moderator,moderatorname,topics,replies,titlefield,numfield,infofield,wisheddate,alternate,prefix)
VALUES (0,"1","0","0",0,"Admin section",0,0,"Admin",0,0,"0","T-%03s","no","0","0","a")';

$oDB->Query($strQ);

?>
Return current item: QuickTicket