diff --git a/edit_game.php b/edit_game.php index bd1a6f3..8919f17 100755 --- a/edit_game.php +++ b/edit_game.php @@ -18,12 +18,12 @@ if (LOGIN!="") { $edit_second_bill=money_to_bill($_POST['edit_second_bill']); $edit_third_id=$_POST['edit_third_id']; $edit_third_bill=money_to_bill($_POST['edit_third_bill']); - mysql_query("UPDATE `games` SET `scoregame` = '$edit_scoregame', `location` = '$edit_location', `datetime` = '$edit_datetime', `player` = '$edit_player', `base_bill` = '$edit_base_bill', `first_id` = '$edit_first_id', `first_bill` = '$edit_first_bill', `second_id` = '$edit_second_id', `second_bill` = '$edit_second_bill', `third_id` = '$edit_third_id', `third_bill` = '$edit_third_bill' WHERE `games`.`id` =$EDIT_ID LIMIT 1 ; ",DB); + mysqli_query($db, "UPDATE `games` SET `scoregame` = '$edit_scoregame', `location` = '$edit_location', `datetime` = '$edit_datetime', `player` = '$edit_player', `base_bill` = '$edit_base_bill', `first_id` = '$edit_first_id', `first_bill` = '$edit_first_bill', `second_id` = '$edit_second_id', `second_bill` = '$edit_second_bill', `third_id` = '$edit_third_id', `third_bill` = '$edit_third_bill' WHERE `games`.`id` =$EDIT_ID LIMIT 1 ; "); } if (TO_DO=="new_game") { - $query=mysql_query("SELECT `location` , `datetime` , `player` , `base_bill` , `first_id` , `first_bill` , `second_id` , `second_bill` , `third_id` , `third_bill` FROM `games` ORDER BY `games`.`id` DESC LIMIT 0 , 1",DB); - $data=mysql_fetch_row($query); + $query=mysqli_query($db, "SELECT `location` , `datetime` , `player` , `base_bill` , `first_id` , `first_bill` , `second_id` , `second_bill` , `third_id` , `third_bill` FROM `games` ORDER BY `games`.`id` DESC LIMIT 0 , 1"); + $data=mysqli_fetch_row($query); $hit=0; if ($data){ foreach($data as $field) { @@ -33,9 +33,10 @@ if (LOGIN!="") { } else $hit=1; if ($hit) { - mysql_query("INSERT INTO `games` ( ) VALUES ( );",DB); - $query=mysql_query("SELECT `id` FROM `games` ORDER BY `games`.`id` DESC LIMIT 0 , 1",DB); - $data=mysql_fetch_row($query); + mysqli_query($db, "INSERT INTO `games` ( `location`, `datetime`, `player`, `base_bill`, `first_id`, `first_bill`, `second_id`, `second_bill`, `third_id`, `third_bill` ) VALUES ( 'Bei Wem?', '1989-10-03 12:00:00', '', '200', '0', '0', '0', '0', '0', '0' );"); + echo "HERE" . mysqli_error($db); + $query=mysqli_query($db, "SELECT `id` FROM `games` ORDER BY `games`.`id` DESC LIMIT 0 , 1"); + $data=mysqli_fetch_row($query); $EDIT_ID=$data[0]; } else { @@ -45,16 +46,16 @@ if (LOGIN!="") { } if ($EDIT_ID) { - $query=mysql_query("SELECT * FROM `games` WHERE `id` = $EDIT_ID LIMIT 0 , 1",DB); - $data =mysql_fetch_array($query); + $query=mysqli_query($db, "SELECT * FROM `games` WHERE `id` = $EDIT_ID LIMIT 0 , 1"); + $data =mysqli_fetch_array($query); $BODY.='
'; $BODY.=''; $BODY.=''; $BODY.=''; $BODY.=''; $BODY.=''; $BODY.=''; $BODY.=''; $BODY.=''; -$query=mysql_query("SELECT * FROM `games` ORDER BY `datetime` ASC",DB); -while ($data=mysql_fetch_array($query)) { +$query=mysqli_query($db, "SELECT * FROM `games` ORDER BY `datetime` ASC"); +while ($data=mysqli_fetch_array($query)) { $id=$data['id']; $BODY.="
Location:
Datum/Zeit:
Spieler:
 1. Platz2. Platz3. Platz
Spieler:Datum, Zeit Dritter
"; if (LOGIN!="") diff --git a/index.php b/index.php index 0776f36..a34465b 100755 --- a/index.php +++ b/index.php @@ -11,8 +11,7 @@ $COMMENT = ""; //comments if (isset($_GET['to_do'])) define ("TO_DO",$_GET['to_do']); else define ("TO_DO",""); - define ('DB',mysql_connect("localhost","poker","JuzFQK6rnNfx75v8")); - mysql_select_db("poker",DB); + $db = mysqli_connect("localhost","poker","*******", "poker"); include("globals.php"); include("functions.php"); @@ -20,13 +19,13 @@ if (!session_start()) $ERROR.="Server Session kann nicht eingerichtet werden, kein login möglich!
"; if (TO_DO=="login") { $login=$_POST['login']; - $password=md5($_POST['password']); - $query=mysql_query("SELECT `password` FROM `player` WHERE `alias` = '$login' AND `password` IS NOT NULL LIMIT 0 , 30",DB); - $data=mysql_fetch_array($query); - if ($data['password']==$password) { + $query=mysqli_query($db, "SELECT `password` FROM `player` WHERE `alias` = '$login' AND `password` IS NOT NULL LIMIT 0 , 30"); + $data=mysqli_fetch_array($query); + if ($data!==NULL && $data!==False && password_verify($_POST['password'], $data['password'])) { $_SESSION['login']=$login; + } else { + $ERROR.="Login nicht erfolgreich!
"; } - else $ERROR.="Login nicht erfolgreich!
"; } if ($page=="logout") { $_SESSION['login']=""; @@ -36,7 +35,8 @@ else define ("LOGIN",""); if (LOGIN!="") { $BODY.='
'.add_icon('user')."  ".LOGIN."    "; - $BODY.=''.add_icon("new_game").'Neues Spiel'; + $BODY.=''.add_icon("new_game").'Neues Spiel    '; + $BODY.=''.add_icon("arrow_out").'Rangliste Aktualisieren    '; $BODY.="
"; } $BODY.="

"; @@ -53,5 +53,5 @@ include ("template.php"); //End of Script - mysql_close(DB); + mysqli_close($db); ?> diff --git a/index.php~ b/index.php~ deleted file mode 100755 index ad8affd..0000000 --- a/index.php~ +++ /dev/null @@ -1,21 +0,0 @@ - diff --git a/main.php b/main.php index 2cce316..9c194b0 100755 --- a/main.php +++ b/main.php @@ -1,6 +1,6 @@
diff --git a/password.php b/password.php new file mode 100755 index 0000000..3381921 --- /dev/null +++ b/password.php @@ -0,0 +1,17 @@ + + + + + + +
+ "; + echo "password algorithm: " . password_get_info($pw_hash)['algoName'] . "
"; + } + ?> + + + diff --git a/rank.php b/rank.php index 9162db5..80c73db 100755 --- a/rank.php +++ b/rank.php @@ -1,19 +1,22 @@ "; if (!$failure) { - $query=mysql_query("SELECT `alias` FROM `player` WHERE `alias` = '$alias' LIMIT 0 , 30",DB); - $data=mysql_fetch_array($query); - if ($data['alias']==$alias) $failure.="Spitzname existiert bereits!
"; + $query=mysqli_query($db, "SELECT `alias` FROM `player` WHERE `alias` = '$alias' LIMIT 0 , 30"); + $data=mysqli_fetch_array($query); + if ($data!==NULL && $data!==False && $data['alias']==$alias) $failure.="Spitzname existiert bereits!
"; } if (!$failure) { - mysql_query("INSERT INTO `player` ( `alias` ) VALUES ( '$alias' );",DB); + mysqli_query($db, "INSERT INTO `player` ( `alias`, `password`, `cnt_games`, `cnt_first`, `cnt_second`, `cnt_third`, `points`, `rate`, `bill`, `rank`) VALUES ( '$alias', '', '0', '0', '0', '0', '0', '0', '0', '0');"); } else { $value_ip_alias = $alias; @@ -49,12 +52,12 @@ if (TO_DO=="save_edit_player" && LOGIN!="" && ($player=$_GET['player'])) { $failure=""; if (!($alias=$_POST['alias'])) $failure.="Spitznamen angeben!
"; if (!$failure) { - $query=mysql_query("SELECT `id`,`alias` FROM `player` WHERE `alias` = '$alias' LIMIT 0 , 30",DB); - while ($data=mysql_fetch_array($query)) + $query=mysqli_query($db, "SELECT `id`,`alias` FROM `player` WHERE `alias` = '$alias' LIMIT 0 , 30"); + while ($data=mysqli_fetch_array($query)) if ($data['id']!=$player) $failure.="Spitzname existiert bereits!
"; } if (!$failure) { - mysql_query("UPDATE `player` SET `alias` = '$alias' WHERE `id` = '$player' LIMIT 1 ;",DB); + mysqli_query($db, "UPDATE `player` SET `alias` = '$alias' WHERE `id` = '$player' LIMIT 1 ;"); } $ERROR.=$failure; } @@ -62,6 +65,7 @@ if (TO_DO=="save_edit_player" && LOGIN!="" && ($player=$_GET['player'])) { $BODY.=' + @@ -74,19 +78,20 @@ $BODY.=' '; -$query=mysql_query("SELECT * FROM `player` $SORTSTRING",DB); -while ($data=mysql_fetch_array($query)) { +$query=mysqli_query($db, "SELECT * FROM `player` $SORTSTRING"); +$position = 1; +while ($data=mysqli_fetch_array($query)) { $id = $data['id']; $alias = $data['alias']; if (TO_DO=="edit_player" && LOGIN!="" && $_GET['player']==$alias) { $BODY.=""; - $BODY.=""; + $BODY.=""; $BODY.="\n"; $BODY.="\n"; $BODY.=""; } else { - $BODY.=""; @@ -101,6 +106,8 @@ while ($data=mysql_fetch_array($query)) { $BODY.=""; $BODY.="\n"; } + + ++$position; } if (LOGIN!="") { diff --git a/style.css b/style.css index c3c0b45..1762595 100755 --- a/style.css +++ b/style.css @@ -14,6 +14,9 @@ table.list { } table.list td { text-align:center; + border-bottom-color:#fffe; + border-bottom-width:1px; + border-bottom-style:dotted; } table.list th{ padding-left:3px;
#   '.(($SORTBY=="alias") ? add_icon($SORTORDER):"").'Spitzname '.(($SORTBY=="cnt_games") ? add_icon($SORTORDER):"").'Spiele'.(($SORTBY=="rank") ? add_icon($SORTORDER):"").'Rang
"; + $BODY.="
$position"; if (LOGIN!="") $BODY.="".add_icon("pencil").""; $BODY.="$alias".$data['rank']."