Project

General

Profile

1 2 Manuela
<?php
2
/**
3
 *
4
 * @category        module
5
 * @package         Form
6
 * @author          WebsiteBaker Project
7
 * @copyright       WebsiteBaker Org. e.V.
8
 * @link            http://wwebsitebaker.org/
9
 * @license         http://www.gnu.org/licenses/gpl.html
10
 * @platform        WebsiteBaker 2.8.3
11
 * @requirements    PHP 5.3.6 and higher
12
 * @version         $Id$
13
 * @filesource      $HeadURL$
14
 * @lastmodified    $Date$
15
 * @description
16
 */
17
if(!defined('WB_PATH')) {
18
    require_once(dirname(dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php');
19
    throw new IllegalFileException();
20
} else {
21
    $table_name = TABLE_PREFIX.'mod_form_settings';
22
    $field_name = 'perpage_submissions';
23
    $description = "INT NOT NULL DEFAULT '10' AFTER `max_submissions`";
24
    if(!$database->field_exists($table_name,$field_name)) {
25
        $database->field_add($table_name, $field_name, $description);
26
    }
27
28
// Insert an extra rows into the database
29
    $header     = '<table class="frm-field_table">'.PHP_EOL
30
                . '    <tbody>'.PHP_EOL;
31
    $field_loop = '        <tr>'.PHP_EOL
32
                . '            <td class="frm-field_title">{TITLE}{REQUIRED}:</td>'.PHP_EOL
33
                . '            <td>{FIELD}</td>'.PHP_EOL
34
                . '        </tr>';
35
    $footer     = '        <tr>'.PHP_EOL
36
                . '            <td>&#32;</td>'.PHP_EOL
37
                . '            <td>'.PHP_EOL
38
                . '                <input type="submit" name="submit" value="{SUBMIT_FORM}" />'.PHP_EOL
39
                . '            </td>'.PHP_EOL
40
                . '        </tr>'.PHP_EOL
41
                . '    </tbody>'.PHP_EOL
42
                . '</table>'.PHP_EOL;
43
44
    $email_to = '';
45
    $email_from = '';
46
    $email_fromname = '';
47
    $email_subject = '';
48
    $success_page = 0;
49
    $success_email_to = '';
50
    $success_email_from = '';
51
    $success_email_fromname = '';
52
    $success_email_text = '';
53
    // $success_email_text = addslashes($success_email_text);
54
    $success_email_subject = '';
55
    $max_submissions = 50;
56
    $stored_submissions = 50;
57
    $perpage_submissions = 10;
58
    $use_captcha = true;
59
60
    // Insert settings
61
    $sql  = 'INSERT INTO  `'.TABLE_PREFIX.'mod_form_settings` SET '
62
          . '`section_id` = \''.$database->escapeString($section_id).'\', '
63
          . '`page_id` = \''.$database->escapeString($page_id).'\', '
64
          . '`header` = \''.$database->escapeString($header).'\', '
65
          . '`field_loop` = \''.$database->escapeString($field_loop).'\', '
66
          . '`footer` = \''.$database->escapeString($footer).'\', '
67
          . '`email_to` = \''.$database->escapeString($email_to).'\', '
68
          . '`email_from` = \''.$database->escapeString($email_from).'\', '
69
          . '`email_fromname` = \''.$database->escapeString($email_fromname).'\', '
70
          . '`email_subject` = \''.$database->escapeString($email_subject).'\', '
71
          . '`success_page` = \''.$database->escapeString($success_page).'\', '
72
          . '`success_email_to` = \''.$database->escapeString($success_email_to).'\', '
73
          . '`success_email_from` = \''.$database->escapeString($success_email_from).'\', '
74
          . '`success_email_fromname` = \''.$database->escapeString($success_email_fromname).'\', '
75
          . '`success_email_text` = \''.$database->escapeString($success_email_text).'\', '
76
          . '`success_email_subject` = \''.$database->escapeString($success_email_subject).'\', '
77
          . '`max_submissions` = \''.$database->escapeString($max_submissions).'\', '
78
          . '`stored_submissions` = \''.$database->escapeString($stored_submissions).'\', '
79
          . '`perpage_submissions` = \''.$database->escapeString($perpage_submissions).'\', '
80
          . '`use_captcha` = \''.$database->escapeString($use_captcha).'\' ';
81
   if($database->query($sql)) {
82
83
    }
84
}