<?php
if(isset($_SESSION['user_id']) AND (substr($_SERVER['PHP_SELF'], -10) != 'iesire.html')) {
    
    $qcont = "SELECT * FROM `utilizatori` WHERE `uid`='".$_SESSION['user_id']."' LIMIT 1";
    $rcont = $dbc->query($qcont);
    $rowct = $rcont->fetch_assoc();
    
    $email = $rowct['email'];
    $default = BASE_URL.PATH."imagini/no-image-icon.png";
    $size = 250;
    
    $grav_url = "https://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "?d=" . urlencode( $default ) . "&s=" . $size;



?>
<div class="w3-row-padding">
<div class="w3-quarter">
<?php include APP.'sidebar_usr.php'; ?>
</div>
<div class="w3-threequarter">
<div class="w3-row w3-indigo">
<h3 class="w3-container"><i class="fa fa-cogs"></i> Setările mele</h3>
</div>


<div class="w3-row w3-margin-top">
<div class="w3-quarter">
<div class="w3-card">
<img class="w3-image" src="<?php echo $grav_url; ?>" alt="<?=$rowct['prenume']?>" style="width:100%;max-width:100%;"/>
</div>
<div class="w3-center">
<a href="https://ro.gravatar.com/" target="_blank">Schimbi imaginea?</a>
</div>
</div>
<div class="w3-threequarter">

<div class="w3-half w3-margin-bottom" style="padding-left:7px;">
<input class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['prenume']?>" disabled=""/>
<label class="w3-right w3-small" for="prenume" style="margin-top:-50px;margin-right:5px;"><em>Prenume</em></label>
</div>

<div class="w3-half w3-margin-bottom" style="padding-left:7px;">
<input class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['nume']?>" disabled=""/>
<label class="w3-right w3-small" for="nume" style="margin-top:-50px;margin-right:5px;"><em>Nume</em></label>
</div>

<div class="w3-half w3-margin-bottom" style="padding-left:7px;">
<input class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['email']?>" disabled=""/>
<label class="w3-right w3-small" for="nume" style="margin-top:-50px;margin-right:5px;"><em>E-mail</em></label>
</div>

<div class="w3-half w3-margin-bottom" style="padding-left:7px;">
<input class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['moneda']?>" disabled=""/>
<label class="w3-right w3-small" for="nume" style="margin-top:-50px;margin-right:5px;"><em>Moneda</em></label>
</div>

<div class="w3-half w3-margin-bottom" style="padding-left:7px;">
<input class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['data_r']?>" disabled=""/>
<label class="w3-right w3-small" for="nume" style="margin-top:-50px;margin-right:5px;"><em>Data înregistrării</em></label>
</div>

<div class="w3-half w3-margin-bottom" style="padding-left:7px;">
<input class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['data_m']?>" disabled=""/>
<label class="w3-right w3-small" for="nume" style="margin-top:-50px;margin-right:5px;"><em>Ultima modificare</em></label>
</div>

</div>

</div>


</div></div>
<?php
 }else{
    $url = PATH.'/index.html';
    ob_end_clean();
    header("Location: $url");
    exit();
 }
?>