DROP TABLE IF EXISTS [db_prefix]sms_systems;
CREATE TABLE IF NOT EXISTS [db_prefix]sms_systems (
  id int(3) NOT NULL auto_increment,
  name varchar(20) NOT NULL DEFAULT '',
  used enum('0','1') NOT NULL DEFAULT '1' ,
  template_name varchar(255) NOT NULL DEFAULT '' ,
  PRIMARY KEY (id)
) CHARSET=utf8;

INSERT INTO [db_prefix]sms_systems (name, used, template_name) VALUES ('SMS Coin', '0', 'smscoin');
INSERT INTO [db_prefix]sms_systems (name, used, template_name) VALUES ('DaoPay', '0', 'daopay');
INSERT INTO [db_prefix]sms_systems (name, used, template_name) VALUES ('ZayPay', '0', 'zaypay');
INSERT INTO [db_prefix]sms_systems (name, used, template_name) VALUES ('PayGol', '0', 'paygol');

DROP TABLE IF EXISTS [db_prefix]sms_sys_paygol;
CREATE TABLE IF NOT EXISTS [db_prefix]sms_sys_paygol (
  seller_id varchar(255) NOT NULL default ''
) CHARSET=utf8;
INSERT INTO [db_prefix]sms_sys_paygol (seller_id) VALUES ('1071');

DROP TABLE IF EXISTS [db_prefix]sms_sys_smscoin;
CREATE TABLE IF NOT EXISTS [db_prefix]sms_sys_smscoin (
  bank_id varchar(255) NOT NULL default '',
  bank_descr blob,
  bank_secret_code varchar(255) NOT NULL default '',
  bank_url text
) CHARSET=utf8;
INSERT INTO [db_prefix]sms_sys_smscoin (bank_id, bank_descr, bank_secret_code, bank_url) VALUES ('','Account charging on dating site','secret_code','http://xxxx.bank.smscoin.com/bank/');

DROP TABLE IF EXISTS [db_prefix]sms_rate_smscoin;
CREATE TABLE IF NOT EXISTS [db_prefix]sms_rate_smscoin (
  id int(11) NOT NULL auto_increment,
  rate_name blob,
  cost_for_user double NOT NULL DEFAULT '0',
  goes_to_site double NOT NULL DEFAULT '0',
  PRIMARY KEY (id)
) CHARSET=utf8;
INSERT INTO [db_prefix]sms_rate_smscoin (rate_name, cost_for_user, goes_to_site) VALUES ('USA', '4.99', '3.12');

DROP TABLE IF EXISTS [db_prefix]sms_sys_daopay;
CREATE TABLE IF NOT EXISTS [db_prefix]sms_sys_daopay (
  appcode varchar(255) NOT NULL default ''
) CHARSET=utf8;
INSERT INTO [db_prefix]sms_sys_daopay (appcode) VALUES ('');

DROP TABLE IF EXISTS [db_prefix]sms_rate_daopay;
CREATE TABLE IF NOT EXISTS [db_prefix]sms_rate_daopay (
  id int(11) NOT NULL auto_increment,
  rate_name blob,
  cost_for_user double NOT NULL DEFAULT '0',
  goes_to_site double NOT NULL DEFAULT '0',
  country_code varchar(5),
  PRIMARY KEY (id)
) CHARSET=utf8;
INSERT INTO [db_prefix]sms_rate_daopay (rate_name, cost_for_user, goes_to_site, country_code) VALUES ('United Kingdom 1.5 GBP / SMS', '2.00', '2.00','GB');
INSERT INTO [db_prefix]sms_rate_daopay (rate_name, cost_for_user, goes_to_site, country_code) VALUES ('Austria 3 EUR / SMS', '3.00', '3.00','AT');

DROP TABLE IF EXISTS [db_prefix]sms_send_requests;
CREATE TABLE IF NOT EXISTS [db_prefix]sms_send_requests (
  id int(11) NOT NULL auto_increment,
  id_user int(11) NOT NULL DEFAULT '0',
  id_rate int(11) NOT NULL DEFAULT '0',
  count_curr_out double,
  count_curr_in double,
  id_service int(3) NOT NULL DEFAULT '1',
  date_send datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  status enum('send', 'approve', 'fail') DEFAULT 'send',
  paysystem varchar(255),
  daopay_orderno varchar(20) DEFAULT '',
  zaypay_paymentid varchar(20) DEFAULT '',
  PRIMARY KEY (id),
  INDEX id_user (id_user),
  INDEX id_rate (id_rate)
) CHARSET=utf8;

DROP TABLE IF EXISTS [db_prefix]sms_rate_zaypay;
CREATE TABLE [db_prefix]sms_rate_zaypay (
  id int(11) NOT NULL auto_increment,
  rate_name blob,
  cost_for_user double NOT NULL default '0',
  goes_to_site double NOT NULL default '0',
  price_setting_id varchar(10) default NULL,
  price_setting_key varchar(255) character set utf8 collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (id)
) CHARSET=utf8;

INSERT INTO [db_prefix]sms_rate_zaypay (rate_name, cost_for_user, goes_to_site, price_setting_id, price_setting_key) VALUES('test1', 2, 20, '38512', '7f02801f3437970f97ea582fec04a93c');
INSERT INTO [db_prefix]sms_rate_zaypay (rate_name, cost_for_user, goes_to_site, price_setting_id, price_setting_key) VALUES('test2', 2, 10, '38522', '016284c2e9061e81238dd33988e1ced3');
INSERT INTO [db_prefix]sms_rate_zaypay (rate_name, cost_for_user, goes_to_site, price_setting_id, price_setting_key) VALUES('test3', 3, 10, '38532', '936fa23d39ee11d6341670763600e38b');