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

// QuickTicket 1.9.0.3 build:20081001

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

case 'mysql':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id int,
  forum int NOT NULL default 0,
  topic int NOT NULL default 0,
  icon char(2) NOT NULL default "00",
  title varchar(64),
  type char(1) NOT NULL default "R",
  userid int NOT NULL default 0,
  username varchar(24),
  issuedate varchar(20) NOT NULL default "0",
  modifdate varchar(20) NOT NULL default "0",
  modifuser int,
  modifname varchar(24),
  attach varchar(255),
  textmsg text,
  PRIMARY KEY (id)
  )';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id int NOT NULL CONSTRAINT pk_'.$qti_prefix.'qtipost PRIMARY KEY,
  forum int NOT NULL default 0,
  topic int NOT NULL default 0,
  icon char(2) NOT NULL default "00",
  title varchar(64) NULL,
  type char(1) NOT NULL default "R",
  userid int NOT NULL default 0,
  username varchar(24) NULL,
  issuedate varchar(20) NOT NULL default "0",
  modifdate varchar(20) NOT NULL default "0",
  modifuser int NULL,
  modifname varchar(24) NULL,
  attach varchar(255) NULL,
  textmsg text
  )';
  break;

case 'pg':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id integer,
  forum integer NOT NULL default 0,
  topic integer NOT NULL default 0,
  icon char(2) NOT NULL default "00",
  title varchar(64) NULL,
  type char(1) NOT NULL default "R",
  userid integer NOT NULL default 0,
  username varchar(24) NULL,
  issuedate varchar(20) NOT NULL default "0",
  modifdate varchar(20) NOT NULL default "0",
  modifuser integer NULL,
  modifname varchar(24) NULL,
  attach varchar(255) NULL,
  textmsg text,
  PRIMARY KEY (id)
  )';
  break;

case 'sqlit':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id integer,
  forum integer NOT NULL default 0,
  topic integer NOT NULL default 0,
  icon text NOT NULL default "00",
  title text,
  type text NOT NULL default "R",
  userid integer NOT NULL default 0,
  username text,
  issuedate text NOT NULL default "0",
  modifdate text NOT NULL default "0",
  modifuser integer,
  modifname text,
  attach text,
  textmsg text,
  PRIMARY KEY (id)
  )';
  break;

case 'ibase':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id integer,
  forum integer default 0,
  topic integer default 0,
  icon char(2) default "00",
  title varchar(64),
  type char(1) default "R",
  userid integer default 0,
  username varchar(24),
  issuedate varchar(20) default "0",
  modifdate varchar(20) default "0",
  modifuser integer,
  modifname varchar(24),
  attach varchar(255),
  textmsg varchar(32700),
  PRIMARY KEY (id)
  )';
  break;

case 'acces':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id int CONSTRAINT pk_'.$qti_prefix.'qtipost PRIMARY KEY,
  forum int,
  topic int,
  icon char(2),
  title varchar(64),
  type char(1),
  userid int,
  username varchar(24),
  issuedate varchar(20),
  modifdate varchar(20),
  modifuser int,
  modifname varchar(24),
  attach varchar(255),
  textmsg text
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id integer NOT NULL,
  forum integer NOT NULL default 0,
  topic integer NOT NULL default 0,
  icon char(2) NOT NULL default "00",
  title varchar(64),
  type char(1) NOT NULL default "R",
  userid integer NOT NULL default 0,
  username varchar(24),
  issuedate varchar(20) NOT NULL default "0",
  modifdate varchar(20) NOT NULL default "0",
  modifuser integer,
  modifname varchar(24),
  attach varchar(255),
  textmsg long varchar,
  textmsg2 varchar(255),
  PRIMARY KEY (id)
  )';
  break;

case 'ifx':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id integer,
  forum integer NOT NULL default 0,
  topic integer NOT NULL default 0,
  icon char(2) NOT NULL default "00",
  title varchar(64),
  type char(1) NOT NULL default "R",
  userid integer NOT NULL default 0,
  username varchar(24),
  issuedate varchar(20) NOT NULL default "0",
  modifdate varchar(20) NOT NULL default "0",
  modifuser integer,
  modifname varchar(24),
  attach varchar(255),
  textmsg text,
  textmsg2 varchar(255),
  PRIMARY KEY (id)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qti_prefix.'qtipost (
  id number(32),
  forum number(32) default 0 NOT NULL,
  topic number(32) default 0 NOT NULL,
  icon char(2) default "00" NOT NULL,
  title varchar2(64),
  type char(1) default "R" NOT NULL,
  userid number(32) default 0 NOT NULL,
  username varchar2(24),
  issuedate varchar2(15) default "0" NOT NULL,
  modifdate varchar2(15) default "0" NOT NULL,
  modifuser number(32),
  modifname varchar2(24),
  attach varchar2(255),
  textmsg varchar2(4000),
  CONSTRAINT pk_'.$qti_prefix.'qtipost PRIMARY KEY (id))';
  break;

default:
  die("Database type [{$oDB->type}] not supported... Must be mysql, mssql, pg, oracle, 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.'qtipost',$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;
}

?>
Return current item: QuickTicket