-BRAIDZ- Posted July 5, 2015 Share Posted July 5, 2015 Is there any bookies mods out there for RC? I have seen it before, I have it also but it is unfinished... And no sql files aha! Quote Link to comment Share on other sites More sharing options...
SRB Posted July 5, 2015 Share Posted July 5, 2015 Recreate the SQL then. I doubt it's so complex that it would take over an hour or so . Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 5, 2015 Author Share Posted July 5, 2015 Recreate the SQL then. I doubt it's so complex that it would take over an hour or so . I dont think it's completed even if the sql was in the database <?php /*------------includes--------------*/ include ('./includes/connections.php'); include ('./includes/brain_file.php'); include ('./includes/style_top.php'); /*------------includes--------------*/ echo "<center><main>Bookies</main><hr width = '75%'>"; echo "<table width = '75%'><tr><td align = 'center'>Welcome to the bookies, Here you can bet on football games and horse races <br/>Please choose a sport below you wish to bet on.</td> </tr></table>"; $q_ry = array(); $q_ry = "SELECT * FROM `bookie_games` ORDER BY bg_time DESC"; $book = array(); $book = mysql_query($q_ry); echo "<br/> <table width = '75%' class = 'forum'> <tr bgcolor = '#999999' align = 'center' style = 'font-weight:800;'> <td align = 'center' width = '20%'>Sport</td> <td align = 'center'>All matches this week</td> <td align = 'center' width = '20%'>Book closes</td> </tr>"; if(mysql_num_rows($book)) { $b = array(); $i = 0; $type_2_image = array('football'=>'http://www.torn.com/images/bookie/football.png'); while($b = mysql_fetch_array($book)) { $i++; if ($i % 2) { $color="#e3e3e3"; } else { $color="#D8D8D8"; } echo "<tr bgcolor = $color><td align = 'center'> <img src='".$type_2_image[$b['bg_type']]."' border = '1' width = '50px' height = '50px'> </td> <td align = 'center'> <font size = '+1'>".stripslashes($b['bg_title'])."</font> </td> <td align = 'center'> " . date('F j',$b['bg_time']) . "<br/>" . date('g:i:s a',$b['bg_time']) . " </td></tr>"; } } else { echo "none"; } echo "</table>"; echo "<hr width = '75%'>><a href='casino.php'>Back</a><hr width = '75%'>"; Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 6, 2015 Author Share Posted July 6, 2015 Anyone? Quote Link to comment Share on other sites More sharing options...
Coly010 Posted July 6, 2015 Share Posted July 6, 2015 (edited) It's all there... In the code... Simply var_dump($b) and it will show you all the data stored in the fields and what type they are, the code then makes references to the names of these fields or more easily use array_keys($b), then just use phpmyadmin's table creator to recreate it. you also realise your game is stealing images from torn for that script ? And you're using mysql_* where you should now be using mysqli_* ? Edited July 6, 2015 by Coly010 Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 6, 2015 Author Share Posted July 6, 2015 It's all there... In the code... Simply var_dump($b) and it will show you all the fields and what type they are, then just use phpmyadmin's table creator to recreate it. you also realise your game is stealing images from torn for that script ? And you're using mysql_* where you should now be using mysqli_* ? It's not all there.. So I'm converting the UOTS engine Bookies. Quote Link to comment Share on other sites More sharing options...
NonStopCoding Posted July 6, 2015 Share Posted July 6, 2015 It's all there... In the code... Simply var_dump($b) and it will show you all the fields and what type they are, then just use phpmyadmin's table creator to recreate it. you also realise your game is stealing images from torn for that script ? And you're using mysql_* where you should now be using mysqli_* ? there is a few things in rc that are taken directly from torn noticed this in the past and also the whole of the rc engine using mysql needs some serious recode Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 6, 2015 Author Share Posted July 6, 2015 (edited) there is a few things in rc that are taken directly from torn noticed this in the past and also the whole of the rc engine using mysql needs some serious recode Too true.. I have converted the UOTS Engine Bookies script to the best of my knowledge. Now I'm just having trouble with the games showing up and being able to manage/add games... <?php /*------------includes--------------*/ include ('./includes/connections.php'); include ('./includes/brain_file.php'); include ('./includes/style_top.php'); /*------------includes--------------*/ echo "<p_title><main><center>Bookies</center></main></p_title><hr width = '800px'>"; if($_SESSION['am_i_staff'] = '5') { echo "><a href ='bookies.php?action=panel'><center>Manage games</center></a><hr width = '800px'>"; } echo "<center>[<a href ='bookies.php?action=cat&cat_id=1'>Football</a>] [<a href ='bookies.php?action=cat&cat_id=2'>Hockey</a>] [<a href ='bookies.php?action=cat&cat_id=3'>Baseball</a>] [<a href ='bookies.php?action=cat&cat_id=4'>Soccer</a>] [<a href ='bookies.php?action=cat&cat_id=5'>Boxing</a>] [<a href ='bookies.php?action=cat&cat_id=6'>Cricket</a>] [<a href ='bookies.php?action=cat&cat_id=7'>Basketball</a>]</br> [<a href ='bookies.php?action=cat&cat_id=8'>All</a>] [<a href ='bookies.php?action=mybets'>Your bets</a>]<hr width = '800px'></center>"; $_GET['action'] = preg_replace('/[^a-z]/', '', $_GET['action']); if(!$_GET['action']) { $_GET['action'] = 'cat'; $_GET['cat_id'] = 8; } if(in_array($_GET['action'], array('panel','cat','bet','mybets'))) { echo "<table width = '800px' class = 'display-stripes'> <tr> <td align = 'center'>"; switch($_GET['action']) { case 'panel' : b_panel(); break; case 'cat' : view_cat(); break; case 'bet' : place_bet(); break; case 'mybets' : view_bets(); break; } echo "</td></tr></table> <hr width = '800px'> ><a href ='casino.php'><center>Casino</Center></a> <hr width = '800px'>"; } function b_panel() { global $user; if($_SESSION['am_i_staff'] == '5') { echo "<p_title>Bookies panel</p_title><hr>"; if($_GET['type']=='add') { $_POST['team1'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team1']); $_POST['team2'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team2']); $_POST['gtype'] = preg_replace('/[^0-9]/', '', $_POST['gtype']); if(!in_array($_POST['gtype'], array(1,2,3,4,5,6,7))) { $_POST['gtype'] = 1; } $_POST['t1oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmax']); $_POST['t1oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmin']); $_POST['t2oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmax']); $_POST['t2oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmin']); $_POST['gmonth'] = preg_replace('/[^a-zA-Z]/', '', $_POST['gmonth']); $_POST['gday'] = preg_replace('/[^0-9]/', '', $_POST['gday']); $_POST['gyear'] = preg_replace('/[^0-9]/', '', $_POST['gyear']); $_POST['ghrs'] = preg_replace('/[^0-9]/', '', $_POST['ghrs']); $_POST['gmins'] = preg_replace('/[^0-9]/', '', $_POST['gmins']); if($_POST['team1']!='' && $_POST['team2']!='' && $_POST['t1oddsmax'] && $_POST['t1oddsmin'] && $_POST['t2oddsmax'] && $_POST['t2oddsmin'] && $_POST['gmonth'] && $_POST['gday'] && $_POST['gyear']) { $title = $_POST['team1']." VS ".$_POST['team2']; $odds1 = $_POST['t1oddsmax'].":".$_POST['t1oddsmin']; $odds2 = $_POST['t2oddsmax'].":".$_POST['t2oddsmin']; $ending=strtotime($_POST['gday']." ".$_POST['gmonth']." ".$_POST['gyear']." ".$_POST['ghrs']." hours ".$_POST['gmins']." minutes"); $cat_name = array('Football','Hockey','Baseball','Soccer','Boxing','Cricket','Basketball','All'); if(!$_GET['step']) { echo "Are you sure you wish to add the <b>".$cat_name[$_POST['gtype']-1]."</b> game(<b>".$title."</b>) with the following:<br> Team one: <b>".$_POST['team1']."[".$odds1."]</b> - Team two: <b>".$_POST['team2']."[".$odds2."]</b><br> End date: ".date('F j Y', $ending)." - ".date('g:i:s a', $ending)."<br> <form name = 'add-g' id = 'add-g'>"; foreach($_POST AS $key => $val) { echo "<input type = 'hidden' name = '".$key."' id = '".$key."' value = '".$val."'>"; } echo "<button class = 'submit:add-g:bookies.php?action=panel&type=add&step=1' id = 'linkage'>Confirm</button></form>"; } else { $odds = $odds1."-".$odds2; $sql = "INSERT INTO `bookie_games` VALUES('NULL', '".mysql_real_escape_string($title)."', '".mysql_real_escape_string($_POST['gtype'])."', '".mysql_real_escape_string($odds)."', '".mysql_real_escape_string($ending)."')"; mysql_query($sql); echo "You added the game successfully!"; } } else { echo warn("Error adding the game!"); } } else { if($_GET['type']=='results') { $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['score1'] = preg_replace('/[^0-9]/', '', $_POST['score1']); $_POST['score2'] = preg_replace('/[^0-9]/', '', $_POST['score2']); if($_GET['id'] && $_POST['score1'] && $_POST['score2']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $tg = mysql_fetch_array($sql); $odds = explode("-", $tg['bg_odds']); $teamn = explode(" VS ", $tg['bg_title']); $cat_name = array('Football','Hockey','Baseball','Soccer','Boxing','Cricket','Basketball','All'); $oddsone = explode(":", $odds[0]); $oddsmax[1] = $oddsone[0]; $oddsmin[1] = $oddsone[1]; $oddstwo = explode(":", $odds[1]); $oddsmax[2] = $oddstwo[0]; $oddsmin[2] = $oddstwo[1]; if($_POST['score1'] > $_POST['score2']) { $winner = 1; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { if($_POST['score2'] > $_POST['score1']) { $winner = 2; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { $winner = 0; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b>"; } } $sql = "SELECT * FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($_GET['id'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { while($gp = mysql_fetch_array($sql)) { if($gp['bb_team'] == $winner) { //they won $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; $msg = $teamn[$gp['bb_team']-1]." won the ".$cat_name[$gp['bb_team']-1]." game you bet on.<br> ".$scoring."<br> You bet ".money_alter($steaks+$scraps)."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."].<br> You have won ".money_alter($prize)."!"; in_event($gp['bb_user'], $msg); credit_money($gp['bb_user'], $prize); } else { //they lost $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; if($winner == '0') { $wintype = 'drawn'; } else { $wintype = 'lost'; } $msg = $teamn[$gp['bb_team']-1]." ".$wintype." the ".$cat_name[$gp['bb_team']-1]." game you bet on.<br> ".$scoring."<br> You bet ".money_alter($gp['bb_bet'])."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."].<br> You have lost ".money_alter($steaks); if($scraps) { $msg.=" and your ".money_alter($scraps)." was returned!"; credit_money($gp['bb_user'], $scraps); } in_event($gp['bb_user'], $msg); } } } $sql = "DELETE FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); $sql = "DELETE FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); echo "Game <b>\"".$tg['bg_title']."\"</b> ended successfully!"; } else { echo warn("Error ending the game!"); } } else { echo warn("Error ending the game!"); } } else { echo "<b>Add a game:</b><hr width = '650px'>"; echo "<form name = 'addg' id = 'addg'> <table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game teams:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <input type = 'text' style = 'width: 90px;' name = 'team1' id = 'team1'> <b>VS</b> <input type = 'text' style = 'width: 90px;' name = 'team2' id = 'team2'> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game type:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 'gtype' id = 'gtype'> <option value = '1'> Football </option> <option value = '2'> Hockey </option> <option value = '3'> Baseball </option> <option value = '4'> Soccer </option> <option value = '5'> Boxing </option> <option value = '6'> Cricket </option> <option value = '7'> Basketball </option> </select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team one odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't1oddsmax' id = 't1oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't1oddsmin' id = 't1oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team two odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't2oddsmax' id = 't2oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't2oddsmin' id = 't2oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8' valign = 'top'> <b>Date betting ends:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'>"; $year = date('o'); $day = date('d'); $month = date('F'); $months = array('january','february','march','april','may','june', 'july','august','september','october','november','december'); echo "<table><tr><td align = 'left' style = 'background: #E3E3E3;'><i>Date:</i> <select name = 'gmonth' id = 'gmonth'>"; for($i = 0; $i < count($months); $i++) { $selected = ''; if(ucfirst($months[$i]) == $month) { $selected = ' SELECTED'; } echo "<option value = '".$months[$i]."'".$selected."> ".ucfirst($months[$i])." </option>"; } echo "</select><b>/</b><select name = 'gday' id = 'gday'>"; for($i = 1; $i <=31; $i++) { $selected = ''; if($i == $day) { $selected = ' SELECTED'; } echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select><b>/</b><select name = 'gyear' id = 'gyear'>"; for($i = $year; $i <=$year+1; $i++) { echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select><br> <i>Time:</i> <select name = 'ghrs' id = 'ghrs'>"; for($i = 0; $i <=24; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select><b>:</b><select name = 'gmins' id = 'gmins'>"; for($i = 0; $i <=59; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select></td></tr></table> </td> </tr> <tr> <td align = 'center' bgcolor = '#b8b8b8' colspan = '3'> <button class = 'submit:addg:bookies.php?action=panel&type=add' id = 'linkage'>Add game</button> </td> </tr> </table> </form>"; echo "<hr width = '650px'><b>End a game:</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ended</b> </th> <th> <b>Post results</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '3'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { $teams = explode(" VS ", $eg['bg_title']); echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])."<br>".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <form name = 'score-".$num."' id = 'score-".$num."'> <i>".$teams[0]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score1' id = 'score1'><br> <i>".$teams[1]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score2' id = 'score2'><br> <button class = 'submit:score-".$num.":bookies.php?action=panel&type=results&id=".$eg['bg_id']."' id = 'linkage'>Confirm</button> </form> </td> </tr>"; $num++; } } echo "</table>"; echo "<hr width = '650px'><b>Games ending soon(12hrs or less):</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ending</b> </th> </tr>"; $time_soon = time()+43200; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string($time_soon)."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '2'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr bgcolor = '".stripe($num)."'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])." - ".date('g:i:s a', $eg['bg_time'])." </td> </tr>"; } } echo "</table>"; } } } else { echo "You really should not be here!"; } } function view_cat() { global $user; $_GET['cat_id'] = preg_replace('/[^0-9]/', '', $_GET['cat_id']); if(!in_array($_GET['cat_id'], array(1,2,3,4,5,6,7,8))) { echo warn("Invalid cat ID!"); } else { $cat_name = array('Football','Hockey','Baseball','Soccer','Boxing','Cricket','Basketball','All'); echo "<p_title>".ucfirst($cat_name[$_GET['cat_id']-1])." games</p_title><hr>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th colspan = '2'> <b>Game title</b> </th> <th style = 'text-align: center;'> <b>Date ending</b> </th> <th style = 'text-align: right;'> <b>Place bet(s)</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` > '".mysql_real_escape_string(time())."'"; if($_GET['cat_id'] < 8) { $sql.="AND `bg_type` = '".mysql_real_escape_string($_GET['cat_id'])."'"; } $sql.="ORDER BY `bg_time` ASC"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '4'><b>No ".ucfirst($cat_name[$_GET['cat_id']-1])." games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr> <td align = 'center' colspan = '4'> <form name = 'bet-".$num."' id = 'bet-".$num."'> <table width = '100%' cellspacing = '0'> <tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left' width = '50px'> <img src = 'images/css/casino/game-".$eg['bg_type'].".png'> </td> <td align = 'left'>"; $title_odds = explode(" VS ", $eg['bg_title']); $odds = explode("-", $eg['bg_odds']); echo "<b>".$title_odds[0]."[".$odds[0]."]</b> VS <b>".$title_odds[1]."[".$odds[1]."]</b><br> ".ucfirst($cat_name[$eg['bg_type']-1])." </td> <td align = 'center'> ".date('F j Y', $eg['bg_time'])."<br>".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <i>Team to win:</i><select name = 'team'> <option value = '1'> ".ucfirst($title_odds[0])." </option> <option value = '2'> ".ucfirst($title_odds[1])." </option> </select><br> <i>Bet:</i><input type = 'text' style = 'width: 50px;' value = '0' name = 'bet' id = 'bet'> </td> </tr> <tr bgcolor = '#000000' height = '30px'> <td colspan = '4' align = 'center'> <button class = 'submit:bet-".$num.":bookies.php?action=bet&id=".$eg['bg_id']."' id = 'linkage'>Place bet</button> </td> </tr> <tr> <td colspan = '4' height = '5px'> </td> </tr> </table> </form> </td> </tr>"; $num++; } } echo "</table>"; } } function place_bet() { global $user; echo "<p_title>Place bet</p_title><hr>"; $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['bet'] = preg_replace('/[^0-9]/', '', $_POST['bet']); $_POST['team'] = preg_replace('/[^0-9]/', '', $_POST['team']); if($_GET['id'] && $_POST['bet'] && $_POST['team']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { if($user['usr_money'] >= $_POST['bet']) { $bg = mysql_fetch_array($sql); $teamname = explode(" VS ", $bg['bg_title']); $teamname = $teamname[$_POST['team']-1]; $oddsmin = explode("-", $bg['bg_odds']); $odds = $oddsmin[$_POST['team']-1]; $oddsmin = explode(":", $oddsmin[$_POST['team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($_POST['bet']/$oddsmin); $betting*=$oddsmin; if(!$_GET['step']) { echo "You are betting <b>".money_alter($_POST['bet'])."</b>(".money_alter($betting)." effective) on team <b>".$teamname."</b> to win with the odds of [".$odds."]. <br>Are you sure you wish to place this bet?<br> <form name = 'bet-c' id = 'bet-c'> <input type = 'hidden' name = 'bet' id = 'bet' value = '".$_POST['bet']."'> <input type = 'hidden' name = 'team' id = 'team' value = '".$_POST['team']."'> <button class = 'submit:bet-c:bookies.php?action=bet&id=".$_GET['id']."&step=1' id = 'linkage'>Confirm bet</button> </form>"; } else { $sql = "INSERT INTO `bookie_bets` VALUES('NULL', '".mysql_real_escape_string($_SESSION['myid'])."', '".mysql_real_escape_string($_GET['id'])."', '".mysql_real_escape_string($_POST['team'])."', '".mysql_real_escape_string($_POST['bet'])."')"; mysql_query($sql); echo min_money($_POST['bet']); echo "Your bet has been placed for a total of <b>".money_alter($_POST['bet'])."</b>.<br> You can view your bets from the top of this page.<br> You will receive an event with the results shortly after the game has ended."; } } else { echo warn("You dont have enough money to make this bet!"); } } else { echo warn("This game does not exist!"); } } else { echo warn("This game does not exist!"); } } function view_bets() { global $user; echo "<p_title>Your bets</p_title><hr>"; echo "<table width = '100%' class = 'display-stripes'> <tr> <th colspan = '2'> Team betting on/Type </th> <th> Odds </th> <th> Ending date </th> <th> Total bet </th> </tr>"; $sql = "SELECT bb.*,bg.* FROM `bookie_bets` bb LEFT JOIN `bookie_games` bg ON bb.bb_game = bg.bg_id WHERE bb.bb_user = '".mysql_real_escape_string($_SESSION['myid'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $num = 0; $cat_name = array('Football','Hockey','Baseball','Soccer','Boxing','Cricket','Basketball','All'); while($mb = mysql_fetch_array($sql)) { $teamname = explode(" VS ", $mb['bg_title']); $teamname = $teamname[$mb['bb_team']-1]; $oddsmin = explode("-", $mb['bg_odds']); $odds = $oddsmin[$mb['bb_team']-1]; $oddsmin = explode(":", $oddsmin[$mb['bb_team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($mb['bb_bet']/$oddsmin); $betting*=$oddsmin; echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td width = '50px'> <img src = 'images/css/casino/game-".$mb['bg_type'].".png'> </td> <td> ".$teamname." - ".ucfirst($cat_name[$mb['bg_type']-1])." </td> <td> [".$odds."] </td> <td> ".date('F j Y', $mb['bg_time'])."<br>".date('g:i:s a', $mb['bg_time'])." </td> <td> ".money_alter($mb['bb_bet'])."(".money_alter($betting)." effective) </td> </tr>"; $num++; } } else { echo "<tr><td colspan = '5'>You have no bets at this time.</td></tr>"; } echo "</table>"; } ?> I can provide my game URL if need be Edited July 7, 2015 by -BRAIDZ- Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 6, 2015 Author Share Posted July 6, 2015 [MENTION=65530]Coly010[/MENTION] Thanks for that post you tagged me in, I will have a read through soon Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 Help anyone? Please... Quote Link to comment Share on other sites More sharing options...
Coly010 Posted July 7, 2015 Share Posted July 7, 2015 remove anything that has echo warn(); min_money(); and money_alter() unless you know that your engine has though functions available. Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 remove anything that has echo warn(); min_money(); and money_alter() unless you know that your engine has though functions available. Still can't get it to work - - - Updated - - - remove anything that has echo warn(); min_money(); and money_alter() unless you know that your engine has though functions available. The links don't work unless I change them, will supply original UOTS file Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 remove anything that has echo warn(); min_money(); and money_alter() unless you know that your engine has though functions available. <?php include('func_file.php'); if($_SERVER['HTTP_REFERER'] == $referer) { page_access($_SERVER['PHP_SELF']); echo "<p_title>Bookies</p_title><hr width = '800px'>"; if($_SESSION['myid'] == '1' || $_SESSION['myid'] == '2') { echo "><span class = 'loader:bookies.php?action=panel' id = 'linkage'>Manage games</span><hr width = '800px'>"; } echo "[<span class = 'loader:bookies.php?action=cat&cat_id=1' id = 'linkage'>Football</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=2' id = 'linkage'>Hockey</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=3' id = 'linkage'>Baseball</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=4' id = 'linkage'>Soccer</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=5' id = 'linkage'>Boxing</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=6' id = 'linkage'>Cricket</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=7' id = 'linkage'>Basketball</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=8' id = 'linkage'>All</span>] [<span class = 'loader:bookies.php?action=mybets' id = 'linkage'>Your bets</span>]<hr width = '800px'>"; $_GET['action'] = preg_replace('/[^a-z]/', '', $_GET['action']); if(!$_GET['action']) { $_GET['action'] = 'cat'; $_GET['cat_id'] = 8; } if(in_array($_GET['action'], array('panel','cat','bet','mybets'))) { echo "<table width = '800px' class = 'display-stripes'> <tr> <td align = 'center'>"; switch($_GET['action']) { case 'panel' : b_panel(); break; case 'cat' : view_cat(); break; case 'bet' : place_bet(); break; case 'mybets' : view_bets(); break; } echo "</td></tr></table> <hr width = '800px'> ><span class = 'loader:casino.php' id = 'linkage'>Casino</span> <hr width = '800px'>"; } } function b_panel() { global $user; if($_SESSION['myid'] == '1' || $_SESSION['myid'] == '2') { echo "<p_title>Bookies panel</p_title><hr>"; if($_GET['type']=='add') { $_POST['team1'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team1']); $_POST['team2'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team2']); $_POST['gtype'] = preg_replace('/[^0-9]/', '', $_POST['gtype']); if(!in_array($_POST['gtype'], array(1,2,3,4,5,6,7))) { $_POST['gtype'] = 1; } $_POST['t1oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmax']); $_POST['t1oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmin']); $_POST['t2oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmax']); $_POST['t2oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmin']); $_POST['gmonth'] = preg_replace('/[^a-zA-Z]/', '', $_POST['gmonth']); $_POST['gday'] = preg_replace('/[^0-9]/', '', $_POST['gday']); $_POST['gyear'] = preg_replace('/[^0-9]/', '', $_POST['gyear']); $_POST['ghrs'] = preg_replace('/[^0-9]/', '', $_POST['ghrs']); $_POST['gmins'] = preg_replace('/[^0-9]/', '', $_POST['gmins']); if($_POST['team1']!='' && $_POST['team2']!='' && $_POST['t1oddsmax'] && $_POST['t1oddsmin'] && $_POST['t2oddsmax'] && $_POST['t2oddsmin'] && $_POST['gmonth'] && $_POST['gday'] && $_POST['gyear']) { $title = $_POST['team1']." VS ".$_POST['team2']; $odds1 = $_POST['t1oddsmax'].":".$_POST['t1oddsmin']; $odds2 = $_POST['t2oddsmax'].":".$_POST['t2oddsmin']; $ending=strtotime($_POST['gday']." ".$_POST['gmonth']." ".$_POST['gyear']." ".$_POST['ghrs']." hours ".$_POST['gmins']." minutes"); $cat_name = array('Football','Hockey','Baseball','Soccer','Boxing','Cricket','Basketball','All'); if(!$_GET['step']) { echo "Are you sure you wish to add the <b>".$cat_name[$_POST['gtype']-1]."</b> game(<b>".$title."</b>) with the following:<br> Team one: <b>".$_POST['team1']."[".$odds1."]</b> - Team two: <b>".$_POST['team2']."[".$odds2."]</b><br> End date: ".date('F j Y', $ending)." - ".date('g:i:s a', $ending)."<br> <form name = 'add-g' id = 'add-g'>"; foreach($_POST AS $key => $val) { echo "<input type = 'hidden' name = '".$key."' id = '".$key."' value = '".$val."'>"; } echo "<button class = 'submit:add-g:bookies.php?action=panel&type=add&step=1' id = 'linkage'>Confirm</button></form>"; } else { $odds = $odds1."-".$odds2; $sql = "INSERT INTO `bookie_games` VALUES('NULL', '".mysql_real_escape_string($title)."', '".mysql_real_escape_string($_POST['gtype'])."', '".mysql_real_escape_string($odds)."', '".mysql_real_escape_string($ending)."')"; mysql_query($sql); echo "You added the game successfully!"; } } else { echo warn("Error adding the game!"); } } else { if($_GET['type']=='results') { $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['score1'] = preg_replace('/[^0-9]/', '', $_POST['score1']); $_POST['score2'] = preg_replace('/[^0-9]/', '', $_POST['score2']); if($_GET['id'] && $_POST['score1'] && $_POST['score2']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $tg = mysql_fetch_array($sql); $odds = explode("-", $tg['bg_odds']); $teamn = explode(" VS ", $tg['bg_title']); $cat_name = array('Football','Hockey','Baseball','Soccer','Boxing','Cricket','Basketball','All'); $oddsone = explode(":", $odds[0]); $oddsmax[1] = $oddsone[0]; $oddsmin[1] = $oddsone[1]; $oddstwo = explode(":", $odds[1]); $oddsmax[2] = $oddstwo[0]; $oddsmin[2] = $oddstwo[1]; if($_POST['score1'] > $_POST['score2']) { $winner = 1; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { if($_POST['score2'] > $_POST['score1']) { $winner = 2; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { $winner = 0; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b>"; } } $sql = "SELECT * FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($_GET['id'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { while($gp = mysql_fetch_array($sql)) { if($gp['bb_team'] == $winner) { //they won $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; $msg = $teamn[$gp['bb_team']-1]." won the ".$cat_name[$gp['bb_team']-1]." game you bet on.<br> ".$scoring."<br> You bet ".money_alter($steaks+$scraps)."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."].<br> You have won ".money_alter($prize)."!"; in_event($gp['bb_user'], $msg); credit_money($gp['bb_user'], $prize); } else { //they lost $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; if($winner == '0') { $wintype = 'drawn'; } else { $wintype = 'lost'; } $msg = $teamn[$gp['bb_team']-1]." ".$wintype." the ".$cat_name[$gp['bb_team']-1]." game you bet on.<br> ".$scoring."<br> You bet ".money_alter($gp['bb_bet'])."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."].<br> You have lost ".money_alter($steaks); if($scraps) { $msg.=" and your ".money_alter($scraps)." was returned!"; credit_money($gp['bb_user'], $scraps); } in_event($gp['bb_user'], $msg); } } } $sql = "DELETE FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); $sql = "DELETE FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); echo "Game <b>\"".$tg['bg_title']."\"</b> ended successfully!"; } else { echo warn("Error ending the game!"); } } else { echo warn("Error ending the game!"); } } else { echo "<b>Add a game:</b><hr width = '650px'>"; echo "<form name = 'addg' id = 'addg'> <table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game teams:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <input type = 'text' style = 'width: 90px;' name = 'team1' id = 'team1'> <b>VS</b> <input type = 'text' style = 'width: 90px;' name = 'team2' id = 'team2'> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game type:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 'gtype' id = 'gtype'> <option value = '1'> Football </option> <option value = '2'> Hockey </option> <option value = '3'> Baseball </option> <option value = '4'> Soccer </option> <option value = '5'> Boxing </option> <option value = '6'> Cricket </option> <option value = '7'> Basketball </option> </select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team one odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't1oddsmax' id = 't1oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't1oddsmin' id = 't1oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team two odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't2oddsmax' id = 't2oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't2oddsmin' id = 't2oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8' valign = 'top'> <b>Date betting ends:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'>"; $year = date('o'); $day = date('d'); $month = date('F'); $months = array('january','february','march','april','may','june', 'july','august','september','october','november','december'); echo "<table><tr><td align = 'left' style = 'background: #E3E3E3;'><i>Date:</i> <select name = 'gmonth' id = 'gmonth'>"; for($i = 0; $i < count($months); $i++) { $selected = ''; if(ucfirst($months[$i]) == $month) { $selected = ' SELECTED'; } echo "<option value = '".$months[$i]."'".$selected."> ".ucfirst($months[$i])." </option>"; } echo "</select><b>/</b><select name = 'gday' id = 'gday'>"; for($i = 1; $i <=31; $i++) { $selected = ''; if($i == $day) { $selected = ' SELECTED'; } echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select><b>/</b><select name = 'gyear' id = 'gyear'>"; for($i = $year; $i <=$year+1; $i++) { echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select><br> <i>Time:</i> <select name = 'ghrs' id = 'ghrs'>"; for($i = 0; $i <=24; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select><b>:</b><select name = 'gmins' id = 'gmins'>"; for($i = 0; $i <=59; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select></td></tr></table> </td> </tr> <tr> <td align = 'center' bgcolor = '#b8b8b8' colspan = '3'> <button class = 'submit:addg:bookies.php?action=panel&type=add' id = 'linkage'>Add game</button> </td> </tr> </table> </form>"; echo "<hr width = '650px'><b>End a game:</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ended</b> </th> <th> <b>Post results</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '3'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { $teams = explode(" VS ", $eg['bg_title']); echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])."<br>".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <form name = 'score-".$num."' id = 'score-".$num."'> <i>".$teams[0]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score1' id = 'score1'><br> <i>".$teams[1]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score2' id = 'score2'><br> <button class = 'submit:score-".$num.":bookies.php?action=panel&type=results&id=".$eg['bg_id']."' id = 'linkage'>Confirm</button> </form> </td> </tr>"; $num++; } } echo "</table>"; echo "<hr width = '650px'><b>Games ending soon(12hrs or less):</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ending</b> </th> </tr>"; $time_soon = time()+43200; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string($time_soon)."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '2'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr bgcolor = '".stripe($num)."'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])." - ".date('g:i:s a', $eg['bg_time'])." </td> </tr>"; } } echo "</table>"; } } } else { echo "You really should not be here!"; } } function view_cat() { global $user; $_GET['cat_id'] = preg_replace('/[^0-9]/', '', $_GET['cat_id']); if(!in_array($_GET['cat_id'], array(1,2,3,4,5,6,7,8))) { echo warn("Invalid cat ID!"); } else { $cat_name = array('Football','Hockey','Baseball','Soccer','Boxing','Cricket','Basketball','All'); echo "<p_title>".ucfirst($cat_name[$_GET['cat_id']-1])." games</p_title><hr>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th colspan = '2'> <b>Game title</b> </th> <th style = 'text-align: center;'> <b>Date ending</b> </th> <th style = 'text-align: right;'> <b>Place bet(s)</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` > '".mysql_real_escape_string(time())."'"; if($_GET['cat_id'] < 8) { $sql.="AND `bg_type` = '".mysql_real_escape_string($_GET['cat_id'])."'"; } $sql.="ORDER BY `bg_time` ASC"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '4'><b>No ".ucfirst($cat_name[$_GET['cat_id']-1])." games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr> <td align = 'center' colspan = '4'> <form name = 'bet-".$num."' id = 'bet-".$num."'> <table width = '100%' cellspacing = '0'> <tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left' width = '50px'> <img src = 'images/css/casino/game-".$eg['bg_type'].".png'> </td> <td align = 'left'>"; $title_odds = explode(" VS ", $eg['bg_title']); $odds = explode("-", $eg['bg_odds']); echo "<b>".$title_odds[0]."[".$odds[0]."]</b> VS <b>".$title_odds[1]."[".$odds[1]."]</b><br> ".ucfirst($cat_name[$eg['bg_type']-1])." </td> <td align = 'center'> ".date('F j Y', $eg['bg_time'])."<br>".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <i>Team to win:</i><select name = 'team'> <option value = '1'> ".ucfirst($title_odds[0])." </option> <option value = '2'> ".ucfirst($title_odds[1])." </option> </select><br> <i>Bet:</i><input type = 'text' style = 'width: 50px;' value = '0' name = 'bet' id = 'bet'> </td> </tr> <tr bgcolor = '#000000' height = '30px'> <td colspan = '4' align = 'center'> <button class = 'submit:bet-".$num.":bookies.php?action=bet&id=".$eg['bg_id']."' id = 'linkage'>Place bet</button> </td> </tr> <tr> <td colspan = '4' height = '5px'> </td> </tr> </table> </form> </td> </tr>"; $num++; } } echo "</table>"; } } function place_bet() { global $user; echo "<p_title>Place bet</p_title><hr>"; $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['bet'] = preg_replace('/[^0-9]/', '', $_POST['bet']); $_POST['team'] = preg_replace('/[^0-9]/', '', $_POST['team']); if($_GET['id'] && $_POST['bet'] && $_POST['team']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { if($user['usr_money'] >= $_POST['bet']) { $bg = mysql_fetch_array($sql); $teamname = explode(" VS ", $bg['bg_title']); $teamname = $teamname[$_POST['team']-1]; $oddsmin = explode("-", $bg['bg_odds']); $odds = $oddsmin[$_POST['team']-1]; $oddsmin = explode(":", $oddsmin[$_POST['team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($_POST['bet']/$oddsmin); $betting*=$oddsmin; if(!$_GET['step']) { echo "You are betting <b>".money_alter($_POST['bet'])."</b>(".money_alter($betting)." effective) on team <b>".$teamname."</b> to win with the odds of [".$odds."]. <br>Are you sure you wish to place this bet?<br> <form name = 'bet-c' id = 'bet-c'> <input type = 'hidden' name = 'bet' id = 'bet' value = '".$_POST['bet']."'> <input type = 'hidden' name = 'team' id = 'team' value = '".$_POST['team']."'> <button class = 'submit:bet-c:bookies.php?action=bet&id=".$_GET['id']."&step=1' id = 'linkage'>Confirm bet</button> </form>"; } else { $sql = "INSERT INTO `bookie_bets` VALUES('NULL', '".mysql_real_escape_string($_SESSION['myid'])."', '".mysql_real_escape_string($_GET['id'])."', '".mysql_real_escape_string($_POST['team'])."', '".mysql_real_escape_string($_POST['bet'])."')"; mysql_query($sql); echo min_money($_POST['bet']); echo "Your bet has been placed for a total of <b>".money_alter($_POST['bet'])."</b>.<br> You can view your bets from the top of this page.<br> You will receive an event with the results shortly after the game has ended."; } } else { echo warn("You dont have enough money to make this bet!"); } } else { echo warn("This game does not exist!"); } } else { echo warn("This game does not exist!"); } } function view_bets() { global $user; echo "<p_title>Your bets</p_title><hr>"; echo "<table width = '100%' class = 'display-stripes'> <tr> <th colspan = '2'> Team betting on/Type </th> <th> Odds </th> <th> Ending date </th> <th> Total bet </th> </tr>"; $sql = "SELECT bb.*,bg.* FROM `bookie_bets` bb LEFT JOIN `bookie_games` bg ON bb.bb_game = bg.bg_id WHERE bb.bb_user = '".mysql_real_escape_string($_SESSION['myid'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $num = 0; $cat_name = array('Football','Hockey','Baseball','Soccer','Boxing','Cricket','Basketball','All'); while($mb = mysql_fetch_array($sql)) { $teamname = explode(" VS ", $mb['bg_title']); $teamname = $teamname[$mb['bb_team']-1]; $oddsmin = explode("-", $mb['bg_odds']); $odds = $oddsmin[$mb['bb_team']-1]; $oddsmin = explode(":", $oddsmin[$mb['bb_team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($mb['bb_bet']/$oddsmin); $betting*=$oddsmin; echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td width = '50px'> <img src = 'images/css/casino/game-".$mb['bg_type'].".png'> </td> <td> ".$teamname." - ".ucfirst($cat_name[$mb['bg_type']-1])." </td> <td> [".$odds."] </td> <td> ".date('F j Y', $mb['bg_time'])."<br>".date('g:i:s a', $mb['bg_time'])." </td> <td> ".money_alter($mb['bb_bet'])."(".money_alter($betting)." effective) </td> </tr>"; $num++; } } else { echo "<tr><td colspan = '5'>You have no bets at this time.</td></tr>"; } echo "</table>"; } ?> Quote Link to comment Share on other sites More sharing options...
Coly010 Posted July 7, 2015 Share Posted July 7, 2015 [MENTION=68406]-BRAIDZ-[/MENTION] I can't help without seeing the rest of how the engine is set up. put this at the top of the file just beneath <?php and tell me what comes up when you try load a game etc: error_reporting(E_ALL); ini_set('error_reporting', E_ALL); Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 [MENTION=68406]-BRAIDZ-[/MENTION] I can't help without seeing the rest of how the engine is set up. put this at the top of the file just beneath <?php and tell me what comes up when you try load a game etc: error_reporting(E_ALL); ini_set('error_reporting', E_ALL); No errors Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 (edited) [MENTION=68406]-BRAIDZ-[/MENTION] I can't help without seeing the rest of how the engine is set up. put this at the top of the file just beneath <?php and tell me what comes up when you try load a game etc: error_reporting(E_ALL); ini_set('error_reporting', E_ALL); function file.. <?php session_start(); if(!$_SESSION['playerid'] || $_SESSION['playerid']<='0') { header('location:home.php'); } if($_SESSION['playerid'] != 1) { ini_set('display_errors', 0); } if(strpos($_SERVER['REQUEST_URI'] , "http://")) { session_unset(); session_destroy(); header("Location:home.php"); } $q_ry = "SELECT `last_hit_IP`,`my_traveltime`,`my_city`,`force_off` FROM `members` WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; $ci = mysql_fetch_array(mysql_query($q_ry)); if($ci['my_traveltime'] > time() && $_SERVER['SCRIPT_NAME'] != "/travelling.php" && $_SERVER['SCRIPT_NAME'] != "/netbook.php" || $ci['my_city'] > '0' && $_SERVER['SCRIPT_NAME'] != "/travelling.php" && $_SERVER['SCRIPT_NAME'] != "/netbook.php") { header('location:travelling.php'); } if($ci['force_off'] > '0') { session_unset(); session_destroy(); header("Location:home.php"); } if($_SERVER['SCRIPT_NAME'] != "/city.php") { $_SESSION['refreshes'] = 0; } if(isset($_SESSION['HTTP_USER_AGENT'])) { if($_SESSION['HTTP_USER_AGENT'] != md5($_SERVER['HTTP_USER_AGENT'])) { session_unset(); session_destroy(); header("Location:home.php"); } } else { $_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']); } $q_ry = "SELECT `fj_time` FROM `fed_jailed` WHERE `fj_playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; $injail = mysql_query($q_ry); if(mysql_num_rows($injail) && $_SERVER['SCRIPT_NAME'] != "/fedjail.php") { $fj = mysql_fetch_array($injail); if(($fj['fj_time']-time()) >= '0') { header('location:fedjail.php'); exit(); die(); } } function new_token() { $_SESSION['token'] = md5(uniqid(rand(), TRUE)); } mysql_query("UPDATE `members_extra` SET `my_crimeexp` = '0' WHERE `my_crimeexp` < '0'"); mysql_query("UPDATE `members` SET `my_life` = `my_maxlife`, `my_hosp` = '0' WHERE `my_hosp` > '".mysql_real_escape_string(time())."' AND `am_i_staff` = '0' || `my_hosp` > '".mysql_real_escape_string(time())."' AND `playerid` = '1'"); mysql_query("UPDATE `members` SET `laston` = '".time()."', `last_hit_IP` = '".mysql_real_escape_string($_SERVER['REMOTE_ADDR'])."' WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"); function errors_($err) { $error = array('user'=>'Invalid User!', 'qty'=>'Invalid quantity in your items!', 'XID'=>'Invalid ID!', 'jail'=>'Sorry, This page cannot be accessed while in jail.', 'hosp'=>'Sorry, This page cannot be accessed while in hospital.', 'jailorhosp'=>'Sorry, This page cannot be accessed while in jail or hospital.', 'shop'=>'Looks like you have walked into a closed down shop!', 'action'=>'Invalid action.'); return $error[$err]; } function page_access($jailtime, $hosptime) { $jailtime = abs(intval($jailtime)); $hosptime = abs(intval($hosptime)); if($jailtime AND !$hosptime) { if($jailtime > time()) return FALSE; else return TRUE; } else if(!$jailtime AND $hosptime) { if($hosptime > time()) return FALSE; else return TRUE; } else if($jailtime AND $hosptime) { if($jailtime || $hosptime > time()) return "FALSE"; else return "TRUE"; } else { return TRUE; } } function money_alter($mon) { if($mon < 0) { return "<font color=#FF0000>\$".number_format($mon)."</font>"; } else { return "\$".number_format($mon).""; } } function valid_form($lasturl, $ext) { $urltocheck = "http://www.ruthlesscity.com/".($ext).".php"; if($lasturl != $urltocheck) return FALSE; else return TRUE; } function check_qty($player, $item, $qty, $xid) { $player = abs(intval($player)); $item = abs(intval($item)); $qty = abs(intval($qty)); $xid = abs(intval($xid)); if($xid==0) { $cq = array(); $q_ry = array(); $q_ry = "SELECT * FROM `members_items` WHERE `it_playerid` = '".mysql_real_escape_string($player)."' AND `it_itemid` = '".mysql_real_escape_string($item)."' AND `it_qty` >= '".mysql_real_escape_string($qty)."'"; $cq = mysql_query($q_ry); } else { $cq = array(); $q_ry = array(); $q_ry = "SELECT * FROM `members_items` WHERE `it_playerid` = '".mysql_real_escape_string($player)."' AND `it_qty` >= '".mysql_real_escape_string($qty)."' AND `it_ID` = '".mysql_real_escape_string($xid)."'"; $cq = mysql_query($q_ry); } $cq = mysql_num_rows($cq) ? mysql_num_rows($cq) : ''; if(!$cq) { return "FALSE"; } else { return "TRUE"; } } function mkglobal($vars) { if (!is_array($vars)) $vars = explode(":", $vars); foreach ($vars as $v) { if (isset($_GET[$v])) $GLOBALS[$v] = ($_GET[$v]); elseif (isset($_POST[$v])) $GLOBALS[$v] = ($_POST[$v]); else return 0; } return 1; } function add_clips($player, $gun, $qty) { $player = abs(intval($player)); $item = abs(intval($item)); $qty = abs(intval($qty)); $q_ry = array(); $q_ry = "SELECT * FROM `members_ammo` WHERE `ma_playerid` = '".mysql_real_escape_string($player)."' AND `ma_gun` = '".mysql_real_escape_string($gun)."'"; $ic = array(); $ic = mysql_query($q_ry); if(mysql_num_rows($ic)) { $p = array(); $p = mysql_fetch_array($ic); mysql_query("UPDATE `members_ammo` SET `ma_clips` = `ma_clips` + '".mysql_real_escape_string($qty)."' WHERE `ma_id` = '".mysql_real_escape_string($p['ma_id'])."'"); } else { mysql_query("INSERT INTO `members_ammo` VALUES ('NULL', '".mysql_real_escape_string($player)."', '".mysql_real_escape_string($gun)."', '".mysql_real_escape_string($qty)."', '0')"); } } function use_clips($player, $gun, $qty) { $player = abs(intval($player)); $gun = abs(intval($gun)); $q_ry = array(); $q_ry = "SELECT `ma_loaded` FROM `members_ammo` WHERE `ma_gun` = '".mysql_real_escape_string($gun)."' AND `ma_playerid` = '".mysql_real_escape_string($player)."'"; $per = array(); $per = mysql_query($q_ry); $p = array(); $p = mysql_fetch_array($per); if($p['ma_loaded'] <= $qty) { $q_ry = array(); $q_ry = "UPDATE `members_ammo` SET `ma_loaded` = '0' WHERE `ma_playerid` = '".mysql_real_escape_string($player)."' AND `ma_gun` = '".mysql_real_escape_string($gun)."'"; mysql_query($q_ry); } else { $q_ry = array(); $q_ry = "UPDATE `members_ammo` SET `ma_loaded` = `ma_loaded` - '".mysql_real_escape_string($qty)."' WHERE `ma_playerid` = '".mysql_real_escape_string($player)."' AND `ma_gun` = '".mysql_real_escape_string($gun)."'"; mysql_query($q_ry); } $q_ry = array(); $q_ry = "DELETE FROM `members_ammo` WHERE `ma_clips` <= '0' AND `ma_loaded` <= '0'"; mysql_query($q_ry); stock_remove(3,1); } function reload_gun($player, $gun) { $player = abs(intval($player)); $gun = abs(intval($gun)); $q_ry = array(); $q_ry = "SELECT `a_perclip` FROM `ammo` WHERE `a_gun` = '".mysql_real_escape_string($gun)."'"; $per = array(); $per = mysql_query($q_ry); $p = array(); $p = mysql_fetch_array($per); $q_ry = array(); $q_ry = "UPDATE `members_ammo` SET `ma_loaded` = '".mysql_real_escape_string($p['a_perclip'])."', `ma_clips` = `ma_clips` - '1' WHERE `ma_playerid` = '".mysql_real_escape_string($player)."' AND `ma_gun` = '".mysql_real_escape_string($gun)."'"; mysql_query($q_ry); $q_ry = array(); $q_ry = "DELETE FROM `members_ammo` WHERE `ma_clips` <= '0' AND `ma_loaded` <= '0'"; mysql_query($q_ry); } function i_credit($player, $item, $qty) { $player = abs(intval($player)); $item = abs(intval($item)); $qty = abs(intval($qty)); $ic = array(); $q_ry = array(); $p = array(); $q_ry = "SELECT * FROM `members_items` WHERE `it_playerid` = '".mysql_real_escape_string($player)."' AND `it_itemid` = '".mysql_real_escape_string($item)."'"; $ic = mysql_query($q_ry); if(mysql_num_rows($ic)) { $p = mysql_fetch_array($ic); mysql_query("UPDATE `members_items` SET `it_qty` = `it_qty` + '".mysql_real_escape_string($qty)."' WHERE `it_ID` = '".mysql_real_escape_string($p['it_ID'])."'"); } else { mysql_query("INSERT INTO `members_items` VALUES ('NULL', '".mysql_real_escape_string($player)."', '".mysql_real_escape_string($item)."', '".mysql_real_escape_string($qty)."')"); } } function i_remove($player, $item, $qty) { $player = abs(intval($player)); $item = abs(intval($item)); $qty = abs(intval($qty)); $ir = array(); $q_ry = array(); $p = array(); $q_ry = "SELECT * FROM `members_items` WHERE `it_playerid` = '".mysql_real_escape_string($player)."' AND `it_itemid` = '".mysql_real_escape_string($item)."' AND `it_qty` > '".mysql_real_escape_string($qty)."'"; $ir=mysql_query($q_ry); if(mysql_num_rows($ir)) { $p = mysql_fetch_array($ir); mysql_query("UPDATE `members_items` SET `it_qty` = `it_qty` - '".mysql_real_escape_string($qty)."' WHERE `it_ID` = '".mysql_real_escape_string($p['it_ID'])."'"); } else { mysql_query("DELETE FROM `members_items` WHERE `it_playerid` = '".mysql_real_escape_string($player)."' AND `it_itemid` = '".mysql_real_escape_string($item)."'"); } } function i_fac_add($faction, $item, $qty) { $faction = abs(intval($faction)); $item = abs(intval($item)); $qty = abs(intval($qty)); $ir = array(); $q_ry = array(); $p = array(); $q_ry = "SELECT * FROM `faction_armouries` WHERE `fa_fac` = '".mysql_real_escape_string($faction)."' AND `fa_item` = '".mysql_real_escape_string($item)."'"; $ir = mysql_query($q_ry); if(mysql_num_rows($ir)) { $p = mysql_fetch_array($ir); mysql_query("UPDATE `faction_armouries` SET `fa_qty` = `fa_qty` + '".mysql_real_escape_string($qty)."' WHERE `fa_id` = '".mysql_real_escape_string($p['fa_id'])."'"); } else { mysql_query("INSERT INTO `faction_armouries` VALUES ('NULL', '".mysql_real_escape_string($faction)."', '".mysql_real_escape_string($item)."', '".mysql_real_escape_string($qty)."')"); } } function i_fac_remove($faction, $item, $qty) { $faction = abs(intval($faction)); $item = abs(intval($item)); $qty = abs(intval($qty)); $ir = array(); $q_ry = array(); $p = array(); $q_ry = "SELECT * FROM `faction_armouries` WHERE `fa_fac` = '".mysql_real_escape_string($faction)."' AND `fa_item` = '".mysql_real_escape_string($item)."' AND `fa_qty` > '".mysql_real_escape_string($qty)."'"; $ir = mysql_query($q_ry); if(mysql_num_rows($ir)) { $p = mysql_fetch_array($ir); mysql_query("UPDATE `faction_armouries` SET `fa_qty` = `fa_qty` - '".mysql_real_escape_string($qty)."' WHERE `fa_id` = '".mysql_real_escape_string($p['fa_id'])."'"); } else { mysql_query("DELETE FROM `faction_armouries` WHERE `fa_fac` = '".mysql_real_escape_string($faction)."' AND `fa_item` = '".mysql_real_escape_string($item)."'"); } } function add_fac_lend($faction, $item, $user) { $faction = abs(intval($faction)); $item = abs(intval($item)); $user = abs(intval($user)); $q_ry = array(); $q_ry = "INSERT INTO `faction_lends` VALUES ('NULL', '".mysql_real_escape_string($faction)."', '".mysql_real_escape_string($item)."', '".mysql_real_escape_string($user)."', unix_timestamp(), '0')"; mysql_query($q_ry); } function remove_fac_lend($id) { $id = abs(intval($id)); $q_ry = array(); $q_ry = "SELECT `fl_itemid`,`fl_playerid`,`fl_equipped` FROM `faction_lends` WHERE `fl_id` = '".mysql_real_escape_string($id)."'"; $lend_stat = array(); $lend_stat = mysql_query($q_ry); $ls = array(); $ls = mysql_fetch_array($lend_stat); if($ls['fl_equipped']!='0') { $q_ry = array(); $q_ry = "SELECT `item_class` FROM `items` WHERE `item_id` = '".mysql_real_escape_string($ls['fl_itemid'])."'"; $i_claass = array(); $i_class = mysql_fetch_array(mysql_query($q_ry)); $type = array(1=>'melee',2=>'secondary',3=>'primary',5=>'armour'); $q_ry = array(); $q_ry = "UPDATE `member_equipped` SET `".$type[$i_class['item_class']]."` = '0' WHERE `playerid` = '".mysql_real_escape_string($ls['fl_playerid'])."'"; mysql_query($q_ry); $q_ry = array(); $q_ry = "DELETE FROM `faction_lends` WHERE `fl_id` = '".mysql_real_escape_string($id)."'"; mysql_query($q_ry); } else { $q_ry = array(); $q_ry = "DELETE FROM `faction_lends` WHERE `fl_id` = '".mysql_real_escape_string($id)."'"; mysql_query($q_ry); } } function valid_XID($xid) { $xid = abs(intval($xid)); $xid = (isset($xid) ? $xid : ''); if(!$xid) { return FALSE; } else { return TRUE; } } function valid_PID($pid) { $pid = abs(intval($pid)); $pid = (isset($pid) ? $pid : ''); if(!$pid) { return FALSE; } else { return TRUE; } } function in_event($player, $text) { $player = abs(intval($player)); $text = stripslashes($text); mysql_query("INSERT INTO `member_events` VALUES('NULL', '".mysql_real_escape_string($player)."', '".mysql_real_escape_string($text)."', unix_timestamp(), '0')"); mysql_query("UPDATE `city_statistic` SET `cs_value` = `cs_value` + '1' WHERE `cs_id` = '1'"); } function in_notif($player, $text) { $player = abs(intval($player)); $text = stripslashes($text); mysql_query("INSERT INTO `member_notifs` VALUES('NULL', '".mysql_real_escape_string($player)."', '".mysql_real_escape_string($text)."', unix_timestamp(), '0')"); } function fac_event($faction, $text) { $faction = abs(intval($faction)); $text = stripslashes($text); mysql_query("INSERT INTO `faction_events` VALUES('NULL', '".mysql_real_escape_string($faction)."', '".mysql_real_escape_string($text)."', unix_timestamp())"); } function org_log($faction, $text, $gain, $cash, $stat) { $faction = abs(intval($faction)); $text = stripslashes($text); $gain = abs(intval($gain)); $cash = abs(intval($cash)); $stat = stripslashes($stat); mysql_query("INSERT INTO `org_logs` VALUES('NULL', '".mysql_real_escape_string($faction)."', '".mysql_real_escape_string($text)."', '".mysql_real_escape_string($gain)."', '".mysql_real_escape_string($cash)."', '".mysql_real_escape_string($stat)."', unix_timestamp())"); } function user_name($player) { $player = abs(intval($player)); $ch = array(); $q_ry = array(); $q_ry = "SELECT `playername`,`my_dondays`,`am_i_staff` FROM `members` WHERE `playerid` = '".mysql_real_escape_string($player)."'"; $ch = mysql_query($q_ry); if(!mysql_num_rows($ch)) { $name = "None"; } else { $c = mysql_fetch_array($ch); if($c['my_dondays']) { $name = "<font color = 'blue'><b>".htmlentities($c['playername'])."</b></font>[".$player."]"; } else { if($c['am_i_staff'] < 2) { $name.= htmlentities($c['playername'])."</a>[".$player."]"; } else if($c['am_i_staff'] == 2) { $name.= "<b><font color=#660099>".htmlentities($c['playername'])."</font></b></a>[".$player."]"; } else if($c['am_i_staff'] == 3) { $name.= "<b><font color=#0085A3>".htmlentities($c['playername'])."</font></b></a>[".$player."]"; } else if($c['am_i_staff'] == 4) { $name.= "<b><font color=#006633>".htmlentities($c['playername'])."</font></b></a>[".$player."]"; } else if($c['am_i_staff'] == 5) { $name.= "<b><font color=#AA0000>".htmlentities($c['playername'])."</font></b></a>[".$player."]"; } } } return $name; } function user_name_icons($player) { $player = abs(intval($player)); $ch = array(); $q_ry = array(); $q_ry = "SELECT `playername`,`my_dondays`,`my_jail`,`my_hosp`,`my_gender`,`am_i_staff` FROM `members` WHERE `playerid` = '".mysql_real_escape_string($player)."'"; $ch = mysql_query($q_ry); if(!mysql_num_rows($ch)) { $name = "None"; } else { $name = "<a href='profile.php?XID=".$player."'>"; $c = mysql_fetch_array($ch); if($c['my_dondays'] && $c['am_i_staff'] < 2) { $name.= "<font color = 'blue'><b>".htmlentities($c['playername'])."</b></font></a>[".$player."]"; } else { if($c['am_i_staff'] < 2) { $name.= htmlentities($c['playername'])."</a>[".$player."]"; } else if($c['am_i_staff'] == 2) { $name.= "<b><font color=#660099>".htmlentities($c['playername'])."</font></b></a>[".$player."]"; } else if($c['am_i_staff'] == 3) { $name.= "<b><font color=#0085A3>".htmlentities($c['playername'])."</font></b></a>[".$player."]"; } else if($c['am_i_staff'] == 4) { $name.= "<b><font color=#006633>".htmlentities($c['playername'])."</font></b></a>[".$player."]"; } else if($c['am_i_staff'] == 5) { $name.= "<b><font color=#AA0000>".htmlentities($c['playername'])."</font></b></a>[".$player."]"; } } $name.= "<img src='images/".$c['my_gender'].".gif' border = '0'>"; if($c['my_dondays']) { $name.= "<img src = 'images/donator.gif' border = '0'>"; } if($c['my_jail'] > time()) { $name.= "<img src = 'images/jail.png' border = '0'>"; } if($c['my_hosp'] > time()) { $name.= "<img src = 'images/hospital.png' border = '0'>"; } } return $name; } function getdogname($dog) { $dog = abs(intval($dog)); $ch = array(); $q_ry = array(); $q_ry = "SELECT `md_name` FROM `members_dogs` WHERE `md_id` = '".mysql_real_escape_string($dog)."'"; $ch = mysql_query($q_ry); if(!mysql_num_rows($ch)) { return "None"; } else { $c = mysql_fetch_array($ch); return htmlentities($c['md_name']); } } function getdogwins($dog) { $dog = abs(intval($dog)); $ch = array(); $q_ry = array(); $q_ry = "SELECT `md_raceswon` FROM `members_dogs` WHERE `md_id` = '".mysql_real_escape_string($dog)."'"; $ch = mysql_query($q_ry); if(!mysql_num_rows($ch)) { return "None"; } else { $c = mysql_fetch_array($ch); return number_format($c['md_raceswon']); } } function check_player($player) { $player = abs(intval($player)); $ch = array(); $q_ry = array(); $q_ry = "SELECT `playerid` FROM `members` WHERE `playerid` = '".mysql_real_escape_string($player)."'"; $ch = mysql_query($q_ry); if(!mysql_num_rows($ch)) { return FALSE; } else { return TRUE; } } function exp_level($lev) { $need = (($lev*100)*($lev)*($lev/2)); return $need; } function check_rank($myrank, $totexp, $player) { $totexp = abs(intval($totexp)); for($i = 2; $i <= 30; $i++) { if($i == 2) { if($totexp >= 300) { if($i > $myrank) { $q_ry = array(); $q_ry = "UPDATE `members` SET `my_rank` = '".mysql_real_escape_string($i)."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); in_event($player, 'Congratulations, You have ranked up to rank '.$i.'!'); } } } else { if($totexp >= (($i*200)*$i*$i)) { if($i > $myrank) { $q_ry = array(); $q_ry = "UPDATE `members` SET `my_rank` = '".mysql_real_escape_string($i)."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); in_event($player, 'Congratulations, You have ranked up to rank '.$i.'!'); } } } } } function check_graft_bar($crimeexp, $curgraft, $player) { $crimeexp = abs(intval($crimeexp)); $curgraft = abs(intval($curgraft)); $newgraft = 10; $poss = array(1=>5000,2=>25000,3=>75000,4=>200000,5=>500000,6=>1750000); $calc = array(5000=>15,25000=>20,75000=>25,200000=>30,500000=>35,1750000=>40); for($i = 1; $i<=6; $i++) { if($crimeexp >= $poss[$i]) { $newgraft = $calc[$poss[$i]]; } else { $newgraft = $newgraft; } } $q_ry = array(); $q_ry = "SELECT `ms_times` FROM `member_merit_spent` WHERE `ms_playerid` = '".mysql_real_escape_string($player)."' AND `ms_tier` = '1'"; $graftgrade = array(); $graftgrade = mysql_query($q_ry); if(mysql_num_rows($graftgrade)) { $gg = array(); $gg = mysql_fetch_array($graftgrade); $newgraft+=$gg['ms_times']; } if($newgraft != $curgraft) { $q_ry = array(); $q_ry = "UPDATE `members` SET `my_maxnerve` = '".mysql_real_escape_string($newgraft)."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); } } function getgmt() { return date("Y-m-d H:i:s"); } function gmtime() { return strtotime(getgmt()); } function sqltounix($s) { return mktime(substr($s, 11, 2), substr($s, 14, 2), substr($s, 17, 2), substr($s, 5, 2), substr($s, 8, 2), substr($s, 0, 4)); } function gettimeleft($tl) { if($tl <= time()) { $release = "0 Seconds"; } else { $mins = floor(($tl - time()) / 60); $hours = floor($mins / 60); $mins -= $hours * 60; $days = floor($hours / 24); $hours -= $days * 24; $months = floor($days / 31); $days -= $months * 31; $weeks = floor($days / 7); $days -= $weeks * 7; $timeleft = ($tl - time()); $secs = round($timeleft%60); if ($months > 0)//MONTHS { $release .= " $months Month" . ($months > 1 ? "s" : ""); } if ($weeks > 0)//WEEKS { if ($months > 0) { $release .= ","; } $release .= " $weeks Week" . ($weeks > 1 ? "s" : ""); } if ($days > 0)//DAYS { if ($months > 0 ||$weeks > 0) { $release .= ","; } $release .= " $days Day" . ($days > 1 ? "s" : ""); } if ($hours > 0)//HOURS { if ($months > 0 ||$weeks > 0 || $days > 0) { $release .= ","; } $release .= " $hours Hour" . ($hours > 1 ? "s" : ""); } if ($mins > 0)//MINUTES { if ($months > 0 ||$weeks > 0 || $days > 0 || $hours > 0) { $release .= ","; } $release .= " $mins Minute" . ($mins > 1 ? "s" : ""); } if($secs > 0)//SECONDS { if($release != "") { $release .= " and"; } $release .= " $secs Second" . ($secs > 1 ? "s" : ""); } } return $release; } function end_war($att,$def) { $att = abs(intval($att)); $def = abs(intval($def)); $q_ry = array(); $q_ry = "SELECT * FROM `faction_wars` WHERE `war_attacker` = '".mysql_real_escape_string($att)."' && `war_defender` = '".mysql_real_escape_string($def)."' || `war_attacker` = '".mysql_real_escape_string($def)."' && `war_defender` = '".mysql_real_escape_string($att)."'"; $in_war = array(); $in_war = mysql_fetch_array(mysql_query($q_ry)); $q_ry = array(); $q_ry = "SELECT `fac_name` FROM `faction_s` WHERE `fac_id` = '".mysql_real_escape_string($att)."'"; $attackers = array(); $attackers = mysql_fetch_array(mysql_query($q_ry)); $q_ry = array(); $q_ry = "SELECT `fac_name` FROM `faction_s` WHERE `fac_id` = '".mysql_real_escape_string($def)."'"; $defenders = array(); $defenders = mysql_fetch_array(mysql_query($q_ry)); if($in_war['war_amade'] > $in_war['war_dmade']) { $message = "<font color = 'green'>The war between you and ".htmlentities($defenders['fac_name'])." has now ended, You won!</font>"; fac_event($att, $message); $message = "<font color = 'red'>The war between you and ".htmlentities($attackers['fac_name'])." has now ended, You lost!</font>"; fac_event($def, $message); } else { $message = "<font color = 'red'>The war between you and ".htmlentities($defenders['fac_name'])." has now ended, You lost!</font>"; fac_event($att, $message); $message = "<font color = 'green'>The war between you and ".htmlentities($attackers['fac_name'])." has now ended, You won!</font>"; fac_event($def, $message); } $q_ry = array(); $q_ry = "DELETE FROM `faction_wars` WHERE `war_id` = '".mysql_real_escape_string($in_war['war_id'])."'"; mysql_query($q_ry); add_pact($att,$def); } function end_war_time($att,$def, $id) { $att = abs(intval($att)); $def = abs(intval($def)); $id = abs(intval($id)); $q_ry = array(); $q_ry = "SELECT `fac_name` FROM `faction_s` WHERE `fac_id` = '".mysql_real_escape_string($att)."'"; $attackers = array(); $attackers = mysql_fetch_array(mysql_query($q_ry)); $q_ry = array(); $q_ry = "SELECT `fac_name` FROM `faction_s` WHERE `fac_id` = '".mysql_real_escape_string($def)."'"; $defenders = array(); $defenders = mysql_fetch_array(mysql_query($q_ry)); $message = "The war between you and ".htmlentities($defenders['fac_name'])." has now ended, Nobody won!"; fac_event($att, $message); $message = "The war between you and ".htmlentities($attackers['fac_name'])." has now ended, Nobody won!"; fac_event($def, $message); $q_ry = array(); $q_ry = "DELETE FROM `faction_wars` WHERE `war_id` = '".mysql_real_escape_string($id)."'"; mysql_query($q_ry); } function start_war($att,$def) { $att = abs(intval($att)); $def = abs(intval($def)); $q_ry = array(); $q_ry = "INSERT INTO `faction_wars` (`war_attacker`,`war_defender`,`war_time`) VALUES ('".mysql_real_escape_string($att)."', '".mysql_real_escape_string($def)."', '".mysql_real_escape_string(time()+604800)."')"; mysql_query($q_ry); } function add_pact($att,$def) { $att = abs(intval($att)); $def = abs(intval($def)); $q_ry = array(); $q_ry = "INSERT INTO `none_agressive` (`na_faction`,`na_pactwith`,`na_days`) VALUES ('".mysql_real_escape_string($att)."', '".mysql_real_escape_string($def)."', '50')"; mysql_query($q_ry); } function p_stats_add($field, $amount, $player) { $amount = abs(intval($amount)); $player = abs(intval($player)); $fld = array('attack_lost'=>'my_attlost','attack_won'=>'my_attwon','stale'=>'my_attstale','i_run'=>'my_timesran', 'i_defend'=>'my_defwon','i_dont_defend'=>'my_deflost','they_ran'=>'my_theyran','def_stale'=>'my_defstale', 'streak'=>'my_currstreak','i_hit'=>'my_hits','i_missed'=>'my_misses','one_hit'=>'my_onehitkill', 'fired'=>'my_rounds','mugged'=>'my_muggain','damage'=>'my_totaldamage','respect'=>'my_respectgain', 'high_level'=>'my_bestlevel','itemarket'=>'my_ifrommarket','bars_bought'=>'my_pointsbought', 'bars_sold'=>'my_pointssold','gunsrfun'=>'my_igunshop','send_item'=>'my_isent','trades'=>'my_trades', 'bailed'=>'my_timesbailed','spent_bail'=>'my_bailfees','busted'=>'my_timesbusted', 'failed_bust'=>'my_failedbusts','jailed'=>'my_timesjailed','medical'=>'my_medsused', 'mail'=>'my_mailsent','mail_spouse'=>'my_mailspouse','mail_faction'=>'my_mailfaction', 'mail_comp'=>'my_mailcolleage','merits_bought'=>'my_meritsbought','refills'=>'my_refills', 'trained'=>'my_trains','r_recieved'=>'my_beenrevived','r_revived'=>'my_revived','b_placed'=>'my_bounties', 'b_spent'=>'my_bountyspent','b_collect'=>'my_collected','b_rewarded'=>'my_rewarded', 'b_recieved'=>'my_bountyrecieved','personal'=>'my_personals','classified'=>'my_classified', 'mail_friend'=>'my_mailfriend','auctionadd'=>'my_iauctioned','auctionwon'=>'my_auctionwon', 'i_found'=>'my_ifound','crit_hits'=>'my_crithits', 'tot_invest'=>'my_totinvested','tot_profit'=>'my_totprofit','enhancers'=>'my_statenhance' ,'druguse'=>'my_drugsused','overdose'=>'my_overdoses','viruses'=>'my_viruses', 'stealth'=>'my_stealths','timesabroad'=>'my_traveled'); if($fld[$field] == 'my_mailsent') { $q_ry = array(); $q_ry = "UPDATE `city_statistic` SET `cs_value` = (`cs_value` + '1') WHERE `cs_id` = '2'"; mysql_query($q_ry); } if($fld[$field] == 'my_currstreak') { $q_ry = array(); $q_ry = "SELECT `my_currstreak`,`my_beststreak` FROM `members_personal` WHERE `playerid` = '".mysql_real_escape_string($player)."'"; $my_best = array(); $my_best = mysql_fetch_array(mysql_query($q_ry)); if($my_best['my_beststreak'] <= ($my_best['my_currstreak']+1)) { $q_ry = array(); $q_ry = "UPDATE `members_personal` SET `my_beststreak` = (`my_currstreak` + '1') WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); } } if($fld[$field] == 'my_totaldamage') { $q_ry = array(); $q_ry = "SELECT `my_bestdamage` FROM `members_personal` WHERE `playerid` = '".mysql_real_escape_string($player)."'"; $my_best = array(); $my_best = mysql_fetch_array(mysql_query($q_ry)); if($my_best['my_bestdamage'] <= $amount) { $q_ry = array(); $q_ry = "UPDATE `members_personal` SET `my_bestdamage` = '".mysql_real_escape_string($amount)."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); } } if($fld[$field] == 'my_bestlevel') { $q_ry = array(); $q_ry = "SELECT `my_bestlevel` FROM `members_personal` WHERE `playerid` = '".mysql_real_escape_string($player)."'"; $my_best = array(); $my_best = mysql_fetch_array(mysql_query($q_ry)); if($my_best['my_bestlevel'] <= $amount) { $q_ry = array(); $q_ry = "UPDATE `members_personal` SET `my_bestlevel` = '".mysql_real_escape_string($amount)."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); } } else { $q_ry = array(); $q_ry = "UPDATE `members_personal` SET ".$fld[$field]." = ".$fld[$field]." + '".mysql_real_escape_string($amount)."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); } } function reset_streak($player) { $q_ry = array(); $q_ry = "UPDATE `members_personal` SET `my_currstreak` = '0' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); } function check_bounty($player,$target) { $q_ry = array(); $q_ry = "SELECT * FROM `active_claims` WHERE `c_playerid` = '".mysql_real_escape_string($player)."' AND `c_target` = '".mysql_real_escape_string($target)."'"; $check = array(); $check = mysql_query($q_ry); if(mysql_num_rows($check)) { $c = array(); $c = mysql_fetch_array($check); $q_ry = array(); $q_ry = "SELECT m.playername,b.* FROM `members` m LEFT JOIN `bounties_placed` b ON b.b_target = m.playerid WHERE b.b_id = '".mysql_real_escape_string($c['c_claiming'])."'"; $the_bounty = array(); $the_bounty = mysql_query($q_ry); $outcome = ''; if(!mysql_num_rows($the_bounty)) { $outcome = "Sorry but it looks like the bounty you was tryin to claim has already been taken by someone else."; } else { $tb = array(); $tb = mysql_fetch_array($the_bounty); $outcome = "You have claimed the bounty that was on ".htmlentities($tb['playername'])."'s head, You have recieved ".money_alter($tb['b_reward'])."!"; $q_ry = array(); $q_ry = "UPDATE `members` SET `wallet` = `wallet` + '".mysql_real_escape_string($tb['b_reward'])."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); p_stats_add('b_collect', 1, $_SESSION['playerid']); p_stats_add('b_rewarded', $tb['b_reward'], $_SESSION['playerid']); $q_ry = array(); $q_ry = "SELECT `playername` FROM `members` WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; $claimer = array(); $claimer = mysql_fetch_array(mysql_query($q_ry)); $message = "<a href='profile.php?XID=".$_SESSION['playerid']."'>" . htmlentities($claimer['playername']) . "</a> claimed the bounty that was on ".htmlentities($tb['playername'])."'s head, They have recieved the ".money_alter($tb['b_reward'])." reward!"; in_event($tb['b_playerid'], $message); } $q_ry = array(); $q_ry = "DELETE FROM `active_claims` WHERE `c_id` = '".mysql_real_escape_string($c['c_id'])."'"; mysql_query($q_ry); $q_ry = array(); $q_ry = "DELETE FROM `bounties_placed` WHERE `b_id` = '".mysql_real_escape_string($c['c_claiming'])."'"; mysql_query($q_ry); return $outcome; } else { return ""; } } function stock_credit($id, $credit) { $q_ry = array(); $q_ry = "UPDATE `stock_market` SET `s_profit` = `s_profit` + '".mysql_real_escape_string($credit)."' WHERE `s_id` = '".mysql_real_escape_string($id)."'"; mysql_query($q_ry); } function stock_remove($id, $credit) { $q_ry = array(); $q_ry = "UPDATE `stock_market` SET `s_losses` = `s_losses` + '".mysql_real_escape_string($credit)."' WHERE `s_id` = '".mysql_real_escape_string($id)."'"; mysql_query($q_ry) or die(mysql_error()); } function add_ruthless($have, $max, $amount, $player) { $have = abs(intval($have)); $max = abs(intval($max)); $amount = abs(intval($amount)); $player = abs(intval($player)); $q_ry = array(); $q_ry = "UPDATE `members` SET `my_respect` = `my_respect` + '".mysql_real_escape_string($amount)."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); if(($have + $amount) >= $max) { $q_ry = array(); $q_ry= "UPDATE `members` SET `my_energy` = `my_maxenergy` + '100', `my_happy` = `my_maxhappy` * 2, `my_nerve` = `my_maxnerve` * 2, `my_maxrespect` = '".mysql_real_escape_string($max*2)."' WHERE `playerid` = '".mysql_real_escape_string($player)."'"; mysql_query($q_ry); in_event($player, 'You are ruthless!!! <br/> Here is a boost to your energy, graft and happy. Use it quick before it runs out.'); } } function send_recieve_log($type, $player, $playerip, $reciever, $text) { $text = trim($text); $q_ry = array(); $q_ry = "SELECT `last_hit_IP` FROM `members` WHERE `playerid` = '".mysql_real_escape_string($reciever)."'"; $recieverip = array(); $recieverip = mysql_fetch_array(mysql_query($q_ry)); $q_ry = array(); $q_ry = "INSERT INTO `member_logs` VALUES ('NULL', '".mysql_real_escape_string($type)."', '".mysql_real_escape_string($player)."', '".mysql_real_escape_string($reciever)."', '".mysql_real_escape_string($playerip)."', '".mysql_real_escape_string($recieverip['last_hit_IP'])."', '".mysql_real_escape_string($text)."', unix_timestamp())"; mysql_query($q_ry); } function other_log($type, $player, $playerip, $text) { $text = trim($text); $q_ry = array(); $q_ry = "INSERT INTO `member_logs` (`l_type`,`l_playerid`,`l_IP`,`l_text`,`l_time`) VALUES ('".mysql_real_escape_string($type)."', '".mysql_real_escape_string($player)."', '".mysql_real_escape_string($playerip)."', '".mysql_real_escape_string($text)."', unix_timestamp())"; mysql_query($q_ry); } function vault_add($amount, $id) { $q_ry = array(); $q_ry = "SELECT `v_id` FROM `member_vaults` WHERE `v_property` = '".mysql_real_escape_string($id)."'"; $thivault = array(); $thivault = mysql_query($q_ry); if(mysql_num_rows($thivault)) { $q_ry = array(); $q_ry = "UPDATE `member_vaults` SET `v_amount` = `v_amount` + '".mysql_real_escape_string($amount)."' WHERE `v_property` = '".mysql_real_escape_string($id)."'"; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE `members` SET `wallet` = `wallet` - '".mysql_real_escape_string($amount)."' WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; mysql_query($q_ry); } else { $q_ry = array(); $q_ry = "INSERT INTO `member_vaults` VALUES('NULL', '".mysql_real_escape_string($id)."', '".mysql_real_escape_string($amount)."')"; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE `members` SET `wallet` = `wallet` - '".mysql_real_escape_string($amount)."' WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; mysql_query($q_ry); } } function vault_remove($amount, $id) { $q_ry = array(); $q_ry = "UPDATE `member_vaults` SET `v_amount` = `v_amount` - '".mysql_real_escape_string($amount)."' WHERE `v_property` = '".mysql_real_escape_string($id)."'"; mysql_query($q_ry); $q_ry = array(); $q_ry = "UPDATE `members` SET `wallet` = `wallet` + '".mysql_real_escape_string($amount)."' WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; mysql_query($q_ry); $q_ry = array(); $q_ry = "DELETE FROM `member_vaults` WHERE `v_amount` <= '0'"; mysql_query($q_ry); } function new_effect($time, $effect, $drugid, $addiction) { $q_ry = "DELETE FROM `member_influences` WHERE `mi_playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; mysql_query($q_ry); $q_ry = "INSERT INTO `member_influences` VALUES('NULL', '".mysql_real_escape_string($_SESSION['playerid'])."', '".mysql_real_escape_string($time)."', '".mysql_real_escape_string($effect)."', '".mysql_real_escape_string($drugid)."')"; mysql_query($q_ry); $q_ry = "UPDATE `members_extra` SET `my_drugadd` = `my_drugadd` + '".mysql_real_escape_string($addiction)."' WHERE `playerid` = '".mysql_real_escape_string($_SESSION['playerid'])."'"; mysql_query($q_ry); p_stats_add('druguse', 1, $_SESSION['playerid']); } function profile_image($id, $width) { $q_ry = array(); $q_ry = "SELECT `i_image` FROM `member_images` WHERE `i_playerid` = '".mysql_real_escape_string($id)."' AND `i_profile` = '1'"; $im = array(); $im = mysql_query($q_ry); if(!mysql_num_rows($im)) { return "<a href=profile.php?XID=".$id."><img src='images/blank_man.jpg' alt = 'No images' title = 'No images' width = '".$width."px' border = '0'></a>"; } else { $mi = array(); $mi = mysql_fetch_array($im); $imgcheck = array(); $imgcheck = "images/uploads/id".$id."/".$mi['i_image'].""; $size = array(); $size = getimagesize($imgcheck); if($size) { $q_ry = array(); $q_ry = "SELECT `playername`,`my_level`,`my_gender` FROM `members` WHERE `playerid` = '".mysql_real_escape_string($id)."'"; $myi = array(); $myi = mysql_fetch_array(mysql_query($q_ry)); return "<a href=profile.php?XID=".$id." rel = 'tooltip' title = '<b>User image</b><br/><img src = \"".$imgcheck."\" width = \"100px\" border = \"0\"><br/>User image for ".htmlentities($myi['playername'])."[".$id."]<br/>Level: ".$myi['my_level']."<br/>Gender: ".$myi['my_gender']."'> <img src = '".$imgcheck."' width = '".$width."px' border = '0'></a>"; } else { // error return "<font color = 'red'><br/><b>Image error</b><br/></font>."; } } } function ae_detect_ie() { if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) return true; else return false; } function back() { return "<hr width='75%'>><a href='javascript:history.back();'>Back</a><hr width='75%'>"; } function round_table($size) { if($size) { $size = "width = '".($size+4)."px'"; } else { $size = ''; } $content = "<table cellspacing = '0' cellpadding = '0' border = '0' ".$size."> <tr> <td style = 'background: url(images/round-table/topleft.png) no-repeat left top;' width = '14px' height = '14px'></td> <td style = 'background: url(images/round-table/top.png) repeat-x center top;' height = '14px'></td> <td style = 'background: url(images/round-table/topright.png) no-repeat right top;' width = '14px' height = '14px'></td> </tr> <tr> <td style = 'background: url(images/round-table/left.png) repeat-y left top;' width = '14px'></td> <td align = 'center'>"; return $content; } function end_round() { $content = "</td> <td style = 'background: url(images/round-table/right.png) repeat-y right top;' width = '14px'></td> </tr> <tr> <td style = 'background: url(images/round-table/bottomleft.png) no-repeat left bottom;' width = '14px' height = '14px'></td> <td style = 'background: url(images/round-table/bottom.png) repeat-x center bottom;' height = '14px'></td> <td style = 'background: url(images/round-table/bottomright.png) no-repeat right bottom;' width = '14px' height = '14px'></td> </tr> </table>"; return $content; } ?> Edited July 7, 2015 by -BRAIDZ- Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 [MENTION=68406]-BRAIDZ-[/MENTION] I can't help without seeing the rest of how the engine is set up. put this at the top of the file just beneath <?php and tell me what comes up when you try load a game etc: error_reporting(E_ALL); ini_set('error_reporting', E_ALL); Did you see my last comment? Quote Link to comment Share on other sites More sharing options...
Coly010 Posted July 7, 2015 Share Posted July 7, 2015 Line 150: You bet ".money_alter($steaks+$scraps)."(".money_alter($st eaks)." effective) should be: You bet ".money_alter($steaks+$scraps)."(".money_alter($steaks)." effective) this should work, i think: <?php include('func_file.php'); if($_SERVER['HTTP_REFERER'] == $referer) { page_access($_SERVER['PHP_SELF']); echo "<p_title>Bookies</p_title><hr width = '800px'>"; if($_SESSION['myid'] == '1' || $_SESSION['myid'] == '2') { echo "><span class = 'loader:bookies.php?action=panel' id = 'linkage'>Manage games</span><hr width = '800px'>"; } echo "[<span class = 'loader:bookies.php?action=cat&cat_id=1' id = 'linkage'>Football</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=2' id = 'linkage'>Hockey</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=3' id = 'linkage'>Baseball</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=4' id = 'linkage'>Soccer</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=5' id = 'linkage'>Boxing</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=6' id = 'linkage'>Cricket</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=7' id = 'linkage'>Basketball</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=8' id = 'linkage'>All</span>] [<span class = 'loader:bookies.php?action=mybets' id = 'linkage'>Your bets</span>]<hr width = '800px'>"; $_GET['action'] = preg_replace('/[^a-z]/', '', $_GET['action']); if(!$_GET['action']) { $_GET['action'] = 'cat'; $_GET['cat_id'] = 8; } if(in_array($_GET['action'], array('panel','cat','bet','mybets'))) { echo "<table width = '800px' class = 'display-stripes'> <tr> <td align = 'center'>"; switch($_GET['action']) { case 'panel' : b_panel(); break; case 'cat' : view_cat(); break; case 'bet' : place_bet(); break; case 'mybets' : view_bets(); break; } echo "</td></tr></table> <hr width = '800px'> ><span class = 'loader:casino.php' id = 'linkage'>Casino</span> <hr width = '800px'>"; } } function b_panel() { global $user; if($_SESSION['myid'] == '1' || $_SESSION['myid'] == '2') { echo "<p_title>Bookies panel</p_title><hr>"; if($_GET['type']=='add') { $_POST['team1'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team1']); $_POST['team2'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team2']); $_POST['gtype'] = preg_replace('/[^0-9]/', '', $_POST['gtype']); if(!in_array($_POST['gtype'], array(1,2,3,4,5,6,7))) { $_POST['gtype'] = 1; } $_POST['t1oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmax']); $_POST['t1oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmin']); $_POST['t2oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmax']); $_POST['t2oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmin']); $_POST['gmonth'] = preg_replace('/[^a-zA-Z]/', '', $_POST['gmonth']); $_POST['gday'] = preg_replace('/[^0-9]/', '', $_POST['gday']); $_POST['gyear'] = preg_replace('/[^0-9]/', '', $_POST['gyear']); $_POST['ghrs'] = preg_replace('/[^0-9]/', '', $_POST['ghrs']); $_POST['gmins'] = preg_replace('/[^0-9]/', '', $_POST['gmins']); if($_POST['team1']!='' && $_POST['team2']!='' && $_POST['t1oddsmax'] && $_POST['t1oddsmin'] && $_POST['t2oddsmax'] && $_POST['t2oddsmin'] && $_POST['gmonth'] && $_POST['gday'] && $_POST['gyear']) { $title = $_POST['team1']." VS ".$_POST['team2']; $odds1 = $_POST['t1oddsmax'].":".$_POST['t1oddsmin']; $odds2 = $_POST['t2oddsmax'].":".$_POST['t2oddsmin']; $ending=strtotime($_POST['gday']." ".$_POST['gmonth']." ".$_POST['gyear']." ".$_POST['ghrs']." hours ".$_POST['gmins']." minutes"); $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); if(!$_GET['step']) { echo "Are you sure you wish to add the <b>".$cat_name[$_POST['gtype']-1]."</b> game(<b>".$title."</b>) with the following: Team one: <b>".$_POST['team1']."[".$odds1."]</b> - Team two: <b>".$_POST['team2']."[".$odds2."]</b> End date: ".date('F j Y', $ending)." - ".date('g:i:s a', $ending)." <form name = 'add-g' id = 'add-g'>"; foreach($_POST AS $key => $val) { echo "<input type = 'hidden' name = '".$key."' id = '".$key."' value = '".$val."'>"; } echo "<button class = 'submit:add-g:bookies.php?action=panel&type=add&step=1' id = 'linkage'>Confirm</button></form>"; } else { $odds = $odds1."-".$odds2; $sql = "INSERT INTO `bookie_games` VALUES('NULL', '".mysql_real_escape_string($title)."', '".mysql_real_escape_string($_POST['gtype'])."', '".mysql_real_escape_string($odds)."', '".mysql_real_escape_string($ending)."')"; mysql_query($sql); echo "You added the game successfully!"; } } else { echo warn("Error adding the game!"); } } else { if($_GET['type']=='results') { $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['score1'] = preg_replace('/[^0-9]/', '', $_POST['score1']); $_POST['score2'] = preg_replace('/[^0-9]/', '', $_POST['score2']); if($_GET['id'] && $_POST['score1'] && $_POST['score2']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $tg = mysql_fetch_array($sql); $odds = explode("-", $tg['bg_odds']); $teamn = explode(" VS ", $tg['bg_title']); $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); $oddsone = explode(":", $odds[0]); $oddsmax[1] = $oddsone[0]; $oddsmin[1] = $oddsone[1]; $oddstwo = explode(":", $odds[1]); $oddsmax[2] = $oddstwo[0]; $oddsmin[2] = $oddstwo[1]; if($_POST['score1'] > $_POST['score2']) { $winner = 1; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { if($_POST['score2'] > $_POST['score1']) { $winner = 2; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { $winner = 0; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b>"; } } $sql = "SELECT * FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($_GET['id'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { while($gp = mysql_fetch_array($sql)) { if($gp['bb_team'] == $winner) { //they won $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; $msg = $teamn[$gp['bb_team']-1]." won the ".$cat_name[$gp['bb_team']-1]." game you bet on. ".$scoring." You bet ".money_alter($steaks+$scraps)."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."]. You have won ".money_alter($prize)."!"; in_event($gp['bb_user'], $msg); credit_money($gp['bb_user'], $prize); } else { //they lost $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; if($winner == '0') { $wintype = 'drawn'; } else { $wintype = 'lost'; } $msg = $teamn[$gp['bb_team']-1]." ".$wintype." the ".$cat_name[$gp['bb_team']-1]." game you bet on. ".$scoring." You bet ".money_alter($gp['bb_bet'])."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."]. You have lost ".money_alter($steaks); if($scraps) { $msg.=" and your ".money_alter($scraps)." was returned!"; credit_money($gp['bb_user'], $scraps); } in_event($gp['bb_user'], $msg); } } } $sql = "DELETE FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); $sql = "DELETE FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); echo "Game <b>\"".$tg['bg_title']."\"</b> ended successfully!"; } else { echo warn("Error ending the game!"); } } else { echo warn("Error ending the game!"); } } else { echo "<b>Add a game:</b><hr width = '650px'>"; echo "<form name = 'addg' id = 'addg'> <table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game teams:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <input type = 'text' style = 'width: 90px;' name = 'team1' id = 'team1'> <b>VS</b> <input type = 'text' style = 'width: 90px;' name = 'team2' id = 'team2'> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game type:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 'gtype' id = 'gtype'> <option value = '1'> Football </option> <option value = '2'> Hockey </option> <option value = '3'> Baseball </option> <option value = '4'> Soccer </option> <option value = '5'> Boxing </option> <option value = '6'> Cricket </option> <option value = '7'> Basketball </option> </select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team one odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't1oddsmax' id = 't1oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't1oddsmin' id = 't1oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team two odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't2oddsmax' id = 't2oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't2oddsmin' id = 't2oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8' valign = 'top'> <b>Date betting ends:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'>"; $year = date('o'); $day = date('d'); $month = date('F'); $months = array('january','february','march','april','may',' june', 'july','august','september','october','november',' december'); echo "<table><tr><td align = 'left' style = 'background: #E3E3E3;'><i>Date:</i> <select name = 'gmonth' id = 'gmonth'>"; for($i = 0; $i < count($months); $i++) { $selected = ''; if(ucfirst($months[$i]) == $month) { $selected = ' SELECTED'; } echo "<option value = '".$months[$i]."'".$selected."> ".ucfirst($months[$i])." </option>"; } echo "</select><b>/</b><select name = 'gday' id = 'gday'>"; for($i = 1; $i <=31; $i++) { $selected = ''; if($i == $day) { $selected = ' SELECTED'; } echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select><b>/</b><select name = 'gyear' id = 'gyear'>"; for($i = $year; $i <=$year+1; $i++) { echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select> <i>Time:</i> <select name = 'ghrs' id = 'ghrs'>"; for($i = 0; $i <=24; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select><b>:</b><select name = 'gmins' id = 'gmins'>"; for($i = 0; $i <=59; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select></td></tr></table> </td> </tr> <tr> <td align = 'center' bgcolor = '#b8b8b8' colspan = '3'> <button class = 'submit:addg:bookies.php?action=panel&type=add' id = 'linkage'>Add game</button> </td> </tr> </table> </form>"; echo "<hr width = '650px'><b>End a game:</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ended</b> </th> <th> <b>Post results</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '3'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { $teams = explode(" VS ", $eg['bg_title']); echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])."".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <form name = 'score-".$num."' id = 'score-".$num."'> <i>".$teams[0]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score1' id = 'score1'> <i>".$teams[1]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score2' id = 'score2'> <button class = 'submit:score-".$num.":bookies.php?action=panel&type=results&id= ".$eg['bg_id']."' id = 'linkage'>Confirm</button> </form> </td> </tr>"; $num++; } } echo "</table>"; echo "<hr width = '650px'><b>Games ending soon(12hrs or less):</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ending</b> </th> </tr>"; $time_soon = time()+43200; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string($time_soon)."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '2'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr bgcolor = '".stripe($num)."'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])." - ".date('g:i:s a', $eg['bg_time'])." </td> </tr>"; } } echo "</table>"; } } } else { echo "You really should not be here!"; } } function view_cat() { global $user; $_GET['cat_id'] = preg_replace('/[^0-9]/', '', $_GET['cat_id']); if(!in_array($_GET['cat_id'], array(1,2,3,4,5,6,7,8))) { echo warn("Invalid cat ID!"); } else { $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); echo "<p_title>".ucfirst($cat_name[$_GET['cat_id']-1])." games</p_title><hr>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th colspan = '2'> <b>Game title</b> </th> <th style = 'text-align: center;'> <b>Date ending</b> </th> <th style = 'text-align: right;'> <b>Place bet(s)</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` > '".mysql_real_escape_string(time())."'"; if($_GET['cat_id'] < 8) { $sql.="AND `bg_type` = '".mysql_real_escape_string($_GET['cat_id'])."'"; } $sql.="ORDER BY `bg_time` ASC"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '4'><b>No ".ucfirst($cat_name[$_GET['cat_id']-1])." games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr> <td align = 'center' colspan = '4'> <form name = 'bet-".$num."' id = 'bet-".$num."'> <table width = '100%' cellspacing = '0'> <tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left' width = '50px'> <img src = 'images/css/casino/game-".$eg['bg_type'].".png'> </td> <td align = 'left'>"; $title_odds = explode(" VS ", $eg['bg_title']); $odds = explode("-", $eg['bg_odds']); echo "<b>".$title_odds[0]."[".$odds[0]."]</b> VS <b>".$title_odds[1]."[".$odds[1]."]</b> ".ucfirst($cat_name[$eg['bg_type']-1])." </td> <td align = 'center'> ".date('F j Y', $eg['bg_time'])."".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <i>Team to win:</i><select name = 'team'> <option value = '1'> ".ucfirst($title_odds[0])." </option> <option value = '2'> ".ucfirst($title_odds[1])." </option> </select> <i>Bet:</i><input type = 'text' style = 'width: 50px;' value = '0' name = 'bet' id = 'bet'> </td> </tr> <tr bgcolor = '#000000' height = '30px'> <td colspan = '4' align = 'center'> <button class = 'submit:bet-".$num.":bookies.php?action=bet&id=".$eg['bg_id']."' id = 'linkage'>Place bet</button> </td> </tr> <tr> <td colspan = '4' height = '5px'> </td> </tr> </table> </form> </td> </tr>"; $num++; } } echo "</table>"; } } function place_bet() { global $user; echo "<p_title>Place bet</p_title><hr>"; $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['bet'] = preg_replace('/[^0-9]/', '', $_POST['bet']); $_POST['team'] = preg_replace('/[^0-9]/', '', $_POST['team']); if($_GET['id'] && $_POST['bet'] && $_POST['team']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { if($user['usr_money'] >= $_POST['bet']) { $bg = mysql_fetch_array($sql); $teamname = explode(" VS ", $bg['bg_title']); $teamname = $teamname[$_POST['team']-1]; $oddsmin = explode("-", $bg['bg_odds']); $odds = $oddsmin[$_POST['team']-1]; $oddsmin = explode(":", $oddsmin[$_POST['team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($_POST['bet']/$oddsmin); $betting*=$oddsmin; if(!$_GET['step']) { echo "You are betting <b>".money_alter($_POST['bet'])."</b>(".money_alter($betting)." effective) on team <b>".$teamname."</b> to win with the odds of [".$odds."]. Are you sure you wish to place this bet? <form name = 'bet-c' id = 'bet-c'> <input type = 'hidden' name = 'bet' id = 'bet' value = '".$_POST['bet']."'> <input type = 'hidden' name = 'team' id = 'team' value = '".$_POST['team']."'> <button class = 'submit:bet-c:bookies.php?action=bet&id=".$_GET['id']."&step=1' id = 'linkage'>Confirm bet</button> </form>"; } else { $sql = "INSERT INTO `bookie_bets` VALUES('NULL', '".mysql_real_escape_string($_SESSION['myid'])."', '".mysql_real_escape_string($_GET['id'])."', '".mysql_real_escape_string($_POST['team'])."', '".mysql_real_escape_string($_POST['bet'])."')"; mysql_query($sql); echo min_money($_POST['bet']); echo "Your bet has been placed for a total of <b>".money_alter($_POST['bet'])."</b>. You can view your bets from the top of this page. You will receive an event with the results shortly after the game has ended."; } } else { echo warn("You dont have enough money to make this bet!"); } } else { echo warn("This game does not exist!"); } } else { echo warn("This game does not exist!"); } } function view_bets() { global $user; echo "<p_title>Your bets</p_title><hr>"; echo "<table width = '100%' class = 'display-stripes'> <tr> <th colspan = '2'> Team betting on/Type </th> <th> Odds </th> <th> Ending date </th> <th> Total bet </th> </tr>"; $sql = "SELECT bb.*,bg.* FROM `bookie_bets` bb LEFT JOIN `bookie_games` bg ON bb.bb_game = bg.bg_id WHERE bb.bb_user = '".mysql_real_escape_string($_SESSION['myid'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $num = 0; $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); while($mb = mysql_fetch_array($sql)) { $teamname = explode(" VS ", $mb['bg_title']); $teamname = $teamname[$mb['bb_team']-1]; $oddsmin = explode("-", $mb['bg_odds']); $odds = $oddsmin[$mb['bb_team']-1]; $oddsmin = explode(":", $oddsmin[$mb['bb_team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($mb['bb_bet']/$oddsmin); $betting*=$oddsmin; echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td width = '50px'> <img src = 'images/css/casino/game-".$mb['bg_type'].".png'> </td> <td> ".$teamname." - ".ucfirst($cat_name[$mb['bg_type']-1])." </td> <td> [".$odds."] </td> <td> ".date('F j Y', $mb['bg_time'])."".date('g:i:s a', $mb['bg_time'])." </td> <td> ".money_alter($mb['bb_bet'])."(".money_alter($betting)." effective) </td> </tr>"; $num++; } } else { echo "<tr><td colspan = '5'>You have no bets at this time.</td></tr>"; } echo "</table>"; } ?> Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 Line 150: You bet ".money_alter($steaks+$scraps)."(".money_alter($st eaks)." effective) should be: You bet ".money_alter($steaks+$scraps)."(".money_alter($steaks)." effective) this should work, i think: <?php include('func_file.php'); if($_SERVER['HTTP_REFERER'] == $referer) { page_access($_SERVER['PHP_SELF']); echo "<p_title>Bookies</p_title><hr width = '800px'>"; if($_SESSION['myid'] == '1' || $_SESSION['myid'] == '2') { echo "><span class = 'loader:bookies.php?action=panel' id = 'linkage'>Manage games</span><hr width = '800px'>"; } echo "[<span class = 'loader:bookies.php?action=cat&cat_id=1' id = 'linkage'>Football</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=2' id = 'linkage'>Hockey</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=3' id = 'linkage'>Baseball</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=4' id = 'linkage'>Soccer</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=5' id = 'linkage'>Boxing</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=6' id = 'linkage'>Cricket</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=7' id = 'linkage'>Basketball</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=8' id = 'linkage'>All</span>] [<span class = 'loader:bookies.php?action=mybets' id = 'linkage'>Your bets</span>]<hr width = '800px'>"; $_GET['action'] = preg_replace('/[^a-z]/', '', $_GET['action']); if(!$_GET['action']) { $_GET['action'] = 'cat'; $_GET['cat_id'] = 8; } if(in_array($_GET['action'], array('panel','cat','bet','mybets'))) { echo "<table width = '800px' class = 'display-stripes'> <tr> <td align = 'center'>"; switch($_GET['action']) { case 'panel' : b_panel(); break; case 'cat' : view_cat(); break; case 'bet' : place_bet(); break; case 'mybets' : view_bets(); break; } echo "</td></tr></table> <hr width = '800px'> ><span class = 'loader:casino.php' id = 'linkage'>Casino</span> <hr width = '800px'>"; } } function b_panel() { global $user; if($_SESSION['myid'] == '1' || $_SESSION['myid'] == '2') { echo "<p_title>Bookies panel</p_title><hr>"; if($_GET['type']=='add') { $_POST['team1'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team1']); $_POST['team2'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team2']); $_POST['gtype'] = preg_replace('/[^0-9]/', '', $_POST['gtype']); if(!in_array($_POST['gtype'], array(1,2,3,4,5,6,7))) { $_POST['gtype'] = 1; } $_POST['t1oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmax']); $_POST['t1oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmin']); $_POST['t2oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmax']); $_POST['t2oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmin']); $_POST['gmonth'] = preg_replace('/[^a-zA-Z]/', '', $_POST['gmonth']); $_POST['gday'] = preg_replace('/[^0-9]/', '', $_POST['gday']); $_POST['gyear'] = preg_replace('/[^0-9]/', '', $_POST['gyear']); $_POST['ghrs'] = preg_replace('/[^0-9]/', '', $_POST['ghrs']); $_POST['gmins'] = preg_replace('/[^0-9]/', '', $_POST['gmins']); if($_POST['team1']!='' && $_POST['team2']!='' && $_POST['t1oddsmax'] && $_POST['t1oddsmin'] && $_POST['t2oddsmax'] && $_POST['t2oddsmin'] && $_POST['gmonth'] && $_POST['gday'] && $_POST['gyear']) { $title = $_POST['team1']." VS ".$_POST['team2']; $odds1 = $_POST['t1oddsmax'].":".$_POST['t1oddsmin']; $odds2 = $_POST['t2oddsmax'].":".$_POST['t2oddsmin']; $ending=strtotime($_POST['gday']." ".$_POST['gmonth']." ".$_POST['gyear']." ".$_POST['ghrs']." hours ".$_POST['gmins']." minutes"); $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); if(!$_GET['step']) { echo "Are you sure you wish to add the <b>".$cat_name[$_POST['gtype']-1]."</b> game(<b>".$title."</b>) with the following: Team one: <b>".$_POST['team1']."[".$odds1."]</b> - Team two: <b>".$_POST['team2']."[".$odds2."]</b> End date: ".date('F j Y', $ending)." - ".date('g:i:s a', $ending)." <form name = 'add-g' id = 'add-g'>"; foreach($_POST AS $key => $val) { echo "<input type = 'hidden' name = '".$key."' id = '".$key."' value = '".$val."'>"; } echo "<button class = 'submit:add-g:bookies.php?action=panel&type=add&step=1' id = 'linkage'>Confirm</button></form>"; } else { $odds = $odds1."-".$odds2; $sql = "INSERT INTO `bookie_games` VALUES('NULL', '".mysql_real_escape_string($title)."', '".mysql_real_escape_string($_POST['gtype'])."', '".mysql_real_escape_string($odds)."', '".mysql_real_escape_string($ending)."')"; mysql_query($sql); echo "You added the game successfully!"; } } else { echo warn("Error adding the game!"); } } else { if($_GET['type']=='results') { $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['score1'] = preg_replace('/[^0-9]/', '', $_POST['score1']); $_POST['score2'] = preg_replace('/[^0-9]/', '', $_POST['score2']); if($_GET['id'] && $_POST['score1'] && $_POST['score2']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $tg = mysql_fetch_array($sql); $odds = explode("-", $tg['bg_odds']); $teamn = explode(" VS ", $tg['bg_title']); $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); $oddsone = explode(":", $odds[0]); $oddsmax[1] = $oddsone[0]; $oddsmin[1] = $oddsone[1]; $oddstwo = explode(":", $odds[1]); $oddsmax[2] = $oddstwo[0]; $oddsmin[2] = $oddstwo[1]; if($_POST['score1'] > $_POST['score2']) { $winner = 1; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { if($_POST['score2'] > $_POST['score1']) { $winner = 2; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { $winner = 0; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b>"; } } $sql = "SELECT * FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($_GET['id'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { while($gp = mysql_fetch_array($sql)) { if($gp['bb_team'] == $winner) { //they won $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; $msg = $teamn[$gp['bb_team']-1]." won the ".$cat_name[$gp['bb_team']-1]." game you bet on. ".$scoring." You bet ".money_alter($steaks+$scraps)."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."]. You have won ".money_alter($prize)."!"; in_event($gp['bb_user'], $msg); credit_money($gp['bb_user'], $prize); } else { //they lost $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; if($winner == '0') { $wintype = 'drawn'; } else { $wintype = 'lost'; } $msg = $teamn[$gp['bb_team']-1]." ".$wintype." the ".$cat_name[$gp['bb_team']-1]." game you bet on. ".$scoring." You bet ".money_alter($gp['bb_bet'])."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."]. You have lost ".money_alter($steaks); if($scraps) { $msg.=" and your ".money_alter($scraps)." was returned!"; credit_money($gp['bb_user'], $scraps); } in_event($gp['bb_user'], $msg); } } } $sql = "DELETE FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); $sql = "DELETE FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); echo "Game <b>\"".$tg['bg_title']."\"</b> ended successfully!"; } else { echo warn("Error ending the game!"); } } else { echo warn("Error ending the game!"); } } else { echo "<b>Add a game:</b><hr width = '650px'>"; echo "<form name = 'addg' id = 'addg'> <table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game teams:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <input type = 'text' style = 'width: 90px;' name = 'team1' id = 'team1'> <b>VS</b> <input type = 'text' style = 'width: 90px;' name = 'team2' id = 'team2'> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game type:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 'gtype' id = 'gtype'> <option value = '1'> Football </option> <option value = '2'> Hockey </option> <option value = '3'> Baseball </option> <option value = '4'> Soccer </option> <option value = '5'> Boxing </option> <option value = '6'> Cricket </option> <option value = '7'> Basketball </option> </select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team one odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't1oddsmax' id = 't1oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't1oddsmin' id = 't1oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team two odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't2oddsmax' id = 't2oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't2oddsmin' id = 't2oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8' valign = 'top'> <b>Date betting ends:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'>"; $year = date('o'); $day = date('d'); $month = date('F'); $months = array('january','february','march','april','may',' june', 'july','august','september','october','november',' december'); echo "<table><tr><td align = 'left' style = 'background: #E3E3E3;'><i>Date:</i> <select name = 'gmonth' id = 'gmonth'>"; for($i = 0; $i < count($months); $i++) { $selected = ''; if(ucfirst($months[$i]) == $month) { $selected = ' SELECTED'; } echo "<option value = '".$months[$i]."'".$selected."> ".ucfirst($months[$i])." </option>"; } echo "</select><b>/</b><select name = 'gday' id = 'gday'>"; for($i = 1; $i <=31; $i++) { $selected = ''; if($i == $day) { $selected = ' SELECTED'; } echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select><b>/</b><select name = 'gyear' id = 'gyear'>"; for($i = $year; $i <=$year+1; $i++) { echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select> <i>Time:</i> <select name = 'ghrs' id = 'ghrs'>"; for($i = 0; $i <=24; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select><b>:</b><select name = 'gmins' id = 'gmins'>"; for($i = 0; $i <=59; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select></td></tr></table> </td> </tr> <tr> <td align = 'center' bgcolor = '#b8b8b8' colspan = '3'> <button class = 'submit:addg:bookies.php?action=panel&type=add' id = 'linkage'>Add game</button> </td> </tr> </table> </form>"; echo "<hr width = '650px'><b>End a game:</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ended</b> </th> <th> <b>Post results</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '3'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { $teams = explode(" VS ", $eg['bg_title']); echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])."".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <form name = 'score-".$num."' id = 'score-".$num."'> <i>".$teams[0]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score1' id = 'score1'> <i>".$teams[1]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score2' id = 'score2'> <button class = 'submit:score-".$num.":bookies.php?action=panel&type=results&id= ".$eg['bg_id']."' id = 'linkage'>Confirm</button> </form> </td> </tr>"; $num++; } } echo "</table>"; echo "<hr width = '650px'><b>Games ending soon(12hrs or less):</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ending</b> </th> </tr>"; $time_soon = time()+43200; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string($time_soon)."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '2'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr bgcolor = '".stripe($num)."'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])." - ".date('g:i:s a', $eg['bg_time'])." </td> </tr>"; } } echo "</table>"; } } } else { echo "You really should not be here!"; } } function view_cat() { global $user; $_GET['cat_id'] = preg_replace('/[^0-9]/', '', $_GET['cat_id']); if(!in_array($_GET['cat_id'], array(1,2,3,4,5,6,7,8))) { echo warn("Invalid cat ID!"); } else { $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); echo "<p_title>".ucfirst($cat_name[$_GET['cat_id']-1])." games</p_title><hr>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th colspan = '2'> <b>Game title</b> </th> <th style = 'text-align: center;'> <b>Date ending</b> </th> <th style = 'text-align: right;'> <b>Place bet(s)</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` > '".mysql_real_escape_string(time())."'"; if($_GET['cat_id'] < 8) { $sql.="AND `bg_type` = '".mysql_real_escape_string($_GET['cat_id'])."'"; } $sql.="ORDER BY `bg_time` ASC"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '4'><b>No ".ucfirst($cat_name[$_GET['cat_id']-1])." games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr> <td align = 'center' colspan = '4'> <form name = 'bet-".$num."' id = 'bet-".$num."'> <table width = '100%' cellspacing = '0'> <tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left' width = '50px'> <img src = 'images/css/casino/game-".$eg['bg_type'].".png'> </td> <td align = 'left'>"; $title_odds = explode(" VS ", $eg['bg_title']); $odds = explode("-", $eg['bg_odds']); echo "<b>".$title_odds[0]."[".$odds[0]."]</b> VS <b>".$title_odds[1]."[".$odds[1]."]</b> ".ucfirst($cat_name[$eg['bg_type']-1])." </td> <td align = 'center'> ".date('F j Y', $eg['bg_time'])."".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <i>Team to win:</i><select name = 'team'> <option value = '1'> ".ucfirst($title_odds[0])." </option> <option value = '2'> ".ucfirst($title_odds[1])." </option> </select> <i>Bet:</i><input type = 'text' style = 'width: 50px;' value = '0' name = 'bet' id = 'bet'> </td> </tr> <tr bgcolor = '#000000' height = '30px'> <td colspan = '4' align = 'center'> <button class = 'submit:bet-".$num.":bookies.php?action=bet&id=".$eg['bg_id']."' id = 'linkage'>Place bet</button> </td> </tr> <tr> <td colspan = '4' height = '5px'> </td> </tr> </table> </form> </td> </tr>"; $num++; } } echo "</table>"; } } function place_bet() { global $user; echo "<p_title>Place bet</p_title><hr>"; $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['bet'] = preg_replace('/[^0-9]/', '', $_POST['bet']); $_POST['team'] = preg_replace('/[^0-9]/', '', $_POST['team']); if($_GET['id'] && $_POST['bet'] && $_POST['team']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { if($user['usr_money'] >= $_POST['bet']) { $bg = mysql_fetch_array($sql); $teamname = explode(" VS ", $bg['bg_title']); $teamname = $teamname[$_POST['team']-1]; $oddsmin = explode("-", $bg['bg_odds']); $odds = $oddsmin[$_POST['team']-1]; $oddsmin = explode(":", $oddsmin[$_POST['team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($_POST['bet']/$oddsmin); $betting*=$oddsmin; if(!$_GET['step']) { echo "You are betting <b>".money_alter($_POST['bet'])."</b>(".money_alter($betting)." effective) on team <b>".$teamname."</b> to win with the odds of [".$odds."]. Are you sure you wish to place this bet? <form name = 'bet-c' id = 'bet-c'> <input type = 'hidden' name = 'bet' id = 'bet' value = '".$_POST['bet']."'> <input type = 'hidden' name = 'team' id = 'team' value = '".$_POST['team']."'> <button class = 'submit:bet-c:bookies.php?action=bet&id=".$_GET['id']."&step=1' id = 'linkage'>Confirm bet</button> </form>"; } else { $sql = "INSERT INTO `bookie_bets` VALUES('NULL', '".mysql_real_escape_string($_SESSION['myid'])."', '".mysql_real_escape_string($_GET['id'])."', '".mysql_real_escape_string($_POST['team'])."', '".mysql_real_escape_string($_POST['bet'])."')"; mysql_query($sql); echo min_money($_POST['bet']); echo "Your bet has been placed for a total of <b>".money_alter($_POST['bet'])."</b>. You can view your bets from the top of this page. You will receive an event with the results shortly after the game has ended."; } } else { echo warn("You dont have enough money to make this bet!"); } } else { echo warn("This game does not exist!"); } } else { echo warn("This game does not exist!"); } } function view_bets() { global $user; echo "<p_title>Your bets</p_title><hr>"; echo "<table width = '100%' class = 'display-stripes'> <tr> <th colspan = '2'> Team betting on/Type </th> <th> Odds </th> <th> Ending date </th> <th> Total bet </th> </tr>"; $sql = "SELECT bb.*,bg.* FROM `bookie_bets` bb LEFT JOIN `bookie_games` bg ON bb.bb_game = bg.bg_id WHERE bb.bb_user = '".mysql_real_escape_string($_SESSION['myid'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $num = 0; $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); while($mb = mysql_fetch_array($sql)) { $teamname = explode(" VS ", $mb['bg_title']); $teamname = $teamname[$mb['bb_team']-1]; $oddsmin = explode("-", $mb['bg_odds']); $odds = $oddsmin[$mb['bb_team']-1]; $oddsmin = explode(":", $oddsmin[$mb['bb_team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($mb['bb_bet']/$oddsmin); $betting*=$oddsmin; echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td width = '50px'> <img src = 'images/css/casino/game-".$mb['bg_type'].".png'> </td> <td> ".$teamname." - ".ucfirst($cat_name[$mb['bg_type']-1])." </td> <td> [".$odds."] </td> <td> ".date('F j Y', $mb['bg_time'])."".date('g:i:s a', $mb['bg_time'])." </td> <td> ".money_alter($mb['bb_bet'])."(".money_alter($betting)." effective) </td> </tr>"; $num++; } } else { echo "<tr><td colspan = '5'>You have no bets at this time.</td></tr>"; } echo "</table>"; } ?> Responding with a blank screen now Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 (edited) Line 150: You bet ".money_alter($steaks+$scraps)."(".money_alter($st eaks)." effective) should be: You bet ".money_alter($steaks+$scraps)."(".money_alter($steaks)." effective) this should work, i think: <?php include('func_file.php'); if($_SERVER['HTTP_REFERER'] == $referer) { page_access($_SERVER['PHP_SELF']); echo "<p_title>Bookies</p_title><hr width = '800px'>"; if($_SESSION['myid'] == '1' || $_SESSION['myid'] == '2') { echo "><span class = 'loader:bookies.php?action=panel' id = 'linkage'>Manage games</span><hr width = '800px'>"; } echo "[<span class = 'loader:bookies.php?action=cat&cat_id=1' id = 'linkage'>Football</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=2' id = 'linkage'>Hockey</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=3' id = 'linkage'>Baseball</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=4' id = 'linkage'>Soccer</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=5' id = 'linkage'>Boxing</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=6' id = 'linkage'>Cricket</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=7' id = 'linkage'>Basketball</span>] [<span class = 'loader:bookies.php?action=cat&cat_id=8' id = 'linkage'>All</span>] [<span class = 'loader:bookies.php?action=mybets' id = 'linkage'>Your bets</span>]<hr width = '800px'>"; $_GET['action'] = preg_replace('/[^a-z]/', '', $_GET['action']); if(!$_GET['action']) { $_GET['action'] = 'cat'; $_GET['cat_id'] = 8; } if(in_array($_GET['action'], array('panel','cat','bet','mybets'))) { echo "<table width = '800px' class = 'display-stripes'> <tr> <td align = 'center'>"; switch($_GET['action']) { case 'panel' : b_panel(); break; case 'cat' : view_cat(); break; case 'bet' : place_bet(); break; case 'mybets' : view_bets(); break; } echo "</td></tr></table> <hr width = '800px'> ><span class = 'loader:casino.php' id = 'linkage'>Casino</span> <hr width = '800px'>"; } } function b_panel() { global $user; if($_SESSION['myid'] == '1' || $_SESSION['myid'] == '2') { echo "<p_title>Bookies panel</p_title><hr>"; if($_GET['type']=='add') { $_POST['team1'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team1']); $_POST['team2'] = preg_replace('/[^a-zA-Z0-9]/', '', $_POST['team2']); $_POST['gtype'] = preg_replace('/[^0-9]/', '', $_POST['gtype']); if(!in_array($_POST['gtype'], array(1,2,3,4,5,6,7))) { $_POST['gtype'] = 1; } $_POST['t1oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmax']); $_POST['t1oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t1oddsmin']); $_POST['t2oddsmax'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmax']); $_POST['t2oddsmin'] = preg_replace('/[^0-9]/', '', $_POST['t2oddsmin']); $_POST['gmonth'] = preg_replace('/[^a-zA-Z]/', '', $_POST['gmonth']); $_POST['gday'] = preg_replace('/[^0-9]/', '', $_POST['gday']); $_POST['gyear'] = preg_replace('/[^0-9]/', '', $_POST['gyear']); $_POST['ghrs'] = preg_replace('/[^0-9]/', '', $_POST['ghrs']); $_POST['gmins'] = preg_replace('/[^0-9]/', '', $_POST['gmins']); if($_POST['team1']!='' && $_POST['team2']!='' && $_POST['t1oddsmax'] && $_POST['t1oddsmin'] && $_POST['t2oddsmax'] && $_POST['t2oddsmin'] && $_POST['gmonth'] && $_POST['gday'] && $_POST['gyear']) { $title = $_POST['team1']." VS ".$_POST['team2']; $odds1 = $_POST['t1oddsmax'].":".$_POST['t1oddsmin']; $odds2 = $_POST['t2oddsmax'].":".$_POST['t2oddsmin']; $ending=strtotime($_POST['gday']." ".$_POST['gmonth']." ".$_POST['gyear']." ".$_POST['ghrs']." hours ".$_POST['gmins']." minutes"); $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); if(!$_GET['step']) { echo "Are you sure you wish to add the <b>".$cat_name[$_POST['gtype']-1]."</b> game(<b>".$title."</b>) with the following: Team one: <b>".$_POST['team1']."[".$odds1."]</b> - Team two: <b>".$_POST['team2']."[".$odds2."]</b> End date: ".date('F j Y', $ending)." - ".date('g:i:s a', $ending)." <form name = 'add-g' id = 'add-g'>"; foreach($_POST AS $key => $val) { echo "<input type = 'hidden' name = '".$key."' id = '".$key."' value = '".$val."'>"; } echo "<button class = 'submit:add-g:bookies.php?action=panel&type=add&step=1' id = 'linkage'>Confirm</button></form>"; } else { $odds = $odds1."-".$odds2; $sql = "INSERT INTO `bookie_games` VALUES('NULL', '".mysql_real_escape_string($title)."', '".mysql_real_escape_string($_POST['gtype'])."', '".mysql_real_escape_string($odds)."', '".mysql_real_escape_string($ending)."')"; mysql_query($sql); echo "You added the game successfully!"; } } else { echo warn("Error adding the game!"); } } else { if($_GET['type']=='results') { $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['score1'] = preg_replace('/[^0-9]/', '', $_POST['score1']); $_POST['score2'] = preg_replace('/[^0-9]/', '', $_POST['score2']); if($_GET['id'] && $_POST['score1'] && $_POST['score2']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $tg = mysql_fetch_array($sql); $odds = explode("-", $tg['bg_odds']); $teamn = explode(" VS ", $tg['bg_title']); $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); $oddsone = explode(":", $odds[0]); $oddsmax[1] = $oddsone[0]; $oddsmin[1] = $oddsone[1]; $oddstwo = explode(":", $odds[1]); $oddsmax[2] = $oddstwo[0]; $oddsmin[2] = $oddstwo[1]; if($_POST['score1'] > $_POST['score2']) { $winner = 1; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { if($_POST['score2'] > $_POST['score1']) { $winner = 2; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b> to <b>".$teamn[$winner-1]."</b>"; } else { $winner = 0; $scoring = "The score was <b>".$_POST['score1']." - ".$_POST['score2']."</b>"; } } $sql = "SELECT * FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($_GET['id'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { while($gp = mysql_fetch_array($sql)) { if($gp['bb_team'] == $winner) { //they won $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; $msg = $teamn[$gp['bb_team']-1]." won the ".$cat_name[$gp['bb_team']-1]." game you bet on. ".$scoring." You bet ".money_alter($steaks+$scraps)."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."]. You have won ".money_alter($prize)."!"; in_event($gp['bb_user'], $msg); credit_money($gp['bb_user'], $prize); } else { //they lost $times = floor($gp['bb_bet']/$oddsmin[$gp['bb_team']]); $steaks = $times*$oddsmin[$gp['bb_team']]; $scraps = $gp['bb_bet']-$steaks; $prize = ($times*$oddsmax[$gp['bb_team']]) + $scraps; if($winner == '0') { $wintype = 'drawn'; } else { $wintype = 'lost'; } $msg = $teamn[$gp['bb_team']-1]." ".$wintype." the ".$cat_name[$gp['bb_team']-1]." game you bet on. ".$scoring." You bet ".money_alter($gp['bb_bet'])."(".money_alter($steaks)." effective) with the odds of [".$oddsmax[$gp['bb_team']].":".$oddsmin[$gp['bb_team']]."]. You have lost ".money_alter($steaks); if($scraps) { $msg.=" and your ".money_alter($scraps)." was returned!"; credit_money($gp['bb_user'], $scraps); } in_event($gp['bb_user'], $msg); } } } $sql = "DELETE FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); $sql = "DELETE FROM `bookie_bets` WHERE `bb_game` = '".mysql_real_escape_string($tg['bg_id'])."'"; mysql_query($sql); echo "Game <b>\"".$tg['bg_title']."\"</b> ended successfully!"; } else { echo warn("Error ending the game!"); } } else { echo warn("Error ending the game!"); } } else { echo "<b>Add a game:</b><hr width = '650px'>"; echo "<form name = 'addg' id = 'addg'> <table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game teams:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <input type = 'text' style = 'width: 90px;' name = 'team1' id = 'team1'> <b>VS</b> <input type = 'text' style = 'width: 90px;' name = 'team2' id = 'team2'> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Game type:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 'gtype' id = 'gtype'> <option value = '1'> Football </option> <option value = '2'> Hockey </option> <option value = '3'> Baseball </option> <option value = '4'> Soccer </option> <option value = '5'> Boxing </option> <option value = '6'> Cricket </option> <option value = '7'> Basketball </option> </select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team one odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't1oddsmax' id = 't1oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't1oddsmin' id = 't1oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8'> <b>Team two odds:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'> <select name = 't2oddsmax' id = 't2oddsmax'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select><b>:</b><select name = 't2oddsmin' id = 't2oddsmin'>"; for($i = 1; $i <=99; $i++) { echo "<option value = '".$i."'> ".$i." </option>"; } echo "</select> </td> </tr> <tr> <td align = 'right' width = '45%' bgcolor = '#b8b8b8' valign = 'top'> <b>Date betting ends:</b> </td> <td bgcolor = '#b8b8b8'> </td> <td align = 'left' width = '45%' bgcolor = '#b8b8b8'>"; $year = date('o'); $day = date('d'); $month = date('F'); $months = array('january','february','march','april','may',' june', 'july','august','september','october','november',' december'); echo "<table><tr><td align = 'left' style = 'background: #E3E3E3;'><i>Date:</i> <select name = 'gmonth' id = 'gmonth'>"; for($i = 0; $i < count($months); $i++) { $selected = ''; if(ucfirst($months[$i]) == $month) { $selected = ' SELECTED'; } echo "<option value = '".$months[$i]."'".$selected."> ".ucfirst($months[$i])." </option>"; } echo "</select><b>/</b><select name = 'gday' id = 'gday'>"; for($i = 1; $i <=31; $i++) { $selected = ''; if($i == $day) { $selected = ' SELECTED'; } echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select><b>/</b><select name = 'gyear' id = 'gyear'>"; for($i = $year; $i <=$year+1; $i++) { echo "<option value = '".$i."'".$selected."> ".$i." </option>"; } echo "</select> <i>Time:</i> <select name = 'ghrs' id = 'ghrs'>"; for($i = 0; $i <=24; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select><b>:</b><select name = 'gmins' id = 'gmins'>"; for($i = 0; $i <=59; $i++) { echo "<option value = '".$i."'>"; if($i < 10) { echo "0"; } echo $i." </option>"; } echo "</select></td></tr></table> </td> </tr> <tr> <td align = 'center' bgcolor = '#b8b8b8' colspan = '3'> <button class = 'submit:addg:bookies.php?action=panel&type=add' id = 'linkage'>Add game</button> </td> </tr> </table> </form>"; echo "<hr width = '650px'><b>End a game:</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ended</b> </th> <th> <b>Post results</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '3'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { $teams = explode(" VS ", $eg['bg_title']); echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])."".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <form name = 'score-".$num."' id = 'score-".$num."'> <i>".$teams[0]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score1' id = 'score1'> <i>".$teams[1]." score:</i> <input type = 'text' style = 'width: 25px;' name = 'score2' id = 'score2'> <button class = 'submit:score-".$num.":bookies.php?action=panel&type=results&id= ".$eg['bg_id']."' id = 'linkage'>Confirm</button> </form> </td> </tr>"; $num++; } } echo "</table>"; echo "<hr width = '650px'><b>Games ending soon(12hrs or less):</b><hr width = '650px'>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th> <b>Game title</b> </th> <th> <b>Date ending</b> </th> </tr>"; $time_soon = time()+43200; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` <= '".mysql_real_escape_string($time_soon)."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '2'><b>No games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr bgcolor = '".stripe($num)."'> <td align = 'left'> ".$eg['bg_title']." </td> <td align = 'left'> ".date('F j Y', $eg['bg_time'])." - ".date('g:i:s a', $eg['bg_time'])." </td> </tr>"; } } echo "</table>"; } } } else { echo "You really should not be here!"; } } function view_cat() { global $user; $_GET['cat_id'] = preg_replace('/[^0-9]/', '', $_GET['cat_id']); if(!in_array($_GET['cat_id'], array(1,2,3,4,5,6,7,8))) { echo warn("Invalid cat ID!"); } else { $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); echo "<p_title>".ucfirst($cat_name[$_GET['cat_id']-1])." games</p_title><hr>"; echo "<table width = '650px' class = 'display-stripes' bgcolor = '#b8b8b8'> <tr> <th colspan = '2'> <b>Game title</b> </th> <th style = 'text-align: center;'> <b>Date ending</b> </th> <th style = 'text-align: right;'> <b>Place bet(s)</b> </th> </tr>"; $sql = "SELECT * FROM `bookie_games` WHERE `bg_time` > '".mysql_real_escape_string(time())."'"; if($_GET['cat_id'] < 8) { $sql.="AND `bg_type` = '".mysql_real_escape_string($_GET['cat_id'])."'"; } $sql.="ORDER BY `bg_time` ASC"; $sql = mysql_query($sql); if(!mysql_num_rows($sql)) { echo "<tr><td align = 'center' colspan = '4'><b>No ".ucfirst($cat_name[$_GET['cat_id']-1])." games to show</b></td></tr>"; } else { $num = 0; while($eg = mysql_fetch_array($sql)) { echo "<tr> <td align = 'center' colspan = '4'> <form name = 'bet-".$num."' id = 'bet-".$num."'> <table width = '100%' cellspacing = '0'> <tr bgcolor = '".stripe($num)."' valign = 'top'> <td align = 'left' width = '50px'> <img src = 'images/css/casino/game-".$eg['bg_type'].".png'> </td> <td align = 'left'>"; $title_odds = explode(" VS ", $eg['bg_title']); $odds = explode("-", $eg['bg_odds']); echo "<b>".$title_odds[0]."[".$odds[0]."]</b> VS <b>".$title_odds[1]."[".$odds[1]."]</b> ".ucfirst($cat_name[$eg['bg_type']-1])." </td> <td align = 'center'> ".date('F j Y', $eg['bg_time'])."".date('g:i:s a', $eg['bg_time'])." </td> <td align = 'right'> <i>Team to win:</i><select name = 'team'> <option value = '1'> ".ucfirst($title_odds[0])." </option> <option value = '2'> ".ucfirst($title_odds[1])." </option> </select> <i>Bet:</i><input type = 'text' style = 'width: 50px;' value = '0' name = 'bet' id = 'bet'> </td> </tr> <tr bgcolor = '#000000' height = '30px'> <td colspan = '4' align = 'center'> <button class = 'submit:bet-".$num.":bookies.php?action=bet&id=".$eg['bg_id']."' id = 'linkage'>Place bet</button> </td> </tr> <tr> <td colspan = '4' height = '5px'> </td> </tr> </table> </form> </td> </tr>"; $num++; } } echo "</table>"; } } function place_bet() { global $user; echo "<p_title>Place bet</p_title><hr>"; $_GET['id'] = preg_replace('/[^0-9]/', '', $_GET['id']); $_POST['bet'] = preg_replace('/[^0-9]/', '', $_POST['bet']); $_POST['team'] = preg_replace('/[^0-9]/', '', $_POST['team']); if($_GET['id'] && $_POST['bet'] && $_POST['team']) { $sql = "SELECT * FROM `bookie_games` WHERE `bg_id` = '".mysql_real_escape_string($_GET['id'])."' AND `bg_time` > '".mysql_real_escape_string(time())."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { if($user['usr_money'] >= $_POST['bet']) { $bg = mysql_fetch_array($sql); $teamname = explode(" VS ", $bg['bg_title']); $teamname = $teamname[$_POST['team']-1]; $oddsmin = explode("-", $bg['bg_odds']); $odds = $oddsmin[$_POST['team']-1]; $oddsmin = explode(":", $oddsmin[$_POST['team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($_POST['bet']/$oddsmin); $betting*=$oddsmin; if(!$_GET['step']) { echo "You are betting <b>".money_alter($_POST['bet'])."</b>(".money_alter($betting)." effective) on team <b>".$teamname."</b> to win with the odds of [".$odds."]. Are you sure you wish to place this bet? <form name = 'bet-c' id = 'bet-c'> <input type = 'hidden' name = 'bet' id = 'bet' value = '".$_POST['bet']."'> <input type = 'hidden' name = 'team' id = 'team' value = '".$_POST['team']."'> <button class = 'submit:bet-c:bookies.php?action=bet&id=".$_GET['id']."&step=1' id = 'linkage'>Confirm bet</button> </form>"; } else { $sql = "INSERT INTO `bookie_bets` VALUES('NULL', '".mysql_real_escape_string($_SESSION['myid'])."', '".mysql_real_escape_string($_GET['id'])."', '".mysql_real_escape_string($_POST['team'])."', '".mysql_real_escape_string($_POST['bet'])."')"; mysql_query($sql); echo min_money($_POST['bet']); echo "Your bet has been placed for a total of <b>".money_alter($_POST['bet'])."</b>. You can view your bets from the top of this page. You will receive an event with the results shortly after the game has ended."; } } else { echo warn("You dont have enough money to make this bet!"); } } else { echo warn("This game does not exist!"); } } else { echo warn("This game does not exist!"); } } function view_bets() { global $user; echo "<p_title>Your bets</p_title><hr>"; echo "<table width = '100%' class = 'display-stripes'> <tr> <th colspan = '2'> Team betting on/Type </th> <th> Odds </th> <th> Ending date </th> <th> Total bet </th> </tr>"; $sql = "SELECT bb.*,bg.* FROM `bookie_bets` bb LEFT JOIN `bookie_games` bg ON bb.bb_game = bg.bg_id WHERE bb.bb_user = '".mysql_real_escape_string($_SESSION['myid'])."'"; $sql = mysql_query($sql); if(mysql_num_rows($sql)) { $num = 0; $cat_name = array('Football','Hockey','Baseball','Soccer','Box ing','Cricket','Basketball','All'); while($mb = mysql_fetch_array($sql)) { $teamname = explode(" VS ", $mb['bg_title']); $teamname = $teamname[$mb['bb_team']-1]; $oddsmin = explode("-", $mb['bg_odds']); $odds = $oddsmin[$mb['bb_team']-1]; $oddsmin = explode(":", $oddsmin[$mb['bb_team']-1]); $oddsmin = $oddsmin[1]; $betting = floor($mb['bb_bet']/$oddsmin); $betting*=$oddsmin; echo "<tr bgcolor = '".stripe($num)."' valign = 'top'> <td width = '50px'> <img src = 'images/css/casino/game-".$mb['bg_type'].".png'> </td> <td> ".$teamname." - ".ucfirst($cat_name[$mb['bg_type']-1])." </td> <td> [".$odds."] </td> <td> ".date('F j Y', $mb['bg_time'])."".date('g:i:s a', $mb['bg_time'])." </td> <td> ".money_alter($mb['bb_bet'])."(".money_alter($betting)." effective) </td> </tr>"; $num++; } } else { echo "<tr><td colspan = '5'>You have no bets at this time.</td></tr>"; } echo "</table>"; } ?> Don't worry, I worked it out.. Now when I try add a game, it does respond, but does not display any text and does not add the game.. Any clue as to why this is happening? Maybe something to do with the way the queries are? I would try change it now, but I am currently on my phone and am 4 hours away from home... And have to reinstall windows on my laptop first Edited July 7, 2015 by -BRAIDZ- Quote Link to comment Share on other sites More sharing options...
Coly010 Posted July 7, 2015 Share Posted July 7, 2015 Not exactly, but does your mysql_query() 's need the connection passed to them? I'm not too sure on that though. Can I also just point out that the html in this is horrible? at the start of the file there are 9 elements sharing the one ID... also [MENTION=68406]-BRAIDZ-[/MENTION] line 7 of your function file : ini_set('display_errors', 0); change it to ini_set('display_errors', true); and see what comes up Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 7, 2015 Author Share Posted July 7, 2015 (edited) Not exactly, but does your mysql_query() 's need the connection passed to them? I'm not too sure on that though. Can I also just point out that the html in this is horrible? at the start of the file there are 9 elements sharing the one ID... also [MENTION=68406]-BRAIDZ-[/MENTION] line 7 of your function file : ini_set('display_errors', 0); change it to ini_set('display_errors', true); and see what comes up No errors were displayed. And I have inserted games into my database, and they aren't showing up. So my guess would be it's the queries, the way they're set out.. Because it doesn't specifies what section of the table to insert and select from Edited July 8, 2015 by -BRAIDZ- Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 8, 2015 Author Share Posted July 8, 2015 (edited) [MENTION=65530]Coly010[/MENTION] ?? Edited July 8, 2015 by -BRAIDZ- Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted July 8, 2015 Share Posted July 8, 2015 @-BRAIDZ- A lot of us don't use or have the RC engine so it's kind of tough for us to effectively trouble shoot your code. And quite frankly this engine has been through the ringer and completely messed up. Like Coly said, your HTML is invalid right out of the gate id='linkage' like 8-9 times???? Your page is only supposed to have 1 id and can't be repeated. Now that's not the problem your having. You can possibly try printing out the MySQL error at the end of your queries you are running by adding something like: $sql = mysql_query($sql) or die(mysql_error()); And see if that prints out any errors Quote Link to comment Share on other sites More sharing options...
-BRAIDZ- Posted July 8, 2015 Author Share Posted July 8, 2015 @-BRAIDZ- A lot of us don't use or have the RC engine so it's kind of tough for us to effectively trouble shoot your code. And quite frankly this engine has been through the ringer and completely messed up. Like Coly said, your HTML is invalid right out of the gate id='linkage' like 8-9 times???? Your page is only supposed to have 1 id and can't be repeated. Now that's not the problem your having. You can possibly try printing out the MySQL error at the end of your queries you are running by adding something like: $sql = mysql_query($sql) or die(mysql_error()); And see if that prints out any errors It's not printing any errors Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.