CREATE TABLE IF NOT EXISTS `#__jegroupbuy_payment` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `p_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `method` varchar(100) NOT NULL,
  `transaction_id` varchar(100) NOT NULL,
  `pdate` varchar(30) NOT NULL,
  `status` char(2) NOT NULL,
  `quantity` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_product` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(250) NOT NULL,
  `alias` varchar(255) NOT NULL,
  `catid` int(11) NOT NULL,
  `store_id` int(11) NOT NULL,
  `description` longtext NOT NULL,
  `published` tinyint(3) NOT NULL,
  `featured` tinyint(3) NOT NULL,
  `access` tinyint(3) NOT NULL,
  `language` char(7) NOT NULL,
  `imageurl` varchar(250) NOT NULL,
  `product_price` varchar(100) NOT NULL,
  `product_discount` varchar(100) NOT NULL,
  `coupon_code` varchar(50) NOT NULL,
  `you_save` varchar(100) NOT NULL,
  `deal_price` varchar(100) NOT NULL,
  `deal_to_date` varchar(25) NOT NULL,
  `total_bought` int(11) NOT NULL,
  `ordering` int(11) NOT NULL,
  `expired` char(2) NOT NULL,
  `gmap_width` int(5) NOT NULL,
  `gmap_height` int(5) NOT NULL,
  `gmap_latitude` varchar(255) NOT NULL,
  `gmap_longitude` varchar(255) NOT NULL,
  `gmap_zoom` int(5) NOT NULL,
  `params` text NOT NULL,
  `currencysymbol` varchar(255) NOT NULL,
  `video` varchar(255) NOT NULL,
  `dealtype` tinyint(3) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_settings` (
  `id` int(11) NOT NULL,
  `test_mode` tinyint(3) NOT NULL,
  `businessid` varchar(100) NOT NULL,
  `show_category` char(2) NOT NULL,
  `show_subscription` char(2) NOT NULL,
  `show_share` char(2) NOT NULL,
  `show_googlemap` char(2) NOT NULL,
  `show_comments` char(2) NOT NULL,
  `layout` varchar(25) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;


CREATE TABLE IF NOT EXISTS `#__jegroupbuy_stores` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `shop_name` varchar(250) NOT NULL,
  `store_id` int(11) NOT NULL,
  `owner` varchar(100) NOT NULL,
  `contact_number` varchar(100) NOT NULL,
  `email` varchar(100) NOT NULL,
  `shop_url` varchar(200) NOT NULL,
  `published` tinyint(3) NOT NULL,
  `address` longtext NOT NULL,
  `store_logo` varchar(200) NOT NULL,
  `access` tinyint(3) NOT NULL,
  `language` char(7) NOT NULL,
  `imageurl` varchar(250) NOT NULL,
  `product_price` varchar(100) NOT NULL,
  `product_discount` varchar(100) NOT NULL,
  `coupon_code` varchar(50) NOT NULL,
  `you_save` varchar(100) NOT NULL,
  `deal_price` varchar(100) NOT NULL,
  `deal_to_date` varchar(25) NOT NULL,
  `total_bought` int(11) NOT NULL,
  `ordering` int(11) NOT NULL,
  `params` text NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_template` (
  `id` int(11) NOT NULL,
  `template` longtext NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_comments` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pid` int(11) NOT NULL,
  `uid` int(11) NOT NULL,
  `comments` longtext NOT NULL,
  `cdate` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 ;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_cashdelivery` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT ,
`pid` INT( 11 ) NOT NULL ,
`user_id` INT( 11 ) NOT NULL ,
`pro_price` VARCHAR( 100 ) NOT NULL ,
`pro_quantity` INT( 11 ) NOT NULL ,
`address` VARCHAR( 1000 ) NOT NULL ,
`state` VARCHAR( 255 ) NOT NULL ,
`country` VARCHAR( 255 ) NOT NULL ,
`city` VARCHAR( 255 ) NOT NULL ,
`phone` INT( 15 ) NOT NULL ,
PRIMARY KEY (`id`)
) ENGINE = MYISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `#__jegroupbuy_addtocart` (
  `cart_id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `prod_id` varchar(255) NOT NULL,
  `pro_quantity` varchar(255) NOT NULL,
  `total_cost` float NOT NULL,
  PRIMARY KEY (`cart_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;