<?php 

	require ('utilities.php');

	@session_start();
	checklogin();

	global $db;

	$title = "Mon Compte"; 



	// --------------------------------


	$user = $db->run ( 
		"SELECT * FROM users WHERE user_id = :id ;", 
		[ 'id' => $_SESSION['user_id'] ]
	);


    $alltransactions = $db->all ( 
    	"SELECT * FROM transactions WHERE user_id = :id ;", 
    	[ 'id' => $_SESSION['user_id'] ]
    );
    	

?>
<?php require( 'partials/_header.php'); ?>




		
	      <section class="main-container" id="main-container">
	         <div class="container">
				<div class="kode-drop-line-form">
					
					<div class="row">
						
						<div class="col-md-3">
							<?php require( 'partials/_menu.php'); ?>
						</div>
						<div class="col-md-6">
							
	                        <div class="panel panel-default">
			                <div class="panel-heading">
			                    <h3 class="text-bold">Informations de compte</h3>
			                </div>
			                <div class="panel-body">
			                    <section class="table-responsive">
			                        <table class="table table-striped table-bordered">
			                            <thead>
			                                <tr>
			                                    <th>Numero de compte</th>
			                                    <th>Type de compte</th>
			                                    <th>Balance</th>
			                                </tr>
			                            </thead>
			                            <tbody>
			                                <tr>
			                                    <td><?= $user->user_id ?></td>
			                                    <td>Compte <?= $user->user_compte ?></td>
			                                    <td>
			                                        <h4 class="text-bold"><?= getSolde($alltransactions) ?> EUR EURO</h4>
			                                    </td>
			                                </tr>
			                            </tbody>
			                        </table>
			                    </section>
			                </div>
			            </div>

						</div>
						<div class="col-md-3">
							<?php require( 'partials/_profil.php'); ?>
						</div>
					</div>

				</div>
			</div>
		</section>






<?php require( 'partials/_footer.php'); ?>