query($query); if ( $rows ) { foreach ($rows as $row) { $all_maintainers[$row['maintainer']] = $row['value']; } } print( "
" );
	print_r( $all_maintainers );
	print( "
" ); $snippets[0] = <<
Assuming you are new here, add your Torn API key

 


 

 


 

HTML; // Let maintainer select (or delete) a player $query = <<prepare($query); $stmt->execute( [$maintainer[0]] ); $rows = $stmt->fetchAll(); /* print("
");
	print( "\$rows:\n" );
	print_r($rows);
	print("
"); */ $players_id = array(); foreach ($rows as $row) { $players_id[] = array($row['player'], $row['value'] . " [" . $row['player'] . "]"); } $snippets[2] .= <<
HTML; foreach ($players_id as $player) { $snippets[2] .= "\n\t\t\t\t\t"; $snippets[2] .= "\n\t\t\t\t\t\t"; $snippets[2] .= "\n\t\t\t\t\t"; } $snippets[2] .= <<
PlayerEditRemove
$player[1]"; $snippets[2] .= ""; $snippets[2] .= ""; $snippets[2] .= "

 

HTML; } if ( $screen == 3 ) { // Edit properties of player // Provided is $_REQUEST['player'] // $maintainer[id, 'name'] is also available in this section $player = $_REQUEST['player']; $query = <<prepare( $query ); $stmt->execute( [$player, $maintainer[0]] ); //$rows = $stmt->fetchAll(); $player_properties = []; $name = '?'; foreach ($stmt as $key => $value) { // @TODO This is one row now since we store it in a JSON string /* print( "
" );
		print( "[\$key, \$value]" );
		print_r( [$key, $value] );
		print( "
" ); */ $player_properties[] = json_decode( $value['property'] ); if ($key == 'name') { $name = $value['value']; } } $query = <<query( $query ); $properties = []; foreach ($stmt as $row) { $properties[] = $row['property']; } $snippets[3] = ''; /* print("
");
	print_r($player_properties);
	print_r($properties);
	print_r( [$player, $maintainer[0]] );
	print("
\n"); */ $snippets[3] = <<

 


 

-->

 

HTML; }