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

// QuickTicket 1.9.0.3 build:20081001

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

case 'mysql':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id char(1),
  name varchar(24),
  icon varchar(24),
  mailto varchar(255),
  color varchar(24),
  PRIMARY KEY (id)
  )';
  break;

case 'mssql':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id char(1) NOT NULL CONSTRAINT pk_'.$qti_prefix.'qtistatus PRIMARY KEY,
  name varchar(24) NULL,
  icon varchar(24) NULL,
  mailto varchar(255) NULL,
  color varchar(24) NULL
  )';
  break;

case 'pg':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id char(1),
  name varchar(24),
  icon varchar(24),
  mailto varchar(255),
  color varchar(24),
  PRIMARY KEY (id)
  )';
  break;

case 'ibase':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id char(1),
  name varchar(24),
  icon varchar(24),
  mailto varchar(255),
  color varchar(24),
  PRIMARY KEY (id)
  )';
  break;

case 'sqlit':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id text,
  name text,
  icon text,
  mailto text,
  color text,
  PRIMARY KEY (id)
  )';
  break;

case 'acces':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id char(1) CONSTRAINT pk_'.$qti_prefix.'qtistatus PRIMARY KEY,
  name varchar(24),
  icon varchar(24),
  mailto varchar(255),
  color varchar(24)
  )';
  break;

case 'db2':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id char(1) NOT NULL,
  name varchar(24),
  icon varchar(24),
  mailto varchar(255),
  color varchar(24),
  PRIMARY KEY (id)
  )';
  break;

case 'ifx':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id char(1),
  name varchar(24),
  icon varchar(24),
  mailto varchar(255),
  color varchar(24),
  PRIMARY KEY (id)
  )';
  break;

case 'oci':
  $strQ='CREATE TABLE '.$qti_prefix.'qtistatus (
  id char(1),
  name varchar2(24),
  icon varchar2(24),
  mailto varchar2(255),
  color varchar2(24),
  CONSTRAINT pk_'.$qti_prefix.'qtistatus 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.'qtistatus',$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;
}

// add default values

$oDB->Query('INSERT INTO '.$qti_prefix.'qtistatus (id,name,icon) VALUES ("A","Submitted","ico_status0.gif")');
$oDB->Query('INSERT INTO '.$qti_prefix.'qtistatus (id,name,icon) VALUES ("B","In process","ico_status2.gif")');
$oDB->Query('INSERT INTO '.$qti_prefix.'qtistatus (id,name,icon,color) VALUES ("C","Completed","ico_status4.gif","#AFED9A")');
$oDB->Query('INSERT INTO '.$qti_prefix.'qtistatus (id,name,icon,color) VALUES ("X","Cancelled","ico_status8.gif","#FF8181")');
$oDB->Query('INSERT INTO '.$qti_prefix.'qtistatus (id,name,icon,color) VALUES ("Z","Closed","ico_topic_t_1.gif","#EEEEEE")');

?>
Return current item: QuickTicket