forked from Chicago/metalicious
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnew_items.php
147 lines (136 loc) · 8.19 KB
/
new_items.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
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
<?php
include 'classes/database.php';
include 'classes/table.php';
include 'classes/variable.php';
include 'include/header.php';
?>
<br />
Databases:
<table>
<?
//show orphans
//databases
$orphan_database_revisions = Database::get_orphan_revisions();
while ($orphan_database_revision = mysqli_fetch_assoc($orphan_database_revisions)) {
?>
<tr>
<td>
<div id="orphan_database_revision_<?php echo $orphan_database_revision['Database_Revision_ID']; ?>_entry">
<a href="javascript:;" onclick="$('#orphan_database_revision_<?php echo $orphan_database_revision['Database_Revision_ID']; ?>').slideToggle('slow');">
<?php echo $orphan_database_revision['Database_Name']; ?></a>
<div id="orphan_database_revision_<?php echo $orphan_database_revision['Database_Revision_ID']; ?>" style="display: none;">
DB Info:
<?php echo $orphan_database_revision['Database_Name']; ?><br />
<a href="javascript:;" onclick="
$.post(
'ajax/activate_revision.php',
{
element_type: 'database',
revision_id: <?php echo $orphan_database_revision['Database_Revision_ID']; ?>
},
function (response){
if (response == '') {
$('#orphan_database_revision_<?php echo $orphan_database_revision['Database_Revision_ID']; ?>_entry').fadeOut('slow');
document.getElementById('message_box').innerHTML = 'Activated new revision successfully';
$('#message_box').slideDown('slow').delay(3000).slideUp('slow');
} else {
document.getElementById('message_box').innerHTML = 'An error occurred while saving the revision: ' + response;
$('#message_box').slideDown('slow').delay(8000).slideUp('slow');
}
}
);">Activate</a>
</div>
</div>
</td>
</tr>
<?php
}
?>
</table>
<br />
Tables:
<table>
<?
//show orphans
//tables
$orphan_table_revisions = Table::get_orphan_revisions();
while ($orphan_table_revision = mysqli_fetch_assoc($orphan_table_revisions)) {
?>
<tr>
<td>
<div id="orphan_table_revision_<?php echo $orphan_table_revision['Table_Revision_ID']; ?>_entry">
<a href="javascript:;" onclick="$('#orphan_table_revision_<?php echo $orphan_table_revision['Table_Revision_ID']; ?>').slideToggle('slow');">
<?php echo $orphan_table_revision['Table_Name']; ?></a>
<div id="orphan_table_revision_<?php echo $orphan_table_revision['Table_Revision_ID']; ?>" style="display: none;">
DB Info:
<?php echo $orphan_table_revision['Table_Name']; ?><br />
<a href="javascript:;" onclick="
$.post(
'ajax/activate_revision.php',
{
element_type: 'table',
revision_id: <?php echo $orphan_table_revision['Table_Revision_ID']; ?>
},
function (response){
if (response == '') {
$('#orphan_table_revision_<?php echo $orphan_table_revision['Table_Revision_ID']; ?>_entry').fadeOut('slow');
document.getElementById('message_box').innerHTML = 'Activated new revision successfully';
$('#message_box').slideDown('slow').delay(3000).slideUp('slow');
} else {
document.getElementById('message_box').innerHTML = 'An error occurred while saving the revision: ' + response;
$('#message_box').slideDown('slow').delay(8000).slideUp('slow');
}
}
);">Activate</a>
</div>
</div>
</td>
</tr>
<?php
}
?>
</table>
<br />
Variables:
<table>
<?
//show orphans
//variables
$orphan_variable_revisions = Variable::get_orphan_revisions();
while ($orphan_variable_revision = mysqli_fetch_assoc($orphan_variable_revisions)) {
?>
<tr>
<td>
<div id="orphan_variable_revision_<?php echo $orphan_variable_revision['Variable_Revision_ID']; ?>_entry">
<a href="javascript:;" onclick="$('#orphan_variable_revision_<?php echo $orphan_variable_revision['Variable_Revision_ID']; ?>').slideToggle('slow');">
<?php echo $orphan_variable_revision['Variable_Name']; ?></a>
<div id="orphan_variable_revision_<?php echo $orphan_variable_revision['Variable_Revision_ID']; ?>" style="display: none;">
DB Info:
<?php echo $orphan_variable_revision['Variable_Name']; ?><br />
<a href="javascript:;" onclick="
$.post(
'ajax/activate_revision.php',
{
element_type: 'variable',
revision_id: <?php echo $orphan_variable_revision['Variable_Revision_ID']; ?>
},
function (response){
if (response == '') {
$('#orphan_variable_revision_<?php echo $orphan_variable_revision['Variable_Revision_ID']; ?>_entry').fadeOut('slow');
document.getElementById('message_box').innerHTML = 'Activated new revision successfully';
$('#message_box').slideDown('slow').delay(3000).slideUp('slow');
} else {
document.getElementById('message_box').innerHTML = 'An error occurred while saving the revision: ' + response;
$('#message_box').slideDown('slow').delay(8000).slideUp('slow');
}
}
);">Activate</a>
</div>
</div>
</td>
</tr>
<?php
}
?>
</table>
<?php include 'include/footer.php'; ?>