mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
statistik occubike fix
This commit is contained in:
parent
6a53adba69
commit
899cb605f7
5 changed files with 16 additions and 10 deletions
|
@ -2318,6 +2318,7 @@ sub stations_available(){
|
|||
|
||||
$return->{$id}->{station} = "$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{int04}";
|
||||
$return->{$id}->{uri_operator} = "$varenv->{wwwhost}";
|
||||
$record->{$id}->{txt06} =~ s/\s//g;
|
||||
($return->{$id}->{gps}->{latitude},$return->{$id}->{gps}->{longitude}) = split(/,/,$record->{$id}->{txt06});
|
||||
my $description = $q->unescapeHTML($record->{$id}->{txt01}) || "";
|
||||
$return->{$id}->{description} = "$description";
|
||||
|
|
|
@ -152,6 +152,8 @@ sub sig_available {
|
|||
$return2copri->{$station}->{barcode} = $1 if($response_out->{$station}->{station} =~ /(\d+)/);#new on station context
|
||||
$return2copri->{$station}->{int04} = $1 if($response_out->{$station}->{station} =~ /(\d+)/);
|
||||
$return2copri->{$station}->{int06} = $1 if($response_out->{$station}->{gps_radius} =~ /(\d+)/);
|
||||
$return2copri->{$station}->{int05} = 2;#capacity
|
||||
$return2copri->{$station}->{int08} = 2;#energy adapter
|
||||
$return2copri->{$station}->{txt01} = "$response_out->{$station}->{description}";
|
||||
$return2copri->{$station}->{txt06} = "$response_out->{$station}->{gps}->{latitude},$response_out->{$station}->{gps}->{longitude}";
|
||||
$return2copri->{$station}->{txt24} = "300102";#node.main_id
|
||||
|
|
|
@ -46,7 +46,7 @@ sub dbconnect {
|
|||
my $database = "dbi:Pg:dbname=$varenv{dbname};host=$varenv{dbhost};port=5432;options='$options'";
|
||||
my $dbh = DBI->connect($database, $varenv{dbuser}, $varenv{dbpassw},{ RaiseError => 1, AutoCommit => 1 }) or die "Can't connect to $varenv{dbname}: $DBI::errstr";
|
||||
my $source = $dbh->get_info( $GetInfoType{SQL_DATABASE_NAME} );
|
||||
$bw->log("--> dbconnect_intern --> $varenv{syshost} $source",$database,"");
|
||||
#$bw->log("--> dbconnect_intern --> $varenv{syshost} $source",$database,"");
|
||||
return $dbh if($dbh);
|
||||
}
|
||||
|
||||
|
@ -511,7 +511,7 @@ sub fetch_rel4tpl4nd(){
|
|||
}else{
|
||||
$rel = $sth->fetchrow_hashref();
|
||||
}
|
||||
$bw->log("fetch_rel4tpl4nd $source",$sql,"") if($debug);
|
||||
#$bw->log("fetch_rel4tpl4nd $source",$sql,"") if($debug);
|
||||
|
||||
return $rel;
|
||||
}
|
||||
|
@ -651,7 +651,7 @@ sub collect_post(){
|
|||
$sql = "SELECT cp.*, ct.state FROM $fetch->{table_pos} cp, $fetch->{table} ct WHERE $cp_where and cp.ct_id=ct.c_id and $poscid IN (SELECT ct.c_id FROM relation rel, $fetch->{table} ct WHERE rel.content_id=ct.c_id and $ct_where) order by cp.mtime ASC";#mtime aufsteigend get last (newest) entry
|
||||
$sth = $dbh->prepare($sql);
|
||||
}
|
||||
$bw->log("DBtank collect_post $source",$sql,"") if($debug);
|
||||
#$bw->log("DBtank collect_post $source",$sql,"") if($debug);
|
||||
my $rc = $sth->execute();
|
||||
|
||||
my $record = { c_id => 0 };
|
||||
|
@ -732,7 +732,7 @@ sub fetch_record(){
|
|||
my $sql = "SELECT ct.*,rel.*,nd.node_name,nd.parent_id,nd.type_id,nd.energy_id FROM $fetch->{table} ct, relation rel, nodes nd $where $order";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
my $rc = $sth->execute();
|
||||
$bw->log("DBtank fetch_record $source: $rc",$sql,"") if($debug);
|
||||
#$bw->log("DBtank fetch_record $source: $rc",$sql,"") if($debug);
|
||||
|
||||
my $record = { c_id => 0 };
|
||||
if($fetch->{fetch} eq "all" && $fetch->{keyfield}){
|
||||
|
@ -796,7 +796,7 @@ sub fetch_tablerecord(){
|
|||
my $sql = "SELECT * FROM $fetch->{table} $where";
|
||||
my $sth = $dbh->prepare($sql);
|
||||
my $rc = $sth->execute();
|
||||
$bw->log("DBtank fetch_tablerecord $source:",$sql,"") if($debug);
|
||||
#$bw->log("DBtank fetch_tablerecord $source:",$sql,"") if($debug);
|
||||
|
||||
my $record = { c_id => 0 };
|
||||
if($fetch->{fetch} eq "all" && $fetch->{keyfield}){
|
||||
|
@ -1134,7 +1134,7 @@ sub collect_transpos {
|
|||
my $sth = $dbh->prepare($sql);
|
||||
my $rc = $sth->execute();
|
||||
my $ct = $sth->fetchall_hashref("c_id");
|
||||
$bw->log("collect_transpos",$sql,"") if($debug);
|
||||
#$bw->log("collect_transpos",$sql,"") if($debug);
|
||||
return $ct;
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,8 @@ sub only_first_free(){
|
|||
};
|
||||
$pref = { %$pref, time_range => "cp.start_time >= '$ctpos->{start_time}' and cp.start_time < '$ctpos->{end_time}' and cp.start_time != cp.end_time" };
|
||||
|
||||
my $record = $dbt->collect_post($dbh,$pref);
|
||||
my $record = { c_id => 0 };
|
||||
$record = $dbt->collect_post($dbh,$pref);
|
||||
return $record;
|
||||
|
||||
}
|
||||
|
@ -113,6 +114,7 @@ sub counting_rental {
|
|||
|
||||
#if end_station == start_station and rental minutes < 5 minutes, then 0
|
||||
$rental_minute = 0 if($ctpos->{int04} == $ctpos->{int06} && $rental_minute && $rental_minute < 5);
|
||||
my $rental_minute_all = $rental_minute;
|
||||
|
||||
#init with some defaults
|
||||
my $total_price = 0;
|
||||
|
@ -259,6 +261,7 @@ sub counting_rental {
|
|||
$return->{rentalog}->{computed_clock} = "$computed_clock";
|
||||
$return->{rentalog}->{computed_hours} = "$computed_hours";
|
||||
$return->{rentalog}->{rental_minute} = "$rental_minute";
|
||||
$return->{rentalog}->{rental_minute_all} = "$rental_minute_all";
|
||||
$return->{rentalog}->{max_fee_daily_minute} = "$max_fee_daily_minute";
|
||||
$return->{rentalog}->{tariff_unitbyminute} = "$tariff_unitbyminute";
|
||||
$return->{rentalog}->{restal_minute} = "$restal_minute";
|
||||
|
@ -268,12 +271,12 @@ sub counting_rental {
|
|||
$return->{rentalog}->{rental_day_price} = "$rental_day_price";
|
||||
$return->{rentalog}->{total_price} = "$total_price";
|
||||
$return->{rentalog}->{rental_time_price} = "$rental_time_price";
|
||||
$return->{rentalog}->{ctpos_freed} = "$ctpos_freed->{c_id}";
|
||||
$return->{rentalog}->{ctpos_freed} = $ctpos_freed->{c_id};
|
||||
$return->{rentalog}->{used_max_fee} = "$used_max_fee";
|
||||
$return->{rentalog}->{used_methode} = "$used_methode";
|
||||
$return->{rentalog}->{counting} = $counting;
|
||||
|
||||
$bw->log("Pricing counting_rental return:",$return,"");
|
||||
#$bw->log("Pricing counting_rental return:",$return,"");
|
||||
return ($return,$counting);
|
||||
}#end counting_rental
|
||||
|
||||
|
|
|
@ -659,7 +659,7 @@ sub tpl(){
|
|||
#2. Tableheader
|
||||
print $q->Tr();
|
||||
#permissions
|
||||
if($users_dms->{int07} == 2){#only DMS-Account Admin
|
||||
if($users_dms_primary->{int03} == 2 && $users_dms->{int03} == 2){
|
||||
print $q->td({-style=>"background-color:silver;"},$q->checkbox(-name=>'toggle_all', -checked=>'', -value=>'off', -label=>'', -title=>'Alle auswählen', -onclick=>'CheckAll();')),"\n";
|
||||
}else{
|
||||
print $q->td({-style=>"background-color:silver;"}," "),"\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue