View file modules/padmin/ads.php

File size: 1.79Kb
<?php
/**********************************
*	@package: PerfCMS			  *
*	@year: 2012					  *
*	@author: Artas				  *
*	@link: http://perfcms.pp.ua	  *
**********************************/
$locate = 'in_padmin';
if(isset($user) && $user['level'] >= 6) {
$title = $lang->word('padmin_ads');
require_once(SYS.'/view/header.php');
$tpl->div('title',  $lang->word('padmin_ads'));
if(isset($_POST['save']) && $_GET['act']== 'save') {
$header = escape($_POST['header']);
$footer = escape($_POST['footer']);
$banner = escape($_POST['banner']);
$db->query("UPDATE `system` SET  `ads_banners` = '". $banner."', `ads_footer` = '". $footer."', `ads_header` = '". $header."'");
$tpl->div('menu', $lang->word('succ_save'));
$tpl->div('block', img('ads.png') . '<a href="/padmin/ads/">'.$lang->word('padmin_ads').'</a><br/>'. img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
exit;
	}
echo '<div class="post">
<form action="/padmin/ads/?act=save" method="post">
<b>'. $lang->word('padmin_ads_header') .'</b>:<br/>
<textarea name="header" rows="6" cols="30">'. $system['ads_header'] .'</textarea><br/>
<b>'. $lang->word('padmin_ads_footer') .'</b>:<br/>
<textarea name="footer" rows="6" cols="30">'. $system['ads_footer'] .'</textarea><br/>
<b>'. $lang->word('padmin_ads_banner') .'</b>:<br/>
<textarea name="banner" rows="6" cols="30">'. $system['ads_banners'] .'</textarea><br/>
<input type="submit" name="save" value="'. $lang->word('save') .'" /><br/>
</form>
</div>';
$tpl->div('block', img('admin.png') .'<a href="/padmin/">'. $lang->word('padmin') .'</a><br/>'. HICO .'<a href="/">'. $lang->word('home') .'</a>');
require_once(SYS.'/view/footer.php');
} else { header('Location: /'); }
?>