Первая копия

This commit is contained in:
2020-02-27 00:28:43 +06:00
commit 925cac4752
1125 changed files with 198979 additions and 0 deletions

3
metadata/dbms/.htaccess Normal file
View File

@ -0,0 +1,3 @@
RewriteEngine on
# Убирает версию файла из file_v1234567890.js в file.js
RewriteRule ^(.*)_v[0-9]*\.(css|js|gif|png|jpg)$ $1.$2 [L]

View File

@ -0,0 +1,117 @@
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;i<data.length;i++) {
var dataString = data[i].string;
var dataProp = data[i].prop;
this.versionSearchString = data[i].versionSearch || data[i].identity;
if (dataString) {
if (dataString.indexOf(data[i].subString) != -1)
return data[i].identity;
}
else if (dataProp)
return data[i].identity;
}
},
searchVersion: function (dataString) {
var index = dataString.indexOf(this.versionSearchString);
if (index == -1) return;
return parseFloat(dataString.substring(index+this.versionSearchString.length+1));
},
dataBrowser: [
{
string: navigator.userAgent,
subString: "Chrome",
identity: "Chrome"
},
{ string: navigator.userAgent,
subString: "OmniWeb",
versionSearch: "OmniWeb/",
identity: "OmniWeb"
},
{
string: navigator.vendor,
subString: "Apple",
identity: "Safari",
versionSearch: "Version"
},
{
prop: window.opera,
identity: "Opera",
versionSearch: "Version"
},
{
string: navigator.vendor,
subString: "iCab",
identity: "iCab"
},
{
string: navigator.vendor,
subString: "KDE",
identity: "Konqueror"
},
{
string: navigator.userAgent,
subString: "Firefox",
identity: "Firefox"
},
{
string: navigator.vendor,
subString: "Camino",
identity: "Camino"
},
{ // for newer Netscapes (6+)
string: navigator.userAgent,
subString: "Netscape",
identity: "Netscape"
},
{
string: navigator.userAgent,
subString: "MSIE",
identity: "Explorer",
versionSearch: "MSIE"
},
{
string: navigator.userAgent,
subString: "Gecko",
identity: "Mozilla",
versionSearch: "rv"
},
{ // for older Netscapes (4-)
string: navigator.userAgent,
subString: "Mozilla",
identity: "Netscape",
versionSearch: "Mozilla"
}
],
dataOS : [
{
string: navigator.platform,
subString: "Win",
identity: "Windows"
},
{
string: navigator.platform,
subString: "Mac",
identity: "Mac"
},
{
string: navigator.userAgent,
subString: "iPhone",
identity: "iPhone/iPod"
},
{
string: navigator.platform,
subString: "Linux",
identity: "Linux"
}
]
};
BrowserDetect.init();

212
metadata/dbms/TCGallery.js Normal file
View File

