[go: up one dir, main page]

Menu

[r19]: / repairDb.php  Maximize  Restore  History

Download this file

173 lines (142 with data), 5.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<?php
$pageRef='System';
include('includes/header.php');
?>
<script>
function successInTakingBackupF(transport){
var args=transport.responseText.evalJSON();
//Success in backup request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in backup operation
setTimeout("OL_backupTableLoad({elementToFill: 'backupTable', onSuccess: setBackupEventHandlers})", 1);
}else{
//Failure in backup operation
}
}
function failureInTakingBackupF(){
//Failure in backup request
}
function manualBackup(){
OL_takeANewBackupOf('oreste', {onSuccess: successInTakingBackupF, onFailure: failureInTakingBackupF});
}
function successInDeletingBackupF(transport){
var args=transport.responseText.evalJSON();
//Success in delete request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in delete operation
setTimeout("OL_backupTableLoad({elementToFill: 'backupTable', onSuccess: setBackupEventHandlers})", 1);
}else{
//Failure in delete operation
}
}
function failureInDeletingBackupF(){
//Failure in delete request
alert('<?php echo _T("NI_repairDb_"); ?>');
}
function deleteBackup(elem){
var args = elem.name.split("_");
var label = args[0];
var labelPart = new Array();
labelPart = label.split('#');
day = labelPart[2];
month = labelPart[1];
year = labelPart[0];
hour = labelPart[3];
minute = labelPart[4];
second = labelPart[5];
result = confirm('<?php echo _T("NI_repairDB_III") ?>');
if(result){
OL_deleteBackup(day, month, year, hour, minute, second, {onSuccess: successInDeletingBackupF, onFailure: failureInDeletingBackupF});
}else{
alert('<?php echo _T("NI_repairDB_II") ?>')
}
}
function successInRestoringBackupF(transport){
var args=transport.responseText.evalJSON();
//Success in restoring request
//Operation result advice
$('qResult').style.display='block';
$('qResult').innerHTML=args.opText;
if(parseInt(args.opResult) == 0){
//Success in restoring operation
}else{
//Failure in restoring operation
}
}
function failureInRestoringBackupF(){
//Failure in restoring request
alert('<?php echo _T("NI_repairDB_IV") ?>');
}
function restoreDb(elem){
var args = elem.name.split("_");
var label = args[0];
var labelPart = new Array();
var day, month, year, hour, minute, second;
labelPart = label.split('#');
day = labelPart[2];
month = labelPart[1];
year = labelPart[0];
hour = labelPart[3];
minute = labelPart[4];
second = labelPart[5];
result = confirm('<?php echo _T("NI_repairDB_I") ?>');
if(result){
OL_restoreDb(day, month, year, hour, minute, second, {onSuccess: successInRestoringBackupF, onFailure: failureInRestoringBackupF});
}else{
alert('<?php echo _T("NI_repairDB_II") ?>')
}
}
function setBackupEventHandlers(){
setTimeout("$$('a.aBkRestore').each(function(s){Event.observe(s,'click',function(){restoreDb(s);})})", 1);
setTimeout("$$('a.aBkDelete').each(function(s){Event.observe(s,'click',function(){deleteBackup(s);})})", 1);
}
function backToSystem(){
window.location.href = 'http://<?php echo $_SERVER['SERVER_ADDR']?>/Oreste/system.php';
}
</script>
<div id="qResult" class="OpResult"></div>
<div class="Columns">
<div class="Column1">
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><span class="BlockHeader"><span><?php echo _T("Actions") ?></span></span><div class="BlockContentBorder">
<ul>
<?php echo "<li><a href=\"javascript:manualBackup()\">" . _T("Manual backup") . "</a></li>"; ?>
<?php echo "<li><a href=\"javascript:backToSystem();\">" . _T("Back to system management") . "</a></li>"; ?>
</ul>
</div>
</div>
</div>
</div>
<div class="MainColumn">
<div class="Block"><div class="BlockBL"><div></div></div><div class="BlockBR"><div></div></div><div class="BlockTL"></div><div class="BlockTR"><div></div></div><div class="BlockT"></div><div class="BlockR"><div></div></div><div class="BlockB"><div></div></div><div class="BlockL"></div><div class="BlockC"></div><div class="BlockContent"><span class="BlockHeader"><span><?php echo _T("Lista backup") ?></span></span><div class="BlockContentBorder" id="backupTable">
</div>
</div>
</div>
</div>
</div>
<script>
// ************************************************************
// * Observe window load event to call the init page function *
// ************************************************************
Event.observe(window, 'load', function(){
// *****************************************
// * Load backups table for the first time *
// *****************************************
OL_backupTableLoad({elementToFill: 'backupTable', onSuccess: setBackupEventHandlers});
// **************************
// * Install event handlers *
// **************************
Event.observe('qResult', 'mouseover', function(){OL_makeThisElementInvisible('qResult');});
});
</script>
<!-- tags opened in the header -->
</div>
</div>
</div>
</body>
</html>