+ Настройка тёмного цвета
This commit is contained in:
@ -1,3 +1,10 @@
|
|||||||
|
/*Переменные для настройки цветов*/
|
||||||
|
:root{
|
||||||
|
--header-color: #505050;
|
||||||
|
--back-color: 3a3a3a;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
*{
|
*{
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
@ -12,9 +19,10 @@ html,body
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-family: Arial;
|
font-family: Arial;
|
||||||
|
background-color: #3a3a3a;
|
||||||
}
|
}
|
||||||
|
|
||||||
input,textarea
|
input,textarea
|
||||||
{
|
{
|
||||||
margin: 0px 0px;
|
margin: 0px 0px;
|
||||||
}
|
}
|
||||||
@ -49,7 +57,7 @@ select
|
|||||||
-ms-user-select: none; /* IE 10+ */
|
-ms-user-select: none; /* IE 10+ */
|
||||||
-o-user-select: none; /* No support for these yet, use at own risk */
|
-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 */
|
user-select: none; /* No support for these yet, use at own risk */
|
||||||
|
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
/*display: table;*/
|
/*display: table;*/
|
||||||
|
|
||||||
@ -58,10 +66,13 @@ select
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*Табличка исполняющая роль окна*/
|
||||||
.shadow {
|
.shadow {
|
||||||
box-shadow: 0 0 10px rgba(0,0,0,0.7);
|
box-shadow: 0 0 10px rgba(255,255,255,0.7);
|
||||||
}
|
background-color: #3a3a3a;
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Для полей состояжих из нескольких элементов (поле с кнопочкой допустим) */
|
/* Для полей состояжих из нескольких элементов (поле с кнопочкой допустим) */
|
||||||
table.DBMSSimple {
|
table.DBMSSimple {
|
||||||
@ -80,8 +91,8 @@ table.SEdit {
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border: 1px double #999999;
|
border: 1px double #999999;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #ffffff;
|
background-color: var(--back-color);
|
||||||
border-spacing: 1px 1px;
|
border-spacing: 1px 1px;
|
||||||
}
|
}
|
||||||
table.SEdit td,table.SEdit th {
|
table.SEdit td,table.SEdit th {
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
@ -90,17 +101,17 @@ table.SEdit td,table.SEdit th {
|
|||||||
|
|
||||||
table.SEdit th {
|
table.SEdit th {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: rgb(218, 218, 218);
|
background-color: var(--header-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* For table filter data whitesmoke */
|
/* For table filter data whitesmoke */
|
||||||
table.SFilter {
|
table.SFilter {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color:#f1f1f1;
|
background-color: var(--back-color);
|
||||||
border-spacing: 1px 1px;
|
border-spacing: 1px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.SFilter td {
|
table.SFilter td {
|
||||||
@ -108,15 +119,13 @@ table.SFilter td {
|
|||||||
border: 0px solid #999999;
|
border: 0px solid #999999;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* For table show data */
|
/* For table show data */
|
||||||
table.SShow {
|
table.SShow {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border: 1px double #999999;
|
border: 1px double #999999;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: #ffffff;
|
background-color: #ffffff;
|
||||||
border-spacing: 1px 1px;
|
border-spacing: 1px 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.SShow td,table.SShow th {
|
table.SShow td,table.SShow th {
|
||||||
@ -125,5 +134,5 @@ table.SShow td,table.SShow th {
|
|||||||
|
|
||||||
table.SShow th {
|
table.SShow th {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: rgb(218, 218, 218);
|
background-color: var(--header-color);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class EdtRec
|
|||||||
this.uid=getUID();
|
this.uid=getUID();
|
||||||
|
|
||||||
this.win=new TWin();
|
this.win=new TWin();
|
||||||
this.win.TWin(pageX-10,pageY-10);
|
this.win.BuildGUI(pageX-10,pageY-10);
|
||||||
this.win.setSize("500px","150px");
|
this.win.setSize("500px","150px");
|
||||||
this.win.setContent('<div id="eDiv'+this.uid+'" style="width: 100%; /*height: 100%;*/ position: relative;"></div>');
|
this.win.setContent('<div id="eDiv'+this.uid+'" style="width: 100%; /*height: 100%;*/ position: relative;"></div>');
|
||||||
|
|
||||||
@ -135,7 +135,7 @@ class EdtRec
|
|||||||
this.setPropCdata(nodeType.getAttribute("ObjectID"),record_id);
|
this.setPropCdata(nodeType.getAttribute("ObjectID"),record_id);
|
||||||
|
|
||||||
let str='';
|
let str='';
|
||||||
str+=' <table id="eTable'+this.uid+'" border="0px" cellspacing="1" cellpadding="1" style="width: 100%; height: 100%; background-color: #afafaf;">';
|
str+=' <table class="SEdit" id="eTable'+this.uid+'" border="0px" cellspacing="1" cellpadding="1" style="width: 100%; height: 100%;">';
|
||||||
str+=' <caption><b id="caption'+this.uid+'"></b></caption>';
|
str+=' <caption><b id="caption'+this.uid+'"></b></caption>';
|
||||||
str+=' <thead>';
|
str+=' <thead>';
|
||||||
str+=' <tr bgcolor="#dadada">';
|
str+=' <tr bgcolor="#dadada">';
|
||||||
@ -262,7 +262,7 @@ class EdtRec
|
|||||||
{
|
{
|
||||||
rpos++;
|
rpos++;
|
||||||
tr = document.createElement('tr');
|
tr = document.createElement('tr');
|
||||||
if (rpos%2==0) bgColor='#EEEEEE'; else bgColor='#FFFFFF';
|
if (rpos%2==0) bgColor=g_rowColor1; else bgColor=g_rowColor2;
|
||||||
tr.setAttribute("bgColor",bgColor);
|
tr.setAttribute("bgColor",bgColor);
|
||||||
if(nodeProp.getAttribute("visible")=='0') tr.style.display='none';
|
if(nodeProp.getAttribute("visible")=='0') tr.style.display='none';
|
||||||
var td1 = document.createElement('td');
|
var td1 = document.createElement('td');
|
||||||
@ -338,7 +338,8 @@ class EdtRec
|
|||||||
var tObj=findNode(nodeProp, "type");
|
var tObj=findNode(nodeProp, "type");
|
||||||
if(tObj!=null)
|
if(tObj!=null)
|
||||||
{
|
{
|
||||||
var button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
||||||
@ -452,6 +453,7 @@ class EdtRec
|
|||||||
newCell1.appendChild( input );
|
newCell1.appendChild( input );
|
||||||
|
|
||||||
button = document.createElement('input');
|
button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","+");
|
button.setAttribute("value","+");
|
||||||
button.setAttribute("title",_("Increase_by_1"));
|
button.setAttribute("title",_("Increase_by_1"));
|
||||||
@ -461,6 +463,7 @@ class EdtRec
|
|||||||
newCell2.appendChild( button );
|
newCell2.appendChild( button );
|
||||||
|
|
||||||
button = document.createElement('input');
|
button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","-");
|
button.setAttribute("value","-");
|
||||||
button.setAttribute("title",_("Decrease_by_1"));
|
button.setAttribute("title",_("Decrease_by_1"));
|
||||||
@ -513,6 +516,7 @@ class EdtRec
|
|||||||
//cmbInp.addEventListener(IndexChangeEvent.CHANGE,onComboObjectChangeHandler);
|
//cmbInp.addEventListener(IndexChangeEvent.CHANGE,onComboObjectChangeHandler);
|
||||||
|
|
||||||
var button = document.createElement('input');
|
var button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;height:100%;";
|
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;height:100%;";
|
||||||
@ -581,6 +585,7 @@ class EdtRec
|
|||||||
hidden.value=value;
|
hidden.value=value;
|
||||||
newCell1.appendChild(hidden);
|
newCell1.appendChild(hidden);
|
||||||
var button = document.createElement('input');
|
var button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
button.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
||||||
@ -649,7 +654,8 @@ class EdtRec
|
|||||||
newCell1.appendChild(input);
|
newCell1.appendChild(input);
|
||||||
|
|
||||||
//Button to send the file to the server
|
//Button to send the file to the server
|
||||||
var btnSel = document.createElement('input');
|
let btnSel = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
btnSel.setAttribute("type","button");
|
btnSel.setAttribute("type","button");
|
||||||
btnSel.setAttribute("value","...");
|
btnSel.setAttribute("value","...");
|
||||||
btnSel.setAttribute("title",_('Upload'));
|
btnSel.setAttribute("title",_('Upload'));
|
||||||
@ -657,7 +663,8 @@ class EdtRec
|
|||||||
btnSel.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
btnSel.style.cssText="width:30px;font-size:9pt;margin:0px;padding:0px;";
|
||||||
newCell2.appendChild(btnSel);
|
newCell2.appendChild(btnSel);
|
||||||
|
|
||||||
var button2 = document.createElement('input');
|
let button2 = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button2.setAttribute("type","button");
|
button2.setAttribute("type","button");
|
||||||
button2.setAttribute("value","X");
|
button2.setAttribute("value","X");
|
||||||
button2.setAttribute("title",_('Delete'));
|
button2.setAttribute("title",_('Delete'));
|
||||||
@ -760,13 +767,14 @@ class EdtRec
|
|||||||
//Button apply
|
//Button apply
|
||||||
tr = document.createElement('tr');
|
tr = document.createElement('tr');
|
||||||
var td = document.createElement('td');
|
var td = document.createElement('td');
|
||||||
td.style.cssText="padding: 5px; vertical-align: bottom; background-color: #f5f5f5;";
|
td.style.cssText="padding: 5px; vertical-align: bottom;";
|
||||||
td.setAttribute("colspan", "2");
|
td.setAttribute("colspan", "2");
|
||||||
if (this.record_id==-1) td.innerHTML='<label style="float: left; white-space: nowrap;"><input id="readd_'+this.uid+'" type="checkbox"> '+_('Repeat_the_addition_of_the_entry')+'</label>';
|
if (this.record_id==-1) td.innerHTML='<label style="float: left; white-space: nowrap;"><input id="readd_'+this.uid+'" type="checkbox"> '+_('Repeat_the_addition_of_the_entry')+'</label>';
|
||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
//var td = document.createElement('td');
|
//var td = document.createElement('td');
|
||||||
td.setAttribute("align","right");
|
td.setAttribute("align","right");
|
||||||
button = document.createElement('input');
|
button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.style.cssText="margin:0px;margin-right:1px;";
|
button.style.cssText="margin:0px;margin-right:1px;";
|
||||||
button.setAttribute("value",_('Apply'));
|
button.setAttribute("value",_('Apply'));
|
||||||
@ -779,6 +787,7 @@ class EdtRec
|
|||||||
|
|
||||||
button = document.createElement('input'); //Button cancel
|
button = document.createElement('input'); //Button cancel
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
|
button.className='button-secondary';
|
||||||
button.style.cssText="margin:0px;";
|
button.style.cssText="margin:0px;";
|
||||||
button.setAttribute("value",_('Cancel'));
|
button.setAttribute("value",_('Cancel'));
|
||||||
//button.onclick=function f_exit(this) { alert(this.win.div); }
|
//button.onclick=function f_exit(this) { alert(this.win.div); }
|
||||||
@ -878,7 +887,7 @@ class EdtRec
|
|||||||
selObj(typeName,propname)
|
selObj(typeName,propname)
|
||||||
{
|
{
|
||||||
var win=new TWin();
|
var win=new TWin();
|
||||||
win.TWin(pageX-10,pageY-10);
|
win.BuildGUI(pageX-10,pageY-10);
|
||||||
|
|
||||||
var str='';
|
var str='';
|
||||||
str+='<table id="thetable'+win+'" bgcolor="SlateGrey" style="border: 1px solid rgb(99, 99, 99);" width="100%">';
|
str+='<table id="thetable'+win+'" bgcolor="SlateGrey" style="border: 1px solid rgb(99, 99, 99);" width="100%">';
|
||||||
@ -1143,7 +1152,7 @@ class EdtRec
|
|||||||
htmlString+='</table>';
|
htmlString+='</table>';
|
||||||
|
|
||||||
var win=new TWin();
|
var win=new TWin();
|
||||||
win.TWin(pageX-280,pageY-7);
|
win.BuildGUI(pageX-280,pageY-7);
|
||||||
win.setContent(htmlString);
|
win.setContent(htmlString);
|
||||||
win.setCaption(document.createTextNode(_("Selection")));
|
win.setCaption(document.createTextNode(_("Selection")));
|
||||||
win.setParent(this.win);
|
win.setParent(this.win);
|
||||||
|
|||||||
BIN
metadata/dbms/form/b_g.png
Normal file
BIN
metadata/dbms/form/b_g.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 625 B |
BIN
metadata/dbms/form/b_x.png
Normal file
BIN
metadata/dbms/form/b_x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 598 B |
@ -77,7 +77,7 @@ function TUser()
|
|||||||
if(this.win==null || this.win.closed)
|
if(this.win==null || this.win.closed)
|
||||||
{
|
{
|
||||||
this.win=new TWin(true);
|
this.win=new TWin(true);
|
||||||
this.win.TWin(10,10);
|
this.win.BuildGUI(10,10);
|
||||||
this.win.setCaption(_('Authorization'));
|
this.win.setCaption(_('Authorization'));
|
||||||
|
|
||||||
this.win.setSize("350px","200px");
|
this.win.setSize("350px","200px");
|
||||||
@ -230,7 +230,7 @@ function TUser()
|
|||||||
{
|
{
|
||||||
this.showLoginForm = function()
|
this.showLoginForm = function()
|
||||||
{
|
{
|
||||||
this.win.TWin(10,10);
|
this.win.BuildGUI(10,10);
|
||||||
this.win.shadow=true;
|
this.win.shadow=true;
|
||||||
this.win.setCaption(document.createTextNode("Enter"));
|
this.win.setCaption(document.createTextNode("Enter"));
|
||||||
|
|
||||||
@ -432,7 +432,7 @@ function TUser()
|
|||||||
function showRestoreForm()
|
function showRestoreForm()
|
||||||
{
|
{
|
||||||
var win=new TWin(true);
|
var win=new TWin(true);
|
||||||
win.TWin(10,10);
|
win.BuildGUI(10,10);
|
||||||
win.setCaption(_("Password_recovery"));
|
win.setCaption(_("Password_recovery"));
|
||||||
|
|
||||||
str='<div id="TWin_DT_'+win.tWinId+'" style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
|
str='<div id="TWin_DT_'+win.tWinId+'" style="width: 100%; height: 100%; padding: 4px; text-align: left;">\n\
|
||||||
|
|||||||
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
function getSQLValue($t,$v)
|
function getSQLValue($t,$v)
|
||||||
{
|
{
|
||||||
global $db_connstr;
|
global $db_connection;
|
||||||
|
|
||||||
if($t=='object' && gettype($v)=='string'){
|
if($t=='object' && gettype($v)=='string'){
|
||||||
$t='string'; //Если id шники uuid
|
$t='string'; //Если id шники uuid
|
||||||
@ -71,7 +71,7 @@
|
|||||||
if($v==''){
|
if($v==''){
|
||||||
$v='NULL';
|
$v='NULL';
|
||||||
}else{
|
}else{
|
||||||
if(strpos($db_connstr, 'pgsql')!==false)
|
if(strpos($db_connection, 'pgsql')!==false)
|
||||||
$v=str_replace("'","''",$v); //так как в SQL строку вставляется
|
$v=str_replace("'","''",$v); //так как в SQL строку вставляется
|
||||||
else
|
else
|
||||||
$v=str_replace('\'','\\\'',$v); //так как в SQL строку вставляется
|
$v=str_replace('\'','\\\'',$v); //так как в SQL строку вставляется
|
||||||
@ -230,12 +230,12 @@
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if(strpos($db_connstr, 'sqlite')!==false)
|
if(strpos($db_connection, 'sqlite')!==false)
|
||||||
{
|
{
|
||||||
$db = new PDO($db_connstr);
|
$db = new PDO($db_connection);
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
$db = new PDO($db_connstr, $db_login, $db_password);
|
$db = new PDO($db_connection, $db_login, $db_password);
|
||||||
}
|
}
|
||||||
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||||
} catch (Exception $e)
|
} catch (Exception $e)
|
||||||
@ -892,7 +892,7 @@
|
|||||||
} catch (Exception $e)
|
} catch (Exception $e)
|
||||||
{ sendError($e->getMessage());
|
{ sendError($e->getMessage());
|
||||||
}
|
}
|
||||||
if(strpos($db_connstr, 'sqlite')===false) //Для SQLite не работает rowCount()
|
if(strpos($db_connection, 'sqlite')===false) //Для SQLite не работает rowCount()
|
||||||
{
|
{
|
||||||
if($res->rowCount()!=1) sendError("Количество записей не равно одному!");
|
if($res->rowCount()!=1) sendError("Количество записей не равно одному!");
|
||||||
}
|
}
|
||||||
@ -1066,7 +1066,7 @@
|
|||||||
}elseif($cmd==1) //Logout
|
}elseif($cmd==1) //Logout
|
||||||
{
|
{
|
||||||
//filter_input(INPUT_COOKIE, 'S_HASH', FILTER_VALIDATE_INT, array('options'=>array('default'=>-1)));
|
//filter_input(INPUT_COOKIE, 'S_HASH', FILTER_VALIDATE_INT, array('options'=>array('default'=>-1)));
|
||||||
$sql='delete from '.$Schema.'_Logins where sessionid='.getSQLValue('string',$_COOKIE['GUID']).' and user_id='.getSQLValue('i4',$_SESSION['USER_ID']).';';
|
$sql='delete from '.$Schema.'_Logins where sessionid='.getSQLValue('string',$_COOKIE['GUID']).' and user_id='.getSQLValue('object',$_SESSION['USER_ID']).';';
|
||||||
try
|
try
|
||||||
{ $db->exec($sql);
|
{ $db->exec($sql);
|
||||||
} catch (Exception $e)
|
} catch (Exception $e)
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class SRec
|
|||||||
{
|
{
|
||||||
this.win=null;
|
this.win=null;
|
||||||
this.rwin=null;
|
this.rwin=null;
|
||||||
|
|
||||||
this.f_State='0'; //"0" - editing, "1" - selecting a single entry, "2" - selecting a multiple record
|
this.f_State='0'; //"0" - editing, "1" - selecting a single entry, "2" - selecting a multiple record
|
||||||
this.f_PropName=""; //If the mode f_State is 1 then f_PropName saves the name of the field for which the data is intended
|
this.f_PropName=""; //If the mode f_State is 1 then f_PropName saves the name of the field for which the data is intended
|
||||||
this.f_TypeName=""; //the name of the displayed object (type-> n attribute)
|
this.f_TypeName=""; //the name of the displayed object (type-> n attribute)
|
||||||
@ -33,17 +33,17 @@ class SRec
|
|||||||
this.masChBox=new Array(); //Checkboxes
|
this.masChBox=new Array(); //Checkboxes
|
||||||
this.xmldoc=null; //accepted XML document (for CDATA creation)
|
this.xmldoc=null; //accepted XML document (for CDATA creation)
|
||||||
this.pagepos=0; //current data page
|
this.pagepos=0; //current data page
|
||||||
|
|
||||||
this.pBarCnt=0; //Progress bar
|
this.pBarCnt=0; //Progress bar
|
||||||
this.pBarDiv=null; //Progress bar
|
this.pBarDiv=null; //Progress bar
|
||||||
|
|
||||||
this.name="";
|
this.name="";
|
||||||
|
|
||||||
this.uid=getUID();
|
this.uid=getUID();
|
||||||
this.request = new TRequest(this);
|
this.request = new TRequest(this);
|
||||||
SRec_mas[this.uid]=this;
|
SRec_mas[this.uid]=this;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyReq(req,fn,node,xmldoc)
|
applyReq(req,fn,node,xmldoc)
|
||||||
{
|
{
|
||||||
//alert(getXMLNodeSerialisation(node));
|
//alert(getXMLNodeSerialisation(node));
|
||||||
@ -126,7 +126,7 @@ class SRec
|
|||||||
{
|
{
|
||||||
//Apply the parameters to the current XML filter if there are filter settings in the parent window!
|
//Apply the parameters to the current XML filter if there are filter settings in the parent window!
|
||||||
if(xml===null || typeof(xml) == "undefined") return;
|
if(xml===null || typeof(xml) == "undefined") return;
|
||||||
|
|
||||||
if(typeof(xml) == "string"){
|
if(typeof(xml) == "string"){
|
||||||
if(xml!="")
|
if(xml!="")
|
||||||
{
|
{
|
||||||
@ -146,7 +146,7 @@ class SRec
|
|||||||
let str='\
|
let str='\
|
||||||
<div id="eDiv'+this.uid+'" style="width: 100%; height: 100%; position: relative;">\
|
<div id="eDiv'+this.uid+'" style="width: 100%; height: 100%; position: relative;">\
|
||||||
<table class="SFilter" border="0" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;"><tr><td>\
|
<table class="SFilter" border="0" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%;"><tr><td>\
|
||||||
<table id="idfilter'+this.uid+'" cellspacing="2" cellpadding="0" style="border: 1px solid rgb(99, 99, 99); table-layout: auto;" width="100%" bgcolor="whitesmoke">\
|
<table id="idfilter'+this.uid+'" cellspacing="2" cellpadding="0" style="border: 1px solid rgb(99, 99, 99); table-layout: auto;" width="100%" bgcolor="'+g_rowColor2+'">\
|
||||||
<caption></caption><thead></thead><tbody></tbody>\
|
<caption></caption><thead></thead><tbody></tbody>\
|
||||||
</table>\
|
</table>\
|
||||||
</td></tr><tr><td>\
|
</td></tr><tr><td>\
|
||||||
@ -173,32 +173,32 @@ class SRec
|
|||||||
if(htmlElement==null || typeof(htmlElement) == "undefined")
|
if(htmlElement==null || typeof(htmlElement) == "undefined")
|
||||||
{
|
{
|
||||||
this.win=new TWin();
|
this.win=new TWin();
|
||||||
this.win.TWin(pageX-10,pageY-10);
|
this.win.BuildGUI(pageX-10,pageY-10);
|
||||||
this.win.setHeight(400);
|
this.win.setHeight(400);
|
||||||
//this.win.setLeftTop()
|
//this.win.setLeftTop()
|
||||||
|
|
||||||
this.win.setContent(str);
|
this.win.setContent(str);
|
||||||
this.win.obj=this;
|
this.win.obj=this;
|
||||||
|
|
||||||
this.win.addResizeListener(function(obj){return function(){obj.updateSize();}}(this));
|
this.win.addResizeListener(function(obj){return function(){obj.updateSize();}}(this));
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
htmlElement.innerHTML=str;
|
htmlElement.innerHTML=str;
|
||||||
}
|
}
|
||||||
|
|
||||||
document.getElementById('SRec_Add_'+this.uid).onclick=function(thiz){return function(){thiz.insertRecord();};}(this);
|
document.getElementById('SRec_Add_'+this.uid).onclick=function(thiz){return function(){thiz.insertRecord();};}(this);
|
||||||
document.getElementById('SRec_Del_'+this.uid).onclick=function(thiz){return function(){thiz.deleteRecord();};}(this);
|
document.getElementById('SRec_Del_'+this.uid).onclick=function(thiz){return function(){thiz.deleteRecord();};}(this);
|
||||||
document.getElementById('SRec_Exc_'+this.uid).onclick=function(thiz){return function(){thiz.showreport('xls');};}(this);
|
document.getElementById('SRec_Exc_'+this.uid).onclick=function(thiz){return function(){thiz.showreport('xls');};}(this);
|
||||||
document.getElementById('SRec_Rfr_'+this.uid).onclick=function(thiz){return function(){thiz.appendFilter(); thiz.sendFilter(-1,0);};}(this);
|
document.getElementById('SRec_Rfr_'+this.uid).onclick=function(thiz){return function(){thiz.appendFilter(); thiz.sendFilter(-1,0);};}(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update dimensions of the elements (the main table in absolute coordinates).
|
//Update dimensions of the elements (the main table in absolute coordinates).
|
||||||
updateSize()
|
updateSize()
|
||||||
{
|
{
|
||||||
let dv1=document.getElementById("tblSContainer_"+this.uid);
|
let dv1=document.getElementById("tblSContainer_"+this.uid);
|
||||||
let dv2=document.getElementById("tblContainer_"+this.uid);
|
let dv2=document.getElementById("tblContainer_"+this.uid);
|
||||||
if(dv1!=null && dv2!=null)
|
if(dv1!=null && dv2!=null)
|
||||||
{
|
{
|
||||||
dv1.style.width = dv2.offsetWidth+"px";
|
dv1.style.width = dv2.offsetWidth+"px";
|
||||||
dv1.style.height = dv2.offsetHeight+"px";
|
dv1.style.height = dv2.offsetHeight+"px";
|
||||||
}
|
}
|
||||||
@ -235,7 +235,7 @@ class SRec
|
|||||||
setDataSelect(node)
|
setDataSelect(node)
|
||||||
{
|
{
|
||||||
//alert("setDataSelect = " + getXMLNodeSerialisation(node));
|
//alert("setDataSelect = " + getXMLNodeSerialisation(node));
|
||||||
|
|
||||||
let nodeType,prop_id,prop,option,nodeProp,id,value,cdataNode;
|
let nodeType,prop_id,prop,option,nodeProp,id,value,cdataNode;
|
||||||
nodeType=findFirstNode(node, 'type');
|
nodeType=findFirstNode(node, 'type');
|
||||||
prop_id=nodeType.getAttribute("pn");//Field name
|
prop_id=nodeType.getAttribute("pn");//Field name
|
||||||
@ -246,9 +246,9 @@ class SRec
|
|||||||
let nodeFilter=findNodeOnPath(this.nodeMetadata,"type/objects-list/filter");
|
let nodeFilter=findNodeOnPath(this.nodeMetadata,"type/objects-list/filter");
|
||||||
let nodeCur=findNodeOnAttribute(nodeFilter, 'column', 'n', prop_id);
|
let nodeCur=findNodeOnAttribute(nodeFilter, 'column', 'n', prop_id);
|
||||||
if(nodeCur!=null) selector=nodeCur.getAttribute("selector");
|
if(nodeCur!=null) selector=nodeCur.getAttribute("selector");
|
||||||
|
|
||||||
//alert("nodeCur = " + getXMLNodeSerialisation(nodeCur));
|
//alert("nodeCur = " + getXMLNodeSerialisation(nodeCur));
|
||||||
|
|
||||||
/*nodeCur=nodeFilter.firstChild
|
/*nodeCur=nodeFilter.firstChild
|
||||||
while(nodeCur!=null)
|
while(nodeCur!=null)
|
||||||
{
|
{
|
||||||
@ -262,7 +262,7 @@ class SRec
|
|||||||
if(selector==="combo") //if the drop-down list
|
if(selector==="combo") //if the drop-down list
|
||||||
{
|
{
|
||||||
prop.innerHTML = "";
|
prop.innerHTML = "";
|
||||||
|
|
||||||
//Select the value for this list
|
//Select the value for this list
|
||||||
let val=null;
|
let val=null;
|
||||||
let nodeFilter=findNodeOnPath(this.nodeMetadata,"type/objects-list/filter");
|
let nodeFilter=findNodeOnPath(this.nodeMetadata,"type/objects-list/filter");
|
||||||
@ -271,7 +271,7 @@ class SRec
|
|||||||
{
|
{
|
||||||
if((nodeCol.nodeName==="column")&&(nodeCol.getAttribute("n")==prop_id))
|
if((nodeCol.nodeName==="column")&&(nodeCol.getAttribute("n")==prop_id))
|
||||||
{
|
{
|
||||||
val=getCdataValue(nodeCol);
|
val=getCdataValue(nodeCol);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
nodeCol=nodeCol.nextSibling;
|
nodeCol=nodeCol.nextSibling;
|
||||||
@ -338,7 +338,7 @@ class SRec
|
|||||||
}else
|
}else
|
||||||
if(count>1) //The item selection window is displayed.
|
if(count>1) //The item selection window is displayed.
|
||||||
{
|
{
|
||||||
let htmlString='<table width="100%" bgcolor="whitesmoke">';
|
let htmlString='<table width="100%" bgcolor="'+g_rowColor2+'">';
|
||||||
nodeProp=nodeType.firstChild
|
nodeProp=nodeType.firstChild
|
||||||
i=0;
|
i=0;
|
||||||
while (nodeProp!=null)
|
while (nodeProp!=null)
|
||||||
@ -358,7 +358,7 @@ class SRec
|
|||||||
htmlString+='</table>';
|
htmlString+='</table>';
|
||||||
|
|
||||||
let win=new TWin();
|
let win=new TWin();
|
||||||
win.TWin(pageX-10,pageY-10);
|
win.BuildGUI(pageX-10,pageY-10);
|
||||||
win.setHeight(400);
|
win.setHeight(400);
|
||||||
win.setContent(htmlString);
|
win.setContent(htmlString);
|
||||||
win.setCaption(document.createTextNode(_('Selection')));
|
win.setCaption(document.createTextNode(_('Selection')));
|
||||||
@ -407,7 +407,7 @@ class SRec
|
|||||||
|
|
||||||
//The function to collect data from HTML fields in XML
|
//The function to collect data from HTML fields in XML
|
||||||
appendFilter()
|
appendFilter()
|
||||||
{
|
{
|
||||||
let nodeType=findFirstNode(this.nodeMetadata, "type");
|
let nodeType=findFirstNode(this.nodeMetadata, "type");
|
||||||
let nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
|
let nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
|
||||||
if (nodeFilter!=null)
|
if (nodeFilter!=null)
|
||||||
@ -420,15 +420,15 @@ class SRec
|
|||||||
let value = '';
|
let value = '';
|
||||||
let input = document.getElementById('filter_'+this.uid+'_'+columnNode.getAttribute("n"));
|
let input = document.getElementById('filter_'+this.uid+'_'+columnNode.getAttribute("n"));
|
||||||
if(input!=null) value=input.value;
|
if(input!=null) value=input.value;
|
||||||
|
|
||||||
//'2016-02-27 00:00:00'
|
//'2016-02-27 00:00:00'
|
||||||
if(columnNode.getAttribute("vt")=="dateTime" || columnNode.getAttribute("vt")=="date") //If field is "dateTime" then transmit in UnixTime format in second
|
if(columnNode.getAttribute("vt")=="dateTime" || columnNode.getAttribute("vt")=="date") //If field is "dateTime" then transmit in UnixTime format in second
|
||||||
{
|
{
|
||||||
if(value!=""){
|
if(value!=""){
|
||||||
let date = new Date(value.replace(/-/g, "/"));
|
let date = new Date(value.replace(/-/g, "/"));
|
||||||
value=date.getTime()/1000;// - date.getTimezoneOffset()*60;
|
value=date.getTime()/1000;// - date.getTimezoneOffset()*60;
|
||||||
if(isNaN(value)) value='';
|
if(isNaN(value)) value='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getCdata(columnNode).nodeValue=value; //TODO do check for data type
|
getCdata(columnNode).nodeValue=value; //TODO do check for data type
|
||||||
}
|
}
|
||||||
@ -463,12 +463,12 @@ class SRec
|
|||||||
{
|
{
|
||||||
xs+='<column n="'+nextNode.getAttribute("n")+'" vt="'+nextNode.getAttribute("vt")+'" size="'+nextNode.getAttribute("size")+'">';
|
xs+='<column n="'+nextNode.getAttribute("n")+'" vt="'+nextNode.getAttribute("vt")+'" size="'+nextNode.getAttribute("size")+'">';
|
||||||
xs+='<![CDATA['+id+']]>';
|
xs+='<![CDATA['+id+']]>';
|
||||||
xs+='</column>\n';
|
xs+='</column>\n';
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
xs+='<column n="'+nextNode.getAttribute("n")+'" vt="'+nextNode.getAttribute("vt")+'" size="'+nextNode.getAttribute("size")+'">';
|
xs+='<column n="'+nextNode.getAttribute("n")+'" vt="'+nextNode.getAttribute("vt")+'" size="'+nextNode.getAttribute("size")+'">';
|
||||||
xs+='<![CDATA['+getCdataValue(nextNode)+']]>';
|
xs+='<![CDATA['+getCdataValue(nextNode)+']]>';
|
||||||
xs+='</column>\n';
|
xs+='</column>\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextNode=nextNode.nextSibling;
|
nextNode=nextNode.nextSibling;
|
||||||
@ -477,7 +477,7 @@ class SRec
|
|||||||
xs+='</metadata>';
|
xs+='</metadata>';
|
||||||
|
|
||||||
//alert(xs);
|
//alert(xs);
|
||||||
|
|
||||||
if(this.request.callServer(ScriptName,xs))
|
if(this.request.callServer(ScriptName,xs))
|
||||||
{
|
{
|
||||||
this.showProgressBar();
|
this.showProgressBar();
|
||||||
@ -488,7 +488,7 @@ class SRec
|
|||||||
setMetadata(node)
|
setMetadata(node)
|
||||||
{
|
{
|
||||||
this.nodeMetadata=node;
|
this.nodeMetadata=node;
|
||||||
this.setXMLSettings(this.f_Settings); //Appending settings to nodeMetadata
|
this.setXMLSettings(this.f_Settings); //Appending settings to nodeMetadata
|
||||||
|
|
||||||
//Create GUI filter
|
//Create GUI filter
|
||||||
let td,tr,td1,td2;
|
let td,tr,td1,td2;
|
||||||
@ -509,7 +509,7 @@ class SRec
|
|||||||
this.nodeMetadataObjList=findNode(nodeType, "objects-list");
|
this.nodeMetadataObjList=findNode(nodeType, "objects-list");
|
||||||
if(this.win!=null) this.win.setWidth(this.nodeMetadataObjList.getAttribute("width"));
|
if(this.win!=null) this.win.setWidth(this.nodeMetadataObjList.getAttribute("width"));
|
||||||
nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
|
nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
|
||||||
|
|
||||||
|
|
||||||
//let id=-1;
|
//let id=-1;
|
||||||
//After loading the metadata, we request the data by sending an XML filter.
|
//After loading the metadata, we request the data by sending an XML filter.
|
||||||
@ -543,7 +543,7 @@ class SRec
|
|||||||
td1.appendChild(table);
|
td1.appendChild(table);
|
||||||
nRow=table.insertRow(0);
|
nRow=table.insertRow(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(row>1)
|
if(row>1)
|
||||||
{
|
{
|
||||||
td1 = nRow.insertCell(-1);
|
td1 = nRow.insertCell(-1);
|
||||||
@ -585,8 +585,8 @@ class SRec
|
|||||||
input.setAttribute("name",columnNode.getAttribute("n"));
|
input.setAttribute("name",columnNode.getAttribute("n"));
|
||||||
if(columnNode.getAttribute("size")!=null)
|
if(columnNode.getAttribute("size")!=null)
|
||||||
input.setAttribute("maxlength",columnNode.getAttribute("size"),0);
|
input.setAttribute("maxlength",columnNode.getAttribute("size"),0);
|
||||||
|
|
||||||
input.setAttribute("value",isNaN(value) || value=='' ? '' : (new Date(value*1000)).toString());
|
input.setAttribute("value",isNaN(value) || value=='' ? '' : (new Date(value*1000)).toString());
|
||||||
input.setAttribute("id",'filter_'+this.uid+'_'+columnNode.getAttribute("n"));
|
input.setAttribute("id",'filter_'+this.uid+'_'+columnNode.getAttribute("n"));
|
||||||
newCell1.appendChild( input );
|
newCell1.appendChild( input );
|
||||||
|
|
||||||
@ -736,6 +736,7 @@ class SRec
|
|||||||
newCell1.appendChild( input );
|
newCell1.appendChild( input );
|
||||||
|
|
||||||
let button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","+");
|
button.setAttribute("value","+");
|
||||||
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
|
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
|
||||||
@ -743,6 +744,7 @@ class SRec
|
|||||||
button.onclick=function(inp){return function(){ inp.value=getIntVal(inp.value)+1; }}(input);
|
button.onclick=function(inp){return function(){ inp.value=getIntVal(inp.value)+1; }}(input);
|
||||||
|
|
||||||
button = document.createElement('input');
|
button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","-");
|
button.setAttribute("value","-");
|
||||||
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
|
button.style.cssText="height:100%;width:22px;margin:0px;padding:0px;";
|
||||||
@ -788,11 +790,12 @@ class SRec
|
|||||||
//select.setAttribute("name",columnNode.getAttribute("n"))
|
//select.setAttribute("name",columnNode.getAttribute("n"))
|
||||||
select.setAttribute("value",value);
|
select.setAttribute("value",value);
|
||||||
select.setAttribute("id",'filter_'+this.uid+'_'+columnNode.getAttribute("n"));
|
select.setAttribute("id",'filter_'+this.uid+'_'+columnNode.getAttribute("n"));
|
||||||
select.onchange = function(thiz,node){ return function(){ thiz.onComboObjectChangeHandler(node);}; }(this,columnNode);
|
select.onchange = function(thiz,node){ return function(){ thiz.onComboObjectChangeHandler(node);}; }(this,columnNode);
|
||||||
|
|
||||||
newCell1.appendChild(select);
|
newCell1.appendChild(select);
|
||||||
|
|
||||||
let button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="display:block; box-sizing: border-box; margin: 0px; padding: 0px;width:100%; height:100%; font-size: 9pt;";
|
button.style.cssText="display:block; box-sizing: border-box; margin: 0px; padding: 0px;width:100%; height:100%; font-size: 9pt;";
|
||||||
@ -807,8 +810,8 @@ class SRec
|
|||||||
nTypeF.setAttribute("c",fc);
|
nTypeF.setAttribute("c",fc);
|
||||||
nTypeF.setAttribute("pn",columnNode.getAttribute("n"));
|
nTypeF.setAttribute("pn",columnNode.getAttribute("n"));
|
||||||
nTypeF.setAttribute("fn",columnNode.getAttribute("n"));
|
nTypeF.setAttribute("fn",columnNode.getAttribute("n"));
|
||||||
|
|
||||||
let strXMLF = getXMLNodeSerialisation(nTypeF);
|
let strXMLF = getXMLNodeSerialisation(nTypeF);
|
||||||
let nColF=nodeFilter.firstChild;
|
let nColF=nodeFilter.firstChild;
|
||||||
while(nColF != null)
|
while(nColF != null)
|
||||||
{
|
{
|
||||||
@ -816,7 +819,7 @@ class SRec
|
|||||||
{
|
{
|
||||||
let valF=getCdataValue(nColF);
|
let valF=getCdataValue(nColF);
|
||||||
strXMLF=strXMLF.replace('${'+nColF.getAttribute('n')+'}', valF);
|
strXMLF=strXMLF.replace('${'+nColF.getAttribute('n')+'}', valF);
|
||||||
}
|
}
|
||||||
nColF = nColF.nextSibling;
|
nColF = nColF.nextSibling;
|
||||||
}
|
}
|
||||||
strXMLF='<?xml version="1.0" encoding="utf-8"?><metadata fn="6">'+strXMLF+'</metadata>';
|
strXMLF='<?xml version="1.0" encoding="utf-8"?><metadata fn="6">'+strXMLF+'</metadata>';
|
||||||
@ -826,7 +829,7 @@ class SRec
|
|||||||
this.showProgressBar();
|
this.showProgressBar();
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
if(this.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="6"><type n="'+object+'" c="'+fc+'" pn="'+columnNode.getAttribute("n")+'" fn="'+columnNode.getAttribute("n")+'"></type></metadata>',true))
|
if(this.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="6"><type n="'+object+'" c="'+fc+'" pn="'+columnNode.getAttribute("n")+'" fn="'+columnNode.getAttribute("n")+'"></type></metadata>',true))
|
||||||
{
|
{
|
||||||
this.showProgressBar();
|
this.showProgressBar();
|
||||||
@ -861,6 +864,7 @@ class SRec
|
|||||||
newCell1.appendChild(hidden);
|
newCell1.appendChild(hidden);
|
||||||
|
|
||||||
let button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value","...");
|
button.setAttribute("value","...");
|
||||||
button.style.cssText="width:30px; height:100%;margin: 0px; padding: 0px;";
|
button.style.cssText="width:30px; height:100%;margin: 0px; padding: 0px;";
|
||||||
@ -895,6 +899,7 @@ class SRec
|
|||||||
td.setAttribute("align","right");
|
td.setAttribute("align","right");
|
||||||
|
|
||||||
let button = document.createElement('input');
|
let button = document.createElement('input');
|
||||||
|
button.className='button-secondary';
|
||||||
button.setAttribute("type","button");
|
button.setAttribute("type","button");
|
||||||
button.setAttribute("value",_("Filtering"));
|
button.setAttribute("value",_("Filtering"));
|
||||||
button.setAttribute("id","btnfilter_"+this.uid);
|
button.setAttribute("id","btnfilter_"+this.uid);
|
||||||
@ -928,15 +933,15 @@ class SRec
|
|||||||
|
|
||||||
if (this.win!=null && this.win.getTop()!=40)
|
if (this.win!=null && this.win.getTop()!=40)
|
||||||
this.win.setCenter();
|
this.win.setCenter();
|
||||||
|
|
||||||
//Building the columns of the data table
|
//Building the columns of the data table
|
||||||
this.buildHead();
|
this.buildHead();
|
||||||
|
|
||||||
//this.sendFilter(id,0);
|
//this.sendFilter(id,0);
|
||||||
this.sendFilter(-1,0);
|
this.sendFilter(-1,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The event occurs when you change the list of the referenced to "vt = Object" and if there is a dependency, then the field is updated.
|
/** The event occurs when you change the list of the referenced to "vt = Object" and if there is a dependency, then the field is updated.
|
||||||
*/
|
*/
|
||||||
onComboObjectChangeHandler(node)
|
onComboObjectChangeHandler(node)
|
||||||
{
|
{
|
||||||
@ -975,7 +980,7 @@ class SRec
|
|||||||
}
|
}
|
||||||
nColF = nColF.nextSibling;
|
nColF = nColF.nextSibling;
|
||||||
}
|
}
|
||||||
|
|
||||||
strXMLF='<?xml version="1.0" encoding="utf-8"?><metadata fn="6">'+strXMLF+'</metadata>';
|
strXMLF='<?xml version="1.0" encoding="utf-8"?><metadata fn="6">'+strXMLF+'</metadata>';
|
||||||
if(this.request.callServer(ScriptName,strXMLF,true))
|
if(this.request.callServer(ScriptName,strXMLF,true))
|
||||||
{
|
{
|
||||||
@ -988,7 +993,7 @@ class SRec
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//We ask the server for a list of values almost like a drop-down list.
|
//We ask the server for a list of values almost like a drop-down list.
|
||||||
//typeName - The name of the object (TODO if the current is the variable f TypeName)
|
//typeName - The name of the object (TODO if the current is the variable f TypeName)
|
||||||
//name - the name of the column for selecting the values (must match the name of any filter in typeName)
|
//name - the name of the column for selecting the values (must match the name of any filter in typeName)
|
||||||
@ -1010,7 +1015,7 @@ class SRec
|
|||||||
this.sendFilter(-1,0);
|
this.sendFilter(-1,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Building a table header for the data
|
//Building a table header for the data
|
||||||
buildHead()
|
buildHead()
|
||||||
{
|
{
|
||||||
@ -1019,7 +1024,7 @@ class SRec
|
|||||||
let thetable = document.getElementById('thetable'+this.uid);
|
let thetable = document.getElementById('thetable'+this.uid);
|
||||||
delChild(thetable.tHead);
|
delChild(thetable.tHead);
|
||||||
let tr=document.createElement('tr');
|
let tr=document.createElement('tr');
|
||||||
tr.style.cssText='background-color: #dadada;';
|
tr.style.cssText='background-color: var(--header-color);';
|
||||||
let th=document.createElement('th');
|
let th=document.createElement('th');
|
||||||
th.appendChild( document.createTextNode('№'));
|
th.appendChild( document.createTextNode('№'));
|
||||||
th.style.cssText='width: 1%;';
|
th.style.cssText='width: 1%;';
|
||||||
@ -1028,8 +1033,8 @@ class SRec
|
|||||||
th.appendChild( document.createTextNode('Del'));
|
th.appendChild( document.createTextNode('Del'));
|
||||||
th.title = _('Invert_selection');
|
th.title = _('Invert_selection');
|
||||||
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
|
th.style.cssText='width: 1%; cursor: pointer; text-decoration: underline;';
|
||||||
th.onmouseover=function(){ this.style.backgroundColor='#C2D7FC'; };
|
th.onmouseover=function(){ this.style.backgroundColor=g_rowColor2; };
|
||||||
th.onmouseout=function(){ this.style.backgroundColor='#dadada'; };
|
th.onmouseout=function(){ this.style.backgroundColor='var(--header-color)'; };
|
||||||
th.onclick=function(thiz){return function(){ for(let i=0;i<thiz.masChBox.length;i++){ if(!thiz.masChBox[i].disabled) thiz.masChBox[i].checked = ! thiz.masChBox[i].checked; }};}(this);
|
th.onclick=function(thiz){return function(){ for(let i=0;i<thiz.masChBox.length;i++){ if(!thiz.masChBox[i].disabled) thiz.masChBox[i].checked = ! thiz.masChBox[i].checked; }};}(this);
|
||||||
tr.appendChild(th);
|
tr.appendChild(th);
|
||||||
|
|
||||||
@ -1044,11 +1049,11 @@ class SRec
|
|||||||
if(this.masVis[pos])
|
if(this.masVis[pos])
|
||||||
{
|
{
|
||||||
th=document.createElement('th');
|
th=document.createElement('th');
|
||||||
th.appendChild( document.createTextNode(columnNode.getAttribute("d")));
|
th.appendChild( document.createTextNode(columnNode.getAttribute("d")));
|
||||||
th.style.cssText='width: '+columnNode.getAttribute("width")+'px;';
|
th.style.cssText='width: '+columnNode.getAttribute("width")+'px;';
|
||||||
|
|
||||||
if(this.nodeMetadataObjList.getAttribute('order')==columnNode.getAttribute('n')) { th.style.backgroundColor='#afafaf'; }
|
if(this.nodeMetadataObjList.getAttribute('order')==columnNode.getAttribute('n')) { th.style.backgroundColor='#afafaf'; }
|
||||||
|
|
||||||
if(columnNode.getAttribute("order")!=null && columnNode.getAttribute("order")!='')
|
if(columnNode.getAttribute("order")!=null && columnNode.getAttribute("order")!='')
|
||||||
{
|
{
|
||||||
th.style.textDecoration='underline';
|
th.style.textDecoration='underline';
|
||||||
@ -1082,7 +1087,7 @@ class SRec
|
|||||||
|
|
||||||
//Delete all rows from the data table
|
//Delete all rows from the data table
|
||||||
for(let i = 1; i < theTable.rows.length;)
|
for(let i = 1; i < theTable.rows.length;)
|
||||||
{
|
{
|
||||||
theTable.deleteRow(i);
|
theTable.deleteRow(i);
|
||||||
}
|
}
|
||||||
this.masChBox=new Array(); //List of checkboxes
|
this.masChBox=new Array(); //List of checkboxes
|
||||||
@ -1090,9 +1095,9 @@ class SRec
|
|||||||
//Delete rows from the page table
|
//Delete rows from the page table
|
||||||
let tablepages=document.getElementById('pages'+this.uid);
|
let tablepages=document.getElementById('pages'+this.uid);
|
||||||
for(let i = 0; i < tablepages.rows.length;)
|
for(let i = 0; i < tablepages.rows.length;)
|
||||||
{
|
{
|
||||||
tablepages.deleteRow(i);
|
tablepages.deleteRow(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
//We build a page selection page in a row of 40 digits.
|
//We build a page selection page in a row of 40 digits.
|
||||||
tablepages.removeChild(tablepages.tBodies[0]);
|
tablepages.removeChild(tablepages.tBodies[0]);
|
||||||
@ -1103,7 +1108,7 @@ class SRec
|
|||||||
for(let i=0;i<pagecount;i++)
|
for(let i=0;i<pagecount;i++)
|
||||||
{
|
{
|
||||||
let bgColor='#DDDDDD';
|
let bgColor='#DDDDDD';
|
||||||
if (i%2==0) bgColor='#EEEEEE';
|
if (i%2==0) bgColor='#EEEEEE';
|
||||||
if (this.pagepos==i) bgColor='DodgerBlue';
|
if (this.pagepos==i) bgColor='DodgerBlue';
|
||||||
let newCell = newRow.insertCell(-1);
|
let newCell = newRow.insertCell(-1);
|
||||||
newCell.setAttribute("bgColor",bgColor);
|
newCell.setAttribute("bgColor",bgColor);
|
||||||
@ -1153,7 +1158,7 @@ class SRec
|
|||||||
{
|
{
|
||||||
let bgColor='';
|
let bgColor='';
|
||||||
let i=theTable.rows.length; //number of rows in the table
|
let i=theTable.rows.length; //number of rows in the table
|
||||||
if (i%2==0) bgColor='white'; else bgColor='whitesmoke';
|
if (i%2==0) bgColor=g_rowColor1; else bgColor=g_rowColor2;
|
||||||
|
|
||||||
if(nColor>=0) //Color from Result
|
if(nColor>=0) //Color from Result
|
||||||
{ bgColorT=findNodeOnNum(nodeRecord,"#cdata-section",nColor).nodeValue;
|
{ bgColorT=findNodeOnNum(nodeRecord,"#cdata-section",nColor).nodeValue;
|
||||||
@ -1172,7 +1177,7 @@ class SRec
|
|||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
|
|
||||||
//CheckBuck to delete records
|
//CheckBuck to delete records
|
||||||
td = document.createElement('td');
|
td = document.createElement('td');
|
||||||
td.style.cssText="text-align: center;";
|
td.style.cssText="text-align: center;";
|
||||||
if(!(this.f_pD!="1" || nodeRecord.getAttribute("a").indexOf("d")==-1))
|
if(!(this.f_pD!="1" || nodeRecord.getAttribute("a").indexOf("d")==-1))
|
||||||
{
|
{
|
||||||
@ -1261,7 +1266,7 @@ class SRec
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Name the column number
|
//Name the column number
|
||||||
getColNumOnName(name)
|
getColNumOnName(name)
|
||||||
{
|
{
|
||||||
@ -1363,7 +1368,7 @@ class SRec
|
|||||||
let tr=document.getElementById(id+'_'+this.uid);
|
let tr=document.getElementById(id+'_'+this.uid);
|
||||||
|
|
||||||
if (tr==null)
|
if (tr==null)
|
||||||
{
|
{
|
||||||
this.insertRows(node,false); //If not then insert
|
this.insertRows(node,false); //If not then insert
|
||||||
}else
|
}else
|
||||||
{
|
{
|
||||||
@ -1380,7 +1385,7 @@ class SRec
|
|||||||
while(tr.childNodes[jj+2].childNodes[0])
|
while(tr.childNodes[jj+2].childNodes[0])
|
||||||
tr.childNodes[jj+2].removeChild(tr.childNodes[jj+2].childNodes[0]);
|
tr.childNodes[jj+2].removeChild(tr.childNodes[jj+2].childNodes[0]);
|
||||||
tr.childNodes[jj+2].appendChild(document.createTextNode(cdataNode.nodeValue));
|
tr.childNodes[jj+2].appendChild(document.createTextNode(cdataNode.nodeValue));
|
||||||
|
|
||||||
jj++;
|
jj++;
|
||||||
}
|
}
|
||||||
ii++;
|
ii++;
|
||||||
@ -1429,16 +1434,16 @@ class SRec
|
|||||||
showreport(ext)
|
showreport(ext)
|
||||||
{
|
{
|
||||||
if(this.rwin!=null) this.rwin.Close();
|
if(this.rwin!=null) this.rwin.Close();
|
||||||
|
|
||||||
this.rwin=new TWin();
|
this.rwin=new TWin();
|
||||||
this.rwin.TWin(pageX-10,pageY-10);
|
this.rwin.BuildGUI(pageX-10,pageY-10);
|
||||||
this.rwin.setParent(this.win);
|
this.rwin.setParent(this.win);
|
||||||
this.rwin.setSize(280,130);
|
this.rwin.setSize(280,130);
|
||||||
this.rwin.setCaption(_('Report'));
|
this.rwin.setCaption(_('Report'));
|
||||||
this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: #f1f1f1;"><tr><td align="center"><b>'+_('Preparing_of_report')+'</b></td></tr><tr><td align="center"><img src="./metadata/dbms/form/loading.gif" alt=""/></td></tr></table>');
|
this.rwin.setContent('<table border="0px" style="width: 100%; height: 100%; background-color: #f1f1f1;"><tr><td align="center"><b>'+_('Preparing_of_report')+'</b></td></tr><tr><td align="center"><img src="./metadata/dbms/form/loading.gif" alt=""/></td></tr></table>');
|
||||||
|
|
||||||
this.appendFilter();
|
this.appendFilter();
|
||||||
//Call data from server
|
//Call data from server
|
||||||
let nodeType=findFirstNode(this.nodeMetadata, "type");
|
let nodeType=findFirstNode(this.nodeMetadata, "type");
|
||||||
let typename=nodeType.getAttribute("n");
|
let typename=nodeType.getAttribute("n");
|
||||||
let nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
|
let nodeFilter=findNodeOnPath(nodeType,"objects-list/filter");
|
||||||
@ -1454,11 +1459,11 @@ class SRec
|
|||||||
{
|
{
|
||||||
xs+='<column n="'+nextNode.getAttribute("n")+'" vt="'+nextNode.getAttribute("vt")+'" size="'+nextNode.getAttribute("size")+'">';
|
xs+='<column n="'+nextNode.getAttribute("n")+'" vt="'+nextNode.getAttribute("vt")+'" size="'+nextNode.getAttribute("size")+'">';
|
||||||
xs+='<![CDATA['+getCdataValue(nextNode)+']]>';
|
xs+='<![CDATA['+getCdataValue(nextNode)+']]>';
|
||||||
xs+='</column>\n';
|
xs+='</column>\n';
|
||||||
}
|
}
|
||||||
nextNode=nextNode.nextSibling;
|
nextNode=nextNode.nextSibling;
|
||||||
}
|
}
|
||||||
xs+=' </filter></objects-list>\n';
|
xs+=' </filter></objects-list>\n';
|
||||||
xs+=' </type>\n';
|
xs+=' </type>\n';
|
||||||
xs+='</metadata>';
|
xs+='</metadata>';
|
||||||
if(this.request.callServer(ScriptName,xs))
|
if(this.request.callServer(ScriptName,xs))
|
||||||
@ -1469,7 +1474,7 @@ class SRec
|
|||||||
|
|
||||||
chp(page)
|
chp(page)
|
||||||
{
|
{
|
||||||
//The current filter values are sent to the script to form a page change
|
//The current filter values are sent to the script to form a page change
|
||||||
document.forms.filter.xml_page.value=page;
|
document.forms.filter.xml_page.value=page;
|
||||||
document.forms.filter.submit();
|
document.forms.filter.submit();
|
||||||
}
|
}
|
||||||
@ -1511,13 +1516,13 @@ class SRec
|
|||||||
if (confirm(_("Are_you_sure_you_want_to_delete_the_entries")+'?'))
|
if (confirm(_("Are_you_sure_you_want_to_delete_the_entries")+'?'))
|
||||||
{
|
{
|
||||||
for(let i=0;i<this.masChBox.length;i++)
|
for(let i=0;i<this.masChBox.length;i++)
|
||||||
{
|
{
|
||||||
if(this.masChBox[i].checked)
|
if(this.masChBox[i].checked)
|
||||||
{
|
{
|
||||||
if(this.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="3"><type n="'+this.f_TypeName+'" id="'+this.masChBox[i].value+'"></type></metadata>',true))
|
if(this.request.callServer(ScriptName,'<?xml version="1.0" encoding="utf-8"?><metadata fn="3"><type n="'+this.f_TypeName+'" id="'+this.masChBox[i].value+'"></type></metadata>',true))
|
||||||
{
|
{
|
||||||
this.showProgressBar();
|
this.showProgressBar();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1527,8 +1532,8 @@ class SRec
|
|||||||
//Update HTML data after update record
|
//Update HTML data after update record
|
||||||
ApplyDelRec(node)
|
ApplyDelRec(node)
|
||||||
{
|
{
|
||||||
nodeType=findFirstNode(node, "type");
|
let nodeType=findFirstNode(node, "type");
|
||||||
typeName=nodeType.getAttribute("n");
|
let typeName=nodeType.getAttribute("n");
|
||||||
id=nodeType.getAttribute("id");
|
id=nodeType.getAttribute("id");
|
||||||
deleteHTML(id+'_'+this.uid);
|
deleteHTML(id+'_'+this.uid);
|
||||||
//Rebuild sequential numbering of rows (first column)
|
//Rebuild sequential numbering of rows (first column)
|
||||||
@ -1540,7 +1545,7 @@ class SRec
|
|||||||
theTable.rows[i].cells[0].appendChild(document.createTextNode(i));
|
theTable.rows[i].cells[0].appendChild(document.createTextNode(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
callData(typeName,settings)
|
callData(typeName,settings)
|
||||||
{
|
{
|
||||||
this.f_TypeName=typeName;
|
this.f_TypeName=typeName;
|
||||||
@ -1557,12 +1562,12 @@ class SRec
|
|||||||
//Convert XML to array
|
//Convert XML to array
|
||||||
function nodeToTable(node)
|
function nodeToTable(node)
|
||||||
{
|
{
|
||||||
let result=new Array();
|
let result=new Array();
|
||||||
|
|
||||||
let nType=findFirstNode(node, "type");
|
let nType=findFirstNode(node, "type");
|
||||||
//Read name fields
|
//Read name fields
|
||||||
let nList=findFirstNode(node, "objects-list");
|
let nList=findFirstNode(node, "objects-list");
|
||||||
let cols=new Array();
|
let cols=new Array();
|
||||||
let pos=0;
|
let pos=0;
|
||||||
let nCols=nList.firstChild;
|
let nCols=nList.firstChild;
|
||||||
while(nCols != null)
|
while(nCols != null)
|
||||||
@ -1583,7 +1588,7 @@ function nodeToTable(node)
|
|||||||
{
|
{
|
||||||
result[pos]['id']=nRecord.getAttribute("id");
|
result[pos]['id']=nRecord.getAttribute("id");
|
||||||
let i=0; //column number
|
let i=0; //column number
|
||||||
|
|
||||||
cdataNode = nRecord.firstChild;
|
cdataNode = nRecord.firstChild;
|
||||||
while (cdataNode!=null)
|
while (cdataNode!=null)
|
||||||
{
|
{
|
||||||
@ -1601,4 +1606,4 @@ function nodeToTable(node)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,13 @@
|
|||||||
|
|
||||||
class tcTab
|
class tcTab
|
||||||
{
|
{
|
||||||
constructor(caption){
|
constructor(config){
|
||||||
|
|
||||||
|
this.bColor="";
|
||||||
|
|
||||||
|
|
||||||
|
if(typeof config.float == 'undefined'){ config.float='left'; }
|
||||||
|
|
||||||
this.id=0;
|
this.id=0;
|
||||||
this.par=null;
|
this.par=null;
|
||||||
this.sel=false;
|
this.sel=false;
|
||||||
@ -10,12 +16,12 @@ class tcTab
|
|||||||
|
|
||||||
//Сам таб на который нажимаем (ушко)
|
//Сам таб на который нажимаем (ушко)
|
||||||
this.div=document.createElement('div')
|
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.cssText='position: relative; top: 1px; cursor: pointer; float: '+config.float+'; 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.style.background = g_backColor1;
|
||||||
this.div.innerHTML=caption;
|
this.div.innerHTML=config.caption;
|
||||||
|
|
||||||
this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#f0f0f0';}}(this);
|
this.div.onmouseover=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_rowColor1; }}(this);
|
||||||
this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = '#dfdfdf' }}(this);
|
this.div.onmouseout=function(obj){return function(){ if(!obj.sel) obj.div.style.background = g_backColor1; }}(this);
|
||||||
this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this)
|
this.div.onclick=function(obj){return function(){ obj.setSel(); if(obj.href!='') goToURL(obj.href); }}(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,12 +50,12 @@ class tcTab
|
|||||||
setSel()
|
setSel()
|
||||||
{
|
{
|
||||||
for(let i=0;i<this.par.tbs.length;i++)
|
for(let i=0;i<this.par.tbs.length;i++)
|
||||||
{ this.par.tbs[i].div.style.background = '#dfdfdf'
|
{ this.par.tbs[i].div.style.background = g_backColor1;
|
||||||
this.par.tbs[i].div.style.borderBottom = "1px solid #b3b3b3"
|
this.par.tbs[i].div.style.borderBottom = "1px solid #b3b3b3"
|
||||||
this.par.tbs[i].sel=false
|
this.par.tbs[i].sel=false
|
||||||
this.par.tbs[i].con.style.display='none'
|
this.par.tbs[i].con.style.display='none'
|
||||||
}
|
}
|
||||||
this.div.style.background = '#ffffff';
|
this.div.style.background = g_rowColor2;
|
||||||
this.div.style.borderBottom = '1px solid #ffffff'
|
this.div.style.borderBottom = '1px solid #ffffff'
|
||||||
//this.con.style.display='inline'
|
//this.con.style.display='inline'
|
||||||
this.con.style.display='block';
|
this.con.style.display='block';
|
||||||
@ -74,7 +80,7 @@ class tcTabs
|
|||||||
tr.style.cssText='display: table-row; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
|
tr.style.cssText='display: table-row; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
|
||||||
|
|
||||||
this.btt=document.createElement('div');
|
this.btt=document.createElement('div');
|
||||||
this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;'
|
this.btt.style.cssText='display: table-cell; width :100%; height: 1%; padding: 0px; margin: 0px; border: 0px solid #0000ff;background-color: '+g_backColor2+';color:'+g_textColor1+';';
|
||||||
tr.appendChild(this.btt);
|
tr.appendChild(this.btt);
|
||||||
this.wra.appendChild(tr);
|
this.wra.appendChild(tr);
|
||||||
|
|
||||||
@ -91,9 +97,9 @@ class tcTabs
|
|||||||
this.bd.appendChild(this.wra);
|
this.bd.appendChild(this.wra);
|
||||||
}
|
}
|
||||||
|
|
||||||
addTab(caption)
|
addTab(config)
|
||||||
{
|
{
|
||||||
var tab=new tcTab(caption)
|
var tab=new tcTab(config)
|
||||||
tab.par=this
|
tab.par=this
|
||||||
this.btt.appendChild(tab.div);
|
this.btt.appendChild(tab.div);
|
||||||
|
|
||||||
|
|||||||
@ -1027,6 +1027,7 @@ class TWin
|
|||||||
constructor(dialog)
|
constructor(dialog)
|
||||||
{
|
{
|
||||||
this.dialog=dialog; //Показывать окно как диалог (без возможности изменения размеров)
|
this.dialog=dialog; //Показывать окно как диалог (без возможности изменения размеров)
|
||||||
|
this.disableClosing=false;
|
||||||
|
|
||||||
this.closed=false; //Закрыли (те. удалили из родителя и детей и из DOM)
|
this.closed=false; //Закрыли (те. удалили из родителя и детей и из DOM)
|
||||||
this.onClose=null; //слушатель закрытия окна
|
this.onClose=null; //слушатель закрытия окна
|
||||||
@ -1107,6 +1108,9 @@ class TWin
|
|||||||
|
|
||||||
Close() //Закрыть и удалить окно из родителя и менеджера
|
Close() //Закрыть и удалить окно из родителя и менеджера
|
||||||
{
|
{
|
||||||
|
if(this.disableClosing)
|
||||||
|
return;
|
||||||
|
|
||||||
this.hide(true);
|
this.hide(true);
|
||||||
this.setParent(null);
|
this.setParent(null);
|
||||||
for(var i=0;i<this.childs.length;i++) if(this.childs[i]!=null) this.childs[i].parent=null
|
for(var i=0;i<this.childs.length;i++) if(this.childs[i]!=null) this.childs[i].parent=null
|
||||||
@ -1124,7 +1128,7 @@ class TWin
|
|||||||
};
|
};
|
||||||
|
|
||||||
//Типа конструктор создать окно с заданой позицией
|
//Типа конструктор создать окно с заданой позицией
|
||||||
TWin(x,y)
|
BuildGUI(x,y)
|
||||||
{
|
{
|
||||||
this.tWinId=Wins.add(this);
|
this.tWinId=Wins.add(this);
|
||||||
/*
|
/*
|
||||||
@ -1186,7 +1190,7 @@ class TWin
|
|||||||
|
|
||||||
var str='';
|
var str='';
|
||||||
str+='<table id="TWin_TBL_'+this.tWinId+'" class="shadow" bgcolor="#f1f1f1" border="0px" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%; border: 1px solid #000000;">';
|
str+='<table id="TWin_TBL_'+this.tWinId+'" class="shadow" bgcolor="#f1f1f1" border="0px" cellspacing="0" cellpadding="0" style="width: 100%; height: 100%; border: 1px solid #000000;">';
|
||||||
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="background: url(../resources/metadata/dbms/form/g.gif) repeat-x;"><td></td><td><table cellspacing="0" cellpadding="0" style="width: 100%; height: 29px;"><tr><td id="TWin_Ca_'+this.tWinId+'" style="vertical-align: middle; cursor: move; font-weight: bold; white-space: nowrap;"></td><td style="width: 10px; vertical-align: middle;"><img src="../resources/metadata/dbms/form/x.gif" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;"></td></tr></table></td><td></td></tr>';
|
str+=' <tr id="TWin_H0_'+this.tWinId+'" style="background: url(../resources/metadata/dbms/form/b_g.png) repeat-x;"><td></td><td><table cellspacing="0" cellpadding="0" style="width: 100%; height: 29px;"><tr><td id="TWin_Ca_'+this.tWinId+'" style="vertical-align: middle; cursor: move; font-weight: bold; white-space: nowrap;"></td><td style="width: 10px; vertical-align: middle;"><img src="../resources/metadata/dbms/form/b_x.png" id="TWin_CL_'+this.tWinId+'" style="cursor:pointer;padding-right: 5px;"></td></tr></table></td><td></td></tr>';
|
||||||
str+=' <tr>';
|
str+=' <tr>';
|
||||||
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:nw-resize;' : '')+'" id="TWin_TL_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
|
str+=' <td style="width: 5px; height: 5px;'+(!this.dialog ? ' cursor:nw-resize;' : '')+'" id="TWin_TL_'+this.tWinId+'"><img src="../resources/metadata/dbms/form/5.gif" alt="" style="display: block;" border="0px" draggable="false"></td>';
|
||||||
str+=' <td style="vertical-align:top;height: 5px;'+(!this.dialog ? ' cursor:n-resize;' : '')+'" id="TWin_T_'+this.tWinId+'"></td>';
|
str+=' <td style="vertical-align:top;height: 5px;'+(!this.dialog ? ' cursor:n-resize;' : '')+'" id="TWin_T_'+this.tWinId+'"></td>';
|
||||||
@ -1277,10 +1281,10 @@ class TWin
|
|||||||
for(var i=0;i<Wins.mas.length;i++) if(Wins.mas[i]!=null)
|
for(var i=0;i<Wins.mas.length;i++) if(Wins.mas[i]!=null)
|
||||||
{
|
{
|
||||||
Wins.mas[i].sel=false;
|
Wins.mas[i].sel=false;
|
||||||
Wins.mas[i].ca.style.color="#555555";
|
Wins.mas[i].ca.style.color="#afafaf"; //555555
|
||||||
}
|
}
|
||||||
this.sel=true;
|
this.sel=true;
|
||||||
this.ca.style.color="black";
|
this.ca.style.color="#ffffff"; //black
|
||||||
this.setWinZ(true);
|
this.setWinZ(true);
|
||||||
}
|
}
|
||||||
//Получить значение Z индекса TODO сделать через геттер
|
//Получить значение Z индекса TODO сделать через геттер
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
@session_start();
|
@session_start();
|
||||||
//if(isset($_SESSION['REMOTE_ADDR']) && $_SESSION['REMOTE_ADDR'] != $_SERVER['REMOTE_ADDR']) unset($_SESSION["USER_ID"]); //Делаемся не авторизованным если зашли с другого ip адреса
|
//if(isset($_SESSION['REMOTE_ADDR']) && $_SESSION['REMOTE_ADDR'] != $_SERVER['REMOTE_ADDR']) unset($_SESSION["USER_ID"]); //Делаемся не авторизованным если зашли с другого ip адреса
|
||||||
if (isset($_REQUEST['id'])) $id = $_REQUEST['id']; else $id = '';
|
if (isset($_REQUEST['id'])) $id = $_REQUEST['id']; else $id = '';
|
||||||
@ -9,15 +9,15 @@ if (isset($_REQUEST['id'])) $id = $_REQUEST['id']; else $id = '';
|
|||||||
$let_amount = 5; //Количество символов, которые нужно набрать
|
$let_amount = 5; //Количество символов, которые нужно набрать
|
||||||
$fon_let_amount = 40; //Количество символов, которые находятся на фоне
|
$fon_let_amount = 40; //Количество символов, которые находятся на фоне
|
||||||
$path_fonts = getcwd().'/fonts/'; //Путь к шрифтам
|
$path_fonts = getcwd().'/fonts/'; //Путь к шрифтам
|
||||||
|
|
||||||
//$letters = array('a','b','c','d','e','f','g','h','j','k','m','n','p','q','r','s','t','u','v','w','x','y','z','2','3','4','5','6','7','9');
|
//$letters = array('a','b','c','d','e','f','g','h','j','k','m','n','p','q','r','s','t','u','v','w','x','y','z','2','3','4','5','6','7','9');
|
||||||
$letters = array('0','1','2','3','4','5','6','7','8','9');
|
$letters = array('0','1','2','3','4','5','6','7','8','9');
|
||||||
$colors = array('10','30','50','70','90','110','130','150','170','190','210');
|
$colors = array('100','200','150','170','190','210','190','160','170','190','210');
|
||||||
|
|
||||||
$src = imagecreatetruecolor($width,$height);
|
$src = imagecreatetruecolor($width,$height);
|
||||||
$fon = imagecolorallocate($src,255,255,255);
|
$fon = imagecolorallocate($src,58,58,58);
|
||||||
imagefill($src,0,0,$fon);
|
imagefill($src,0,0,$fon);
|
||||||
|
|
||||||
$fonts = array();
|
$fonts = array();
|
||||||
$dir=opendir($path_fonts);
|
$dir=opendir($path_fonts);
|
||||||
while($fontName = readdir($dir))
|
while($fontName = readdir($dir))
|
||||||
@ -31,27 +31,27 @@ if (isset($_REQUEST['id'])) $id = $_REQUEST['id']; else $id = '';
|
|||||||
|
|
||||||
for($i=0;$i<$fon_let_amount;$i++)
|
for($i=0;$i<$fon_let_amount;$i++)
|
||||||
{
|
{
|
||||||
$color = imagecolorallocatealpha($src,rand(0,255),rand(0,255),rand(0,255),100);
|
$color = imagecolorallocatealpha($src,rand(0,255),rand(0,255),rand(0,255),100);
|
||||||
$font = $path_fonts.$fonts[rand(0,sizeof($fonts)-1)];
|
$font = $path_fonts.$fonts[rand(0,sizeof($fonts)-1)];
|
||||||
$letter = $letters[rand(0,sizeof($letters)-1)];
|
$letter = $letters[rand(0,sizeof($letters)-1)];
|
||||||
$size = rand($font_size-2,$font_size+2);
|
$size = rand($font_size-2,$font_size+2);
|
||||||
imagettftext($src,$size,rand(0,45),rand($width*0.1,$width-$width*0.1),rand($height*0.2,$height),$color,$font,$letter);
|
imagettftext($src,$size,rand(0,45),rand($width*0.1,$width-$width*0.1),rand($height*0.2,$height),$color,$font,$letter);
|
||||||
}
|
}
|
||||||
|
|
||||||
for($i=0;$i<$let_amount;$i++)
|
for($i=0;$i<$let_amount;$i++)
|
||||||
{
|
{
|
||||||
$color = imagecolorallocatealpha($src,$colors[rand(0,sizeof($colors)-1)],$colors[rand(0,sizeof($colors)-1)],$colors[rand(0,sizeof($colors)-1)],rand(20,40));
|
$color = imagecolorallocatealpha($src,$colors[rand(0,sizeof($colors)-1)],$colors[rand(0,sizeof($colors)-1)],$colors[rand(0,sizeof($colors)-1)],rand(20,40));
|
||||||
$font = $path_fonts.$fonts[rand(0,sizeof($fonts)-1)];
|
$font = $path_fonts.$fonts[rand(0,sizeof($fonts)-1)];
|
||||||
$letter = $letters[rand(0,sizeof($letters)-1)];
|
$letter = $letters[rand(0,sizeof($letters)-1)];
|
||||||
$size = rand($font_size*2.1-2,$font_size*2.1+2);
|
$size = rand($font_size*2.1-2,$font_size*2.1+2);
|
||||||
$x = ($i+0.9)*$font_size + rand(4,7);
|
$x = ($i+0.9)*$font_size + rand(4,7);
|
||||||
$y = (($height*2.3)/3) + rand(0,5);
|
$y = (($height*2.3)/3) + rand(0,5);
|
||||||
$cod[] = $letter;
|
$cod[] = $letter;
|
||||||
imagettftext($src,$size,rand(0,15),$x,$y,$color,$font,$letter);
|
imagettftext($src,$size,rand(0,15),$x,$y,$color,$font,$letter);
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['secpic'.$id] = implode('',$cod);
|
$_SESSION['secpic'.$id] = implode('',$cod);
|
||||||
|
|
||||||
header ("Content-type: image/gif");
|
header ("Content-type: image/gif");
|
||||||
imagegif($src);
|
imagegif($src);
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user