if(isset($_POST["submit_user_data"])){
if(empty($_POST["name_user"]) || empty($_POST["last_name_user"]) || empty($_POST["phone_user"]))
{
$alert = '<div class="alert alert-warning" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<h2>Upsss...</h2>
<p>Wypełnij wszystkie pola formularza.</p>
</div>';
}else{
db_connect();
$name_user = clear($_POST['name_user']);
$last_name_user = clear($_POST['last_name_user']);
$phone_user = clear($_POST['phone_user']);
$inquiry = "UPDATE users SET name_user='$name_user', last_name_user='$last_name_user', phone_user='$phone_user' WHERE id='$id_user'";
if(mysql_query($inquiry)){
$alert = '<div class="alert alert-succes" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<h2>Zaaktualizowano !</h2>
<p>Twoje dane zostały poprawnie zaaktualizowane.</p>
</div>';
}else{
$alert = '<div class="alert alert-danger" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
<h2>Upss...</h2>
<p>Wystąpił problem połączenia z bazą danych.</p>
<p>Spróbuj ponownie później.</p>
</div>';
}
db_close();
}
}