<?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();

?>
<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-pencil"></i> Editare profil</h3>
</div>
<?php if(isset($actualizare) == '1'){?>
<div class="w3-panel w3-padding w3-green"><i class="fa fa-check"></i> Profilul dvs. a fost actualizat!</div>
<?php }elseif(isset($actualizare) == '2'){ ?>
<div class="w3-panel w3-padding w3-red"><i class="fa fa-times"></i> Profilul dvs. nu a fost actualizat!</div>
<?php } ?>
<div class="w3-row w3-margin-top">
<form action="" method="post">
<div class="w3-half w3-margin-bottom" style="padding-left:7px;">
<input name="prenume" class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['prenume']?>" placeholder="Prenumele dvs." value="<?=$rowct['prenume']?>"/>
<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 name="nume" class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['nume']?>" placeholder="Numele dvs." value="<?=$rowct['nume']?>"/>
<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 name="mobil" class="w3-input w3-white w3-xlarge w3-card" value="<?=$rowct['mobil']?>" placeholder="Mobil (ex. 407****)" value="<?=$rowct['mobil']?>"/>
<label class="w3-right w3-small" for="mobil" style="margin-top:-50px;margin-right:5px;"><em>Mobil</em></label>
</div>

<div class="w3-half w3-margin-bottom" style="padding-left:7px;">
<select name="moneda" class="w3-input w3-white w3-xlarge w3-card">
<?php if($rowct['moneda'] == "RON"){ ?>
<option value="EUR">EURO</option>
<option value="<?=$rowct['moneda']?>" selected=""><?=$rowct['moneda']?></option>
<?php }elseif($rowct['moneda'] == "EUR"){ ?>
<option value="<?=$rowct['moneda']?>" selected="">EURO</option>
<option value="RON">RON</option>
<?php }else{ ?>
<option value="" selected="">Selectați moneda</option>
<option value="EUR">EURO</option>
<option value="RON">RON</option>
<?php } ?>
</select>
<label class="w3-right w3-small" for="nume" style="margin-top:-50px;margin-right:45px;"><em>Moneda</em></label>
</div>

<div class="w3-margin-bottom w3-center">
<button type="submit" class="w3-button w3-hover-green w3-blue w3-xlarge w3-round-large">Actualizare</button>
</div>

<input type="hidden" name="uid" value="<?=$rowct['uid']?>"/>
<input type="hidden" name="actualizareprofil" value="true"/>
</form>

<div class="w3-margin-bottom">
<p>Notă!<br/>
Adresa de e-mail nu se poate modifica, aceasta nu este și nu v-a fi publică, este unică.</p>
</div>

</div>


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