Project

General

Profile

1 1457 Luisehahne
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         droplet
6
 * @author          Ruud Eisinga (Ruud) John (PCWacht)
7
 * @author          WebsiteBaker Project
8
 * @copyright       2004-2009, Ryan Djurovich
9
 * @copyright       2009-2011, Website Baker Org. e.V.
10
 * @link			http://www.websitebaker2.org/
11
 * @license         http://www.gnu.org/licenses/gpl.html
12
 * @platform        WebsiteBaker 2.8.x
13
 * @requirements    PHP 5.2.2 and higher
14
 * @version         $Id$
15
 * @filesource		$HeadURL$
16
 * @lastmodified    $Date$
17
 *
18
 */
19
20
require('../../config.php');
21
22
require_once(WB_PATH.'/framework/class.admin.php');
23
require_once(WB_PATH.'/framework/functions.php');
24 1503 Luisehahne
$admin = new admin('admintools','admintools',true,false);
25 1457 Luisehahne
if($admin->get_permission('admintools') == true) {
26 1503 Luisehahne
27 1457 Luisehahne
	$admintool_link = ADMIN_URL .'/admintools/index.php';
28
	$module_edit_link = ADMIN_URL .'/admintools/tool.php?tool=droplets';
29 1503 Luisehahne
	// $admin = new admin('admintools', 'admintools');
30 1457 Luisehahne
31
	$modified_when = time();
32 1503 Luisehahne
	$modified_by = intval($admin->get_user_id());
33 1457 Luisehahne
34
	// Insert new row into database
35 1503 Luisehahne
	$sql = 'INSERT INTO `'.TABLE_PREFIX.'mod_droplets` SET ';
36
	$sql .= '`active` = 1, ';
37
	$sql .= '`modified_when` = '.$modified_when.', ';
38
	$sql .= '`modified_by` = '.$modified_by.' ';
39
	$database->query($sql);
40 1457 Luisehahne
41
	// Get the id
42 1503 Luisehahne
	$droplet_id = intval($database->get_one("SELECT LAST_INSERT_ID()"));
43 1457 Luisehahne
44
	// Say that a new record has been added, then redirect to modify page
45
	if($database->is_error()) {
46
		$admin->print_error($database->get_error(), $module_edit_link);
47
	} else {
48
		$admin->print_success($TEXT['SUCCESS'], WB_URL.'/modules/droplets/modify_droplet.php?droplet_id='. $admin->getIDKEY($droplet_id));
49
	}
50
51
} else {
52 1503 Luisehahne
		$admin->print_error($database->get_error(), $module_edit_link);
53
}
54
55
// Print admin footer
56
$admin->print_footer();