diff --git a/copri4/main/src/Mod/APIfunc.pm b/copri4/main/src/Mod/APIfunc.pm index baa6f09..b418b9f 100755 --- a/copri4/main/src/Mod/APIfunc.pm +++ b/copri4/main/src/Mod/APIfunc.pm @@ -1477,7 +1477,7 @@ sub bikes_available(){ $return->{$id}->{Ilockit_GUID} = "$record->{$id}->{txt17}"; $return->{$id}->{Ilockit_ID} = "$record->{$id}->{txt18}"; $return->{$id}->{bike_group} = ["$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{main_id}"]; - #if($users_serviceapp->{int09}){ + #if($users_serviceapp->{int09}) #shareetool if($q->param('authcookie') && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} && $dbt->{merchant_ids}->{$varenv->{merchant_id}}->{id} == 187 && scalar(@{$user_tour} >= 1)){ my @service_code = split(/\s/,$record->{$id}->{txt23}); diff --git a/copri4/main/src/Mod/SMSTransport.pm b/copri4/main/src/Mod/SMSTransport.pm index a5921f9..b0a1f2b 100755 --- a/copri4/main/src/Mod/SMSTransport.pm +++ b/copri4/main/src/Mod/SMSTransport.pm @@ -44,6 +44,7 @@ my $response_in = {}; my $dbh = ""; my $owner = 181; +#used for sending smsAck codes to user sub sms_ack_digest { my $self = shift; my $ctadr = shift; @@ -99,7 +100,7 @@ sub sms_ack_digest { return $ret_json; } -#used for sending message if lock_state=locking and after 45 sec no lock_state=locked +#used for sending message to user sub sms_message { my $self = shift; my $todo = shift; diff --git a/copri4/main/src/scripts/sms_message.pl b/copri4/main/src/scripts/sms_message.pl index f3efd06..d66b9d9 100755 --- a/copri4/main/src/scripts/sms_message.pl +++ b/copri4/main/src/scripts/sms_message.pl @@ -58,6 +58,9 @@ if($todo eq "24h_occupied"){ int10 => 3, start_time_interval => "(now() - interval '1 day')", }; + my $update_pos = { + table => "contenttranspos", + }; my $dt1 = DateTime->now(time_zone => "Europe/Berlin"); @@ -76,17 +79,26 @@ if($todo eq "24h_occupied"){ #print $dt1 . ">=" . $dt2_72h_occupied . "|" . $dt1 . ">=" . $dt2_48h_occupied . "|" . $dt1 . ">=" . $dt2_24h_occupied . "\n"; if($dt2){ if($dt1 >= $dt2_72h_occupied){ - $todo = "72h_occupied"; - $smstrans->sms_message($dt1 >= $dt2_72h_occupied,$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}); - print $dt1 . ">=" . $dt2_72h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n"; + if($cttpos->{$pid}->{int33} != 3){ + $todo = "72h_occupied"; + print $dt1 . ">=" . $dt2_72h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n"; + $smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}); + $dbt->update_one($dbh,$update_pos,"int33=3",$cttpos->{$pid}->{c_id}); + } }elsif($dt1 >= $dt2_48h_occupied){ - $todo = "48h_occupied"; - $smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}); - print $dt1 . ">=" . $dt2_48h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n"; + if($cttpos->{$pid}->{int33} != 2){ + $todo = "48h_occupied"; + print $dt1 . ">=" . $dt2_48h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n"; + $smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}); + $dbt->update_one($dbh,$update_pos,"int33=2",$cttpos->{$pid}->{c_id}); + } }elsif($dt1 >= $dt2_24h_occupied){ - $todo = "24h_occupied"; - $smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}); - print $dt1 . ">=" . $dt2_24h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n"; + if($cttpos->{$pid}->{int33} != 1){ + $todo = "24h_occupied"; + print $dt1 . ">=" . $dt2_24h_occupied . "|$todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n"; + $smstrans->sms_message($todo,$hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}); + $dbt->update_one($dbh,$update_pos,"int33=1",$cttpos->{$pid}->{c_id}); + } } } sleep 1;