This repository has been archived by the owner on Sep 25, 2021. It is now read-only.
/
buyitnow.php
66 lines (59 loc) · 2.77 KB
/
buyitnow.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/***************************************************************************
* copyright : (C) 2008 - 2014 WeBid
* site : http://www.webidsupport.com/
***************************************************************************/
/***************************************************************************
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. Although none of the code may be
* sold. If you have been sold this script, get a refund.
***************************************************************************/
define('InAdmin', 1);
$current_page = 'settings';
include '../common.php';
include $include_path . 'functions_admin.php';
include 'loggedin.inc.php';
unset($ERR);
if (isset($_POST['action']) && $_POST['action'] == 'update')
{
$bn_only_percent = ($_POST['bn_only_percent'] > 100) ? 100 : ($_POST['bn_only_percent'] < 0) ? 0 : intval($_POST['bn_only_percent']);
// reset the bn_only blockers
if ($bn_only_percent > $system->SETTINGS['bn_only_percent'])
{
$query = "UPDATE " . $DBPrefix . "users SET bn_only = 'y' WHERE id = bn_only = 'n'";
$db->direct_query($query);
}
$query = "UPDATE " . $DBPrefix . "settings SET
buy_now = :buy_now,
bn_only = :bn_only,
bn_only_disable = :disable,
bn_only_percent = :percent";
$params = array();
$params[] = array(':buy_now', $_POST['buy_now'], 'int');
$params[] = array(':bn_only', $_POST['bn_only'], 'str');
$params[] = array(':disable', $_POST['bn_only_disable'], 'str');
$params[] = array(':percent', $bn_only_percent, 'str');
$db->query($query, $params);
$system->SETTINGS['buy_now'] = $_POST['buy_now'];
$system->SETTINGS['bn_only'] = $_POST['bn_only'];
$system->SETTINGS['bn_only_disable'] = $_POST['bn_only_disable'];
$system->SETTINGS['bn_only_percent'] = $_POST['bn_only_percent'];
$ERR = $MSG['30_0066'];
}
loadblock($MSG['920'], $MSG['921'], 'batch', 'buy_now', $system->SETTINGS['buy_now'], array($MSG['029'], $MSG['030']));
loadblock($MSG['30_0064'], $MSG['30_0065'], 'yesno', 'bn_only', $system->SETTINGS['bn_only'], array($MSG['030'], $MSG['029']));
loadblock($MSG['355'], $MSG['358'], 'yesno', 'bn_only_disable', $system->SETTINGS['bn_only_disable'], array($MSG['030'], $MSG['029']));
loadblock($MSG['356'], '', 'percent', 'bn_only_percent', $system->SETTINGS['bn_only_percent'], array($MSG['357']));
$template->assign_vars(array(
'ERROR' => (isset($ERR)) ? $ERR : '',
'SITEURL' => $system->SETTINGS['siteurl'],
'TYPENAME' => $MSG['25_0008'],
'PAGENAME' => $MSG['2__0025']
));
$template->set_filenames(array(
'body' => 'adminpages.tpl'
));
$template->display('body');
?>