mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-02-22 11:46:27 +01:00
sigo lock_state unlocking
This commit is contained in:
parent
c40f326d37
commit
5870071d1b
6 changed files with 26 additions and 7 deletions
|
@ -1086,7 +1086,7 @@ sub booking_update(){
|
|||
}#end if $state =~ /canceled|occupied|available/
|
||||
|
||||
|
||||
if($lock_state && $lock_state =~ /locking|locked|unlocked/ && $record_pos->{cc_id} && $record_pos->{cc_id} > 0){
|
||||
if($lock_state && $lock_state =~ /locking|locked|unlocking|unlocked/ && $record_pos->{cc_id} && $record_pos->{cc_id} > 0){
|
||||
#content
|
||||
my $update_cc = {
|
||||
table => "content",
|
||||
|
@ -1186,7 +1186,6 @@ sub booking_update(){
|
|||
$lock_value = 2;
|
||||
$update_cc->{int20} = "$lock_value";
|
||||
$update_pos->{int20} = "$lock_value";
|
||||
$update_pos->{int23} = "$geo_distance";
|
||||
if($state){
|
||||
$booking_values->{response_state} .= " OK: bike " . $q->param('bike') . " unlocked confirmed";
|
||||
$booking_values->{response_text} .= " Aufschließen von Fahrrad Nr. " . $q->param('bike') . " bestätigt";
|
||||
|
@ -1211,7 +1210,17 @@ sub booking_update(){
|
|||
system("$varenv{basedir}/src/scripts/sms_message.pl $varenv{syshost} locking_progress $auth->{txt07} $record_pos->{c_id} &");
|
||||
}
|
||||
$update_pos->{int32} = $record_pos->{int32} + 1;#sms_message sent marker
|
||||
|
||||
}elsif($lock_state eq "unlocking"){
|
||||
$lock_value = 4;
|
||||
$update_cc->{int20} = "$lock_value";
|
||||
$update_pos->{int20} = "$lock_value";
|
||||
if($state){
|
||||
$booking_values->{response_state} .= " OK: bike " . $q->param('bike') . " unlocking in progress";
|
||||
$booking_values->{response_text} .= " Aufschließen von Fahrrad Nr. " . $q->param('bike') . " ist im Prozess.";
|
||||
}else{
|
||||
$booking_values->{response_state} = "OK: bike " . $q->param('bike') . " unlocking in progress";
|
||||
$booking_values->{response_text} = "Aufschließen von Fahrrad Nr. " . $q->param('bike') . " ist im Prozess.";
|
||||
}
|
||||
}
|
||||
|
||||
$dbt->update_record($dbh,$update_pos,$record_pos);
|
||||
|
@ -1234,6 +1243,7 @@ sub booking_update(){
|
|||
$booking_values->{lock_state} = "locked" if($booking->{int20} == 1);
|
||||
$booking_values->{lock_state} = "unlocked" if($booking->{int20} == 2);
|
||||
$booking_values->{lock_state} = "locking" if($booking->{int20} == 3);
|
||||
$booking_values->{lock_state} = "unlocking" if($booking->{int20} == 4);
|
||||
|
||||
#fetch tracking distance on Ilockit cloud by summary trip if(tracking && deviceId && available)
|
||||
if($booking->{int25} == 1 && $booking->{int10} == 1){
|
||||
|
@ -1475,6 +1485,7 @@ sub bikes_available(){
|
|||
$return->{$id}->{lock_state} = "locked" if($record->{$id}->{int20} == 1);
|
||||
$return->{$id}->{lock_state} = "unlocked" if($record->{$id}->{int20} == 2);
|
||||
$return->{$id}->{lock_state} = "locking" if($record->{$id}->{int20} == 3);
|
||||
$return->{$id}->{lock_state} = "unlocking" if($record->{$id}->{int20} == 4);
|
||||
$return->{$id}->{bike_group} = ["$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{main_id}"];
|
||||
|
||||
if($record->{$id}->{int11} eq "2"){
|
||||
|
@ -1585,6 +1596,7 @@ sub bikes_all(){
|
|||
$return->{$id}->{lock_state} = "locked" if($record->{$id}->{int20} == 1);
|
||||
$return->{$id}->{lock_state} = "unlocked" if($record->{$id}->{int20} == 2);
|
||||
$return->{$id}->{lock_state} = "locking" if($record->{$id}->{int20} == 3);
|
||||
$return->{$id}->{lock_state} = "unlocking" if($record->{$id}->{int20} == 4);
|
||||
$return->{$id}->{bike_group} = ["$dbt->{operator}->{$varenv->{dbname}}->{oprefix}$record->{$id}->{main_id}"];
|
||||
|
||||
if($record->{$id}->{int11} eq "2"){
|
||||
|
|
|
@ -282,7 +282,7 @@ elsif($q->param('request') eq "booking_cancel" || $q->param('request') eq "booki
|
|||
if($q->param('request') eq "booking_update" && $q->param('state') && $q->param('state') =~ /canceled/){
|
||||
($rows, my $booking_values) = $apif->booking_update($q,\%varenv,$authraw,$aowner);
|
||||
$response = {%$response, %$booking_values};
|
||||
}elsif($q->param('request') eq "booking_update" && (($q->param('state') && $q->param('state') =~ /occupied|available/) || ($q->param('lock_state') && $q->param('lock_state') =~ /locking|locked|unlocked/))){
|
||||
}elsif($q->param('request') eq "booking_update" && (($q->param('state') && $q->param('state') =~ /occupied|available/) || ($q->param('lock_state') && $q->param('lock_state') =~ /locking|locked|unlocking|unlocked/))){
|
||||
($rows, my $booking_values) = $apif->booking_update($q,\%varenv,$authraw,$aowner);
|
||||
$response = {%$response, %$booking_values};
|
||||
|
||||
|
|
|
@ -306,7 +306,7 @@ sub selector_class(){
|
|||
my $value = $opt;
|
||||
($id,$value) = split /:/,$opt if($opt =~ /\:/);
|
||||
$des_style = "color:grey;" if(!$id);
|
||||
if("$sel" eq "$id"){
|
||||
if($sel && $sel eq $id){
|
||||
push @selopt, "<option style='$des_style' selected value='$id'>$value</option>\n";
|
||||
}else{
|
||||
push @selopt, "<option style='$des_style' value='$id'>$value</option>\n";
|
||||
|
@ -326,7 +326,7 @@ sub selector_byidclass(){
|
|||
my $id = $opt;
|
||||
my $value = $opt;
|
||||
($id,$value) = split /:/,$opt if($opt =~ /\w+\:.*/);
|
||||
if("$sel" eq "$id"){
|
||||
if($sel && $sel eq $id){
|
||||
push @selopt, "<option selected value=\"$id\">$value</option>\n";
|
||||
}else{
|
||||
push @selopt, "<option value=\"$id\">$value</option>\n";
|
||||
|
|
|
@ -180,6 +180,7 @@ sub sharee_pricing(){
|
|||
$return->{lock_state} = "locked" if($ctpos->{int20} == 1);
|
||||
$return->{lock_state} = "unlocked" if($ctpos->{int20} == 2);
|
||||
$return->{lock_state} = "locking" if($ctpos->{int20} == 3);
|
||||
$return->{lock_state} = "unlocking" if($ctpos->{int20} == 4);
|
||||
}
|
||||
}
|
||||
$bw->log("hour computed:",$logging,"");
|
||||
|
|
|
@ -408,6 +408,7 @@ sub tpl(){
|
|||
$lock_state = "locked" if($cttpos->{$pid}->{int20} == 1);
|
||||
$lock_state = "<span style='color:#c63e3e;'>unlocked</span>" if($cttpos->{$pid}->{int20} == 2);
|
||||
$lock_state = "<span style='color:#c63e3e;'>locking in progress</span>" if($cttpos->{$pid}->{int20} == 3);
|
||||
$lock_state = "<span style='color:#c63e3e;'>unlocking in progress</span>" if($cttpos->{$pid}->{int20} == 4);
|
||||
if($cttpos->{$pid}->{int20} ne $ct4rel_ware->{$cttpos->{$pid}->{cc_id}}->{int20}){
|
||||
$lock_state = "<span style='border: 1px solid #c63e3e;'>$dbt->{copri_conf}->{lock_state}->{$cttpos->{$pid}->{int20}}</span>";
|
||||
}
|
||||
|
|
|
@ -191,14 +191,19 @@ my $booking_update_locking = "$uriop?request=booking_update&bike=$bike&lock_stat
|
|||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_locking"},"[ booking_update_locking ]---> $booking_update_locking")),"\n";
|
||||
my $booking_update_locked = "$uriop?request=booking_update&bike=$bike&lock_state=locked$and_station_state_locked&authcookie=$coo";
|
||||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_locked"},"[ booking_update_locked ]---> $booking_update_locked")),"\n";
|
||||
my $booking_update_unlocking = "$uriop?request=booking_update&bike=$bike&lock_state=unlocking$and_station_state_unlocked&voltage=39&authcookie=$coo";
|
||||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_unlocking"},"[ booking_update_unlocking ]---> $booking_update_unlocking")),"\n";
|
||||
my $booking_update_unlocked = "$uriop?request=booking_update&bike=$bike&lock_state=unlocked$and_station_state_unlocked&voltage=39&authcookie=$coo";
|
||||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_unlocked"},"[ booking_update_unlocked ]---> $booking_update_unlocked")),"\n";
|
||||
|
||||
my $booking_update_oc_ul = "$uriop?request=booking_update&bike=$bike&state=occupied&lock_state=unlocked$and_station_state_unlocked&authcookie=$coo";
|
||||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_oc_ul"},"[ booking_update_oc_ul ]---> $booking_update_oc_ul")),"\n";
|
||||
|
||||
my $booking_request_oc_uling = "$uriop?request=booking_request&bike=$bike&state=occupied&lock_state=unlocking$and_station_state_unlocked&authcookie=$coo";
|
||||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_request_oc_uling"},"[ booking_request_oc_unlocking ]---> $booking_request_oc_uling")),"\n";
|
||||
|
||||
my $booking_request_oc_ul = "$uriop?request=booking_request&bike=$bike&state=occupied&lock_state=unlocked$and_station_state_unlocked&authcookie=$coo";
|
||||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_request_oc_ul"},"[ booking_request_oc_ul ]---> $booking_request_oc_ul")),"\n";
|
||||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_request_oc_ul"},"[ booking_request_oc_unlocked ]---> $booking_request_oc_ul")),"\n";
|
||||
|
||||
my $booking_update_av_lo = "$uriop?request=booking_update&bike=$bike&state=available&lock_state=locked$and_station_state_locked&latitude=$latitude&longitude=$longitude&gps_age=300&user_device_manufaturer=samsung)&user_device_model=SM-G398FN&user_device_platform=Android&user_device_version=10&user_device_id=90af86831c10374d&authcookie=$coo";
|
||||
print $q->div({-style=>'margin:15px;'},$q->a({-target=>'_blank', -href=>"$booking_update_av_lo"},"[ booking_update_av_lo ]---> $booking_update_av_lo")),"\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue