Файл: Source/admin/admin.php
Строк: 48
<?php
/*
* Script name: Points4Prize
* Author: Soft Projects
* Date created: 15/07/2015
*/
include "common.php";
head();
?>
<div class="body content rows scroll-y">
<!-- Page header -->
<div class="page-heading">
<h1>
Admin
<small>
profile..
</small>
</h1>
</div>
<!-- End page header -->
<!-- Begin info box -->
<div class="row">
<div class="col-md-12">
<div class="box-info">
<h2>
Admin profile
</h2>
<div class="panel-body">
<?php
if (isset($_POST['edit'])) {
$name = htmlspecialchars($_POST['name']);
$password = htmlspecialchars($_POST['password']);
$password = md5($password);
$mail = htmlspecialchars($_POST['mail']);
$avatar = htmlspecialchars($_POST['avatar']);
$edit = "UPDATE admin SET name='$name', password='$password', mail='$mail', avatar='$avatar' WHERE id='1'";
$sql = mysql_query($edit);
echo '
<div class="alert alert-success" role="alert">
Update of the admin information was successful.
<meta http-equiv=Refresh content=3;url=admin.php>
</div>
';
}
$sql = "SELECT * FROM admin WHERE id = '1'";
$result = mysql_query($sql) or die(mysql_error());
$row = mysql_fetch_array($result);
echo '
<form action="" method="post">
<p>
<label>
Avatar
</label>
<input name="avatar" class="form-control" type="text" value="' . $row['avatar'] . '">
</p>
<p>
<label>
Name
</label>
<input name="name" class="form-control" type="text" value="' . $row['name'] . '">
</p>
<p>
<label>
Password
</label>
<input name="password" class="form-control" type="password" value="' . $row['password'] . '">
</p>
<p>
<label>
E-Mail
</label>
<input name="mail" class="form-control" type="text" value="' . $row['mail'] . '">
</p>
<br>
<input type="submit" class="btn btn-success" name="edit" value="Update information" />
</form>
';
?>
</div>
</div>
<?php footer(); ?>
</div>
</div>
</div>