Файл: Source/admin/answer_faq.php
Строк: 48
<?php
/*
* Script name: Points4Prize
* Author: Soft Projects
* Date created: 15/07/2015
*/
include "common.php";
$ID = (int) htmlspecialchars($_GET['id']);
$data = mysql_query("SELECT * FROM `chesto_zadavani_vaprosi` WHERE `id`='$ID'");
$row = mysql_fetch_array($data);
head();
?>
<div class="body content rows scroll-y">
<!-- Page header -->
<div class="page-heading">
<h1><b>Answer FAQ</b> </h1>
</div>
<!-- End page header -->
<!-- Begin info box -->
<div class="row">
<div class="col-md-12">
<div class="box-info">
<h2>Answer FAQ</h2>
<?php
if (isset($_POST['answer_button'])) {
$answer = htmlspecialchars($_POST['answer']);
if (empty($answer)) {
} else {
mysql_query("UPDATE `chesto_zadavani_vaprosi` SET `otgovor` = '$answer', `active`='yes' WHERE `id` =$ID");
echo ' <META HTTP-EQUIV="refresh" CONTENT="0; URL=faq.php"> ';
}
}
?>
<form method="post">
<div class="panel panel-default">
<div class="panel-heading"><?php echo $row['pital']; ?></div>
<div class="panel-body">
<div class="form-group">
<label for="textArea" class="col-lg-2 control-label">Question</label>
<div class="col-lg-10">
<?php echo $row['vapros']; ?>
<br />
</div>
</div>
<br />
<div class="form-group">
<label for="textArea" class="col-lg-2 control-label">Answer</label>
<div class="col-lg-10">
<textarea class="form-control" name="answer" rows="3" id="textArea"><?php echo $row['otgovor']; ?></textarea>
<br />
<button type="submit" name="answer_button" class="btn btn-success">Answer question</button>
<a href="delete_faq.php?id=<?php echo $ID; ?>" class="btn btn-danger">Delete question</a>
</div>
</div>
</div>
</div>
</form>
</div>
<?php
footer();
?>
</div>
</div>