The following files exists in this folder. Click to view.
history.php65 lines UTF-8 Unix (LF) 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="sv">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Historik</title>
<link rel="stylesheet" href="/spectre/spectre-master/dist/spectre.css">
<style>
.hContainer {
border: 1px solid black;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.5vw;
}
.hAmmount{
flex: 1;
text-align: left;
padding-top: 1.5vw;
}
.hDate{
flex: 1;
text-align: center;
padding-top: 1.5vw;
}
.hAction {
flex: 1;
text-align: right;
padding-top: 1.5vw;
}
</style>
</head>
<body style="text-align: center;">
<br>
<h1>Historik för "<?php echo"{$_GET["mess"]}"?>"</h1> <!-- $_GET["mess"] innehåller kontonamnet, som skickas via a-taggen på user-sidan -->
<p>©Söderbank</p>
<a href="../user.php" class="btn">Tillbaka</a>
<br><br>
<?php
$file_in="../accounts/{$_SESSION["username"]}.json";
$json=json_decode(file_get_contents($file_in), true);
foreach($json["{$_SESSION["username"]}"] as $t){
if ($t["account-name"]==$_GET["mess"]){
for($i=0;$i<=count($t["transactions"])-1; $i++){
echo "<div class=\"hContainer\"><p class=\"hAmmount\">Belopp: {$t["transactions"][$i]}kr</p>";
$i++;
echo "<p class=\"hDate\">Datum: {$t["transactions"][$i]}</p>";
$i++;
echo "<p class=\"hAction\">Händelse: {$t["transactions"][$i]}</p></div>";
}
}
}
?>
</body>
</html>