mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-07-12 00:16:26 +02:00
sms_message if lock_state=locking
This commit is contained in:
parent
beb2d92f71
commit
7b24b1dca8
4 changed files with 100 additions and 2 deletions
45
copri4/main/src/scripts/sms_message.pl
Executable file
45
copri4/main/src/scripts/sms_message.pl
Executable file
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/perl
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
# Copyright (c) Rainer Gümpelein, TeilRad GmbH
|
||||
#
|
||||
#sudo su www-data -c "./src/scripts/sms_message.pl shareeapp-operator locking_progress '0179xxxx372' $pos_id"
|
||||
#
|
||||
use vars qw($syshost);
|
||||
|
||||
BEGIN {
|
||||
$syshost = $ARGV[0] || die 'syshost not defined';
|
||||
}
|
||||
|
||||
use lib "/var/www/copri-bike/$syshost/src";
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use POSIX;
|
||||
use Mod::DBtank;
|
||||
use Mod::SMSTransport;
|
||||
|
||||
my $dbt = new DBtank;
|
||||
my $smstrans = new SMSTransport;
|
||||
|
||||
my $todo = $ARGV[1] || die 'todo not defined';
|
||||
my $phone = $ARGV[2] || die 'phone not defined';
|
||||
my $pos_id = $ARGV[3] || die 'no booking id available';
|
||||
my $dbh = "";
|
||||
|
||||
if($todo eq "locking_progress"){
|
||||
sleep 45;
|
||||
#select booking pos if lock_state=locking still set
|
||||
my $booking_pos = {
|
||||
table => "contenttranspos",
|
||||
fetch => "one",
|
||||
c_id => "$pos_id",
|
||||
};
|
||||
|
||||
my $booking = { c_id => 0 };
|
||||
$booking = $dbt->fetch_tablerecord($dbh,$booking_pos);
|
||||
if($booking->{int20} == 3){
|
||||
$smstrans->sms_message($phone,$booking->{ct_name});
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue