web-bayern contrast methods

This commit is contained in:
Rainer Gümpelein 2022-03-24 07:25:20 +01:00
parent be4d83cc8d
commit 1503e52196
6 changed files with 127 additions and 43 deletions

View file

@ -1,3 +1,4 @@
function change_fontsize1(){
document.getElementById('Contenttxt').style.cssText = 'font-size:1em;';
}
@ -8,6 +9,49 @@ function change_fontsize3(){
document.getElementById('Contenttxt').style.cssText = 'font-size:1.4em;';
}
function change_contrast(){
var element = document.querySelectorAll('*');
for (var i = 0; i < element.length; i++) {
//const bgcol = element[i].style.backgroundColor;
const style = getComputedStyle(element[i]);
const bgcol = style.backgroundColor;
console.log(bgcol);
const fgcol = style.color;
console.log(fgcol);
if(bgcol == ('rgb(0, 141, 210)')){ //008dd2 (blue)
element[i].style.backgroundColor = "rgb(63, 63, 63)";//3f3f3f (black)
element[i].style.color = "rgb(255, 255, 254)";//white
}
if(bgcol == ('rgb(63, 63, 63)')){ //black
element[i].style.backgroundColor = "rgb(0, 141, 210)";
element[i].style.color = "rgb(255, 255, 254)";
}
//hover active
if(bgcol == ('rgb(3, 101, 149)')){ //036595 (darkblue)
element[i].style.backgroundColor = "rgb(255, 255, 254)";
element[i].style.color = "rgb(63, 63, 63)";
}
//hover active
if(bgcol == ('rgb(255, 255, 254)')){ //fffffe (white)
element[i].style.backgroundColor = "rgb(3, 101, 149)";
element[i].style.color = "rgb(255, 255, 254)";
}
//if only font ist colored and backround is white
if(fgcol == ('rgb(0, 141, 210)') && bgcol == ('rgb(255, 255, 255)')){ //008dd2
element[i].style.color = "rgb(63, 63, 63)";
element[i].style.backgroundColor = "rgb(255, 255, 255)";
}
if(fgcol == ('rgb(63, 63, 63)') && bgcol == ('rgb(255, 255, 255)')){ //black
element[i].style.color = "rgb(0, 141, 210)";
element[i].style.backgroundColor = "rgb(255, 255, 255)";
}
}
}
function show_passwd() {
var x = document.getElementById('txt04');
if (x.type === "password") {

View file

@ -1079,6 +1079,7 @@ sub collect_transpos {
$where .= " and cp.$key = $search->{$key}" if($key eq "barcode" && looks_like_number($search->{$key}));
$where .= " and cp.$key = $search->{$key}" if($key eq "int12" && looks_like_number($search->{$key}));#bike_group
$where .= " and cp.$key = $search->{$key}" if($key eq "owner" && looks_like_number($search->{$key}));
$where .= " and cp.$key is $search->{$key}" if($key eq "int34" && $search->{$key} eq "null");
}
$where .= " ORDER BY cp.end_time $updown LIMIT $search->{limit} OFFSET $search->{offset}" if($search->{limit});
@ -1249,6 +1250,8 @@ sub insert_pos(){
$artikelnr = $ct->{barcode} if(!$artikelnr);#RadID
my $user_name = $ctadr->{txt01};
$user_name = $ctadr->{txt08} if(!$user_name || $user_name eq "no name");
my $staff = 0;
$staff = 1 if($ctadr->{txt18});#service staff (no sms message)
my $deviceId = $ct->{int13} || 0;
my $bike_charge = $ct->{int19} || 0;
@ -1278,7 +1281,7 @@ sub insert_pos(){
my $sth;
#Verleihräder
if($ct->{template_id} && $ct->{template_id} == 205){#Leihrad_list
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt01,txt08,txt02,txt09,itime,start_time,end_time,int02,int03,int06,int04,txt05,txt06,txt07,int10,int12,int13,owner,int07,txt04,int09,int17,int15,int16,int11,int18,int19,txt17,txt18,int20,int25) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$artikelnr','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}',now(),now(),'$endRental','$unit_price','$menge','$station','$station','$ct->{txt06}','$ct->{txt06}','$ct->{txt07}','$status','$from_main_id','$deviceId','$owner','$rabatt','$tariff_desc','$tariff_nr','$day_maxprice','$abo_price','$free_hours','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{txt18}','$ct->{int20}','$trackon') RETURNING c_id");
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt01,txt08,txt02,txt09,itime,start_time,end_time,int02,int03,int06,int04,txt05,txt06,txt07,int10,int12,int13,owner,int07,txt04,int09,int17,int15,int16,int11,int18,int19,txt17,txt18,int20,int25,int34) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$artikelnr','$ct->{barcode}','$ct->{txt01}','$user_name','$ct->{txt02}','$ctadr->{txt09}',now(),now(),'$endRental','$unit_price','$menge','$station','$station','$ct->{txt06}','$ct->{txt06}','$ct->{txt07}','$status','$from_main_id','$deviceId','$owner','$rabatt','$tariff_desc','$tariff_nr','$day_maxprice','$abo_price','$free_hours','$ct->{int11}','$sharing_type','$bike_charge','$ct->{txt17}','$ct->{txt18}','$ct->{int20}','$trackon','$staff') RETURNING c_id");
}else{
$sth = $dbh->prepare("INSERT INTO contenttranspos (ct_id,cc_id,ca_id,ct_name,barcode,txt08,txt09,itime,int02,int03,txt01,txt06,txt07,int10,int12,owner) VALUES ('$ctt_id','$ct->{c_id}','$ctadr->{c_id}','$artikelnr','0','$user_name','$ctadr->{txt09}',now(),'$unit_price','1','$ct->{txt01}','$ct->{txt06}','$ct->{txt07}','0','$from_main_id','$owner') RETURNING c_id");
}

View file

@ -56,6 +56,7 @@ if($todo eq "24h_occupied"){
my $search = {
table => "contenttranspos",
int10 => 3,
int34 => "null",#if not staff
start_time_interval => "(now() - interval '1 day')",
};
my $update_pos = {