Thread: Betting system
View Single Post
  #4  
Old 7th June 2010, 11:09
Marco Marco is offline
Senior Member
 
Join Date: Jun 2009
Seychelles
Posts: 327
Default hello
here we go

i wish to mention it's not my work it's a tbdeved version translated in hungarian by angelo and with bibicu help :) so if you need another language you have to translate

1step SQL
Code:
DROP TABLE IF EXISTS `bet`;

CREATE TABLE `bet` (

`id` int(10) unsigned NOT NULL auto_increment,

`name` varchar(50) NOT NULL default '',

`active` tinyint(1) unsigned NOT NULL default '0',

PRIMARY KEY (`id`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;



-- 

-- Dumping data for table `bet`

-- 





-- --------------------------------------------------------



-- 

-- Table structure for table `bet_winns`

-- 



DROP TABLE IF EXISTS `bet_winns`;

CREATE TABLE `bet_winns` (

`id` int(10) unsigned NOT NULL auto_increment,

`betid` int(10) unsigned NOT NULL default '0',

`choice` tinyint(2) default NULL,

PRIMARY KEY (`id`),

KEY `betid` (`betid`),

KEY `choice` (`choice`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;



-- 

-- Dumping data for table `bet_winns`

-- 





-- --------------------------------------------------------



-- 

-- Table structure for table `betchoices`

-- 



DROP TABLE IF EXISTS `betchoices`;

CREATE TABLE `betchoices` (

`id` int(10) unsigned NOT NULL auto_increment,

`betid` int(10) unsigned NOT NULL default '0',

`name` varchar(50) NOT NULL default '',

`active` tinyint(1) unsigned NOT NULL default '0',

`choice1` varchar(40) default NULL,

`choice2` varchar(40) default NULL,

`choice3` varchar(40) default NULL,

`choice4` varchar(40) default NULL,

`choice5` varchar(40) default NULL,

`choice6` varchar(40) default NULL,

`choice7` varchar(40) default NULL,

`choice8` varchar(40) default NULL,

`choice9` varchar(40) default NULL,

`choice10` varchar(40) default NULL,

`payout1` decimal(2,1) default NULL,

`payout2` decimal(2,1) default NULL,

`payout3` decimal(2,1) default NULL,

`payout4` decimal(2,1) default NULL,

`payout5` decimal(2,1) default NULL,

`payout6` decimal(2,1) default NULL,

`payout7` decimal(2,1) default NULL,

`payout8` decimal(2,1) default NULL,

`payout9` decimal(2,1) default NULL,

`payout10` decimal(2,1) default NULL,

PRIMARY KEY (`id`),

KEY `betid` (`betid`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;



-- 

-- Dumping data for table `betchoices`

-- 





-- --------------------------------------------------------



-- 

-- Table structure for table `bets`

-- 



DROP TABLE IF EXISTS `bets`;

CREATE TABLE `bets` (

`id` int(10) unsigned NOT NULL auto_increment,

`userid` int(10) unsigned NOT NULL default '0',

`betid` int(10) unsigned NOT NULL default '0',

`choice` tinyint(2) unsigned NOT NULL default '0',

`bet` bigint(13) unsigned NOT NULL default '0',

`paid` tinyint(1) unsigned NOT NULL default '0',

PRIMARY KEY (`id`),

KEY `userid` (`userid`),

KEY `betid` (`betid`),

KEY `choice` (`choice`)

) TYPE=MyISAM AUTO_INCREMENT=1 ;



-- 

-- Dumping data for table `bets`

--
create a file named betting.php
[code]
<?
require 'global.php';

dbconn();

loggedinorreturn();
$action = $_GET["action"];
if ($action == "placebet") {
$betid = 0 + $_POST["bcid"];
if ($betid == "")
stderr("Error", "Oh Nice One You Fucked Up.");
$i = 1;
while ($i < 11) {
$bi = "amount" . $i;
if ($_POST[$bi] != "") {
$bis = $bi;
$amount = 0 + $_POST[$bi];
}
$i++;
}
$amount = round($amount * 1048576);
$maxamount = round($CURUSER['uploaded'] / 10);
if ($amount > $maxamount)
stderr("Hiba!", "Nincs fedezete a fogad

Last edited by Marco; 9th June 2010 at 10:53.
Reply With Quote
The Following User Says Thank You to Marco For This Useful Post:
mmisu120000 (9th June 2010)