<?php $wallet_id = get_picked_wallet(); $logged_user = get_logged_user(); if ($logged_user == 0) { header('Location: index.php'); } if (!$wallet_id) { header('Location: portal.php'); } if (!is_wallet_mine($logged_user, $wallet_id)) { unpick_wallet(); header('Location: portal.php?e=M'); } $wallet_from_db = get_whole_wallet($wallet_id); $dashboard = get_outcome_by_category($wallet_id); ?> <div style="float:left;"> <h1 style="margin:0px;">Portfel: <span class="regular orange"> <?php echo mb_convert_case($wallet_from_db['name'], MB_CASE_UPPER, "UTF-8"); ?> </span> <?php if (!is_wallet_opened($wallet_id)) { echo '<span class="regular gray">(portfel zamknięty)</span>'; } ?> </h1> </div>
function is_wallet_picked_and_its_active() { $wallet_id = get_picked_wallet(); $wallet = get_whole_wallet($wallet_id); if ($wallet['state'] == 'O') { return true; } else { return false; } }
<?php $wallet_id = $_GET['wallet_id']; $logged_user = get_logged_user(); if ($logged_user == 0) { header('Location: index.php'); } if (!$wallet_id) { header('Location: portal.php'); } if (!is_wallet_mine($logged_user, $wallet_id)) { unpick_wallet(); header('Location: portal.php?e=M'); } $wallet = get_whole_wallet($wallet_id); ?> <h1>Edytuj portfel</h2> <section class="form login-form" style="margin-left:0px;"> <form action="user_panel/save_edited_wallet.php" method="POST" id="wallet-form"> <div class="label">Nazwa portfela:</div> <div class="form-input"><input type="text" name="name" id="name" value="<?php echo $wallet[2]; ?> " /></div> <div style="clear:both; height:10px;"></div> <div class="submit-button"> <input type="hidden" name="wallet_id" value="<?php echo $wallet[0]; ?>