Plugin Directory

Changeset 3753931


Ignore:
Timestamp:
10/19/2026 04:09:42 AM (72 minutes ago)
Author:
bandido
Message:

Version 1.19.9

Location:
nova-poshta-ttn
Files:
416 added
4 edited

Legend:

Unmodified
Added
Removed
  • nova-poshta-ttn/trunk/README.txt

    r3336362 r3753931  
    33Tags: Nova Poshta, нова пошта, новая почта, нова почта
    44Requires at least: 5.0
    5 Tested up to: 6.7
     5Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.19.8
     7Stable tag: 1.19.9
    88License: GPLv2
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    … …  
    111111== Що нового? ==
    112112
     113= 1.19.9 =
     114* WP 7.1 - сумісний
     115
    113116= 1.19.8 =
    114117* [fix] виправили завантаження відділень
  • nova-poshta-ttn/trunk/includes/class-morkvanp-plugin-loader.php

    r3129422 r3753931  
    149149
    150150        add_action( 'wp_ajax_mrkv_np_remove_ttn', array( $this, 'mrkv_np_remove_ttn_func' ) );
    151         add_action( 'wp_ajax_nopriv_mrkv_np_remove_ttn', array( $this, 'mrkv_np_remove_ttn_func' ) );
    152151
    153152        # Add order column
    … …  
    14391438            echo '<a style="margin: 5px;" href="https://my.novaposhta.ua/orders/printMarkings/orders[]/' . $invoice_number . '/type/pdf/apiKey/' . $api_key . '" class="button" target="_blank">' . '<img src="' . plugins_url('img/003-barcode.png', __FILE__) . '" height="15" width="15"  />' . ' Друк стікера</a>';
    14401439            echo '<div style="margin: 5px;" href="" class="button mrkv-np-remove-ttn" target="_blank">' . '<img src="' . plugins_url('img/001-delete-button.png', __FILE__) . '" height="15" width="15"  />' . __('Видалити накладну', 'nova-poshta-ttn') . '</div>';
     1440            $nonce = wp_create_nonce('mrkv_np_remove_ttn_nonce');
    14411441            echo '<script>
    14421442                jQuery(".mrkv-np-remove-ttn").click(function(event){
    14431443                    event.preventDefault();
    14441444                    jQuery.ajax({
    1445                         url: "'. admin_url( "admin-ajax.php" ) . '",
     1445                        url: "' . admin_url( "admin-ajax.php" ) . '",
    14461446                        type: "POST",
    1447                         data: "action=mrkv_np_remove_ttn&order_id=' . $order_id . '&ttn=' . $invoice_number . '",
     1447                        data: {
     1448                            action: "mrkv_np_remove_ttn",
     1449                            order_id: ' . intval($order_id) . ',
     1450                            ttn: "' . esc_js($invoice_number) . '",
     1451                            nonce: "' . esc_js($nonce) . '"
     1452                        },
    14481453                        success: function( data ) {
    14491454                            location.reload();
    … …  
    15151520    public function mrkv_np_remove_ttn_func()
    15161521    {
    1517         # Check order id
    1518         if(isset($_POST['order_id']) && isset($_POST['ttn']))
    1519         {
    1520             # Get order data
    1521             $invoice_number = $_POST['ttn'];
    1522             $order_id = $_POST['order_id'];
    1523 
    1524             # Get api key
    1525             $api_key = get_option('mrkvnp_sender_api_key');
    1526             $api_url = 'https://api.novaposhta.ua/v2.0/json/';
    1527 
    1528             # Get invoice ref
    1529             global $wpdb;
    1530             $resultstring = "SELECT `invoice_ref` FROM {$wpdb->prefix}novaposhta_ttn_invoices WHERE `order_id` = '{$order_id}'";
    1531             $invoice_ref = $wpdb->get_var($resultstring);
    1532 
    1533             # Check invoice ref
    1534             if($invoice_ref)
    1535             {
    1536                 # Set method delete
    1537                 $methodProperties_delete = array(
    1538                     "DocumentRefs" => $invoice_ref
    1539                 );
    1540 
    1541                 # Create params for delete
    1542                 $deleteBulkInvoices = array(
    1543                     "apiKey" => $api_key,
    1544                     "modelName" => "InternetDocument",
    1545                     "calledMethod" => "delete",
    1546                     "methodProperties" => $methodProperties_delete
    1547                 );
    1548 
    1549                 # Set args data
    1550                 $args = array(
    1551                     'timeout' => 30,
    1552                     'redirection' => 10,
    1553                     'httpversion' => '1.0',
    1554                     'blocking' => true,
    1555                     'headers' => array( "content-type" => "application/json" ),
    1556                     'body' => \json_encode( $deleteBulkInvoices ),
    1557                     'cookies' => array(),
    1558                     'sslverify' => false,
    1559                 );
    1560 
    1561                 # Send request
    1562                 $response = wp_remote_post( $api_url, $args );
    1563 
    1564                 # Set database name
    1565                 $delete_table_name = $wpdb->prefix . 'novaposhta_ttn_invoices';
    1566                 # Set database name
    1567                 $delete_table_name_meta = $wpdb->prefix . 'postmeta';
    1568 
    1569                 if(class_exists( \Automattic\WooCommerce\Utilities\OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled())
    1570                 {
    1571                     $order = wc_get_order( $order_id );
    1572                     # Delete ttn meta
    1573                     $order->delete_meta_data( "novaposhta_ttn" );
    1574 
    1575                     $order->save();
    1576                 }
    1577                 else
    1578                 {
    1579                     # Delete ttn meta
    1580                     delete_post_meta( $order_id , "novaposhta_ttn" );
    1581                 }
    1582 
    1583                 # Delete ttn from db
    1584                 $delete_from_db = $wpdb->delete( $delete_table_name, array( 'invoice_ref' => $invoice_ref ) );
    1585 
    1586                 # Delete ttn from db
    1587                 $delete_from_db = $wpdb->delete( $delete_table_name_meta, array( 'post_id' => $order_id, 'meta_key' => 'novaposhta_ttn' ) );
     1522        if (!current_user_can('edit_shop_orders')) {
     1523            wp_send_json_error(__('You do not have permission to edit orders.', 'nova-poshta-ttn'), 403);
     1524        }
     1525
     1526        if (!isset($_POST['nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['nonce'])), 'mrkv_np_remove_ttn_nonce')) {
     1527            wp_send_json_error(__('Security check failed.', 'nova-poshta-ttn'), 403);
     1528        }
     1529
     1530        if (empty($_POST['order_id']) || empty($_POST['ttn'])) {
     1531            wp_send_json_error(__('Invalid parameters.', 'nova-poshta-ttn'), 400);
     1532        }
     1533
     1534        $order_id = absint($_POST['order_id']);
     1535        $invoice_number = sanitize_text_field(wp_unslash($_POST['ttn']));
     1536
     1537        global $wpdb;
     1538        $table_name = $wpdb->prefix . 'novaposhta_ttn_invoices';
     1539       
     1540        $invoice_ref = $wpdb->get_var($wpdb->prepare(
     1541            "SELECT invoice_ref FROM {$table_name} WHERE order_id = %d AND (invoice_number = %s OR invoice_ref = %s)",
     1542            $order_id,
     1543            $invoice_number,
     1544            $invoice_number
     1545        ));
     1546
     1547        if (!$invoice_ref) {
     1548            wp_send_json_error(__('Waybill not found for this order.', 'nova-poshta-ttn'), 404);
     1549        }
     1550
     1551        $api_key = get_option('mrkvnp_sender_api_key');
     1552        $api_url = 'https://api.novaposhta.ua/v2.0/json/';
     1553
     1554        $deleteBulkInvoices = array(
     1555            "apiKey" => $api_key,
     1556            "modelName" => "InternetDocument",
     1557            "calledMethod" => "delete",
     1558            "methodProperties" => array(
     1559                "DocumentRefs" => $invoice_ref
     1560            )
     1561        );
     1562
     1563        $args = array(
     1564            'timeout'     => 30,
     1565            'redirection' => 10,
     1566            'httpversion' => '1.0',
     1567            'blocking'    => true,
     1568            'headers'     => array("content-type" => "application/json"),
     1569            'body'        => json_encode($deleteBulkInvoices),
     1570            'cookies'     => array(),
     1571            'sslverify'   => true,
     1572        );
     1573
     1574        $response = wp_remote_post($api_url, $args);
     1575
     1576        if (is_wp_error($response)) {
     1577            wp_send_json_error(__('API connection error.', 'nova-poshta-ttn'), 500);
     1578        }
     1579
     1580        $body = wp_remote_retrieve_body($response);
     1581        $data = json_decode($body, true);
     1582
     1583        if (isset($data['success']) && $data['success'] === false) {
     1584            $error_messages = isset($data['errors']) ? implode(', ', $data['errors']) : __('Unknown API error', 'nova-poshta-ttn');
     1585            wp_send_json_error($error_messages, 400);
     1586        }
     1587
     1588        if (class_exists(\Automattic\WooCommerce\Utilities\OrderUtil::class) && \Automattic\WooCommerce\Utilities\OrderUtil::custom_orders_table_usage_is_enabled()) {
     1589            $order = wc_get_order($order_id);
     1590            if ($order) {
     1591                $order->delete_meta_data("novaposhta_ttn");
     1592                $order->save();
    15881593            }
    1589 
    1590             die;
    1591         }   
     1594        } else {
     1595            delete_post_meta($order_id, "novaposhta_ttn");
     1596        }
     1597
     1598        $wpdb->delete($table_name, array('invoice_ref' => $invoice_ref));
     1599       
     1600        $delete_table_name_meta = $wpdb->prefix . 'postmeta';
     1601        $wpdb->delete($delete_table_name_meta, array('post_id' => $order_id, 'meta_key' => 'novaposhta_ttn'));
     1602
     1603        wp_send_json_success(__('Waybill removed successfully.', 'nova-poshta-ttn'));
    15921604    }
    15931605
  • nova-poshta-ttn/trunk/nova-poshta-ttn.php

    r3267676 r3753931  
    44 * Plugin URI: https://morkva.co.ua/shop/nova-poshta-ttn-pro-lifetime
    55 * Description: Плагін 2-в-1: спосіб доставки Нова Пошта та генерація накладних Нова Пошта.
    6  * Version: 1.19.8
     6 * Version: 1.19.9
    77 * Author: MORKVA
    88 * Text Domain: nova-poshta-ttn
    99 * Domain Path: /i18n/
    10  * Tested up to: 6.7
     10 * Tested up to: 7.1
    1111 * WC requires at least: 3.8
    1212 * WC tested up to: 9.4
    … …  
    895895    delete_transient( 'mrkv-admin-novaposhta-settings' );
    896896}
     897
     898add_action('admin_notices', 'mrkv_np_deprecate_notice');
     899
     900function mrkv_np_deprecate_notice() {
     901    if (get_user_meta(get_current_user_id(), 'mrkv_np_deprecated_notice_dismissed', true)) {
     902        return;
     903    }
     904
     905    if (!current_user_can('manage_woocommerce') && !current_user_can('activate_plugins')) {
     906        return;
     907    }
     908
     909    $plugin_url = 'https://wordpress.org/plugins/morkva-ua-shipping/';
     910   
     911    ?>
     912    <div class="notice notice-warning is-dismissible" id="mrkv-np-deprecated-notice">
     913        <p>
     914            <strong>Увага!</strong> Плагін Nova Poshta TTN для WooCommerce застарів і більше не підтримується.
     915            Будь ласка, переходьте на новий універсальний плагін
     916            <a href="<?php echo esc_url($plugin_url); ?>" target="_blank">Morkva UA Shipping</a>,
     917            який підтримує Нову Пошту, Укрпошту та сучасний блочний чекаут (Checkout Blocks)!
     918        </p>
     919    </div>
     920    <script>
     921    jQuery(document).ready(function($) {
     922        $(document).on('click', '#mrkv-np-deprecated-notice .notice-dismiss', function() {
     923            $.ajax({
     924                url: ajaxurl,
     925                type: 'POST',
     926                data: {
     927                    action: 'mrkv_np_dismiss_notice',
     928                    nonce: '<?php echo wp_create_nonce('mrkv_np_dismiss_nonce'); ?>'
     929                }
     930            });
     931        });
     932    });
     933    </script>
     934    <?php
     935}
     936
     937add_action('wp_ajax_mrkv_np_dismiss_notice', function() {
     938    check_ajax_referer('mrkv_np_dismiss_nonce', 'nonce');
     939   
     940    if (current_user_can('manage_woocommerce') || current_user_can('activate_plugins')) {
     941        update_user_meta(get_current_user_id(), 'mrkv_np_deprecated_notice_dismissed', true);
     942    }
     943   
     944    wp_die();
     945});
  • nova-poshta-ttn/trunk/public/partials/edit-ttn.php

    r3012378 r3753931  
    11<div class="wrap">
    2  <?php
    3  global $wpdb;
     2<?php
     3global $wpdb;
    44
    5  if(class_exists( \Automattic\WooCommerce\Utilities\OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled())
    6 {
    7   $order = wc_get_order( $_GET['invoice'] );
     5$invoice_get = isset($_GET['invoice']) ? sanitize_text_field(wp_unslash($_GET['invoice'])) : '';
    86
    9   $ttn = $order->get_meta('novaposhta_ttn');
     7if (class_exists( \Automattic\WooCommerce\Utilities\OrderUtil::class ) && OrderUtil::custom_orders_table_usage_is_enabled()) {
     8    $order = wc_get_order( $invoice_get );
     9    $ttn = $order ? $order->get_meta('novaposhta_ttn') : '';
     10    if ($order) {
     11        $order->save();
     12    }
     13} else {
     14    $ttn = get_post_meta( intval($invoice_get), 'novaposhta_ttn', true );
     15}
    1016
    11   $order->save();
    12 }
    13 else
    14 {
    15   $ttn = get_post_meta( $_GET['invoice'], 'novaposhta_ttn', true );
    16 }
    17  
     17$date = strtotime('-14 days');
     18$dd = date('d.m.Y', $date);
    1819
     20$methodProperties = array("Type" => "csv", "DateTime" => date('d.m.Y'), "DocumentRefs" => array($ttn));
     21$invoiceData = array(
     22    "apiKey" => $api_key,
     23    "modelName" => "InternetDocument",
     24    "calledMethod" => "generateReport",
     25    "methodProperties" => $methodProperties
     26);
    1927
    20   $date = strtotime('-14 days');
    21 $dd =  date('d.m.Y', $date);
    22 // print_r($dd);
    23 print_r(date('d.m.Y'));
     28$curl = curl_init();
     29$url = "https://api.novaposhta.ua/v2.0/json/";
    2430
    25   $methodProperties = array("Type"=>"csv","DateTime" => date('d.m.Y') ,"DocumentRefs" => array($ttn));
    26   $invoiceData = array(
    27     "apiKey" => $api_key,
    28       "modelName" => "InternetDocument",
    29       "calledMethod" => "generateReport",
    30       "methodProperties" => $methodProperties
    31   );
    32 
    33   $curl = curl_init();
    34 
    35   $url = "https://api.novaposhta.ua/v2.0/json/";
    36   curl_setopt_array($curl, array(
     31curl_setopt_array($curl, array(
    3732    CURLOPT_URL => $url,
    38     CURLOPT_RETURNTRANSFER => True,
     33    CURLOPT_RETURNTRANSFER => true,
    3934    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    4035    CURLOPT_CUSTOMREQUEST => "POST",
    4136    CURLOPT_POSTFIELDS => json_encode( $invoiceData ),
    42     CURLOPT_HTTPHEADER => array("content-type: application/json",),
    43   ));
     37    CURLOPT_HTTPHEADER => array("content-type: application/json"),
     38));
    4439
    45   $response = curl_exec( $curl );
    46   $error = curl_error( $curl );
    47   curl_close( $curl );
     40$response = curl_exec( $curl );
     41$error = curl_error( $curl );
     42curl_close( $curl );
    4843
    49   if ( $error ) {
     44$obj2 = array();
     45if ( !$error ) {
     46    $response_json = json_decode( $response, true );
     47    if ( is_array($response_json) ) {
     48        $obj2 = $response_json;
     49    }
     50}
    5051
    51   } else {
    52     $response_json = json_decode( $response, true );
     52$obj2data = isset($obj2['data']) ? $obj2['data'] : array();
     53if (is_array($obj2data)) {
     54    for($i = 0; $i < sizeof($obj2data); $i++){
     55        $element = $obj2data[$i];
     56        if(isset($element['IntDocNumber']) && $element['IntDocNumber'] == $ttn){
     57            $obj2 = $element;
     58            break;
     59        }
     60    }
     61}
     62?>
     63<div class="gridttn h3cont">
     64    <div>
     65        <h3 class="wp-heading-inline">ЕКСПРЕС-НАКЛАДНА <br> № <?php echo esc_html($ttn); ?></h3>
     66    </div>
     67    <div><br>Статус: <br>
     68        <?php echo isset($obj['Status']) ? esc_html($obj['Status']) : ''; ?>
     69        <br>Час: <br>
     70        <?php echo isset($obj2['DateTime']) ? esc_html($obj2['DateTime']) : ''; ?>
     71    </div>
     72</div>
    5373
     74<form method="post" action="<?php echo esc_url( admin_url( 'admin.php?page=morkvanp_invoices&invoice=' . $invoice_get ) ); ?>" class="gridttn">
     75    <input type="hidden" name="ref" value="<?php echo isset($obj2['Ref']) ? esc_attr($obj2['Ref']) : ''; ?>">
     76    <div class="">
     77        <div class="">
     78            <h4>Інформація про відправника</h4>
     79            <label for="">Місто відправника</label>
     80            <input type="text" name="city" readonly value="<?php echo isset($obj2["CitySenderDescription"]) ? esc_attr($obj2["CitySenderDescription"]) : ''; ?>">
     81            <input type="hidden" name="cityid" value="<?php echo isset($obj2["CitySender"]) ? esc_attr($obj2["CitySender"]) : ''; ?>">
     82            <br>
     83            <input type="hidden" name="sender_phone" value="<?php echo isset($obj2['SendersPhone']) ? esc_attr($obj2['SendersPhone']) : ''; ?>">
     84            <label for="">Контактна особа</label>
     85            <?php
     86            $senders = getsenders();
     87            echo '<select class="custom-select" id="mrkvnp_invoice_sender_ref" name="mrkvnp_invoice_sender_ref">';
     88            if (is_array($senders)) {
     89                for($s = 0; $s < sizeof($senders); $s++){
     90                    echo '<option namero="' . esc_attr($senders[$s]->Description) . '" phone="' . esc_attr($senders[$s]->Phones) . '" value="' . esc_attr($senders[$s]->Ref) . '">' . esc_html($senders[$s]->Description . ' ' . $senders[$s]->Phones) . '</option>';
     91                }
     92            }
     93            echo '</select>';
     94           
     95            $default_desc = (isset($senders[0]->Description)) ? $senders[0]->Description : '';
     96            echo '<input style="display:none" type="text" id="sender_name" name="mrkvnp_invoice_sender_names" class="input sender_name" value="' . esc_attr($default_desc) . '" />';
     97            ?>
     98            <br>
     99            <hr>
     100        </div>
     101        <h4>Інформація про одержувача</h4>
     102        <label for="">Місто одержувача</label>
     103        <input type="text" id="woocommerce_nova_poshta_shipping_method_city_all_name" class="input-text regular-input ui-autocomplete-input" name="" value="<?php echo isset($obj2["CityRecipientDescription"]) ? esc_attr($obj2["CityRecipientDescription"]) : ''; ?>">
     104        <input type="hidden" name="woocommerce_nova_poshta_shipping_method_city" id="woocommerce_nova_poshta_shipping_method_city" value="<?php echo isset($obj2['CityRecipient']) ? esc_attr($obj2['CityRecipient']) : ''; ?>">
     105        <br>
     106        <label for="">Відділення</label>
     107        <input class="uai input-text regular-input ui-autocomplete-input" id="mrkvnp_invoice_sender_warehouse_name" type="text" name="mrkvnp_invoice_sender_warehouse_name" value="<?php echo isset($obj2["RecipientAddressDescription"]) ? esc_attr($obj2["RecipientAddressDescription"]) : ''; ?>">
     108        <input class="input-text regular-input jjs-hide-nova-poshta-option" type="hidden" name="mrkvnp_invoice_sender_warehouse_ref" id="mrkvnp_invoice_sender_warehouse_ref" value="<?php echo isset($obj2["RecipientAddress"]) ? esc_attr($obj2["RecipientAddress"]) : ''; ?>">
     109        <br>
     110        <label for="">АБО Адреса </label>
    54111
    55     $obj2 = (array) $response_json;
     112        <table>
     113            <tbody>
     114                <tr>
     115                    <td>Вулиця</td>
     116                    <td>
     117                        <input type="text" placeholder="" class="input-text regular-input ui-autocomplete-input" id="mrkvnp_invoice_sender_address_name" name="mrkvnp_invoice_sender_address_name" value="" autocomplete="off">
     118                        <input type="hidden" name="woocommerce_nova_poshta_shipping_method_address" id="woocommerce_nova_poshta_shipping_method_address" value="8ceab873-4146-11dd-9198-001d60451983">
     119                    </td>
     120                </tr>
     121                <tr>
     122                    <td><label>Будинок</label></td>
     123                    <td><input type="text" name="mrkvnp_invoice_sender_building_number" value=""></td>
     124                </tr>
     125                <tr>
     126                    <td><label>Квартира/офіс</label></td>
     127                    <td><input type="text" name="mrkvnp_invoice_sender_flat_number" value=""></td>
     128                </tr>
     129            </tbody>
     130        </table>
    56131
    57     // print_r($obj2);
    58 
    59    }
    60 
    61 
    62    $obj2data =  $obj2['data'];
    63    //print_r($obj2data);
    64    for($i=0; $i< sizeof($obj2data);$i++){
    65      $element = $obj2data[$i];
    66      if($element['IntDocNumber'] == $ttn){
    67        $obj2 =$element;
    68      }
    69 
    70 
    71     }
    72  ?>
    73  <div class="gridttn h3cont" class="" >
    74    <div>
    75    <h3 class="wp-heading-inline">ЕКСПРЕС-НАКЛАДНА <br> № <?php echo $ttn; ?></h3>
    76    </div>
    77  <div class=""><br>Статус: <br>
    78    <?php echo $obj['Status'];?>
    79 <br>Час: <br>
    80    <?php echo $obj2['DateTime'];?>
    81  </div>
    82  </div>
    83  <form method=post action="admin.php?page=morkvanp_invoices&invoice=<?php echo $_GET['invoice']; ?>" class=gridttn class="" >
    84    <input type="hidden" name="ref" value="<?php echo $obj2['Ref'];?>">
    85    <div class="">
    86      <div class="">
    87        <h4>Інформація про відправника</h4>
    88        <label for="">Місто відправника</label>
    89        <input type="text" name="city" readonly value="<?php echo $obj2["CitySenderDescription"];?>">
    90        <input type="hidden" name="cityid" value="<?php echo $obj2["CitySender"];?>">
    91        <br>
    92        <!--label for="">Адреса (звідки забирається відправлення)</label>
    93        <input type="text" name="" value="<?php echo $obj["CitySender"];?>">
    94        <br-->
    95        <!--label for="">Телефон</label><br-->
    96        <input type="hidden" name="sender_phone" value="<?php echo $obj2['SendersPhone']; ?>">
    97        <label for="">Контактна особа</label>
    98        <?php
    99 
    100        $senders = getsenders();
    101 
    102        echo "<select class=custom-select v-model=selected  id=mrkvnp_invoice_sender_ref name=mrkvnp_invoice_sender_ref>";
    103    for($s=0; $s<sizeof($senders); $s++){
    104      echo '<option namero="'.$senders[$s]->Description.'" phone="'.$senders[$s]->Phones.'" value='.$senders[$s]->Ref.'>'.$senders[$s]->Description.' '.$senders[$s]->Phones.'</option>';
    105 
    106    }
    107 
    108    echo "</select>
    109         <script></script>";
    110    echo "<input style=display:none type=\"text\" id=\"sender_name\" name=\"mrkvnp_invoice_sender_names\" class=\"input sender_name\" value=\""
    111    .$senders[0]->Description."\" />";
    112        ?>
    113 
    114        <!--input type="text" name="" value="<?php echo $obj2['SenderContactPerson'];?>"-->
    115        <br>
    116        <hr>
    117      </div>
    118      <h4>Інформація про одержувача</h4>
    119      <label for="">Місто одержувача</label>
    120      <input type="text" id=woocommerce_nova_poshta_shipping_method_city_all_name class="input-text regular-input  ui-autocomplete-input" name="" value="<?php echo $obj2["CityRecipientDescription"];?>">
    121      <input type="hidden" name="woocommerce_nova_poshta_shipping_method_city" id="woocommerce_nova_poshta_shipping_method_city" value="<?php echo $obj2['CityRecipient']; ?>">
    122      <br>
    123      <label for="">Відділення</label>
    124      <input class="uai input-text regular-input  ui-autocomplete-input" id="mrkvnp_invoice_sender_warehouse_name" type="text" name="mrkvnp_invoice_sender_warehouse_name" value="<?php echo $obj2["RecipientAddressDescription"];?>">
    125      <input class="input-text regular-input jjs-hide-nova-poshta-option" type="hidden" name="mrkvnp_invoice_sender_warehouse_ref" id="mrkvnp_invoice_sender_warehouse_ref" style="" value="<?php echo $obj2["RecipientAddress"];?>" placeholder="">
    126      <br>
    127  <label for="">АБО Адреса </label>
    128 
    129  <table>
    130    <tbody>
    131      <tr>
    132        <td>Вулиця</td>
    133        <td>
    134          <input type="text" placeholder="" class="input-text regular-input  ui-autocomplete-input" id="mrkvnp_invoice_sender_address_name" name="mrkvnp_invoice_sender_address_name" value="" readonlyd="" autocomplete="off">
    135          <input class="" type="hidden" name="woocommerce_nova_poshta_shipping_method_address" id="woocommerce_nova_poshta_shipping_method_address" style="" value="8ceab873-4146-11dd-9198-001d60451983" placeholder="">
    136        </td>
    137      </tr>
    138      <tr>
    139        <td><label>Будинок</label></td>
    140        <td><input type="text" name="mrkvnp_invoice_sender_building_number" value=""></td>
    141      </tr>
    142      <tr>
    143        <td><label>Квартира/офіс</label></td>
    144        <td><input type="text" name="mrkvnp_invoice_sender_flat_number" value=""></td>
    145      </tr>
    146    </tbody>
    147  </table>
    148 
    149    <br>
    150      <label for="">Телефон</label><br>
    151      <input type="text" name="recipient_phone" value="<?php echo $obj2['RecipientsPhone']; ?>"><br>
    152      <label for="">П.І.Б. контактної особи (повністю)</label>
    153      <input readonly type="text" name="recipient_name" value="<?php echo $obj2['RecipientContactPerson'];?>">
    154      <input type="hidden" name="ContactRecipient" value="<?php echo $obj2['ContactRecipient']; ?>">
    155      <input type="hidden" name="Recipient" value="<?php echo $obj2['Recipient']; ?>">
    156      <br>
    157      <hr>
    158    </div>
    159    <div class="">
    160      <h4>Інформація про відправлення</h4>
    161      <label for="">Фактична вага</label><br>
    162      <input type="text" name="Weight" value="<?php echo $obj2["Weight"];?>">
    163      <br>
    164      <label for="">Об'єм'</label><br>
    165      <input type="text" name="Volume" value="<?php echo $obj2["Volume"];?>">
    166      <br>
    167      <label for="">Оголошена вартість</label><br>
    168      <input type="text" name="cost" value="<?php echo $obj2["Cost"];?>">
    169      <label for="">Зворотня доставка (наложений платіж)</label><br>
    170      <input type="text" name="backward" value="<?php echo $obj2["BackwardDeliverySum"];?>">
    171      <label for="">Повний опис відправлення</label><br>
    172      <textarea name=invoicedescription><?php echo $obj2["Description"];?></textarea>
    173      <br>
    174    </div>
    175    <?php  include 'card.php'; ?>
    176    <div>
    177    </div>
    178    <div>
    179    </div>
    180    <div>
    181      <button type="submit" name="updatettn">Оновити</button>
    182    </div>
    183  </form>
     132        <br>
     133        <label for="">Телефон</label><br>
     134        <input type="text" name="recipient_phone" value="<?php echo isset($obj2['RecipientsPhone']) ? esc_attr($obj2['RecipientsPhone']) : ''; ?>"><br>
     135        <label for="">П.І.Б. контактної особи (повністю)</label>
     136        <input readonly type="text" name="recipient_name" value="<?php echo isset($obj2['RecipientContactPerson']) ? esc_attr($obj2['RecipientContactPerson']) : ''; ?>">
     137        <input type="hidden" name="ContactRecipient" value="<?php echo isset($obj2['ContactRecipient']) ? esc_attr($obj2['ContactRecipient']) : ''; ?>">
     138        <input type="hidden" name="Recipient" value="<?php echo isset($obj2['Recipient']) ? esc_attr($obj2['Recipient']) : ''; ?>">
     139        <br>
     140        <hr>
     141    </div>
     142    <div class="">
     143        <h4>Інформація про відправлення</h4>
     144        <label for="">Фактична вага</label><br>
     145        <input type="text" name="Weight" value="<?php echo isset($obj2["Weight"]) ? esc_attr($obj2["Weight"]) : ''; ?>">
     146        <br>
     147        <label for="">Об'єм</label><br>
     148        <input type="text" name="Volume" value="<?php echo isset($obj2["Volume"]) ? esc_attr($obj2["Volume"]) : ''; ?>">
     149        <br>
     150        <label for="">Оголошена вартість</label><br>
     151        <input type="text" name="cost" value="<?php echo isset($obj2["Cost"]) ? esc_attr($obj2["Cost"]) : ''; ?>">
     152        <label for="">Зворотня доставка (наложений платіж)</label><br>
     153        <input type="text" name="backward" value="<?php echo isset($obj2["BackwardDeliverySum"]) ? esc_attr($obj2["BackwardDeliverySum"]) : ''; ?>">
     154        <label for="">Повний опис відправлення</label><br>
     155        <textarea name="invoicedescription"><?php echo isset($obj2["Description"]) ? esc_textarea($obj2["Description"]) : ''; ?></textarea>
     156        <br>
     157    </div>
     158    <?php include 'card.php'; ?>
     159    <div></div>
     160    <div></div>
     161    <div>
     162        <button type="submit" name="updatettn">Оновити</button>
     163    </div>
     164</form>
    184165</div>
    185 <?php
    186 
    187     echo "<pre>";
    188     //print_r($obj2);
    189     echo "</pre>"; ?>
Note: See TracChangeset for help on using the changeset viewer.