@ -0,0 +1,212 @@
//Галерея изображений на первой странице сайта
function TCGallery(parent)
{
this.work = function()
{
if(this.mas[0].style.opacity > 0.05)
{
this.mas[0].style.opacity = this.mas[0].style.opacity - 0.05;
this.timeout_id=setTimeout(function(thiz){return function(){thiz.work();}}(this),50);
this.test++;
//console.info(this.test+' 50 '+this.mas[0].style.opacity);
}else
{
//Перестовляем Z индексы первый на последнее место (больший наверху)
if(this.mas.length>0)
{
var z=this.mas[this.mas.length-1].style.zIndex;
for(var i=this.mas.length-1;i>0;i--)
{
this.mas[i].style.zIndex=this.mas[i-1].style.zIndex
}
this.mas[0].style.zIndex=z;
}
//Поменяли местами востанавливаем прозрачность
for(var i=0;i<this.mas.length;i++)
{ this.mas[i].style.opacity = 1;
}
this.mas.sort(function(a,b){return b.style.zIndex-a.style.zIndex;}); //Сортируем с макс Z индексом наверху в 0ле
this.timeout_id=setTimeout(function(thiz){return function(){thiz.work();}}(this),5000); //Перезапускаем таймер через 10 секунд с максимальным Z индексом
this.selected();
this.test++;
//console.info(this.test+' 5000 '+this.mas[0].style.opacity);
}
};
//Стартуем галерею
this.Start = function()
{
var maxz=0;
for(var i=0;i<this.mas.length;i++)
{ this.mas[i].style.opacity = 1;
if(maxz<this.mas[i].style.zIndex) maxz=this.mas[i].style.zIndex;
}
if(this.mas.length>0)
setTimeout(function(thiz){return function(){thiz.work();}}(this),5000);
maxz++;
//Кнопочки для переключения картинок
var cdv=document.createElement('div');
cdv.style.cssText='opacity: 0.7; display: block; position: absolute; bottom: 5px; right: 5px; z-index: '+maxz+'; border: solid 0px red;';
for(var i=0;i<this.mas.length;i++)
{
var btn=document.createElement('div');
btn.style.cssText='cursor: pointer; background-color: #eeeeee; text-align: center; display: inline-block; margin: 2px; border: solid 1px black; width: 17px;';
btn.appendChild(document.createTextNode(i+1));
btn.onclick = function(thiz,i){return function(){ thiz.moveTo(i); }; }(this,i);
cdv.appendChild(btn);
this.btns.push(btn);
}
this.parent.appendChild(cdv);
if(this.btns.length>0) this.btns[0].style.backgroundColor='#f3af5a';
};
//Переместить на заданный слой (позиция с 0)
this.moveTo = function(pos)
{
if(pos<0 || pos>this.firstmas.length - 1) return;
var elm=this.firstmas[pos];
for(var j=0;j<this.mas.length;j++)
{
if(this.mas[0]==elm) break;
var z=this.mas[this.mas.length-1].style.zIndex;
for(var i=this.mas.length-1;i>0;i--)
{
this.mas[i].style.zIndex=this.mas[i-1].style.zIndex
}
this.mas[0].style.zIndex=z;
this.mas.sort(function(a,b){return b.style.zIndex-a.style.zIndex;});
}
//Поменяли местами востанавливаем прозрачность
for(var i=0;i<this.mas.length;i++)
{ this.mas[i].style.opacity = 1.0;
}
clearTimeout(this.timeout_id)
this.timeout_id=setTimeout(function(thiz){return function(){thiz.work();}}(this),10000);
this.selected();
};
//Поменялся элемент
this.selected = function()
{
var pos=0;
for(var i=0;i<this.firstmas.length;i++)
{ if(this.mas[0]==this.firstmas[i])
{ pos=i;
break;
}
}
//Обнуляем стили
for(var i=0;i<this.btns.length;i++)
this.btns[i].style.backgroundColor='#eeeeee';
//Выставляем стиль для выбранного элемента
this.btns[pos].style.backgroundColor='#f3af5a';
};
//Private
//Получить детей в виде массива
this.getChildsMas = function()
{
var mas = new Array();
if(this.parent!==null)
{
var child = this.parent.firstChild;
while(child)
{ if(typeof child.style !== "undefined") //Только те где есть стиль
{ mas.push(child);
}
child = child.nextSibling;
}
}
return mas;
};
//Private
//Получить позицию по объекту (-1 если ненайден)
this.getPos = function(obj)
{
for(var i=0;i<this.firstmas.length;i++)
{ if(this.firstmas[i]==obj) return i;
}
return -1;
};
this.test=0;
//Конструктор
this.timeout_id =0;
this.parent=parent;
this.mas = this.getChildsMas(); //Массив элементов которые будут "Галереится"
this.mas.sort(function(a,b){return b.style.zIndex-a.style.zIndex;});
this.firstmas = [].concat(this.mas); //Первоначальный порядок элементов
this.btns = new Array();
}
//Галерея изображений на странице товара (Двигается в право в лево)
function TCGallery2(parent)
{
this.addImage = function(small)
{
this.mas.push({div: small, sell: false});
small.onmouseover = function(thiz,small)
{ return function()
{
if(!thiz.ower) return;
pos=-1;
for(i=0;i<thiz.mas.length;i++) if(small===thiz.mas[i].div) { pos=i;} //Позиция элемента в массиве
if(pos===-1) return;
if(thiz.ower && pos!== thiz.pos )
{ thiz.pos=pos * 400;
thiz.moveTo();
}
};
}(this,small);
small.onclick = function(thiz,small)
{ return function()
{
pos=-1;
for(i=0;i<thiz.mas.length;i++) if(small===thiz.mas[i].div) { pos=i; } else { thiz.mas[i].div.style.borderColor="#dfdfdf"; thiz.mas[i].sell=false; } //Позиция элемента в массиве
if(pos===-1) return;
if(!thiz.mas[pos].sell) //Если щёлкнули на выделеное 1й раз
{ thiz.mas[pos].sell = true;
thiz.ower=false;
small.style.borderColor='#999999';
}else
{ thiz.mas[pos].sell = false;
thiz.ower=true;
small.style.borderColor='#dfdfdf';
}
if(pos!== thiz.pos )
{ thiz.pos=pos * 400;
thiz.moveTo();
}
};
}(this,small);
};
//Плавная прокрутка по горизонтали
this.moveTo = function()
{
if(this.parent==null) return;
var dx=(this.pos - this.parent.scrollLeft)/20.0; //Шагов для достижения нужного положения
if(dx>0) dx=Math.ceil(dx); else dx=Math.floor(dx);
this.parent.scrollLeft+=dx;
if(this.parent.scrollLeft!=this.pos)
setTimeout(function(thiz){ return function(){ thiz.moveTo(); } }(this),10);
}
this.mas = new Array(); //Массим элементов с рисуночками
this.parent=parent;
this.pos=0;
this.ower=true;
}

