Exemple #1
0
<?php

if (isset($_GET['page'])) {
    $page = $_GET['page'];
} else {
    $page = 'wallet_list';
}
if ($page != 'chname' && $page != 'stats' && $page != 'new_wallet' and $page != 'wallet_list' and $page != 'statistics' and $page != 'welcome' and $page != 'wallet' and $page != 'counter' and $page != 'wallet_savings' and $page != 'savings_counter') {
    header('Location: index.php');
}
include 'utils/db.php';
$logged_user = get_logged_user();
$wallet = get_picked_wallet();
if ($wallet > 0) {
    $is_mine = is_wallet_mine($logged_user, $wallet);
    if ($is_mine == 0) {
        header('Location: index.php?e=N');
    }
}
if ($logged_user == 0) {
    header('Location: index.php');
}
?>

<!DOCTYPE html class="no-js">
  <head>
    <title>Wirtualny Portfel</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta name="description" content="Kalkulator wydatków, pomocnik w oszczędzaniu" />
    <meta name="keywords" content="wirtualny portfel, oszczędzanie, kalkulator wydatków" />
    <meta property="og:title" content="Wirtualny Porftel" />
<?php

include '../utils/db.php';
$wallet_id = get_picked_wallet();
$logged_user = get_logged_user();
$operation_id = $_GET['id'];
if ($logged_user == 0) {
    header('Location: index.php');
}
if (!$wallet_id) {
    header('Location: portal.php');
}
if (!is_wallet_mine($logged_user, $wallet_id)) {
    header('Location: portal.php?e=M');
}
$sql = "DELETE FROM operations WHERE us_id = " . $logged_user . " AND wallet_id = " . $wallet_id;
mysql_query($sql);
$sql = "DELETE FROM wallets WHERE us_id = " . $logged_user . " AND id = " . $wallet_id;
mysql_query($sql);
header('Location: ../portal.php?page=wallet_list&o=U');