Menu

[r9]: / administration / updatedatabase.php  Maximize  Restore  History

Download this file

131 lines (112 with data), 4.4 kB

  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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
/*
** Application name: phpCollab
** Last Edit page: 2003-10-23
** Path by root: ../administration/updatedatabase.php
** Authors: Ceam / Fullo
**
** =============================================================================
**
** phpCollab - Project Managment
**
** -----------------------------------------------------------------------------
** Please refer to license, copyright, and credits in README.TXT
**
** -----------------------------------------------------------------------------
** FILE: updatedatabase.php
**
** DESC: Screen: System information and php library
**
** HISTORY:
** 2003-10-23 - update db to the new version
** -----------------------------------------------------------------------------
** TO-DO:
**
**
** =============================================================================
*/
$checkSession = "true";
include_once('../includes/library.php');
$setTitle .= " : Edit Database";
if ($profilSession != "0") {
headerFunction('../general/permissiondenied.php?'.session_name().'='.session_id());
exit;
}
$versionNew = "2.5";
if ($action == "printSetup") {
include("../includes/db_var.inc.php");
include("../includes/setup_db.php");
for($con = 0; $con < count($SQL); $con++){
echo $SQL[$con] . ';<br/>';
}
}
if ($action == "printUpdate") {
include("../includes/db_var.inc.php");
include("../includes/update_db.php");
for($con = 0; $con < count($SQL); $con++){
echo $SQL[$con] . '<br/>';
}
}
if ($action == "generate") {
include("../includes/db_var.inc.php");
include("../includes/update_db.php");
if ($databaseType == "mysql") {
$my = @mysql_connect(MYSERVER, MYLOGIN, MYPASSWORD);
if (mysql_errno() != 0){ exit('<br/><b>PANIC! <br/> Error during connection on server MySQL.</b><br/>'); }
mysql_select_db(MYDATABASE, $my);
if (mysql_errno() != 0){ exit('<br/><b>PANIC! <br/> Error during selection database.</b><br/>'); }
for($con = 0; $con < count($SQL); $con++){
mysql_query($SQL[$con]);
//echo $SQL[$con] . '<br/>';
if (mysql_errno() != 0){ exit('<br/><b>PANIC! <br/> Error during the update of the database.</b><br/> Error: '. mysql_error()); }
}
}
if ($databaseType == "sqlserver") {
$my = @mssql_connect(MYSERVER, MYLOGIN, MYPASSWORD);
if (mssql_get_last_message() != 0){ exit('<br/><b>PANIC! <br/> Error during connection on server SQl Server.</b><br/>'); }
mssql_select_db(MYDATABASE, $my);
if (mssql_get_last_message() != 0){ exit('<br/><b>PANIC! <br/> Error during selection database.</b><br/>'); }
for($con = 0; $con < count($SQL); $con++){
mssql_query($SQL[$con]);
//echo $SQL[$con] . '<br/>';
if (mssql_get_last_message() != 0){ exit('<br/><b>PANIC! <br/> Error during the update of the database.</b><br/> Error: '. mssql_get_last_message()); }
}
}
headerFunction("../administration/admin.php?msg=update&".session_name()."=".session_id());
}
include('../themes/'.THEME.'/header.php');
$blockPage = new block();
$blockPage->openBreadcrumbs();
$blockPage->itemBreadcrumbs($blockPage->buildLink("../administration/admin.php?",$strings["administration"],in));
$blockPage->itemBreadcrumbs($strings["edit_database"]);
$blockPage->closeBreadcrumbs();
$block1 = new block();
$block1->heading($strings["edit_database"]);
$block1->openContent();
$block1->contentTitle("Details");
$block1->form = "settings";
$block1->openForm("../administration/updatedatabase.php?action=generate&".session_name()."=".session_id());
if ($version == $versionNew) {
if ($versionOld == "") {
$versionOld = $version;
}
echo "<input value=\"$versionOld\" name=\"versionOldNew\" type=\"hidden\">";
} else {
echo "<input value=\"$version\" name=\"versionOldNew\" type=\"hidden\">";
}
echo "<tr class=\"odd\"><td valign=\"top\" class=\"leftvalue\">&nbsp;</td><td>Old version $versionOld<br/>";
$comptUpdateDatabase = count($updateDatabase);
for ($i=0;$i<$comptUpdateDatabase;$i++) {
if ($versionOld < $updateDatabase[$i]) {
echo "<input type=\"checkbox\" value=\"1\" name=\"dumpVersion[$updateDatabase[$i]]\" checked>$updateDatabase[$i]";
$submit = "true";
}
}
echo "<br/>New version $version</td></tr>";
if ($submit == "true") {
echo "<tr class=\"odd\"><td valign=\"top\" class=\"leftvalue\">&nbsp;</td><td><input type=\"SUBMIT\" value=\"".$strings["save"]."\"></td></tr>";
}
$block1->closeContent();
$block1->closeForm();
include('../themes/'.THEME.'/footer.php');
?>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.