mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-07-17 02:07:26 +02:00
CMS-Text for SMS messaging
This commit is contained in:
parent
1744cd35a3
commit
de824a241a
4 changed files with 61 additions and 29 deletions
|
@ -8,7 +8,7 @@
|
|||
#./src/scripts/sms_message.pl shareedms-operator '24h_occupied' '' ''
|
||||
#
|
||||
#SMS message locking_progress after 60sec
|
||||
#./src/scripts/sms_message.pl shareeapp-operator locking_progress '0179xxxx372' $pos_id
|
||||
#./src/scripts/sms_message.pl shareeapp-operator locking_progress $adr_id $pos_id
|
||||
#
|
||||
#SMS theftalarm
|
||||
#./src/scripts/sms_message.pl shareedms-operator 'send_alarm2hotline' '' '18498'
|
||||
|
@ -24,6 +24,7 @@ use lib "/var/www/copri-bike/$syshost/src";
|
|||
use strict;
|
||||
use warnings;
|
||||
use POSIX;
|
||||
use Scalar::Util qw(looks_like_number);
|
||||
use DateTime;
|
||||
use DateTime::Format::Pg;
|
||||
use Lib::Config;
|
||||
|
@ -37,7 +38,7 @@ my $dbt = new DBtank;
|
|||
my $smstrans = new SMSTransport;
|
||||
|
||||
my $todo = $ARGV[1] || die 'todo not defined';
|
||||
my $phone = $ARGV[2] || "";
|
||||
my $adr_id = $ARGV[2] || "";
|
||||
my $pos_id = $ARGV[3] || "";
|
||||
my $dbh = "";
|
||||
my $oprefix = $dbt->{operator}->{$varenv{dbname}}->{oprefix} || "";
|
||||
|
@ -53,8 +54,7 @@ my $record_cc = { c_id => 0 };
|
|||
$record_cc = $dbt->fetch_record($dbh,$pref_cc);
|
||||
my $contact_hotline = "";
|
||||
$record_cc->{txt07} =~ s/\s//g;
|
||||
$contact_hotline = "Hotline $record_cc->{txt01} $record_cc->{txt07}";
|
||||
|
||||
$contact_hotline = "Hotline $record_cc->{txt01} $record_cc->{txt08}, $record_cc->{txt07}";
|
||||
|
||||
#SMS message if 24h,48h,72h occupied
|
||||
if($todo eq "24h_occupied"){
|
||||
|
@ -88,8 +88,8 @@ if($todo eq "24h_occupied"){
|
|||
if($dt1 >= $dt2_72h_occupied){
|
||||
if($cttpos->{$pid}->{int33} != 3){
|
||||
$todo = "72h_occupied";
|
||||
print $dt1 . ">=" . $dt2_72h_occupied . "|$todo,$contact_hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
|
||||
$smstrans->sms_message($todo,$contact_hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
|
||||
print $dt1 . ">=" . $dt2_72h_occupied . "|$todo,$contact_hotline,$cttpos->{$pid}->{ca_id},$cttpos->{$pid}->{ct_name}\n";
|
||||
$smstrans->sms_message($todo,$contact_hotline,$cttpos->{$pid}->{ca_id},"",$cttpos->{$pid}->{ct_name});
|
||||
$dbt->update_one($dbh,$update_pos,"int33=3",$cttpos->{$pid}->{c_id});
|
||||
}
|
||||
}
|
||||
|
@ -97,16 +97,16 @@ if($todo eq "24h_occupied"){
|
|||
#elsif($dt1 >= $dt2_48h_occupied){
|
||||
# if($cttpos->{$pid}->{int33} != 2){
|
||||
# $todo = "48h_occupied";
|
||||
# print $dt1 . ">=" . $dt2_48h_occupied . "|$todo,$contact_hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
|
||||
# $smstrans->sms_message($todo,$contact_hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
|
||||
# print $dt1 . ">=" . $dt2_48h_occupied . "|$todo,$contact_hotline,$cttpos->{$pid}->{ca_id},$cttpos->{$pid}->{ct_name}\n";
|
||||
# $smstrans->sms_message($todo,$contact_hotline,$cttpos->{$pid}->{ca_id},"",$cttpos->{$pid}->{ct_name});
|
||||
# $dbt->update_one($dbh,$update_pos,"int33=2",$cttpos->{$pid}->{c_id});
|
||||
# }
|
||||
#}
|
||||
elsif($dt1 >= $dt2_24h_occupied){
|
||||
if($cttpos->{$pid}->{int33} != 1){
|
||||
$todo = "24h_occupied";
|
||||
print $dt1 . ">=" . $dt2_24h_occupied . "|$todo,$contact_hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name}\n";
|
||||
$smstrans->sms_message($todo,$contact_hotline,$cttpos->{$pid}->{phone},$cttpos->{$pid}->{ct_name});
|
||||
print $dt1 . ">=" . $dt2_24h_occupied . "|$todo,$contact_hotline,$cttpos->{$pid}->{ca_id},$cttpos->{$pid}->{ct_name}\n";
|
||||
$smstrans->sms_message($todo,$contact_hotline,$cttpos->{$pid}->{ca_id},"",$cttpos->{$pid}->{ct_name});
|
||||
$dbt->update_one($dbh,$update_pos,"int33=1",$cttpos->{$pid}->{c_id});
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ if($todo eq "24h_occupied"){
|
|||
}#end
|
||||
|
||||
#SMS message locking_progress after 60sec
|
||||
if($todo eq "locking_progress" && $phone && $pos_id){
|
||||
if($todo eq "locking_progress" && $adr_id && $pos_id){
|
||||
sleep 60;
|
||||
#select booking pos if lock_state=locking still set
|
||||
my $booking_pos = {
|
||||
|
@ -129,7 +129,7 @@ if($todo eq "locking_progress" && $phone && $pos_id){
|
|||
my $booking = { c_id => 0 };
|
||||
$booking = $dbt->fetch_tablerecord($dbh,$booking_pos);
|
||||
if($booking->{int20} == 3){
|
||||
$smstrans->sms_message($todo,$contact_hotline,$phone,$booking->{ct_name});
|
||||
$smstrans->sms_message($todo,$contact_hotline,$adr_id,"",$booking->{ct_name});
|
||||
}
|
||||
}#end
|
||||
|
||||
|
@ -164,10 +164,10 @@ if($todo eq "send_alarm2hotline" && $pos_id){
|
|||
my @alarm_phone = ("$dbt->{copri_conf}->{sms_to_alarm}");
|
||||
@alarm_phone = split(/\|/,$dbt->{copri_conf}->{sms_to_alarm}) if($dbt->{copri_conf}->{sms_to_alarm} =~ /\|/);
|
||||
foreach(@alarm_phone){
|
||||
$smstrans->sms_message($todo,"",$_,"$oprefix$ct->{barcode}");
|
||||
$smstrans->sms_message($todo,"","",$_,"$oprefix$ct->{barcode}");
|
||||
}
|
||||
}else{
|
||||
$smstrans->sms_message($todo,"",$phone,"$oprefix$ct->{barcode}");
|
||||
$smstrans->sms_message($todo,"","",$phone,"$oprefix$ct->{barcode}");
|
||||
}
|
||||
|
||||
}#end
|
||||
|
@ -186,7 +186,7 @@ if($todo eq "fraud_rental" && $pos_id){
|
|||
my $booking = { c_id => 0 };
|
||||
$booking = $dbt->fetch_tablerecord($dbh,$booking_pos);
|
||||
|
||||
$smstrans->sms_message($todo,"",$sms_to,$booking->{ct_name});
|
||||
$smstrans->sms_message($todo,"","",$sms_to,$booking->{ct_name});
|
||||
|
||||
}#end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue