DROP TABLE IF EXISTS [db_prefix]games;
CREATE TABLE [db_prefix]games (
  id_games int(11) NOT NULL auto_increment,
  id_category int(11) default NULL,
  code text,
  name varchar(255) default NULL,
  description text,
  instruction text,
  icon varchar(255) default NULL,
  date_add datetime default NULL,
  count_play bigint(11) default '0',
  id_servers int(11) default '1',
  paid int(11) default '0',
  PRIMARY KEY  (id_games)
) CHARSET=utf8;

INSERT INTO [db_prefix]games (id_games, id_category, code, name, description, instruction, icon, date_add, count_play, id_servers) VALUES
(1, 1, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=19988" width="640" height="480" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Dots II', 'Save your pens and pencils, it\'s the classic game of Dots, in Flash! Redesigned, and now with two player mode!', 'Сlick lines to complete boxes.', 'icon_7b6fe120.jpg', '2011-01-05 00:08:00', 0, 1),
(2, 1, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=5" width="570" height="420" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Mini Pool', 'The aim of the game is to first pot the pink ball as this usually has the least number of seconds on it and thus it\'s best to get rid of this ball first. Then one by one pot the red balls before the time runs out.', 'Play This Game = Use Mouse', 'icon_ee5238d9.jpg', '2011-01-05 00:10:47', 0, 1),
(3, 2, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=15231" width="650" height="420" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'City Gunner', 'Go on a shooting rampage to save little boys from captivity! In this game, you are a girl who’s mission is to kill the bad guys and save cute boys from captivity. Go on a shooting rampage and shoot your enemies and avoid being shot at. You have two different heroic females to choose from. So get ready to take out some bad guys!\r\n', 'Navigate Character= WSAD keys \r\nAim/Shoot Gun = Mouse click', 'icon_4107f79c.jpg', '2011-01-05 00:14:35', 0, 1),
(4, 2, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=15198" width="550" height="500" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Mushroom Farm Defender', 'In this game you have to strategically place mushroom along the pathway from where your enemies come. Your mushrooms will automatically defend your farm by shooting at the enemies. The more enemies your mushrooms kill the more money you make and thus having more money for upgrades and adding more mushrooms to defend your farm. So this game is all about strategically placing your mushrooms in the right spot. Good Luck!', 'Drag and Place Mushroom in Desired Position = Mouse (point and click)', 'icon_43cdd36a.jpg', '2011-01-05 00:16:49', 0, 1),
(5, 3, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=20597" width="670" height="550" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Crazy Darts', 'It\'s darts as you\'ve never played it before! Put your timing and accuracy to the test as you try to score on a spinning dartboard! Don\'t get too comfortable though - time is against you!', 'Aim and throw dart - Use the mouse to aim, left click to throw Navigate menus - Use the mouse', 'icon_4b8f9015.jpg', '2011-01-05 00:18:15', 0, 1),
(6, 3, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=10818" width="570" height="440" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Dare Devil', 'The objective of the game is to do tricks to earn points. You can spend points to upgrade your bike and make it more agile. Bike stats include weight reduction, acceleration and max speed. Strategy to this game is to do 360 flips for maximum points. Try to spend your points where you need them. Good Luck!', 'Movements = Arrow Keys \r\nBike Rotation = A Key \r\nBar Rotation = S Key \r\nSuperman = D Key', 'icon_debf7f31.jpg', '2011-01-05 00:20:39', 0, 1),
(7, 4, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=20263" width="640" height="480" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'High School Wars', 'It\'s your gang versus theirs. Chavs, Punks, Jocks and Hoodies, who will you side with? Raise your fists, show your pride and fight to become the kings of the schoolyard! This is brutal... this is High School Wars!', '&middot; <b>Select a gang member</b> - Left click on a to select, left click, hold and drag a box around several members to select a group. &middot; <b>Move gang member(s)</b> - Left click on the spot you wish to move the members to. &middot; <b>Take over enemy territories</b> - Move your gang memebers over the enemy gang territories. &middot; <b>Fight enemies</b> - Move your gang memebers over to an enemy gang member\r\n', 'icon_304c596e.jpg', '2011-01-05 00:26:18', 2, 1),
(8, 5, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=19335" width="670" height="430" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Extreme Snowboard', 'Keep your balance as you whizz down the freezing steep slopes, collecting stars along the way and performing impressive tricks!', '&middot; Speed up - <b>Up arrow key</b> &middot; Tilt - <b>Left/right arrow keys</b> &middot; Slow down - <b>Down arrow key</b> &middot; Jump - <b>Space</b> &middot; Left hand grab - <b>X</b> &middot; Right hand grab - <b>C</b> &middot; Two-handed grab - <b>Z</b>', 'icon_81b8f92d.jpg', '2011-01-05 00:28:00', 0, 1),
(9, 6, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=13792" width="550" height="550" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', '18 Wheeler', 'The objective of the game is to park the truck into designated parking areas before the time runs out. Try to finish the levels as quick as possible to get more points. You lose points when you crash the truck so be very careful.', '&middot; <b>Drive</b> - Arrow Keys &middot; <b>Brakes</b> - SpaceBar', 'icon_5845537f.jpg', '2011-01-05 00:30:28', 0, 1),
(10, 7, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=4530" width="600" height="400" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Fat Ninja', 'Play this addictive flash game and control the fat ninja to kill all the enemies through various challenging stages without getting spotted by security agents. Use various attacking options according to the scenario, as for every wrong move the possibility of ringing of alarms will increase. Good Luck!', '&middot; <b>Movements</b> = Arrow Keys &middot; <b>Attack from Back</b> = Z Key &middot; <b>Hide</b> = Z Key &middot; <b>Opening Doors</b> = Z Key &middot; <b>Attack</b> = Space Bar &middot; <b>Super Attack</b> = X Key &middot; <b>Fighting</b> = Space Bar', 'icon_0fbea932.jpg', '2011-01-05 00:34:03', 0, 1),
(11, 7, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=453" width="550" height="400" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Mad Cows', 'Its sad but true: your cows have been infected by a strange disease. They are getting mad. Your only chance is to pick out the infected animals and get rid of them. You have 60 seconds to find 30 mad cows. Note: A healthy cow is behaving exactly like a cow should do. So avoid these as it\'ll cost you 10 seconds off the clock for putting a healthy cow down. Good Luck!!!', '&middot; <b>Play This Game</b> = Use Mouse', 'icon_745198b1.jpg', '2011-01-05 00:35:56', 3, 1),
(12, 8, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=501" width="500" height="300" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Balloony', 'Ever travel in a hot air balloon before, if your answer is \'No\'. Here is your chance! The aim of the game is to accumulate points by shooting down anything that flies, floats, or glides in the sky....this can be anything from hot air balloons, to black birds and even Spaceship\'s. But just be careful not to shoot down your own friends, you\'ll get to know who they are once you start the game.', '&middot; <b>Aim & Fire</b> = Use Mouse', 'icon_a1fdd492.jpg', '2011-01-05 00:43:52', 1, 1),
(13, 9, '<iframe src="http://www.freeonlinegames.com/embed.php?g_id=2750" width="560" height="420" scrolling="no" allowTransparency="true" frameborder="0"></iframe>', 'Lucky Balls', 'The aim of this addictive puzzle game is, to eliminate all the colorful balls rolling down the spiral tube, before they reach the skull. You can eliminate them by shooting a ball from the center and group 3 or more balls of the same color. &lt;p&gt; The degree of difficulty rises as you proceed further, so you\'ve to be very quick in order to gain the maximum number of points. &lt;/p&gt; &lt;p&gt; The color of the next ball to be rolled down and also the next ball to pop out at the center, are indicated by the two boxes in the top corners of the play screen. Keep an eye on the flow of the balls and rapidly clear them off as soon as possible to score the maximum points and make it to the high score', 'Move your <b>Mouse</b> to set the direction and <b>Left Click</b> to shoot a ball. Good Luck and enjoy... </p>', 'icon_0acdf5df.jpg', '2011-01-05 00:45:14', 0, 1);

DROP TABLE IF EXISTS [db_prefix]games_category;
CREATE TABLE [db_prefix]games_category (
  id_category int(11) NOT NULL auto_increment,
  name varchar(255) default NULL,
  PRIMARY KEY  (id_category)
) CHARSET=utf8;

INSERT INTO [db_prefix]games_category (id_category, name) VALUES
(1, 'Puzzle Games'),
(2, 'Shooting Games'),
(3, 'Sports Games'),
(4, 'Strategy Games'),
(5, 'Physics Games'),
(6, 'Driving Games'),
(7, 'Funny Games'),
(8, 'Arcade Games'),
(9, 'Matching Games');

DROP TABLE IF EXISTS [db_prefix]games_comments;
CREATE TABLE [db_prefix]games_comments (
  id_comment int(11) NOT NULL auto_increment,
  id_user int(11) default NULL,
  id_game int(11) default NULL,
  comment text,
  date_add datetime default NULL,
  PRIMARY KEY  (id_comment)
) CHARSET=utf8;

INSERT INTO [db_prefix]games_comments (id_comment, id_user, id_game, comment, date_add) VALUES
(1, 6, 11, 'Look for crazy cow outfit! hahahah<img src="./templates/pilot_3_theme/emoticons/wink.png" alt="">', '2011-01-05 00:46:41'),
(2, 3, 12, 'Poor birds!', '2011-01-05 00:49:04'),
(3, 20, 11, 'Very funny!!!!', '2011-01-05 00:50:30'),
(4, 8, 11, 'Let\'s find those creative cows, guys!', '2011-01-05 00:51:52');

DROP TABLE IF EXISTS [db_prefix]user_games_play;
CREATE TABLE [db_prefix]user_games_play (
  id_user int(11) default NULL,
  id_games int(11) default NULL,
  count_play int(11) default '0'
) CHARSET=utf8;

INSERT INTO [db_prefix]user_games_play (id_user, id_games, count_play) VALUES
(26, 7, 2),
(6, 11, 1),
(3, 12, 1),
(20, 11, 1),
(8, 11, 1);

DROP TABLE IF EXISTS [db_prefix]games_category_lang;
CREATE TABLE [db_prefix]games_category_lang (
  id_category int(11) default NULL,
  name varchar(255) default NULL,
  id_lang int(11) default NULL
) CHARSET=utf8;

DROP TABLE IF EXISTS [db_prefix]games_lang;
CREATE TABLE [db_prefix]games_lang (
  id_games int(11) default NULL,
  name varchar(255) default NULL,
  description text,
  instruction text,
  id_lang int(11) default NULL
) CHARSET=utf8;

DROP TABLE IF EXISTS [db_prefix]games_orders;
CREATE TABLE [db_prefix]games_orders (
  id int(11) NOT NULL auto_increment,
  id_user int(11) default NULL,
  date_order datetime NOT NULL default '0000-00-00 00:00:00',
  status enum('attempt','send','approve','fail') default NULL,
  order_price varchar(255) default NULL,
  period_end datetime NOT NULL default '0000-00-00 00:00:00',
  order_type varchar(255) default NULL,
  PRIMARY KEY  (id)
) CHARSET=utf8;

DROP TABLE IF EXISTS [db_prefix]games_settings;
CREATE TABLE [db_prefix]games_settings (
  name varchar(255) default NULL,
  value varchar(255) default NULL
) CHARSET=utf8;

INSERT INTO [db_prefix]games_settings (name, value) VALUES ('use_paid','0');