/web/htdocs/www.euroroma.net/home/zenphoto/zp-core/setup/setup-sqlform.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
    <li>
    <div class="sqlform">
    <p><?php echo gettext("Fill in the information below and <strong>setup</strong> will attempt to update your configuration file."); ?><br />
    </p>
    <form action="" method="post"><input type="hidden" name="db" value="yes" />
        <input type="hidden" name="xsrfToken" value="<?php echo $xsrftoken?>" />
        <?php
        
if ($debug) {
            
?>
            <input type="hidden" name="debug" />
            <?php
        
}
        
?>
    <script type="text/javascript">
        function showFields() {
            switch ($('#dbselect').val()) {
            <?php
            
foreach ($engines as $engine) {
                if (
$engine) {
                    
$handler $engine['engine'];
                    
?>
                    case '<?php echo $handler?>':
                        <?php
                        
foreach ($engine as $field=>$show) {
                            if (
$show) {
                                
?>
                                $('#<?php echo $field?>').show();
                                <?php
                            
} else {
                                
?>
                                $('#<?php echo $field?>').hide();
                                <?php
                            
}
                        }
                        
?>
                        break;
                    <?php
                
}
            }
            
?>
            }
        }
        $(document).ready(function() {
            showFields();
        });
    </script>
    <table class="inputform">
        <tr>
            <td><?php echo gettext("Database engine"?></td>
            <td><select id="dbselect" name="db_software" onchange="showFields();">
                <?php
                
foreach ($engines as $engine) {
                    
$handler $engine['engine'];
                    
$modifiers '';
                    if (
$engine['enabled']) {
                        if (
$handler == $selected_database) {
                            
$modifiers ' selected="selected"';
                        }
                    } else {
                        
$modifiers ' disabled="disabled"';
                    }
                    
?>
                <option value="<?php echo $handler?><?php echo $modifiers?>>
                    <?php if (isset($engine['experimental'])) printf(gettext('%s (experimental)'),$handler); else echo $handler;?>
                </option>
                <?php
                
}
            
?>
            </select></td>
        </tr>
        <tr id="user" >
            <td><?php echo gettext("Database admin user"?></td>
            <td><input type="text" size="40" name="db_user"
                value="<?php echo $_zp_conf_vars['mysql_user']; ?>" />&nbsp;</td>
        </tr>
        <tr id="pass" >
            <td><?php echo gettext("Database admin password"?></td>
            <td><input type="password" size="40" name="db_pass" value="<?php echo $_zp_conf_vars['mysql_pass']; ?>" />&nbsp;</td>
        </tr>
        <tr id="host" >
            <td><?php echo gettext("Database host"); ?>
            </td>
            <td><input type="text" size="40" name="db_host" value="<?php echo $_zp_conf_vars['mysql_host']; ?>" /></td>
        </tr>
        <tr id="database" >
            <td><?php echo gettext("Database name"); ?></td>
            <td><input type="text" size="40" name="db_database" value="<?php echo $_zp_conf_vars['mysql_database']?>" />&nbsp;</td>
        </tr>
        <tr id="prefix" >
            <td><?php echo gettext("Database table prefix"); ?></td>
            <?php
            
if($_zp_conf_vars['mysql_prefix']=='.') {
                
$path str_replace(array(' ','/'), '_'trim(WEBPATH,'/')).'_';
            } else {
                
$path $_zp_conf_vars['mysql_prefix'];
            }
            
?>
            <td><input type="text" size="40" name="db_prefix" value="<?php echo $path; ; ?>" /></td>
        </tr>
        <tr>
            <td></td>
            <td><input type="submit" value="<?php echo gettext('save'); ?>" /></td>
        </tr>
    </table>
    </form>
    </div>
    </li>