Файл: Source/admin/settings.php
Строк: 155
<?php
/*
* Script name: Points4Prize
* Author: Soft Projects
* Date created: 15/07/2015
*/
include "common.php";
head();
if (isset($_POST['update'])) {
$site_name = htmlspecialchars($_POST['site_name']);
$site_description = htmlspecialchars($_POST['site_description']);
$site_metatags = htmlspecialchars($_POST['site_metatags']);
$site_url = htmlspecialchars($_POST['site_url']);
$skype = htmlspecialchars($_POST['skype']);
$mobile_number = htmlspecialchars($_POST['mobile_number']);
$facebook = htmlspecialchars($_POST['facebook']);
$vote_points = (int) htmlspecialchars($_POST['vote_points']);
$email = htmlspecialchars($_POST['email']);
$myfile = fopen("../site_settings.php", "w") or die("Unable to open file!");
$txt = '
<?php
/*
* Script name: Get Prizes
* Author: Soft Projects
* Date created: 18/05/2015
*/
$site_name = "'.$site_name.'";
$site_description = "'.$site_description.'";
$site_metatags = "'.$site_metatags.'";
$site_url = "'.$site_url.'"; //(Example: http://mysite.com/)
$skype = "'.$skype.'";
$mobile_number = "'.$mobile_number.'";
$email = "'.$email.'";
$facebook = "'.$facebook.'";
$vote_points = '.$vote_points.';
?>';
fwrite($myfile, $txt);
fclose($myfile);
$_SESSION['message_settings'] = "The general settings has been updated.";
header("Location: settings.php");
}
?>
<div class="body content rows scroll-y">
<!-- Page header -->
<div class="page-heading">
<h1>
Site
<small>
settings..
</small>
</h1>
</div>
<!-- End page header -->
<!-- Begin info box -->
<div class="row">
<div class="col-md-12">
<div class="box-info">
<h2>
Site settings
</h2>
<form class="form-horizontal" method="POST">
<div class="panel-body">
<div class="row">
<?php
if (@$_SESSION['message_settings'] != ''){
?>
<div class="alert alert-success"><?php echo $_SESSION['message_settings']; ?></div>
<?php
$_SESSION['message_settings'] = '';
}
?>
<div class="col-md-12">
<div class="form-group">
<label class="col-md-2 control-label">Site name</label>
<div class="col-md-10">
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-globe"></span></span>
<input class="form-control" name="site_name" value="<?php echo $GLOBALS['site_name']; ?>" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Site description</label>
<div class="col-md-10">
<textarea class="form-control" name="site_description"><?php echo $GLOBALS['site_description']; ?></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Site meta tags</label>
<div class="col-md-10">
<textarea class="form-control" name="site_metatags"><?php echo $GLOBALS['site_metatags']; ?></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Site URL</label>
<div class="col-md-10">
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-link"></span></span>
<input class="form-control" name="site_url" value="<?php echo $GLOBALS['site_url']; ?>" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Skype</label>
<div class="col-md-10">
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-skype"></span></span>
<input class="form-control" name="skype" value="<?php echo $GLOBALS['skype']; ?>" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">facebook</label>
<div class="col-md-10">
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-facebook"></span></span>
<input class="form-control" name="facebook" value="<?php echo $GLOBALS['facebook']; ?>" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Phone</label>
<div class="col-md-10">
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-phone"></span></span>
<input class="form-control" name="mobile_number" value="<?php echo $GLOBALS['mobile_number']; ?>" type="text">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Vote points</label>
<div class="col-md-10">
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-angellist"></span></span>
<input class="form-control" name="vote_points" value="<?php echo $GLOBALS['vote_points']; ?>" type="number">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">System Email Adress</label>
<div class="col-md-10">
<div class="input-group">
<span class="input-group-addon"><span class="fa fa-envelope"></span></span>
<input class="form-control" name="email"
value="<?php echo $GLOBALS['email']; ?>" type="email">
</div>
<br />
Example: noreplay@mysite.com
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label"></label>
<div class="col-md-10">
<div class="input-group">
<input type="submit" class="btn btn-success" name="update" value="Update settings" />
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php footer(); ?>
</div>
</div>
</div>