$fp = sugar_fopen($sqlScript, 'r');
 } else {
     $fp = fopen($sqlScript, 'r');
 }
 $contents = fread($fp, filesize($sqlScript));
 $anyScriptChanges = $contents;
 // remove __uw_temp tables
 //testCleanUp($db->dbType);
 fclose($fp);
 $customTables = getCustomTables($db->dbType);
 if (!empty($customTables)) {
     $_SESSION['alterCustomTableQueries'] = alterCustomTables($db->dbType, $customTables);
 } else {
     $_SESSION['alterCustomTableQueries'] = false;
 }
 $_SESSION['allTables'] = getAllTables($db->dbType);
 $schema = "<p><a href='javascript:void(0); toggleNwFiles(\"schemashow\");'>{$mod_strings['LBL_UW_SHOW_SCHEMA']}</a>";
 $schema .= "<div id='schemashow' style='display:none;'>";
 $schema .= "<textarea readonly cols='80' rows='10'>{$contents}</textarea>";
 $schema .= "</div></p>";
 if (version_compare($current_version, '450', "<")) {
     if (isset($_SESSION['allTables']) && !empty($_SESSION['allTables'])) {
         $alterTableContents = printAlterTableSql($_SESSION['allTables']);
         $alterTableSchema = "<p><a href='javascript:void(0); toggleNwFiles(\"alterTableSchemashow\");'>{$mod_strings['LBL_UW_CHARSET_SCHEMA_CHANGE']}</a>";
         $alterTableSchema .= "<div id='alterTableSchemashow' style='display:none;'>";
         $alterTableSchema .= "<textarea readonly cols='80' rows='10'>{$alterTableContents}</textarea>";
         $alterTableSchema .= "</div></p>";
     }
 } else {
     $alterTableSchema = '<i>' . $mod_strings['LBL_UW_PREFLIGHT_NOT_NEEDED'] . '</i>';
 }
Exemplo n.º 2
0
    return $result;
}
/**
 * 
 * @param unknown $string
 * @param string $capitalizeFirstCharacter
 * @return mixed
 */
function dashesToCamelCase($string, $capitalizeFirstCharacter = false)
{
    $string = strtolower($string);
    $str = str_replace(' ', '', ucwords(str_replace('_', ' ', $string)));
    if (!$capitalizeFirstCharacter) {
        $str[0] = strtolower($str[0]);
    }
    return $str;
}
?>

		<?php 
$tableArray = getAllTables();
?>
 <br/>

		<?php 
?>

</div>

<?php 
include_once 'sidebardown.php';
Exemplo n.º 3
0
function getTree($db)
{
    $allTables = getAllTables($db);
    $html = "<style>\n        .tree-db {            \n            padding-left:0px;\n        }\n\n        .tree-table {\n            display:none;\n            padding-left:5px;\n        }\n\n        .tree-column {\n            display:none;\n            padding-left:15px;\n            color:grey;\n        }\n\n    </style><script>\n\n    <script>";
    $dbname = "";
    $table = "";
    foreach ($allTables as $item) {
        if ($dbname == "" || $dbname != $item['dbl']) {
            $dbname = $item['dbl'];
            $html .= "<div class='tree-db' >";
            $html .= "<input type='checkbox' name='d[" . $dbname . "]' " . (isset($_REQUEST['d'][$dbname]) ? "checked" : "") . " >";
            $html .= "<b><span onclick='\$(\"#tree-d-" . $dbname . "\").toggle();'>" . $dbname . "</span></b>";
            $html .= "</div>";
        }
        if ($table == "" || $table != $item['tbl']) {
            $table = $item['tbl'];
            $html .= "<div class='tree-table' >";
            $html .= "<input type='checkbox' name='t[" . $dbname . "][" . $table . "]' " . (isset($_REQUEST['t'][$dbname][$table]) ? "checked" : "") . " >";
            $html .= "<i><span onclick='\$(\"#tree-t-" . $dbname . "-" . $table . "\").toggle();'>" . $table . "</span></i>";
            $html .= "</div>";
        }
        $column = $item['clm'];
        $html .= "<div class='tree-column' >";
        $html .= "<input type='checkbox' name='c[" . $dbname . "][" . $table . "][" . $column . "]' " . (isset($_REQUEST['t'][$dbname][$table][$column]) ? "checked" : "") . " >";
        $html .= "<span onclick='\$(\"#tree-c-" . $dbname . "-" . $table . "-" . $column . "\").toggle();'>" . $column . "</span>";
        $html .= "</div>";
    }
    return "<div class='tree'>" . $html . "</div>";
}