예제 #1
0
function html_dbase_start($type = null)
{
    global $language, $step, $dbase_connected, $config, $icon;
    $step_next = $step + 1;
    $slct = $type ?: 'mysqli';
    require_once 'include/dbselect.inc.php';
    $dbselect = new DbaseSelect();
    echo <<<EOT
\t<form action="install.php?step={$step_next}" name="cpgform" id="cpgform" method="post" style="margin:0px;padding:0px">
\t\t<table width="100%" border="0" cellpadding="0" cellspacing="1" class="maintable">
\t\t\t<tr>
\t\t\t\t<td class="tableb" colspan="2">
\t\t\t\t\t{$language['sect_dbase_info']}<br />
\t\t\t\t</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td colspan="2">&nbsp;</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td align="right">Database Type</td>
\t\t\t\t<td><select name="db_type">{$dbselect->options($slct)}</select></td>
\t\t\t</tr>
EOT;
    if ($dbase_connected) {
        echo <<<EOT
\t\t\t<tr>
\t\t\t\t<td></td>
\t\t\t\t<td align="left"><div class="cpg_message_success">{$language['dbase_succ']}</div></td>
\t\t\t</tr>

EOT;
    }
    $db_host = isset($config['db_host']) && $dbase_connected ? $config['db_host'] : 'localhost';
    $db_user = isset($config['db_user']) && $dbase_connected ? $config['db_user'] : '';
    $db_password = isset($config['db_password']) && $dbase_connected ? $config['db_password'] : '';
    echo <<<EOT
         <tr>
          <td align="right">{$language['dbase_host']}</td>
          <td><input type="text" class="textinput" name="db_host" value="{$db_host}" /></td>
         </tr>
         <tr>
          <td align="right">{$language['dbase_username']}</td>
          <td><input type="text" class="textinput" name="db_user" value="{$db_user}" /></td>
         </tr>
         <tr>
          <td align="right">{$language['dbase_password']}</td>
          <td><input type="password" name="db_password" value="{$db_password}" /></td>
         </tr>
         <tr>
         <td colspan="2" align="center">
            <button type="submit" class="button" name="update_check_connection" value="{$language['dbase_test_connection']}">{$icon['test']}{$language['dbase_test_connection']}</button>
          </td>
         </tr>

EOT;
    if ($dbase_connected) {
        echo <<<EOT
        <tr>
          <td colspan="2" align="center" class="tableh2">
            <button type="submit" class="button" name="submit" value="{$language['continue']}">{$language['continue']}{$icon['submit']}</button>
          </td>
         </tr>

EOT;
    } else {
        echo <<<EOT
        <tr>
          <td colspan="2" align="center" class="tableh2">&nbsp;<br /></td>
        </tr>

EOT;
    }
    echo <<<EOT

        </table>
      </form>

EOT;
}
예제 #2
0
function html_dbase_select()
{
    global $lang_update_php, $lang_common, $help;
    $superCage = Inspekt::makeSuperCage();
    require_once 'include/dbselect.inc.php';
    $dbselect = new DbaseSelect(array('mysqli' => 'MYSQLI' . $lang_update_php['recommended'], 'pdo:mysql' => 'PDO:MYSQL', 'mysql' => 'MYSQL' . $lang_update_php['current_nr']));
    if (function_exists('cpg_fetch_icon')) {
        $ok_icon = cpg_fetch_icon('ok', 2);
    } else {
        $update_icon = '';
        $ok_icon = '';
    }
    echo <<<EOT
\t<form action="update.php" name="cpgform" id="cpgform" method="post" style="margin:0px;padding:0px">
\t\t<table width="100%" border="0" cellpadding="0" cellspacing="1" class="maintable">
\t\t\t<tr>
\t\t\t\t<td class="tableb" colspan="2">
\t\t\t\t\t{$lang_update_php['newDbMethod']}<br />
\t\t\t\t</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td colspan="2">&nbsp;</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td style="text-align:right;width:50%">Database Type</td>
\t\t\t\t<td><select name="db_type">{$dbselect->options()}</select></td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td colspan="2">&nbsp;</td>
\t\t\t</tr>
\t\t\t<tr>
\t\t\t\t<td colspan="2" align="center" class="tableh2">
\t\t\t\t\t<button type="submit" class="button" name="submit" value="{$lang_common['continue']}">{$lang_common['continue']}{$ok_icon}</button>
\t\t\t\t</td>
\t\t\t</tr>
\t\t</table>
\t\t<input type="hidden" name="action" value="dbselect" />
\t</form>
EOT;
}