formating;

XHTML compliance;
improved IE compatibility;
This commit is contained in:
Sebastian Mendel
2007-03-28 16:36:12 +00:00
parent 8314aec9da
commit 11dd7b3f5b
3 changed files with 544 additions and 387 deletions

View File

@@ -77,7 +77,7 @@ function MouseDown(e)
cur_click.style.zIndex = 2;
}
if (layer_menu_cur_click) {
offsetx = isIE ? event.clientX + document.body.scrollLeft: e.pageX;
offsetx = isIE ? event.clientX + document.body.scrollLeft : e.pageX;
dx = offsetx - parseInt(document.getElementById("layer_menu").style.width);
}
}
@@ -86,18 +86,17 @@ function MouseMove(e)
{
//Glob_X = e.pageX;
//Glob_Y = e.pageY;
Glob_X = isIE ? event.clientX + document.body.scrollLeft: e.pageX;
Glob_Y = isIE ? event.clientY + document.body.scrollTop: e.pageY;
Glob_X = isIE ? event.clientX + document.body.scrollLeft : e.pageX;
Glob_Y = isIE ? event.clientY + document.body.scrollTop : e.pageY;
//mouseX = (bw.ns4||bw.ns6)? e.pageX: bw.ie&&bw.win&&!bw.ie4? (event.clientX-2)+document.body.scrollLeft : event.clientX+document.body.scrollLeft;
//mouseY = (bw.ns4||bw.ns6)? e.pageY: bw.ie&&bw.win&&!bw.ie4? (event.clientY-2)+document.body.scrollTop : event.clientY+document.body.scrollTop;
//window.status = "X = "+ Glob_X + " Y = "+ Glob_Y;
var mGx, mGy;
if (cur_click != null) {
mGx = Glob_X - dx;
mGy = Glob_Y - dy;
var mGx = Glob_X - dx;
var mGy = Glob_Y - dy;
mGx = mGx > 0 ? mGx : 0;
mGy = mGy > 0 ? mGy : 0;
@@ -106,17 +105,17 @@ function MouseMove(e)
mGy = mGy % step < step / 2 ? mGy - mGy % step : mGy - mGy % step + step;
}
cur_click.style.left = mGx;
cur_click.style.top = mGy;
cur_click.style.left = mGx + 'px';
cur_click.style.top = mGy + 'px';
}
if (ON_relation || ON_display_field) {
document.getElementById('hint').style.left = Glob_X + 20;
document.getElementById('hint').style.top = Glob_Y + 20;
document.getElementById('hint').style.left = (Glob_X + 20) + 'px';
document.getElementById('hint').style.top = (Glob_Y + 20) + 'px';
}
if (layer_menu_cur_click) {
document.getElementById("layer_menu").style.width = Glob_X - dx>=150?Glob_X - dx:150;
document.getElementById("layer_menu").style.width = ((Glob_X - dx) >= 150 ? Glob_X - dx : 150) + 'px';
//document.getElementById("layer_menu").style.height = Glob_Y - dy>=200?Glob_Y - dy:200;
//document.getElementById("id_scroll_tab").style.height = Glob_Y - dy2;
}
@@ -149,8 +148,8 @@ function Canvas_pos()
canvas_height = document.getElementById('canvas').height = osn_tab_height - 3;
if (isIE) {
document.getElementById('canvas').style.width = (osn_tab_width - 3)?(osn_tab_width - 3):0;
document.getElementById('canvas').style.height = (osn_tab_height - 3)?(osn_tab_height - 3):0;
document.getElementById('canvas').style.width = ((osn_tab_width - 3)?(osn_tab_width - 3):0) + 'px';
document.getElementById('canvas').style.height = ((osn_tab_height - 3)?(osn_tab_height - 3):0) + 'px';
}
}
@@ -170,7 +169,7 @@ function Main()
document.getElementById('layer_menu').style.position = 'absolute';
}
document.getElementById("layer_menu").style.top = -1000; //fast scroll
document.getElementById("layer_menu").style.top = -1000 + 'px'; //fast scroll
sm_x += document.getElementById('osn_tab').offsetLeft;
sm_y += document.getElementById('osn_tab').offsetTop;
Osn_tab_pos();
@@ -195,15 +194,18 @@ function Rezize_osn_tab()
max_X = max_X < k_x ? k_x : max_X;
max_Y = max_Y < k_y ? k_y : max_Y;
}
osn_tab_width = max_X + 50;
osn_tab_height = max_Y + 50;
Canvas_pos();
document.getElementById('osn_tab').style.width = osn_tab_width;
document.getElementById('osn_tab').style.height = osn_tab_height;
document.getElementById('osn_tab').style.width = osn_tab_width + 'px';
document.getElementById('osn_tab').style.height = osn_tab_height + 'px';
}
//------------------------------------------------------------------------------
/**
* refreshes display, must be called after state changes
*/
function Re_load()
{
Rezize_osn_tab();
@@ -217,8 +219,11 @@ function Re_load()
for (key2 in contr[K][key]) // table name
for (key3 in contr[K][key][key2]) // field name
{
if (!document.getElementById("check_vis_"+key2).checked ||
!document.getElementById("check_vis_"+contr[K][key][key2][key3][0]).checked) continue; // if hide
if (!document.getElementById("check_vis_" + key2).checked ||
!document.getElementById("check_vis_" + contr[K][key][key2][key3][0]).checked) {
// if hide
continue;
}
var x1_left = document.getElementById(key2).offsetLeft+1;
var x1_right = x1_left + document.getElementById(key2).offsetWidth;
var x2_left = document.getElementById(contr[K][key][key2][key3][0]).offsetLeft;
@@ -230,7 +235,7 @@ function Re_load()
n = s_left = s_right = 0;
for (var i = 1; i < 4; i++) {
if (a[n] > a[i]) {
n=i;
n = i;
}
}
if (n == 1) {
@@ -257,15 +262,43 @@ function Re_load()
x2 = x2_left - sm_s;
s_left = 1;
}
//alert(key2+"."+key3);
var y1 = document.getElementById(key2).offsetTop + document.getElementById(key2 + "." + key3).offsetTop + height_field;
//alert(key2 + "." + key3);
var row_offset_top = 0;
//alert('id_tbody_' + key2);
//alert(document.getElementById('id_hide_tbody_' + key2));
var tab_hide_button = document.getElementById('id_hide_tbody_' + key2);
//alert(tab_hide_button.innerHTML);
if (tab_hide_button.innerHTML == 'v') {
row_offset_top = document.getElementById(key2 + "." + key3).offsetTop;
}
var y1 = document.getElementById(key2).offsetTop
+ row_offset_top
+ height_field;
//alert(1);
var y2 = document.getElementById(contr[K][key][key2][key3][0]).offsetTop +
document.getElementById(contr[K][key][key2][key3][0] + "." + contr[K][key][key2][key3][1]).offsetTop + height_field;
row_offset_top = 0;
var tab_hide_button = document.getElementById('id_hide_tbody_' + contr[K][key][key2][key3][0]);
if (tab_hide_button.innerHTML == 'v') {
row_offset_top = document.getElementById(contr[K][key][key2][key3][0]
+ '.' + contr[K][key][key2][key3][1]).offsetTop;
}
var y2 =
document.getElementById(contr[K][key][key2][key3][0]).offsetTop
+ row_offset_top
+ height_field;
//alert(y1 + ' - ' + key2 + "." + key3);
Line0(x1 - sm_x, y1 - sm_y, x2 - sm_x, y2 - sm_y, "rgba(0,100,150,1)");
}
}
/**
* draws a line from x1:y1 to x2:y2 with color
*/
function Line(x1, y1, x2, y2, color_line)
{
var canvas = document.getElementById("canvas");
@@ -278,8 +311,14 @@ function Line(x1, y1, x2, y2, color_line)
ctx.stroke();
}
/**
* draws a relation/constraint line, whether angular or not
*/
function Line0(x1, y1, x2, y2, color_line)
{
Circle(x1, y1, 3, 3, "rgba(0,0,255,1)");
Rect(x2 - 1, y2 - 2, 4, 4, "rgba(0,0,255,1)");
if (ON_angular_direct) {
Line2(x1, y1, x2, y2, color_line);
} else {
@@ -287,14 +326,14 @@ function Line0(x1, y1, x2, y2, color_line)
}
}
/**
* draws a angualr relation/constraint line
*/
function Line2(x1, y1, x2, y2, color_line)
{
var x1_ = x1;
var x2_ = x2;
Circle(x1, y1, 3, 3, "rgba(0,0,255,1)");
Rect(x2 - 1, y2 - 2, 4, 4, "rgba(0,0,255,1)");
if (s_right) {
x1_ += sm_add;
x2_ += sm_add;
@@ -314,14 +353,14 @@ function Line2(x1, y1, x2, y2, color_line)
Line(x1_, y1, x2_, y2, color_line);
}
/**
* draws a relation/constraint line
*/
function Line3(x1, y1, x2, y2, color_line)
{
var x1_ = x1;
var x2_ = x2;
Circle(x1, y1, 3, 3, "rgba(0,0,255,1)");
Rect(x2 - 1, y2 - 2, 4, 4, "rgba(0,0,255,1)");
var x_s = (x1 + x2) / 2;
if (s_right) {
if (x1 < x2) {
x1_ += x2 - x1 + sm_add;
@@ -334,7 +373,7 @@ function Line3(x1, y1, x2, y2, color_line)
Line(x1, y1, x1_, y1, color_line);
Line(x2, y2, x2_, y2, color_line);
Line(x1_, y1, x2_, y2, color_line);
return; //0
return;
}
if (s_left) {
if (x1 < x2) {
@@ -348,14 +387,13 @@ function Line3(x1, y1, x2, y2, color_line)
Line(x1, y1, x1_, y1, color_line);
Line(x2, y2, x2_, y2, color_line);
Line(x1_, y1, x2_, y2, color_line);
return; //0
return;
}
var x_s = (x1 + x2) / 2;
Line(x1, y1, x_s, y1, color_line);
Line(x_s, y2, x2, y2, color_line);
Line(x_s, y1, x_s, y2, color_line);
//return ???
}
function Circle(x, y, r, w, color)
@@ -387,10 +425,10 @@ function Rect(x1, y1, w, h, color)
function Save(url) // (del?) no for pdf
{
for (key in j_tabs) {
document.getElementById('t_x['+key+']').value=parseInt(document.getElementById(key).style.left);
document.getElementById('t_y['+key+']').value=parseInt(document.getElementById(key).style.top);
document.getElementById('t_v['+key+']').value=document.getElementById('_|_tbody_'+key).style.display == 'none' ? 0 : 1;
document.getElementById('t_h['+key+']').value=document.getElementById('check_vis_'+key).checked ? 1 : 0;
document.getElementById('t_x_' + key + '_').value = parseInt(document.getElementById(key).style.left);
document.getElementById('t_y_' + key + '_').value = parseInt(document.getElementById(key).style.top);
document.getElementById('t_v_' + key + '_').value = document.getElementById('id_tbody_' + key).style.display == 'none' ? 0 : 1;
document.getElementById('t_h_' + key + '_').value = document.getElementById('check_vis_' + key).checked ? 1 : 0;
}
document.form1.action = url;
document.form1.submit();
@@ -400,10 +438,10 @@ function Get_url_pos()
{
var poststr = '';
for (key in j_tabs) {
poststr += '&t_x['+key+']=' + parseInt(document.getElementById(key).style.left);
poststr += '&t_y['+key+']=' + parseInt(document.getElementById(key).style.top);
poststr += '&t_v['+key+']=' + (document.getElementById('_|_tbody_'+key).style.display == 'none' ? 0 : 1);
poststr += '&t_h['+key+']=' + (document.getElementById('check_vis_'+key).checked ? 1 : 0);
poststr += '&t_x[' + key + ']=' + parseInt(document.getElementById(key).style.left);
poststr += '&t_y[' + key + ']=' + parseInt(document.getElementById(key).style.top);
poststr += '&t_v[' + key + ']=' + (document.getElementById('id_tbody_' + key).style.display == 'none' ? 0 : 1);
poststr += '&t_h[' + key + ']=' + (document.getElementById('check_vis_' + key).checked ? 1 : 0);
}
return poststr;
}
@@ -417,13 +455,9 @@ function Save2()
function Grid()
{
if (!ON_grid ) {
if (!ON_grid) {
ON_grid = 1;
document.getElementById('grid_button').className = 'M_butt_Selected_down';//'#FFEE99';gray #AAAAAA
if (isIE) { // correct for IE
document.getElementById('grid_button').className = 'M_butt_Selected_down_IE';
}
document.getElementById('grid_button').className = 'M_butt_Selected_down';
} else {
document.getElementById('grid_button').className = 'M_butt';
ON_grid = 0;
@@ -432,13 +466,9 @@ function Grid()
function Angular_direct()
{
if (ON_angular_direct ) {
if (ON_angular_direct) {
ON_angular_direct = 0;
document.getElementById('angular_direct_button').className = 'M_butt_Selected_down';//'#FFEE99';gray #AAAAAA
if (isIE) { // correct for IE
document.getElementById('angular_direct_button').className = 'M_butt_Selected_down_IE';
}
document.getElementById('angular_direct_button').className = 'M_butt_Selected_down';
} else {
ON_angular_direct = 1;
document.getElementById('angular_direct_button').className = 'M_butt';
@@ -457,11 +487,7 @@ function Start_relation()
ON_relation = 1;
document.getElementById('hint').innerHTML = LangSelectReferencedKey;
document.getElementById('hint').style.visibility = "visible";
document.getElementById('rel_button').className = 'M_butt_Selected_down';//'#FFEE99';gray #AAAAAA
if (isIE) { // correct for IE
document.getElementById('rel_button').className = 'M_butt_Selected_down_IE';
}
document.getElementById('rel_button').className = 'M_butt_Selected_down';
} else {
document.getElementById('hint').innerHTML = "";
document.getElementById('hint').style.visibility = "hidden";
@@ -491,8 +517,10 @@ function Click_field(T, f, PK) // table field
if (j_tabs[db + '.' + T] != 'INNODB' || !PK) {
document.getElementById('InnoDB_relation').style.display = 'none';
}
document.getElementById('layer_new_relation').style.left = Glob_X - (document.getElementById('layer_new_relation').offsetWidth>>1);
document.getElementById('layer_new_relation').style.top = Glob_Y - document.getElementById('layer_new_relation').offsetHeight - 10;
var left = Glob_X - (document.getElementById('layer_new_relation').offsetWidth>>1);
document.getElementById('layer_new_relation').style.left = left + 'px';
var top = Glob_Y - document.getElementById('layer_new_relation').offsetHeight - 10;
document.getElementById('layer_new_relation').style.top = top + 'px';
document.getElementById('layer_new_relation').style.visibility = "visible";
link_relation += '&T2=' + T + '&F2=' + f;
}
@@ -511,7 +539,7 @@ function Click_field(T, f, PK) // table field
} else {
old_class = 'tab_field_3';
if (display_field[T]) {
document.getElementById('_|_tr_' + T + '.' + display_field[T]).className = 'tab_field';
document.getElementById('id_tr_' + T + '.' + display_field[T]).className = 'tab_field';
//display_field.splice(T, 1);
delete display_field[T];
}
@@ -551,13 +579,9 @@ function Start_tab_upd(table)
function Small_tab_all(id_this) // max/min all tables
{
if (isIE) {
alert(LangIEnotSupport);
return;
}
if (id_this.alt == "v") {
for (key in j_tabs) {
if (document.getElementById('_|_hide_tbody_'+key).innerHTML == "v") {
if (document.getElementById('id_hide_tbody_'+key).innerHTML == "v") {
Small_tab(key, 0);
}
}
@@ -565,7 +589,7 @@ function Small_tab_all(id_this) // max/min all tables
id_this.src = "pmd/images/rightarrow1.png";
} else {
for (key in j_tabs) {
if (document.getElementById('_|_hide_tbody_'+key).innerHTML != "v") {
if (document.getElementById('id_hide_tbody_'+key).innerHTML != "v") {
Small_tab(key, 0);
}
}
@@ -577,10 +601,6 @@ function Small_tab_all(id_this) // max/min all tables
function Small_tab_invert() // invert max/min all tables
{
if (isIE) {
alert(LangIEnotSupport);
return;
}
for (key in j_tabs) {
Small_tab(key, 0);
}
@@ -590,7 +610,7 @@ function Small_tab_invert() // invert max/min all tables
function Small_tab_refresh()
{
for (key in j_tabs) {
if(document.getElementById('_|_hide_tbody_'+key).innerHTML != "v") {
if(document.getElementById('id_hide_tbody_'+key).innerHTML != "v") {
Small_tab(key, 0);
Small_tab(key, 0);
}
@@ -599,16 +619,13 @@ function Small_tab_refresh()
function Small_tab(t, re_load)
{
var id = document.getElementById('_|_tbody_' + t);
var id_this = document.getElementById('_|_hide_tbody_' + t);
var id = document.getElementById('id_tbody_' + t);
var id_this = document.getElementById('id_hide_tbody_' + t);
var id_t = document.getElementById(t);
id_t.style.width = id_t.offsetWidth;
id_t.style.width = id_t.offsetWidth + 'px';
if (id_this.innerHTML == "v") {
//---CROSS
if (isIE) {
return; //IE not supported
}
id.style.display = 'none';
id_this.innerHTML = '>';
} else {
@@ -622,17 +639,17 @@ function Small_tab(t, re_load)
//------------------------------------------------------------------------------
function Select_tab(t)
{
var id_zag = document.getElementById('_|_zag_' + t);
var id_zag = document.getElementById('id_zag_' + t);
if (id_zag.className != 'tab_zag_3') {
document.getElementById('_|_zag_' + t).className = 'tab_zag_2';
document.getElementById('id_zag_' + t).className = 'tab_zag_2';
} else {
document.getElementById('_|_zag_' + t).className = 'tab_zag';
document.getElementById('id_zag_' + t).className = 'tab_zag';
}
//----------
var id_t = document.getElementById(t);
window.scrollTo(parseInt(id_t.style.left) - 300, parseInt(id_t.style.top) - 300);
setTimeout(function(){document.getElementById('_|_zag_' + t).className = 'tab_zag';}, 800);
setTimeout(function(){document.getElementById('id_zag_' + t).className = 'tab_zag';}, 800);
}
//------------------------------------------------------------------------------
@@ -707,8 +724,10 @@ function Canvas_click(id)
if (selected) {
// select relations
//alert(Key0+' - '+Key1+' - '+Key2+' - '+Key3);
document.getElementById('layer_upd_relation').style.left = Glob_X - (document.getElementById('layer_upd_relation').offsetWidth>>1);
document.getElementById('layer_upd_relation').style.top = Glob_Y - document.getElementById('layer_upd_relation').offsetHeight - 10;
var left = Glob_X - (document.getElementById('layer_upd_relation').offsetWidth>>1);
document.getElementById('layer_upd_relation').style.left = left + 'px';
var top = Glob_Y - document.getElementById('layer_upd_relation').offsetHeight - 10;
document.getElementById('layer_upd_relation').style.top = top + 'px';
document.getElementById('layer_upd_relation').style.visibility = 'visible';
link_relation = 'T1=' + Key0 + '&F1=' + Key1 + '&T2=' + Key2 + '&F2=' + Key3 + '&K=' + Key;
}
@@ -828,10 +847,10 @@ function General_scroll()
(
function()
{
document.getElementById('top_menu').style.left = document.body.scrollLeft;
document.getElementById('top_menu').style.top = document.body.scrollTop;
document.getElementById('layer_menu').style.left = document.body.scrollLeft;
document.getElementById('layer_menu').style.top = document.body.scrollTop + document.getElementById('top_menu').offsetHeight;
document.getElementById('top_menu').style.left = document.body.scrollLeft + 'px';
document.getElementById('top_menu').style.top = document.body.scrollTop + 'px';
document.getElementById('layer_menu').style.left = document.body.scrollLeft + 'px';
document.getElementById('layer_menu').style.top = (document.body.scrollTop + document.getElementById('top_menu').offsetHeight) + 'px';
}
,200
);
@@ -853,7 +872,7 @@ function General_scroll_end()
function Show_left_menu(id_this) // max/min all tables
{
if (id_this.alt == "v") {
document.getElementById("layer_menu").style.top = document.getElementById('top_menu').offsetHeight;
document.getElementById("layer_menu").style.top = document.getElementById('top_menu').offsetHeight + 'px';
document.getElementById("layer_menu").style.visibility = 'visible';
id_this.alt = ">";
id_this.src = "pmd/images/uparrow2_m.png";
@@ -861,7 +880,7 @@ function Show_left_menu(id_this) // max/min all tables
General_scroll();
}
} else {
document.getElementById("layer_menu").style.top = -1000; //fast scroll
document.getElementById("layer_menu").style.top = -1000 + 'px'; //fast scroll
document.getElementById("layer_menu").style.visibility = 'hidden';
id_this.alt = "v";
id_this.src = "pmd/images/downarrow2_m.png";
@@ -871,7 +890,7 @@ function Show_left_menu(id_this) // max/min all tables
function Top_menu_right(id_this)
{
if (id_this.alt == ">") {
document.getElementById('top_menu').style.marginLeft = document.getElementById('top_menu').offsetWidth; // = 350
document.getElementById('top_menu').style.marginLeft = document.getElementById('top_menu').offsetWidth + 'px'; // = 350
id_this.alt = "<";
id_this.src = "pmd/images/2leftarrow_m.png";
} else {

View File

@@ -11,6 +11,10 @@ body {
margin: 0;
}
img {
border: 0;
}
.input_tab {
background-color: #A6C7E1;
color: #000000;
@@ -100,7 +104,7 @@ form {
}
.scroll_tab {
overflow: scroll;
overflow: auto;
width: 100%;
height: 500px;
}
@@ -196,7 +200,7 @@ input, select, textarea {
color: #000000;
}
#butt {
.butt {
border: #4477aa solid 1px;
font-size: 11px;
font-weight: bold;
@@ -233,35 +237,35 @@ input, select, textarea {
height: 10px;
}
#frams1 {
.frams1 {
background: url(images/1.png) no-repeat right bottom;
}
#frams2 {
.frams2 {
background: url(images/2.png) no-repeat left bottom;
}
#frams3 {
.frams3 {
background: url(images/3.png) no-repeat left top;
}
#frams4 {
.frams4 {
background: url(images/4.png) no-repeat right top;
}
#frams5 {
.frams5 {
background: url(images/5.png) repeat-x center bottom;
}
#frams6 {
.frams6 {
background: url(images/6.png) repeat-y left;
}
#frams7 {
.frams7 {
background: url(images/7.png) repeat-x top;
}
#frams8 {
.frams8 {
background: url(images/8.png) repeat-y right;
}
@@ -271,8 +275,8 @@ input, select, textarea {
border: #A9A9A9 solid 1px;
}
ul.header {
width: 350px;
.header {
/* width: 350px; */
background-color: #EAEEF0;
color: #000000;
text-align: center;
@@ -287,66 +291,90 @@ ul.header {
background-position: top;
background-repeat: repeat-x;
border-right: #999999 solid 1px;
/*border-bottom:#999999 solid 1px;*/
/* border-bottom:#999999 solid 1px;*/
border-left: #999999 solid 1px;
height: 28px;
}
/* Button CSS rules */
a.M_butt img,a.M_butt_Selected_down img {
width: 20px;
.header a {
display: block;
float: left;
margin: 3px 1px 4px 1px;
height: 20px;
cursor: default;
margin-top: 3px;
margin-left: 1px;
margin-bottom: 3px;
border: 1px dotted #ffffff;
}
a.M_butt img {
border: 1px dotted #F0F0EE !important;
.header .M_bord {
display: block;
float: left;
margin: 4px;
height: 20px;
width: 2px;
}
a.M_butt_Selected_down img {
border: 1px solid #C0C0BB !important;
background-color: #99FF99;
color: #000000;
.header a.first {
margin-right: 1em;
}
a.M_butt img:hover {
border: 1px solid #0099CC !important;
cursor: default;
background-color: #FFEE99;
color: #000000;
.header a.last {
margin-left: 1em;
}
/* for IE */
* html a.M_butt img,a.M_butt_Selected_down_IE {
border: 0 !important;
margin-top: 4px;
margin-bottom: 1px;
}
* html a.M_butt {
/*border: 1px dotted #F0F0EE;*/
border: 1px dotted #FFFFFF;
cursor: default;
}
a.M_butt_Selected_down_IE {
a.M_butt_Selected_down_IE,
a.M_butt_Selected_down {
border: 1px solid #C0C0BB;
background-color: #99FF99;
color: #000000;
}
* html a.M_butt:hover {
a.M_butt_Selected_down_IE:hover,
a.M_butt_Selected_down:hover,
a.M_butt:hover {
border: 1px solid #0099CC;
cursor: default;
background-color: #FFEE99;
color: #000000;
}
.M_bord {
border: 0;
margin-left: 2px;
margin-right: 2px;
margin-bottom: 4px;
#layer_menu {
left: 0;
top: 28px;
width: 150px;
position: fixed;
z-index: 1000;
background-color: #EAEEF0;
border: #999999 solid 1px;
}
#layer_action {
position: absolute;
left: 638px;
top: 52px;
z-index: 1000;
background-color: #CCFF99;
padding: 3px;
border: #009933 solid 1px;
white-space: nowrap;
font-weight: bold;
}
#layer_upd_relation {
position: absolute;
left: 637px;
top: 224px;
z-index: 1000;
}
#layer_new_relation {
position: absolute;
left: 636px;
top: 85px;
z-index: 1000;
width: 153px;
}
#layer_menu_sizer {
background-image: url(../../images/resize.png);
cursor: nw-resize;
width: 16px;
height: 16px;
}

View File

@@ -9,7 +9,7 @@
/**
*
*/
include_once "./pmd_common.php";
require_once "./pmd_common.php";
$tab_column = get_tab_info();
$script_tabs = get_script_tabs();
@@ -20,278 +20,388 @@ $tables_all_keys = get_all_keys();
$hidden = "hidden";
?>
<html xmlns:v="urn:schemas-microsoft-com:vml">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" lang="<?php echo $GLOBALS['available_languages'][$GLOBALS['lang']][2]; ?>" dir="<?php echo $GLOBALS['text_dir']; ?>">
<head>
<link rel="SHORTCUT ICON" href="pmd/images/favicon.ico" />
<?php if(0){ ?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<link rel="stylesheet" type="text/css" href="pmd/styles/default/style1.css">
<?php } ?>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
<link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css">
<title>Designer</title>
</head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $charset ?>" />
<link rel="icon" href="pmd/images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="pmd/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css" />
<title>Designer</title>
<script type="text/javascript">
// <![CDATA[
<?php
echo '
<script>
var db = "' . $db . '";
var token = "' . $token . '";
var LangSelectReferencedKey = "' . $strSelectReferencedKey . '";
var LangSelectForeignKey = "' . $strSelectForeignKey . '";
var LangPleaseSelectPrimaryOrUniqueKey = "' . $strPleaseSelectPrimaryOrUniqueKey . '";
var LangIEnotSupport = "' . $strIEUnsupported . '";
var LangChangeDisplay = "' . $strChangeDisplay . '";
var db = "' . PMA_escapeJsString($db) . '";
var token = "' . PMA_escapeJsString($token) . '";
var LangSelectReferencedKey = "' . PMA_escapeJsString($strSelectReferencedKey) . '";
var LangSelectForeignKey = "' . PMA_escapeJsString($strSelectForeignKey) . '";
var LangPleaseSelectPrimaryOrUniqueKey = "' . PMA_escapeJsString($strPleaseSelectPrimaryOrUniqueKey) . '";
var LangIEnotSupport = "' . PMA_escapeJsString($strIEUnsupported) . '";
var LangChangeDisplay = "' . PMA_escapeJsString($strChangeDisplay) . '";
var strLang = Array();
strLang["strModifications"] = "' . $strModifications . '";
strLang["strRelationDeleted"] = "' . $strRelationDeleted . '";
strLang["strInnoDBRelationAdded"] = "' . $strInnoDBRelationAdded . '";
strLang["strGeneralRelationFeat:strDisabled"] = "' . $strGeneralRelationFeat . ' : ' . $strDisabled . '";
strLang["strInternalRelationAdded"] = "' . $strInternalRelationAdded . '";
strLang["strErrorRelationAdded"] = "' . $strErrorRelationAdded . '";
strLang["strErrorRelationExists"] = "' . $strErrorRelationExists . '";
strLang["strErrorSaveTable"] = "' . $strErrorSaveTable . '";
</script>';
var strLang = Array();
strLang["strModifications"] = "' . PMA_escapeJsString($strModifications) . '";
strLang["strRelationDeleted"] = "' . PMA_escapeJsString($strRelationDeleted) . '";
strLang["strInnoDBRelationAdded"] = "' . PMA_escapeJsString($strInnoDBRelationAdded ). '";
strLang["strGeneralRelationFeat:strDisabled"] = "' . PMA_escapeJsString($strGeneralRelationFeat . ' : ' . $strDisabled) . '";
strLang["strInternalRelationAdded"] = "' . PMA_escapeJsString($strInternalRelationAdded) . '";
strLang["strErrorRelationAdded"] = "' . PMA_escapeJsString($strErrorRelationAdded) . '";
strLang["strErrorRelationExists"] = "' . PMA_escapeJsString($strErrorRelationExists) . '";
strLang["strErrorSaveTable"] = "' . PMA_escapeJsString($strErrorSaveTable) . '";';
?>
<script language=javascript src="pmd/scripts/ajax.js" type=text/javascript></script>
<script language=javascript src="pmd/scripts/move.js" type=text/javascript></script>
<!--[if IE]><script type="text/javascript" src="pmd/scripts/iecanvas.js"></script><![endif]-->
// ]]>
</script>
<script src="pmd/scripts/ajax.js" type="text/javascript"></script>
<script src="pmd/scripts/move.js" type="text/javascript"></script>
<!--[if IE]>
<script src="pmd/scripts/iecanvas.js" type="text/javascript"></script>
<![endif]-->
<?php
echo $script_tabs . $script_contr . $script_display_field;
?>
<body onLoad="Main()" class="general_body" marginheight="0" marginwidth="0">
<ul class="header" id="top_menu"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" align="left"><a
href="javascript:Show_left_menu(document.getElementById('key_Show_left_menu'));" onMouseDown="return false;" class="M_butt" target="_self"><img id='key_Show_left_menu' title="<?php echo $strShowHideLeftMenu; ?>" alt="v" src="pmd/images/downarrow2_m.png" ></a></td>
<td width="80%" align="center" nowrap><a
href="javascript:Save2();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strSavePosition ?>" src="pmd/images/save.png"></a><a
href="javascript:Start_table_new();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strCreateTable ?>" src="pmd/images/table.png"></a><a
href="javascript:Start_relation();" onMouseDown="return false;" class="M_butt" id="rel_button" target="_self"><img title="<?php echo $strCreateRelation ?>" src="pmd/images/relation.png"></a><a
href="javascript:Start_display_field();" onMouseDown="return false;" class="M_butt" id="display_field_button" target="_self"><img title="<?php echo $strChangeDisplay ?>" src="pmd/images/display_field.png"></a><a
href="javascript:location.reload();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strReload; ?>" src="pmd/images/reload.png"></a><a
href="javascript:Help();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strHelp; ?>" src="pmd/images/help.png"></a><img class="M_bord" src="pmd/images/bord.png"><a
href="javascript:Angular_direct();" onMouseDown="return false;" class="M_butt" id="angular_direct_button" target="_self"><img title="<?php echo $strAngularLinks.' / '.$strDirectLinks; ?>" src="pmd/images/ang_direct.png"></a><a
href="javascript:Grid();" onMouseDown="return false;" class="M_butt" id="grid_button" target="_self"><img title="<?php echo $strSnapToGrid ?>" src="pmd/images/grid.png"></a><img class="M_bord" src="pmd/images/bord.png"><a
href="javascript:Small_tab_all(document.getElementById('key_SB_all'));" onMouseDown="return false;" class="M_butt" target="_self"><img id='key_SB_all' title="<?php echo $strSmallBigAll; ?>" alt="v" src="pmd/images/downarrow1.png" ></a><a
href="javascript:Small_tab_invert();" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strToggleSmallBig; ?>" alt="key" src="pmd/images/bottom.png" ></a><img class="M_bord" src="pmd/images/bord.png"><a
href="javascript:PDF_save();" onMouseDown="return false;" class="M_butt" target="_self"><img src="pmd/images/pdf.png" alt="key" width="20" height="20" title="<?php echo $strImportExportCoords; ?>"></a></td>
<td width="10%" align="right"><a
href="javascript:Top_menu_right(document.getElementById('key_Left_Right'));" onMouseDown="return false;" class="M_butt" target="_self"><img src="pmd/images/2rightarrow_m.png" id="key_Left_Right" alt=">" title="<?php echo $strMoveMenu; ?>"></a></td>
</tr>
</table></ul>
</head>
<body onload="Main()" class="general_body" id="pmd_body">
<div class="header" id="top_menu">
<a href="javascript:Show_left_menu(document.getElementById('key_Show_left_menu'));"
onmousedown="return false;" class="M_butt first" target="_self">
<img id='key_Show_left_menu' title="<?php echo $strShowHideLeftMenu; ?>"
alt="v" src="pmd/images/downarrow2_m.png" /></a>
<a href="javascript:Save2();" onmousedown="return false;"
class="M_butt" target="_self"
><img title="<?php echo $strSavePosition ?>" src="pmd/images/save.png" alt=""
/></a><a href="javascript:Start_table_new();" onmousedown="return false;"
class="M_butt" target="_self"
><img title="<?php echo $strCreateTable ?>" src="pmd/images/table.png" alt=""
/></a><a href="javascript:Start_relation();" onmousedown="return false;"
class="M_butt" id="rel_button" target="_self"
><img title="<?php echo $strCreateRelation ?>" src="pmd/images/relation.png" alt=""
/></a><a href="javascript:Start_display_field();" onmousedown="return false;"
class="M_butt" id="display_field_button" target="_self"
><img title="<?php echo $strChangeDisplay ?>" src="pmd/images/display_field.png" alt=""
/></a><a href="javascript:location.reload();" onmousedown="return false;"
class="M_butt" target="_self"
><img title="<?php echo $strReload; ?>" src="pmd/images/reload.png" alt=""
/></a><a href="javascript:Help();" onmousedown="return false;"
class="M_butt" target="_self"
><img title="<?php echo $strHelp; ?>" src="pmd/images/help.png" alt=""
/></a><img class="M_bord" src="pmd/images/bord.png" alt=""
/><a href="javascript:Angular_direct();" onmousedown="return false;"
class="M_butt" id="angular_direct_button" target="_self"
><img title="<?php echo $strAngularLinks . ' / ' . $strDirectLinks; ?>"
src="pmd/images/ang_direct.png" alt=""
/></a><a href="javascript:Grid();" onmousedown="return false;"
class="M_butt" id="grid_button" target="_self"
><img title="<?php echo $strSnapToGrid ?>" src="pmd/images/grid.png" alt=""
/></a><img class="M_bord" src="pmd/images/bord.png" alt=""
/><a href="javascript:Small_tab_all(document.getElementById('key_SB_all'));"
onmousedown="return false;" class="M_butt" target="_self"
><img id='key_SB_all' title="<?php echo $strSmallBigAll; ?>" alt="v"
src="pmd/images/downarrow1.png"
/></a><a href="javascript:Small_tab_invert();" onmousedown="return false;"
class="M_butt" target="_self"
><img title="<?php echo $strToggleSmallBig; ?>" alt="key" src="pmd/images/bottom.png"
/></a><img class="M_bord" src="pmd/images/bord.png" alt=""
/><a href="javascript:PDF_save();" onmousedown="return false;"
class="M_butt" target="_self"
><img src="pmd/images/pdf.png" alt="key" width="20" height="20"
title="<?php echo $strImportExportCoords; ?>" /></a>
<a href="javascript:Top_menu_right(document.getElementById('key_Left_Right'));"
onmousedown="return false;" class="M_butt last" target="_self">
<img src="pmd/images/2rightarrow_m.png" id="key_Left_Right" alt=">"
title="<?php echo $strMoveMenu; ?>" /></a>
</div>
<div id="osn_tab">
<CANVAS id="canvas" width="100" height="100" onClick="Canvas_click(this)"></CANVAS>
<CANVAS id="canvas" width="100" height="100" onclick="Canvas_click(this)"></CANVAS>
</div>
<form action="" method="post" name="form1">
<div id="layer_menu" style="left:0px; top:28px; width:150px; visibility:<?PHP echo $hidden ?>; position:fixed; z-index:1000; background-color:#EAEEF0; border:#999999 solid 1px;">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="1px">
<div align="center" style="padding-top:5px">
<a
href="javascript:Hide_tab_all(document.getElementById('key_HS_all'));" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strHideShowAll; ?>" alt="v" src="pmd/images/downarrow1.png" id='key_HS_all' ></a><a
href="javascript:No_have_constr(document.getElementById('key_HS'));" onMouseDown="return false;" class="M_butt" target="_self"><img title="<?php echo $strHideShowNoRelation; ?>" alt="v" src="pmd/images/downarrow2.png" id='key_HS'></a>
</div>
</td>
</tr>
<tr>
<td>
<div id="id_scroll_tab" class="scroll_tab">
<table width="100%" style="padding-left:3px;">
<?php
for ( $i=0; $i < sizeof( $GLOBALS['PMD']['TABLE_NAME'] ); $i++ )
{
?>
<tr>
<td title="<?php echo $strStructure; ?>" width="1px" onMouseOver="this.className='L_butt2_2'" onMouseOut="this.className='L_butt2_1'" ><img onClick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');" src="pmd/images/exec.png"></td>
<td width="1px"><input onClick="VisibleTab(this,'<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>')" title="<?php echo $strHide ?>" id="check_vis_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>" style="margin:0px;" type="checkbox" value="<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>" <?php if( isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]) ) echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"]?"checked":""; else echo "checked"; ?>></td>
<td class="Tabs" onMouseOver="this.className='Tabs2'" onMouseOut="this.className='Tabs'" onClick="Select_tab('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>');"><?php echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i]; ?></td>
</tr>
<?php
}
?>
</table>
</div>
</td>
</tr>
<tr>
<td height="1px">
<div align="center"><?php echo $strNumberOfTables ?>: <?php echo sizeof( $GLOBALS['PMD']['TABLE_NAME'] ) ?></div>
<div align="right"><div style=" background-image:url(pmd/images/resize.png); cursor:nw-resize; width:16px; height:16px; " onMouseDown="layer_menu_cur_click=1" onMouseUp="layer_menu_cur_click=0"></div></div>
</td>
</tr>
</table>
<div id="layer_menu" style="visibility:<?php echo $hidden ?>;">
<div align="center" style="padding-top:5px;">
<a href="javascript:Hide_tab_all(document.getElementById('key_HS_all'));"
onmousedown="return false;" class="M_butt" target="_self">
<img title="<?php echo $strHideShowAll; ?>" alt="v"
src="pmd/images/downarrow1.png" id='key_HS_all' /></a>
<a href="javascript:No_have_constr(document.getElementById('key_HS'));"
onmousedown="return false;" class="M_butt" target="_self">
<img title="<?php echo $strHideShowNoRelation; ?>" alt="v"
src="pmd/images/downarrow2.png" id='key_HS' /></a>
</div>
<?php
for ( $i=0; $i < sizeof( $GLOBALS['PMD']["TABLE_NAME"] ); $i++ )
{
$t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
$t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
?>
<input name="t_x[<?php echo $t_n_url ?>]" type="hidden" id="t_x[<?php echo $t_n_url ?>]">
<input name="t_y[<?php echo $t_n_url ?>]" type="hidden" id="t_y[<?php echo $t_n_url ?>]">
<input name="t_v[<?php echo $t_n_url ?>]" type="hidden" id="t_v[<?php echo $t_n_url ?>]">
<input name="t_h[<?php echo $t_n_url ?>]" type="hidden" id="t_h[<?php echo $t_n_url ?>]">
<table id="<?php echo $t_n_url ?>" cellpadding="0" cellspacing="0" class="tab"
style="position:absolute;
left: <?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["X"]; else echo rand(180,800); ?>;
top: <?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["Y"]; else echo rand(30,500); ?>;
visibility: <?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["H"]?"visible":"hidden"; ?>;
">
<tr>
<td class="small_tab" onMouseOver="this.className='small_tab2';" onMouseOut="this.className='small_tab';" id="_|_hide_tbody_<?php echo $t_n_url ?>" onClick="Small_tab('<?php echo $t_n_url ?>',1)"><?php if( isset($tab_pos[$t_n]) ) echo $tab_pos[$t_n]["V"]?"v":">";else echo "v"; ?></td>
<td class="small_tab_pref" onMouseOver="this.className='small_tab_pref2';" onMouseOut="this.className='small_tab_pref';" onClick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');"><img src="pmd/images/exec_small.png"></td>
<td nowrap id="_|_zag_<?php echo $t_n_url ?>" class="tab_zag" onMouseDown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"
onMouseOver="this.className = 'tab_zag_2'" onMouseOut="this.className = 'tab_zag'"
><?php echo "<span class='owner'>".strtolower($GLOBALS['PMD_OUT']["OWNER"][$i]).".</span>".$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i]; ?></td>
</tr>
<tbody id="_|_tbody_<?php echo $t_n_url ?>"
<?php if (! isset($tab_pos[$t_n])) echo 'style="display: none;"'; ?>>
<?php
$display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
for ( $j=0; $j < sizeof( $tab_column[$t_n]["COLUMN_ID"] ); $j++ )
{
?>
<tr id = "_|_tr_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i].'.'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
<?php if($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) echo ' class="tab_field_3" '; else echo ' class="tab_field" '; ?>
onMouseOver="old_class = this.className; this.className = 'tab_field_2';" onMouseOut="this.className = old_class;"
onMouseDown="Click_field('<?php
echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])."',";
if ($GLOBALS['PMD']['TABLE_TYPE'][$i] != 'INNODB') {
echo (isset( $tables_pk_or_unique_keys[ $t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j] ] ) ? 1 : 0);
} else {
// if this is an InnoDB table, it's not necessary that the
// index is a primary key
echo (isset( $tables_all_keys[ $t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j] ] ) ? 1 : 0);
}
?>)">
<td width="10px" colspan="3" id="<?php echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
><div style="white-space:nowrap">
<?php
if(isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]])) {
?>
<img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE']
?>/images/FieldKey_small.png" alt="*"><?php
} else {
?><img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE']?>/images/Field_small<?php
if(strstr($tab_column[$t_n]["TYPE"][$j],'char')
|| strstr($tab_column[$t_n]["TYPE"][$j],'text') ) echo '_char';
elseif(strstr($tab_column[$t_n]["TYPE"][$j],'int')
|| strstr($tab_column[$t_n]["TYPE"][$j],'float')
|| strstr($tab_column[$t_n]["TYPE"][$j],'double')
|| strstr($tab_column[$t_n]["TYPE"][$j],'decimal') ) echo '_int';
elseif(strstr($tab_column[$t_n]["TYPE"][$j],'date')
|| strstr($tab_column[$t_n]["TYPE"][$j],'time')
|| strstr($tab_column[$t_n]["TYPE"][$j],'year') ) echo '_date';
?>.png" alt="*"><?php } ?>
<?php echo htmlspecialchars($tab_column[$t_n]["COLUMN_NAME"][$j]." : ".$tab_column[$t_n]["TYPE"][$j], ENT_QUOTES); ?>
</div>
</td>
<div id="id_scroll_tab" class="scroll_tab">
<table width="100%" style="padding-left: 3px;">
<?php
for ($i = 0; $i < count($GLOBALS['PMD']['TABLE_NAME']); $i++) {
?>
<tr><td title="<?php echo $strStructure; ?>" width="1px"
onmouseover="this.className='L_butt2_2'"
onmouseout="this.className='L_butt2_1'">
<img onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');"
src="pmd/images/exec.png" alt="" /></td>
<td width="1px">
<input onclick="VisibleTab(this,'<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>')"
title="<?php echo $strHide ?>"
id="check_vis_<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"
style="margin:0px;" type="checkbox"
value="<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"
<?php
if (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])) {
echo $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"] ? 'checked="checked"' : '';
} else {
echo 'checked="checked"';
}
?> /></td>
<td class="Tabs" onmouseover="this.className='Tabs2'"
onmouseout="this.className='Tabs'"
onclick="Select_tab('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>');">
<?php echo $GLOBALS['PMD_OUT']["TABLE_NAME"][$i]; ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
}
?>
</table>
</div>
<div align="center">
<?php echo $strNumberOfTables ?>: <?php echo count($GLOBALS['PMD']['TABLE_NAME']) ?>
</div>
<div align="right">
<div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">
</div>
</div>
</div>
<?php
for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
$t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
$t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i];
?>
<input name="t_x[<?php echo $t_n_url ?>]" type="hidden" id="t_x_<?php echo $t_n_url ?>_" />
<input name="t_y[<?php echo $t_n_url ?>]" type="hidden" id="t_y_<?php echo $t_n_url ?>_" />
<input name="t_v[<?php echo $t_n_url ?>]" type="hidden" id="t_v_<?php echo $t_n_url ?>_" />
<input name="t_h[<?php echo $t_n_url ?>]" type="hidden" id="t_h_<?php echo $t_n_url ?>_" />
<table id="<?php echo $t_n_url ?>" cellpadding="0" cellspacing="0" class="tab"
style="position: absolute;
left: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["X"]; else echo rand(180, 800); ?>px;
top: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["Y"]; else echo rand(30, 500); ?>px;
visibility: <?php if (isset($tab_pos[$t_n])) echo $tab_pos[$t_n]["H"] ? "visible" : "hidden"; ?>;
">
<thead>
<tr>
<td class="small_tab" onmouseover="this.className='small_tab2';"
onmouseout="this.className='small_tab';"
id="id_hide_tbody_<?php echo $t_n_url ?>"
onclick="Small_tab('<?php echo $t_n_url ?>', 1)"><?php
// no space alloawd here, between tags and content !!!
// JavaScript function does require this
if (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) {
echo 'v';
} else {
echo '&gt;';
}
?></td>
<td class="small_tab_pref" onmouseover="this.className='small_tab_pref2';"
onmouseout="this.className='small_tab_pref';"
onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');">
<img src="pmd/images/exec_small.png" alt="" /></td>
<td nowrap="nowrap" id="id_zag_<?php echo $t_n_url ?>" class="tab_zag"
onmousedown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"
onmouseover="this.className = 'tab_zag_2'"
onmouseout="this.className = 'tab_zag'">
<span class='owner'>
<?php
echo $GLOBALS['PMD_OUT']["OWNER"][$i];
echo '.</span>';
echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
?></td>
</tr>
</thead>
<tbody id="id_tbody_<?php echo $t_n_url ?>"
<?php if (! isset($tab_pos[$t_n])) echo 'style="display: none;"'; ?>>
<?php
$display_field = PMA_getDisplayField($db, $GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]);
for ($j = 0; $j < count($tab_column[$t_n]["COLUMN_ID"]); $j++) {
?>
<tr id="id_tr_<?php
echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i] . '.'
. urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>"
<?php
if ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) {
echo ' class="tab_field_3" ';
} else {
echo ' class="tab_field" ';
}
?>
onmouseover="old_class = this.className; this.className = 'tab_field_2';"
onmouseout="this.className = old_class;"
onmousedown="Click_field('
<?php
echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]."','".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])."',";
if ($GLOBALS['PMD']['TABLE_TYPE'][$i] != 'INNODB') {
echo (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
} else {
// if this is an InnoDB table, it's not necessary that the
// index is a primary key
echo (isset($tables_all_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
}
?>)">
<td width="10px" colspan="3"
id="<?php echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>">
<div style="white-space:nowrap">
<?php
if (isset($tables_pk_or_unique_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]])) {
?>
<img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'];?>/images/FieldKey_small.png"
alt="*" />
<?php
} else {
?>
<img src="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE']?>/images/Field_small<?php
if (strstr($tab_column[$t_n]["TYPE"][$j],'char')
|| strstr($tab_column[$t_n]["TYPE"][$j],'text')) {
echo '_char';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j],'int')
|| strstr($tab_column[$t_n]["TYPE"][$j],'float')
|| strstr($tab_column[$t_n]["TYPE"][$j],'double')
|| strstr($tab_column[$t_n]["TYPE"][$j],'decimal')) {
echo '_int';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j],'date')
|| strstr($tab_column[$t_n]["TYPE"][$j],'time')
|| strstr($tab_column[$t_n]["TYPE"][$j],'year')) {
echo '_date';
}
?>.png" alt="*" />
<?php
}
echo htmlspecialchars($tab_column[$t_n]["COLUMN_NAME"][$j]
. " : " . $tab_column[$t_n]["TYPE"][$j], ENT_QUOTES);
?>
</div>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
}
?>
</form>
<div id="hint"></div>
<div id='layer_action' style="position:absolute; left:638px; top:52px; z-index:1000;
visibility:<?PHP echo $hidden ?>; background-color:#CCFF99; padding:3px; border:#009933 solid 1px; white-space:nowrap; font-weight:bold">Load...</div>
<div id='layer_action' style="visibility:<?php echo $hidden ?>;">Load...</div>
<table id="layer_new_relation" style="visibility:<?PHP echo $hidden ?>; position:absolute; left:636px; top:85px; z-index:1000; width: 153px;" width="5%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="frams1" width="10px"></td>
<td width="99%" id="frams5"></td>
<td width="10px" id="frams2"><div class="bor"></div></td>
</tr>
<tr>
<td id="frams8"></td>
<td class="input_tab"><table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td colspan="2" align="center" nowrap><b><?php echo $strCreateRelation; ?></b></td>
</tr>
<tbody id="InnoDB_relation">
<tr>
<td colspan="2" align="center" nowrap><b>InnoDB</b></td>
</tr>
<tr>
<td width="58" nowrap>on delete</td>
<table id="layer_new_relation" style="visibility:<?php echo $hidden ?>;"
width="5%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px"></td>
<td class="frams5" width="99%" ></td>
<td class="frams2" width="10px"><div class="bor"></div></td>
</tr>
<tr>
<td class="frams8"></td>
<td class="input_tab">
<table width="168" border="0" align="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" align="center" nowrap="nowrap"><b><?php echo $strCreateRelation; ?></b></td>
</tr>
</thead>
<tbody id="InnoDB_relation">
<tr>
<td colspan="2" align="center" nowrap="nowrap"><b>InnoDB</b></td>
</tr>
<tr>
<td width="58" nowrap="nowrap">on delete</td>
<td width="102"><select name="on_delete" id="on_delete">
<option value="nix" selected="selected">--</option>
<option value="CASCADE">CASCADE</option>
<option value="SET NULL">SET NULL</option>
<option value="NO ACTION">NO ACTION</option>
<option value="RESTRICT">RESTRICT</option>
</select> </td>
</tr>
<tr>
<td nowrap>on update</td>
<option value="nix" selected="selected">--</option>
<option value="CASCADE">CASCADE</option>
<option value="SET NULL">SET NULL</option>
<option value="NO ACTION">NO ACTION</option>
<option value="RESTRICT">RESTRICT</option>
</select>
</td>
</tr>
<tr>
<td nowrap="nowrap">on update</td>
<td><select name="on_update" id="on_update">
<option value="nix" selected="selected">--</option>
<option value="CASCADE">CASCADE</option>
<option value="SET NULL">SET NULL</option>
<option value="NO ACTION">NO ACTION</option>
<option value="RESTRICT">RESTRICT</option>
</select> </td>
</tr>
</tbody>
<tr>
<td colspan="2" align="center" nowrap>
<input type="button" id="butt" name="Button" value="<?php echo $strOK; ?>" onClick="New_relation()" >
<input type="button" id="butt" name="Button" value="<?php echo $strCancel; ?>" onClick="document.getElementById('layer_new_relation').style.visibility = 'hidden';">
<option value="nix" selected="selected">--</option>
<option value="CASCADE">CASCADE</option>
<option value="SET NULL">SET NULL</option>
<option value="NO ACTION">NO ACTION</option>
<option value="RESTRICT">RESTRICT</option>
</select>
</td>
</tr>
</table></td>
<td id="frams6"></td>
</tr>
<tr>
<td id="frams4"><div class="bor"></div></td>
<td id="frams7"></td>
<td id="frams3"></td>
</tr>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" align="center" nowrap="nowrap">
<input type="button" class="butt" name="Button"
value="<?php echo $strOK; ?>" onclick="New_relation()" />
<input type="button" class="butt" name="Button"
value="<?php echo $strCancel; ?>"
onclick="document.getElementById('layer_new_relation').style.visibility = 'hidden';" />
</td>
</tr>
</tbody>
</table>
</td>
<td class="frams6"></td>
</tr>
<tr>
<td class="frams4"><div class="bor"></div></td>
<td class="frams7"></td>
<td class="frams3"></td>
</tr>
</tbody>
</table>
<table id="layer_upd_relation" style="visibility:<?PHP echo $hidden ?>; position:absolute; left:637px; top:224px; z-index:1000;" width="5%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td id="frams1" width="10px"></td>
<td width="99%" id="frams5"></td>
<td width="10px" id="frams2"><div class="bor"></div></td>
</tr>
<tr>
<td id="frams8"></td>
<td class="input_tab"><table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td colspan="3" align="center" nowrap><b><?php echo $strDeleteRelation; ?></b></td>
</tr>
<tr>
<td colspan="3" align="center" nowrap>
<input name="Button" type="button" id="butt" onClick="Upd_relation()" value="<?php echo $strDelete; ?>" >
<input type="button" id="butt" name="Button" value="<?php echo $strCancel; ?>" onClick="document.getElementById('layer_upd_relation').style.visibility = 'hidden'; Re_load();">
<table id="layer_upd_relation" style="visibility:<?PHP echo $hidden ?>;"
width="5%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px"></td>
<td class="frams5" width="99%"></td>
<td class="frams2" width="10px"><div class="bor"></div></td>
</tr>
<tr>
<td class="frams8"></td>
<td class="input_tab">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td colspan="3" align="center" nowrap="nowrap"><b><?php echo $strDeleteRelation; ?></b></td>
</tr>
<tr>
<td colspan="3" align="center" nowrap="nowrap">
<input name="Button" type="button" class="butt"
onclick="Upd_relation()" value="<?php echo $strDelete; ?>" />
<input type="button" class="butt" name="Button"
value="<?php echo $strCancel; ?>"
onclick="document.getElementById('layer_upd_relation').style.visibility = 'hidden'; Re_load();" />
</td>
</tr>
</table></td>
<td id="frams6"></td>
</tr>
<tr>
<td id="frams4"><div class="bor"></div></td>
<td id="frams7"></td>
<td id="frams3"></td>
</tr>
</tr>
</table></td>
<td class="frams6"></td>
</tr>
<tr>
<td class="frams4"><div class="bor"></div></td>
<td class="frams7"></td>
<td class="frams3"></td>
</tr>
</tbody>
</table>
<!-- cache images -->
<img src="pmd/images/2leftarrow_m.png" width="0" height="0">
<img src="pmd/images/rightarrow1.png" width="0" height="0">
<img src="pmd/images/rightarrow2.png" width="0" height="0">
<img src="pmd/images/uparrow2_m.png" width="0" height="0">
<img src="pmd/images/2leftarrow_m.png" width="0" height="0" alt="" />
<img src="pmd/images/rightarrow1.png" width="0" height="0" alt="" />
<img src="pmd/images/rightarrow2.png" width="0" height="0" alt="" />
<img src="pmd/images/uparrow2_m.png" width="0" height="0" alt="" />
</body>
</html>