<?php

// include "LN_loginext_include.php";
// require_once("../include/dbconnect.inc.php");
// function createCounter() {

//     global $tokenFile, $db;

//     $selectVehicleCounterSQL = "INSERT INTO phoenix.genericdatacontainer (gdc_obj_type, gdc_obj_id, gdc_gen_fieldname, gdc_content, gdc_context) VALUES ('cr_virtual', '1', 'ups_vehicle_counter', '4000', '')";
//     $selectVehicleCounter = $db->query($selectVehicleCounterSQL);

//     // $updateVehicleCounterSQL = "UPDATE phoenix.genericdatacontainer SET gdc_content = '". $selectVehicleCounter['gdc_content']+1 ."' WHERE gdc_gen_fieldname = 'ups_vehicle_counter'";
//     // $updateVehicleCounter = $db->query($updateVehicleCounterSQL);

//     return $selectVehicleCounter;

// }

// function getCounter() {

//     global $tokenFile, $db;

//     $selectVehicleCounterSQL = "SELECT gdc_content FROM phoenix.genericdatacontainer WHERE gdc_obj_type = 'cr_virtual' AND gdc_obj_id = '1' AND gdc_gen_fieldname = 'ups_vehicle_counter'";
//     $selectVehicleCounter = $db->query($selectVehicleCounterSQL);
//     $selectVehicleCounter = $selectVehicleCounter->fetch_assoc();
//     $vehicleCounter = $selectVehicleCounter['gdc_content'];
//     $tempCounter = $selectVehicleCounter['gdc_content'] + 1;

//     $updateVehicleCounterSQL = "UPDATE phoenix.genericdatacontainer SET gdc_content = '". $tempCounter ."' WHERE gdc_gen_fieldname = 'ups_vehicle_counter' AND gdc_obj_type = 'cr_virtual' AND gdc_obj_id = '1'";
//     $updateVehicleCounter = $db->query($updateVehicleCounterSQL);

//     return $vehicleCounter;
// }

// // var_dump(createCounter());
// var_dump(getCounter());

//logiNextMileOrderGet();
//logiNextMileDeliveryAssociateCreate();
//generateToken();


/*-----------------------StartTrip------------------------------*/
//$OrderReferenceId = array(
//    "938a928824b34a768223e968e1d26ea4"
//);
//
////$OrderReferenceId = "f40cf4493a5949199775499b5750a272";
//
//var_dump(lnStartTrip($OrderReferenceId));

///*-----------------------StopTrip------------------------------*/

//$OrderReferenceIds = array(
//    "938a928824b34a768223e968e1d26ea4",
//);
//
////$OrderReferenceId = "f40cf4493a5949199775499b5750a272";
//
//var_dump(lnStopTrip($OrderReferenceIds));
///*-------------------------send Tracking Info----------------------------*/
// $locationData = array(
//    "STVH1422_322143213" => array(
//        "latitude" => 48.70618,
//        "longitude" => 9.236693,
//    ),
//    "STVH1421_38934897" => array(
//        "latitude" => 48.79542,
//        "longitude" => 9.672859,
//    )
// );

// var_dump(lnCreateTracking($locationData));

//"newStatus" => $orderStatusData['status'],
//        "orderDetails" => array(
//    array(
//        "orderReferenceId" => $orderStatusData['orderReferenceId'],
//        "reasonCd" => $orderStatusData['reasonCd'],
//        "otherReason" => "",
//        "latitude" => $orderStatusData['latitude'],
//        "longitude" => $orderStatusData['longitude'],
//        "updateTime" => $orderStatusData['updateTime']

//$orderStatusData = array(
//    "orderReferenceId" => "938a928824b34a768223e968e1d26ea4",
//    "status" => "DELIVERED",
//    "updateTime" => "2018-02-08T09:30:00Z",
//    "reasonCd" => "REASON"
//);
//
//var_dump(lnUpdateOrderStatus($orderStatusData));

// $orderStatusData = array(
//     "orderReferenceId" => "0c0ae9fd99af433ab5fbf9644a3640c8",
//     "status" => "PICKEDUP",
//     "updateTime" => "2021-02-19T11:30:49Z",
//     "reasonCd" => "REASON"
// );

// var_dump(lnUpdateOrderStatus($orderStatusData));

//$orderPickedUp = array(
//    "orderReferenceIds" => array(
//        "6b106144208243ffb4b8c4114fd44f123d",
//        "6b106144208243ffb4b8c4114fd44f123d"
//    ),
//    "checkInLocation" => "PICKUP",
//    "checkInTime" => "2018-02-08T09:30:00Z",
//);

//$orderPickedUp = array(
//    "03f70b3ffcbd4727b52f1e7b429ee865"
//);
//
//var_dump(logiNextMileMobileCheckIn($orderPickedUp));
//
// var_dump(generateAssociateToken("STVH1371"));

//$data = array(
//    "costcenter" => "JUNIPER NETWORKS-EMEA GOOD INVENTORY",
//    "origin"  => "Am Kronberger Hang 3,Schwalbach am Taunus,GERMANY,65824",
//    "destination"  => "Veenderveld 37,Roelofarendsveen,NETHERLANDS,2371 TT"
//);
//
//var_dump(getAuthHeaderVotian($data));

// var_dump(getAvailableDummyVehicle("_34575437"));

// var_dump(generateToken());
// $myfile = fopen(dirname(__FILE__)."/"."webhookLogNew.txt", "a");
// fwrite($myfile, "TESTTEST\n");
// fwrite($myfile, "\n");
// fwrite($myfile, "\n");
// fclose($myfile);

// var_dump($myfile);
// $crUsrID = 858858;
// $timestamp = "2022-03-22 05:08:34";

// var_dump($crUsrID);
// var_dump($timestamp);

// var_dump(votianGetLastTrackStatusUpdate($crUsrID, $timestamp));

var_dump(date("m-Y"));

// $orderStatusData = array(
//                "orderReferenceId" => $orderReferenceId,
//                "status" => "PICKEDUP",
//                "updateTime" => $trFinishtime,
//                "reasonText" => "",
//                "reasonCd" => "",
//                "recipientName" => "",
//                "crID" => $crId,
//                "crUsrID" => $crUsrId
//            );

// $orderStatusData = array(
//    "orderReferenceId" => "938a928824b34a768223e968e1d26ea4",
//    "status" => "DELIVERED",
//    "updateTime" => "2022-03-22 05:08:34",
//    "reasonCd" => "REASON",
//    "crID" => "",
//    "crUsrID" => "858858"
// );
// var_dump(lnUpdateOrderStatus($orderStatusData));
var_dump(date("m-Y"));