129
metadata/dbms/dbms.css Normal file
View File

@ -0,0 +1,129 @@
*{
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
}
html,body
{
height:100%;
min-height:100%;
margin: 0px 0px;
padding: 0px;
font-size: 14px;
font-family: Arial;
}
input,textarea
{
margin: 0px 0px;
}
select
{
display: block;
-moz-box-sizing: content-box;
-webkit-box-sizing:content-box;
/*box-sizing:content-box;*/
box-sizing: border-box;
}
/*Над всеми по Z*/
#menu
{
padding:0px;
position:fixed;
left:1px;
top:1px;
height:34px;
width:70px;
border:1px solid #000000;
display:block;
text-decoration:none;
z-index: 99999
}
/* Для элементов выступающих в роли кнопок */
.button {
-webkit-user-select: none; /* Chrome all / Safari all */
-moz-user-select: none; /* Firefox all */
-ms-user-select: none; /* IE 10+ */
-o-user-select: none; /* No support for these yet, use at own risk */
user-select: none; /* No support for these yet, use at own risk */
display: inline-block;
/*display: table;*/
cursor: pointer;
/*hite-space: nowrap;*/
text-align: center;
}
.shadow {
box-shadow: 0 0 10px rgba(0,0,0,0.7);
}
/* Для полей состояжих из нескольких элементов (поле с кнопочкой допустим) */
table.DBMSSimple {
width: 100%;
height: 100%;
}
table.DBMSSimple td,table.DBMSSimple th {
padding: 0px;
border: 0px solid #999999;
}
/* For table show data */
table.SEdit {
border-collapse: collapse;
border: 1px double #999999;
width: 100%;
background-color: #ffffff;
border-spacing: 1px 1px;
}
table.SEdit td,table.SEdit th {
padding: 1px;
border: 0px solid #999999;
}
table.SEdit th {
font-weight: bold;
background-color: rgb(218, 218, 218);
}
/* For table filter data whitesmoke */
table.SFilter {
border-collapse: collapse;
width: 100%;
height: 100%;
background-color:#f1f1f1;
border-spacing: 1px 1px;
}
table.SFilter td {
padding: 1px;
border: 0px solid #999999;
}
/* For table show data */
table.SShow {
border-collapse: collapse;
border: 1px double #999999;
width: 100%;
background-color: #ffffff;
border-spacing: 1px 1px;
}
table.SShow td,table.SShow th {
border: 1px solid #999999;
}
table.SShow th {
font-weight: bold;
background-color: rgb(218, 218, 218);
}

1553
metadata/dbms/editrecord.js Normal file

File diff suppressed because it is too large Load Diff

BIN
metadata/dbms/form/1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 B

BIN
metadata/dbms/form/5.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 B

BIN
metadata/dbms/form/_t-l.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

BIN
metadata/dbms/form/b-l.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

BIN
metadata/dbms/form/b-r.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

BIN
metadata/dbms/form/b.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
metadata/dbms/form/g.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 295 B

BIN
metadata/dbms/form/help.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

BIN
metadata/dbms/form/hide.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 B

BIN
metadata/dbms/form/l.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

BIN
metadata/dbms/form/none.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 B

BIN
metadata/dbms/form/r.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

BIN
metadata/dbms/form/t-l.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 175 B

BIN
metadata/dbms/form/t-r.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

BIN
metadata/dbms/form/t.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 B

BIN
metadata/dbms/form/t1.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 319 B

BIN
metadata/dbms/form/t11.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

BIN
metadata/dbms/form/t12.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

BIN
metadata/dbms/form/t2.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

BIN
metadata/dbms/form/t22.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 B

BIN
metadata/dbms/form/x.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
metadata/dbms/images/g.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 977 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

505
metadata/dbms/login.js Normal file
View File

@ -0,0 +1,505 @@
function TUser()
{
//Функция запрашивает информацию о текущем пользователе с сервера
this.LoadData = function()
{
var r = new TRequest(this);
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[0]]></cmd></metadata>';
if(r.callServer(ScriptName,xs))
{
this.showShadow(true);
}
};
this.applyReq=function(req,fn,node)
{
//alert(getXMLNodeSerialisation(node));
this.showShadow(false);
if(fn==7)
{
var nCmd=findFirstNode(node, "cmd");
if(nCmd!=null)
{
if(findFirstNode(nCmd,'#cdata-section').nodeValue=="1") //Logout
{
location.reload();
//window.location.href = '../';
}else if(findFirstNode(nCmd,'#cdata-section').nodeValue=="2") //Check if user not logged
{
if(findNode(node,'#cdata-section').nodeValue=="0") //if not logged
{
this.showLoginForm();
}else
{
this.name=getCdataValue(findNode(node,'name'));
this.surname=getCdataValue(findNode(node,'surname'));
this.patronymic=getCdataValue(findNode(node,'patronymic'));
if (typeof this.onUpdateName !== 'undefined') {
this.onUpdateName(this.name,this.surname,this.patronymic);
}
//configGUIbyAccessLevel();
//var shadow=document.getElementById("shadow");
//if(shadow.parentNode!=null) shadow.parentNode.removeChild(shadow);
}
}else if(findFirstNode(nCmd,'#cdata-section').nodeValue=="3") //Login
{
//if(findNode(node,'#cdata-section').nodeValue=="0") //if not logged
//{
// alert(_('Invalid_username_and_or_password'));
//}else
//{
// location.reload();
//}
}else if(findFirstNode(nCmd,'#cdata-section').nodeValue=="4") //Register
{
//if(findNode(node,'#cdata-section').nodeValue=="1") //if register
//{
// alert(_('New_user_is_registered')+'\n'+_('The_password_has_been_sent_to_you_by_Email'));
// location.reload();
//}
}
}
}
};
//Display login and registration form
this.showLoginForm = function()
{
if(this.win==null || this.win.closed)
{
this.win=new TWin(true);
this.win.TWin(10,10);
this.win.setCaption(_('Authorization'));
this.win.setSize("350px","200px");
var str='<div style="width: 100%; height: 100%; padding: 3px; text-align: left;">\n\
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
<tbody>\n\
<tr><td>\n\
<table border="0" style="width: 100%; height: 100%;">\n\
<tr>\n\
<td style="padding: 2px; width: 30%; white-space: nowrap"><b>'+_('Login')+' (E-mail):</b></td>\n\
<td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin'+this.uid+'" name="login"><br></td>\n\
</tr>\n\
<tr>\n\
<td style="padding: 2px;"><b>Password:</b></td>\n\
<td style="padding: 2px;"><input type="password" maxlength="33" style="width: 100%; padding: 2px; display: inline;" id="tcPassword'+this.uid+'" name="password"><br></td>\n\
</tr>\n\
<tr>\n\
<td style="padding: 2px;" colspan="2"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%;"><tr><td><label for="save0" style="white-space: nowrap;"><input id="save_'+this.uid+'" type="checkbox" style="display: inline;" checked/>&nbsp;Remember&nbsp;(<a href="#" onclick="showRestoreForm();">Forgot your password?</a>)</label></td></tr></table></td>\n\
</tr>\n\
<tr><td colspan="2" style="text-align: right;"><input class="button-secondary" id="TLogin_E'+this.uid+'" type="button" style="display: inline;" value="'+_('Log_in')+'"></td></tr>\n\
</table>\n\
</td></tr>\n\
</tbody>\n\
</table>\n\
</div>';
this.win.setContent(str);
//Center the window and display the shadow
//if(this.win.tbl.offsetHeight>this.win.div.offsetHeight) this.win.div.style.height=this.win.tbl.offsetHeight+"px";
//if(this.win.tbl.offsetWidth>this.win.div.offsetWidth) this.win.div.style.width=this.win.tbl.offsetWidth+"px";
this.win.setCenter();
this.win.shadow=true;
this.win.hide(false);
//Нажатие на кнопку авторизоваться
var obj=null;
obj=document.getElementById('TLogin_E'+this.uid);
if(obj!==null)
{
obj.onclick=function(thiz)
{
return function()
{
var xs='<?xml version="1.0" encoding="utf-8"?>\
<metadata fn="7">\
<cmd><![CDATA[3]]></cmd>\n\
<login><![CDATA['+document.getElementById('tcLogin'+thiz.uid).value+']]></login>\
<password><![CDATA['+document.getElementById('tcPassword'+thiz.uid).value+']]></password>\
</metadata>';
var request=new TRequest(thiz);
if(request.callServer(ScriptName,xs))
{
thiz.win.showProgressBar();
}
};
}(this);
}
}
};
//logout current user
this.Logout = function()
{
xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[1]]></cmd></metadata>';
var request=new TRequest(this);
if(request.callServer(ScriptName,xs))
{
this.showShadow();
}
};
//Checking the session without its extension, if it is completed, we display the authorization window.
this.checkSession = function()
{
$.getJSON('../session',{},function(thiz){return function(data){ if(data.result=='ERROR'){thiz.showLoginForm();} };}(this));
setTimeout(function(thiz){return function(){thiz.checkSession();};}(this), 10000);
};
this.showShadow = function(visible)
{
if(visible)
{
this.divsh=document.createElement('div'); //Тень для модального окна
this.divsh.style.cssText="display: block; position: fixed; z-index:9999; top:0; left:0; height: 100%; width: 100%; background: rgba(0,0,0,0.3);";
document.body.appendChild( this.divsh );
}else
{
deleteHTML(this.divsh);
}
};
//Check whether the already authorized (+ attempt to log in through "hash").
this.isLogined=function()
{
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[2]]></cmd></metadata>';
var request=new TRequest(this);
if(request.callServer(ScriptName,xs))
{
this.showShadow(true);
alert(ScriptName+" = "+xs);
//m_winPP.showProgressBar();
}
};
this.divsh=null;
this.id=null;
this.name='';
this.surname='';
this.patronymic='';
this.temp=false;
this.role='';
//Запрашиваю данные о текущем пользователе с сервера
//this.LoadData();
};
/*
* Login form (not cross-source).
* [^\x00-\x7F]+
*/
function TLogin()
{
this.showLoginForm = function()
{
this.win.TWin(10,10);
this.win.shadow=true;
this.win.setCaption(document.createTextNode("Enter"));
var str='<div style="width: 100%; height: 100%; padding: 3px; text-align: left;">\n\
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%;">\n\
<tbody>\n\
<tr><td>\n\
<table border="0" style="width: 100%; height: 100%;">\n\
<tr>\n\
<td style="padding: 2px; width: 30%; white-space: nowrap"><b>'+_('Login')+' (E-mail):</b></td>\n\
<td style="padding: 2px;"><input type="text" maxlength="50" style="width: 100%; padding: 2px; display: inline;" id="tcLogin'+this.uid+'" name="login"><br></td>\n\
</tr>\n\
<tr>\n\
<td style="padding: 2px;"><b>Password:</b></td>\n\
<td style="padding: 2px;"><input type="password" maxlength="33" style="width: 100%; padding: 2px; display: inline;" id="tcPassword'+this.uid+'" name="password"><br></td>\n\
</tr>\n\
<tr>\n\
<td style="padding: 2px;" colspan="2"><table cellspacing="0" cellpadding="0" border="0" style="width: 100%;"><tr><td><label for="save0" style="white-space: nowrap;"><input id="save_'+this.uid+'" type="checkbox" style="display: inline;" checked/>&nbsp;Remember&nbsp;(<a href="#" onclick="showRestoreForm();">Forgot your password?</a>)</label></td></tr></table></td>\n\
</tr>\n\
<tr><td colspan="2" style="text-align: right;"><input class="button-secondary" id="TLogin_E'+this.uid+'" type="button" style="display: inline;" value="'+_('Log_in')+'"></td></tr>\n\
</table>\n\
</td></tr>\n\
</tbody>\n\
</table>\n\
</div>';
this.win.setContent(str);
var e=document.getElementById('TLogin_E'+this.uid);
e.onclick=function(obj){ return function(){obj.onEnter(); };}(this);
e=document.getElementById('tcLogin'+this.uid);
e.onkeydown=function(obj){ return function(e){ if(e.which==13) obj.onEnter(); return true; };}(this);
e=document.getElementById('tcPassword'+this.uid);
e.onkeydown=function(obj){ return function(e){ if(e.which==13) obj.onEnter(); return true; };}(this);
this.win.setSize("300px","155px");
this.win.setCenter();
this.win.obj=this;
this.win.hide(false);
};
this.onEnter=function()
{
var login=document.getElementById('tcLogin'+this.uid).value;
var password=document.getElementById('tcPassword'+this.uid).value;
if(login=='' || password=='')
{ str="Not filled in the required fields: ";
if(login=='') str+='"'+_('Login')+' (E-mail)"';
if(login=='' && password=='') str+=', ';
if(password=='') str+='"Password"';
str+='!';
alert(str);
}else
this.Login(login,password,document.getElementById('save_'+this.uid).checked);
};
this.applyReq=function(req,fn,node)
{
// alert(getXMLNodeSerialisation(node));
if (fn==-1)
{
alert(findFirstNode(node,'#cdata-section').nodeValue);
}else if (fn==4)
{
//nodeToTable(node);
}else if (fn==7)
{
var cmd=getCdataValue(findFirstNode(node,"cmd"));
//alert('cmd='+cmd);
if(cmd==='0')
{
this.m_lo=getCdataValue(findFirstNode(node,"login")) == '0' ? false : true;
if(!this.m_lo)
{ this.showLoginForm();
}else
{
var name=getCdataValue(findFirstNode(node,"name"));
var user_name=document.getElementById('user_name');
if(user_name!=null) user_name.innerHTML=name;
//Информируем слушатеелй о логине
for(i=0;i<this.m_ls.length;i++)
if(this.m_ls[i]!==null)
this.m_ls[i].OnLogin(true); //0 - authorized, 1 - an incorrect username or password, 2 - left.
}
}else if(cmd==='1')
{
location.reload();
}else if(cmd==='2')
{
var login=getCdataValue(findFirstNode(node,"login")) == '0' ? false : true;
if(!login)
{ alert('Не удалось авторизоваться.\nНеверный логин и/или пароль.');
}else
{
this.m_lo=true;
this.win.Close();
var name=getCdataValue(findFirstNode(node,"name"));
var user_name=document.getElementById('user_name');
if(user_name!=null) user_name.innerHTML=name;
//Информируем слушатеелй о логине
for(i=0;i<this.m_ls.length;i++)
if(this.m_ls[i]!==null)
this.m_ls[i].OnLogin(true); //0 - authorized, 1 - an incorrect username or password, 2 - left.
}
}
/*
this.m_lo=getCdataValue(findFirstNode(node,"login")) == '0' ? true : false;
if(this.m_lo && this.win.div!==null) this.win.hide(true);
this.m_UserName=getCdataValue(findFirstNode(node,"name"));
*/
}else
alert("Not known function! fn=\""+fn+"\"" );
this.win.hideProgressBar();
};
//l - login, p - password, s - allow or disallow auto-login!
this.Login=function(login,password,save)
{
if(save)
{ setCookie('GUID', guid(), 60, '/','','');
}else
{ setCookie('GUID', '', 60, '/','','');
}
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7">\n\
<cmd><![CDATA[2]]></cmd>\n\
<login><![CDATA['+login+']]></login>\n\
<password><![CDATA['+password+']]></password>\n\
</metadata>';
//alert(xs);
if(this.request.callServer(ScriptName,xs))
{
this.win.showProgressBar();
}
};
//Check whether the already authorized (+ attempt to log in through "hash").
this.Logined=function()
{
var xs='<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[0]]></cmd></metadata>';
//alert('xs='+xs);
this.request.callServer(ScriptName,xs);
};
//logout current user
this.Exit=function()
{
if(this.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="7"><cmd><![CDATA[1]]></cmd></metadata>'))
{
setCookie('GUID', '', 60, '/','','');
showProgressBar(document.body);
}
};
this.addListener=function(l)
{ if(l.OnLogin==null) alert('Object does not have the function "OnLogin()"!');
this.m_ls[this.m_ls.length]=l;
};
this.remListener=function(l)
{ for(i=0;i<this.m_ls.length;i++)
{ if(this.m_ls[i]==l)
this.m_ls[i]=null;
}
};
TLogin.LoginIsOk=0; //login in
TLogin.LoginIsError=1; //Invalid password and / or login.
TLogin.LoginIsExit=2; //Exit
this.m_lo=false; //login in?
this.name='Login';
this.uid=getUID();
this.win=new TWin();
this.win.shadow=true;
this.m_ls=new Array(); //Listeners called OnLogin function.
this.guid='';
this.m_UserName=''; //Member Name
this.m_html=false;
this.request = new TRequest(this);
}
//Display password recovery form
function showRestoreForm()
{
var win=new TWin(true);
win.TWin(10,10);
win.setCaption(_("Password_recovery"));
str='<div id="TWin_DT_'+win.tWinId+'" style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; height: 100%; padding: 0px;">\n\
<tr>\n\
<td style="padding: 2px; white-space: nowrap"><b>'+_('Login')+' (E-mail)</b></td>\n\
<td style="padding: 2px;"><input type="text" maxlength="40" style="width: 100%; display: inline;" id="'+win.uid+'_email" name="login">\n\
<table id="'+win.uid+'_phone" style="width: 100%; display: none;" cellpadding="0" cellspacing="0"><tr><td style="white-space: nowrap;"><b>+7 ( </b><input type="text" maxlength="3" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" style="width: 35px; display: inline;" id="'+win.uid+'_phone0" value=""><b> ) </b></td><td style="width: 90%;"><input type="text" onkeydown="this.value = this.value.replace(/[^0-9]/g, \'\')" onkeyup="this.value = this.value.replace(/[^0-9]/g, \'\')" maxlength="7" style="width: 100%;display: inline;" id="'+win.uid+'_phone1" value=""></td></tr></table><br></td>\n\
</tr>\n\
<tr><td colspan="2" style="text-align: right; padding: 2px;"><input class="button-secondary" id="'+win.uid+'_restore" type="button" style="display: inline;" value="'+_('Restore')+'"></td></tr>\n\
</table>\n\
</td></tr>\n\
</div>';
document.getElementById('TWin_Co_'+win.tWinId).innerHTML=str;
win.setSize("300px","100px");
//Центрируем окно и отображаем тень
if(win.tbl.offsetHeight>win.div.offsetHeight) win.div.style.height=win.tbl.offsetHeight+"px";
if(win.tbl.offsetWidth>win.div.offsetWidth) win.div.style.width=win.tbl.offsetWidth+"px";
win.setCenter();
win.shadow=true;
win.hide(false);
//Click on restore button
var obj=null;
obj=document.getElementById(win.uid+'_restore');
if(obj!=null)
{
obj.onclick=function(win)
{ return function()
{
win.showProgressBar();
//showProgressBar(document.getElementById('TWin_DT_'+win.tWinId),win.uid);
var em=document.getElementById(win.uid+'_email').value;
if(em==''){ document.getElementById(win.uid+'_email').select(); alert(_('Not_filled_Email_address')); win.hideProgressBar(); return; }
if(! isEmail(em)){ document.getElementById(win.uid+'_email').select(); alert(_('Please_enter_a_valid_email_address')); win.hideProgressBar(); return; }
//Send AJAX reqwest to server
var xml='<?xml version="1.0" encoding="utf-8"?>\
<metadata fn="7">\
<cmd><![CDATA[0]]></cmd>\
<login><![CDATA['+em+']]></login>\
<captcha><![CDATA[]]></captcha>\
</metadata>';
//Anonymous object
obj=new function(win)
{
this.processReqChange = function(xmlHttpRequest, url, xmlString)
{
if(typeof(xmlHttpRequest.status)=='undefined' || xmlHttpRequest.status == 200)
{
if(typeof(xmlHttpRequest.responseXML)=='undefined' && xmlHttpRequest.contentType.match(/\/xml/)) //For IE XDomainRequest
xmlHttpRequest.responseXML=CreateXMLDOC(xmlHttpRequest.responseText);
//загрузился xml документ начинаем его разбирать (по id функции в документе)
var xmldoc = xmlHttpRequest.responseXML
if(xmldoc==null) alert(_('Wrong_XML_document')+"!\n"+xmlHttpRequest.responseText);
var node = xmldoc.documentElement;
if((node==null)||(node.getAttribute("fn")==null)) alert(_('Error')+"\n "+_("No_data")+"!\n"+xmlHttpRequest.responseText);
else
{
//alert("Принятый браузером XML=\n"+getXMLNodeSerialisation(node));
var fn = node.getAttribute("fn");
if (fn==-1)
{
alert(findFirstNode(node,'#cdata-section').nodeValue);
this.win.hideProgressBar();
}else
if(fn==7)
{
alert(findFirstNode(node,'#cdata-section').nodeValue);
this.win.Close();
}
}
}else
{
if(confirm(_('Failed_to_get_data')+"\n URL: "+url+"\n"+xmlHttpRequest.statusText+"\nRedo the request?"))
{
var call=new myXMLHttpRequest(this);
call.callServer(url,xmlString);
}
}
return null;
};
this.win=win; //For close after showing message.
}
(win);
var call=new myXMLHttpRequest(obj);
call.callServer(ScriptName,xml);
};
}(win);
}
}

1489
metadata/dbms/records.php Normal file

File diff suppressed because it is too large Load Diff

57
metadata/dbms/session.js Normal file
View File

@ -0,0 +1,57 @@
//AJAX запросы для проверки сесии
function CheckSession(path)
{
this.processReqChange=function(req,url)
{
if(req.readyState === 4 || typeof(req.readyState) === 'undefined')
{
if(req.status === 200 || typeof(req.status) === 'undefined')
{
if(url.indexOf('fn=0')>=0)
{
this.ses_name=req.responseText;
this.sendReq('?fn=1');
}else
if(url.indexOf('fn=1')>=0)
{
this.ses_id=req.responseText;
this.run();
}else
if(url.indexOf('fn=2')>=0)
{
if(parseInt(req.responseText)<0)
{
clearTimeout(this.timer);
//alert('Ваша сессия завершилась!');
//location.reload();
alert2('Ваша сессия завершилась! При нажатии на “OK” страница перезагрузится, а при нажатии на “X“ закроется сообщение.').onclick=function(){ location.reload(); };
}
}
}
}
};
//Отправить запрос на сервер
this.sendReq=function(prm)
{
var url=this.path+prm; //'http://'+document.domain+this.path+prm
var req = new window.XMLHttpRequest;
req.onreadystatechange=function(thiz,req,url){ return function(){ thiz.processReqChange(req,url) } }(this,req,url);
req.open("GET", url, true);
req.send(null);
};
//Запрос состояния сессии через заданный интервал
this.run=function()
{
this.sendReq('?fn=2&'+this.ses_name+'='+this.ses_id);
this.timer=setTimeout(function(thiz){ return function(){ thiz.run(); }}(this), 60000);
};
this.path=path; //URL файла session.php
this.ses_name=''; //Наименование сесии
this.ses_id=''; //Идентификатор сесии
this.timer=0; //Идентификатор таймера
this.sendReq('?fn=0');
}

45
metadata/dbms/session.php Normal file
View File

@ -0,0 +1,45 @@
<?
//Скрипт должен возвращять время в секундах когда умрёт сесия
//Скрипт работающий как AJAX в связке с javascript функцией 1 после загрузки выдать наименование сессионной переменной потом проверять на существование соответствующего файла в базе данных
//Проверить обновляется ли файлик сесии
//http://leopard.in.ua/2008/09/20/otslezhivanie-istecheniya-sroka-dejstviya-sessij/
//session_save_path('C:\ses');
require_once("../include/tools.php");
$host = $_SERVER['HTTP_HOST'];
$host = '.'.cutAfterLast($host,'.',2);
ini_set('session.cookie_domain', $host);
error_reporting(E_ALL);
if(isset($_GET['fn'])) $fn=$_GET['fn']; else $fn='';
if($fn=='0')
{
echo session_name();
exit;
}else
if($fn=='1')
{
@session_start();
echo session_id();
exit;
}else
if($fn=='2') //Вернуть время до смерти сесии в секундах
{
if(isset($_GET[session_name()])) $id=$_GET[session_name()]; else exit;
$sessionfile = ini_get('session.save_path') . DIRECTORY_SEPARATOR . 'sess_'.$id;
if ( file_exists($sessionfile) )
{
//echo ini_get('session.gc_maxlifetime') - (time() - filemtime($sessionfile));
echo '1'; //Чтоб только если файл удалился
}else echo '-1';
exit;
}else
{
echo 'error';
}
?>

4
metadata/dbms/setup.js Normal file
View File

@ -0,0 +1,4 @@
//var ScriptName='../metadata/dbms/records.jsp';
var ScriptName='../records';
var ScriptDName='../download';
var ScriptUName='./upload';

1599
metadata/dbms/showrecord.js Normal file

File diff suppressed because it is too large Load Diff

117
metadata/dbms/tabs.js Normal file
View File

@ -0,0 +1,117 @@
function tcTab(caption)
{
this.setConText=function(txt)
{ if(this.con!=null) this.con.parent.removeChild(this.con)
this.con=document.createElement('div')
this.con.style.cssText='width: 100%; height: 100%;'
if(!this.sel) this.con.style.display='none'
this.con.innerHTML=txt
this.par.ctt.appendChild(this.con)
return this.con
}
this.setConObj=function(val)
{
if(this.con!=null) this.con.parent.removeChild(this.con)
if (typeof val === 'string' || val instanceof String)
val=document.getElementById(val);
if(val===null || typeof(val)=='undefined') return;
this.con=val;
if(!this.sel) this.con.style.display='none';
this.par.ctt.appendChild(this.con);
return val;
}
this.setSel=function()
{
for(var i=0;i<this.par.tbs.length;i++)
{ this.par.tbs[i].div.style.background = '#dfdfdf'
this.par.tbs[i].div.style.borderBottom = "1px solid #b3b3b3"
this.par.tbs[i].sel=false
this.par.tbs[i].con.style.display='none'
}
this.div.style.background = '#ffffff';
this.div.style.borderBottom = '1px solid #ffffff'
//this.con.style.display='inline'
this.con.style.display='block';
this.sel=true
}
this.id=0;
this.par=null;
this.sel=false;
this.con=null; //Элемент с содержимым
this.href='';
//Сам таб на который нажимаем (ушко)
this.div=document.createElement('div')
this.div.style.cssText='position: relative; top: 1px; cursor: pointer; float: left; border: 1px solid #b3b3b3; border-radius: 5px 5px 0px 0px; padding: 1px; padding-right: 4px; padding-left: 4px; margin-left: 2px; margin-right: 2px;'
this.div.style.background = '#dfdfdf';
this.div.innerHTML=caption
this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#f0f0f0';}}(this);
this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#dfdfdf' }}(this);
this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this)
}
/** Создать закладки
* id - контейнер либо идентификатор контейнера в который вставляем табы
*/
function tcTabs(id)
{
this.addTab=function(caption)
{
var tab=new tcTab(caption)
tab.par=this
this.btt.appendChild(tab.div);
this.tbs[this.tbs.length]=tab;
return tab;
}
this.delTab=function(tab)
{
if (typeof tab === 'string' || tab instanceof String)
{
}else
{
for(var i=0;i<this.tbs.length;i++)
{
if(this.tbs[i]==tab)
{
this.btt.removeChild(tab.div);
}
}
}
}
this.tbs=new Array();
if(typeof id == 'string') this.bd=document.getElementById(id); else this.bd=id;
this.wra=document.createElement('div');
this.wra.style.cssText="display: table; width :100%; height: 100%; padding: 0px; margin: 0px; border-collapse: collapse; border: 0px solid #000000;";
var tr=null;
tr=document.createElement('div');
tr.style.cssText='display: table-row; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
this.btt=document.createElement('div');
this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
tr.appendChild(this.btt);
this.wra.appendChild(tr);
tr=document.createElement('div');
tr.style.cssText='display: table-row; width :100%; height: 100%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
//Content
this.ctt=document.createElement('div');
this.ctt.style.cssText='display:table-cell; width :100%; height: 100%; padding: 0px; margin: 0px; border; border: 1px solid #b3b3b3; overflow:hidden;'
tr.appendChild(this.ctt);
this.wra.appendChild(tr);
this.bd.appendChild(this.wra);
}

View File

@ -0,0 +1 @@
RewriteEngine off

1565
metadata/dbms/tools.js Normal file

File diff suppressed because it is too large Load Diff