function content_55d5c52c1f4c73_26393234($_smarty_tpl)
    {
        if (!is_callable('smarty_function_html_options')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.html_options.php';
        }
        if (!is_callable('smarty_function_html_checkboxes')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.html_checkboxes.php';
        }
        if (!$_smarty_tpl->tpl_vars['order_status_descr']->value) {
            ?>
    <?php 
            if (!$_smarty_tpl->tpl_vars['status_type']->value) {
                $_smarty_tpl->tpl_vars["status_type"] = new Smarty_variable(@constant('STATUSES_ORDER'), null, 0);
            }
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["order_status_descr"] = new Smarty_variable(fn_get_simple_statuses($_smarty_tpl->tpl_vars['status_type']->value), null, 0);
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['display']->value == "view") {
            echo htmlspecialchars($_smarty_tpl->tpl_vars['order_status_descr']->value[$_smarty_tpl->tpl_vars['status']->value], ENT_QUOTES, 'UTF-8');
        } elseif ($_smarty_tpl->tpl_vars['display']->value == "select") {
            echo smarty_function_html_options(array('name' => $_smarty_tpl->tpl_vars['name']->value, 'options' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'selected' => $_smarty_tpl->tpl_vars['status']->value, 'id' => $_smarty_tpl->tpl_vars['select_id']->value), $_smarty_tpl);
        } elseif ($_smarty_tpl->tpl_vars['display']->value == "checkboxes") {
            echo smarty_function_html_checkboxes(array('name' => $_smarty_tpl->tpl_vars['name']->value, 'options' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'selected' => $_smarty_tpl->tpl_vars['status']->value, 'columns' => ($tmp = @$_smarty_tpl->tpl_vars['columns']->value) === null || $tmp === '' ? 4 : $tmp, 'assign' => '_html_checkboxes', 'labels' => false), $_smarty_tpl);
            $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars['item']->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['_html_checkboxes']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                $_smarty_tpl->tpl_vars['item']->_loop = true;
                ?>
<label><?php 
                echo $_smarty_tpl->tpl_vars['item']->value;
                ?>
</label><?php 
            }
        }
    }
Пример #2
0
function fn_log_event($type, $action, $data = array())
{
    $object_primary_keys = array('users' => 'user_id', 'orders' => 'order_id', 'products' => 'product_id', 'categories' => 'category_id');
    $update = false;
    $content = array();
    $actions = Registry::get('settings.Logging.log_type_' . $type);
    $cut_log = Registry::ifGet('log_cut', false);
    Registry::del('log_cut');
    $cut_data = Registry::ifGet('log_cut_data', false);
    Registry::del('log_cut_data');
    if (empty($actions) || $action && !empty($actions) && empty($actions[$action]) || !empty($cut_log)) {
        return false;
    }
    if (!empty($_SESSION['auth']['user_id'])) {
        $user_id = $_SESSION['auth']['user_id'];
    } else {
        $user_id = 0;
    }
    if ($type == 'users' && $action == 'logout' && !empty($data['user_id'])) {
        $user_id = $data['user_id'];
    }
    if ($user_id) {
        $udata = db_get_row("SELECT firstname, lastname, email FROM ?:users WHERE user_id = ?i", $user_id);
    }
    $event_type = 'N';
    // notice
    if (!empty($data['backtrace'])) {
        $_btrace = array();
        $func = '';
        foreach (array_reverse($data['backtrace']) as $v) {
            if (!empty($v['file'])) {
                $v['file'] = fn_get_rel_dir($v['file']);
            }
            if (empty($v['file'])) {
                $func = $v['function'];
                continue;
            } elseif (!empty($func)) {
                $v['function'] = $func;
                $func = '';
            }
            $_btrace[] = array('file' => !empty($v['file']) ? $v['file'] : '', 'line' => !empty($v['line']) ? $v['line'] : '', 'function' => $v['function']);
        }
        $data['backtrace'] = serialize($_btrace);
    } else {
        $data['backtrace'] = '';
    }
    if ($type == 'general') {
        if ($action == 'deprecated') {
            $content['deprecated_function'] = $data['function'];
        }
        $content['message'] = $data['message'];
    } elseif ($type == 'orders') {
        $order_status_descr = fn_get_simple_statuses(STATUSES_ORDER, true, true);
        $content = array('order' => '# ' . $data['order_id'], 'id' => $data['order_id']);
        if ($action == 'status') {
            $content['status'] = $order_status_descr[$data['status_from']] . ' -> ' . $order_status_descr[$data['status_to']];
        }
    } elseif ($type == 'products') {
        $product = db_get_field("SELECT product FROM ?:product_descriptions WHERE product_id = ?i AND lang_code = ?s", $data['product_id'], Registry::get('settings.Appearance.backend_default_language'));
        $content = array('product' => $product . ' (#' . $data['product_id'] . ')', 'id' => $data['product_id']);
        if ($action == 'low_stock') {
            // log stock - warning
            $event_type = 'W';
        }
    } elseif ($type == 'categories') {
        $category = db_get_field("SELECT category FROM ?:category_descriptions WHERE category_id = ?i AND lang_code = ?s", $data['category_id'], Registry::get('settings.Appearance.backend_default_language'));
        $content = array('category' => $category . ' (#' . $data['category_id'] . ')', 'id' => $data['category_id']);
    } elseif ($type == 'database') {
        if ($action == 'error') {
            $content = array('error' => $data['error']['message'], 'query' => $data['error']['query']);
            $event_type = 'E';
        }
    } elseif ($type == 'requests') {
        if (!empty($cut_data)) {
            $data['data'] = preg_replace("/\\<(" . implode('|', $cut_data) . ")\\>(.*?)\\<\\/(" . implode('|', $cut_data) . ")\\>/s", '<${1}>******</${1}>', $data['data']);
            $data['data'] = preg_replace("/%3C(" . implode('|', $cut_data) . ")%3E(.*?)%3C%2F(" . implode('|', $cut_data) . ")%3E/s", '%3C${1}%3E******%3C%2F${1}%3E', $data['data']);
            $data['data'] = preg_replace("/(" . implode('|', $cut_data) . ")=(.*?)(&)/s", '${1}=******${3}', $data['data']);
        }
        $content = array('url' => $data['url'], 'request' => fn_strlen($data['data']) < LOG_MAX_DATA_LENGTH && preg_match('//u', $data['data']) ? $data['data'] : '', 'response' => fn_strlen($data['response']) < LOG_MAX_DATA_LENGTH && preg_match('//u', $data['response']) ? $data['response'] : '');
    } elseif ($type == 'users') {
        if (!empty($data['time'])) {
            if (empty($_SESSION['log']['login_log_id'])) {
                return false;
            }
            $content = db_get_field('SELECT content FROM ?:logs WHERE log_id = ?i', $_SESSION['log']['login_log_id']);
            $content = unserialize($content);
            $minutes = ceil($data['time'] / 60);
            $hours = floor($minutes / 60);
            if ($hours) {
                $minutes -= $hours * 60;
            }
            if ($hours || $minutes) {
                $content['loggedin_time'] = ($hours ? $hours . ' |hours| ' : '') . ($minutes ? $minutes . ' |minutes|' : '');
            }
            if (!empty($data['timeout']) && $data['timeout']) {
                $content['timeout'] = true;
            }
            $update = $_SESSION['log']['login_log_id'];
        } else {
            if (!empty($data['user_id'])) {
                $info = db_get_row("SELECT firstname, lastname, email FROM ?:users WHERE user_id = ?i", $data['user_id']);
                $content = array('user' => $info['firstname'] . ($info['firstname'] && $info['lastname'] ? ' ' : '') . $info['lastname'] . ($info['firstname'] || $info['lastname'] ? '; ' : '') . $info['email'] . ' (#' . $data['user_id'] . ')');
                $content['id'] = $data['user_id'];
            } elseif (!empty($data['user'])) {
                $content = array('user' => $data['user']);
            }
            if (in_array($action, array('session', 'failed_login'))) {
                $ip = fn_get_ip();
                $content['ip_address'] = empty($data['ip']) ? $ip['host'] : $data['ip'];
            }
        }
        if ($action == 'failed_login') {
            // failed login - warning
            $event_type = 'W';
        }
    }
    fn_set_hook('save_log', $type, $action, $data, $user_id, $content, $event_type, $object_primary_keys);
    $content = serialize($content);
    if ($update) {
        db_query('UPDATE ?:logs SET content = ?s WHERE log_id = ?i', $content, $update);
    } else {
        if (Registry::get('runtime.company_id')) {
            $company_id = Registry::get('runtime.company_id');
        } elseif (!empty($object_primary_keys[$type]) && !empty($data[$object_primary_keys[$type]])) {
            $company_id = fn_get_company_id($type, $object_primary_keys[$type], $data[$object_primary_keys[$type]]);
        } else {
            $company_id = 0;
        }
        $row = array('user_id' => $user_id, 'timestamp' => TIME, 'type' => $type, 'action' => $action, 'event_type' => $event_type, 'content' => $content, 'backtrace' => $data['backtrace'], 'company_id' => $company_id);
        $log_id = db_query("INSERT INTO ?:logs ?e", $row);
        if ($type == 'users' && $action == 'session') {
            $_SESSION['log']['login_log_id'] = $log_id;
        }
    }
    return true;
}
Пример #3
0
     $shipping_methods = Api::getAsList('companies_rates', $product_groups);
     $shipping_methods['shipping_failed'] = !empty($_SESSION['cart']['shipping_failed']) ? $_SESSION['cart']['shipping_failed'] : false;
     $response->setData($shipping_methods);
 } elseif ($meta['object'] == 'product_files') {
     $file_url = array('fileUrl' => fn_url("orders.get_file&ekey=" . $_REQUEST['ekey'] . "&file_id=" . $_REQUEST['file_id'] . "&product_id=" . $_REQUEST['product_id'], AREA, 'rel'));
     $response->setData($file_url);
 } elseif ($meta['object'] == 'errors') {
     $response->returnResponse();
 } elseif ($meta['object'] == 'reward_points_userlog') {
     $items_per_page = !empty($items_per_page) ? $items_per_page : TWG_RESPONSE_ITEMS_LIMIT;
     $request = $_REQUEST;
     $auth =& $_SESSION['auth'];
     $page = !empty($request['page']) ? $request['page'] : 1;
     list($_reward_points_log, $params) = fn_twg_get_reward_points_userlog(array('user_id' => $auth['user_id'], 'items_per_page' => $items_per_page, 'page' => $page));
     $reward_points_log = array();
     $statuses = fn_get_simple_statuses(STATUSES_ORDER, true, true);
     $actions = array(CHANGE_DUE_ORDER => 'CHANGE_DUE_ORDER', CHANGE_DUE_USE => 'CHANGE_DUE_USE', CHANGE_DUE_RMA => 'CHANGE_DUE_RMA', CHANGE_DUE_ADDITION => 'CHANGE_DUE_ADDITION', CHANGE_DUE_SUBTRACT => 'CHANGE_DUE_SUBTRACT', CHANGE_DUE_ORDER_DELETE => 'CHANGE_DUE_ORDER_DELETE', CHANGE_DUE_ORDER_PLACE => 'CHANGE_DUE_ORDER_PLACE');
     foreach ($_reward_points_log as &$record) {
         $record['reason'] = !in_array($record['action'], array(CHANGE_DUE_ADDITION, CHANGE_DUE_SUBTRACT)) ? unserialize($record['reason']) : $record['reason'];
         $date_format = Registry::get('settings.Appearance.date_format') . ', ' . Registry::get('settings.Appearance.time_format');
         $record['timestamp'] = fn_date_format($record['timestamp'], $date_format);
         $record['order_exists'] = !empty($record['reason']['order_id']) ? fn_get_order_name($record['reason']['order_id']) != false : false;
         $record['custom_action'] = false;
         if (in_array($record['action'], array_keys($actions))) {
             $record['action'] = $actions[$record['action']];
         } else {
             $record['custom_action'] = true;
         }
         if (is_array($record['reason'])) {
             if (!empty($record['reason']['text'])) {
                 $record['reason']['text'] = ltrim($record['reason']['text'], 'text_');
Пример #4
0
*   (c) 2004 Vladimir V. Kalynyak, Alexey V. Vinokurov, Ilya M. Shalnev    *
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
require_once Registry::get('config.dir.functions') . 'fn.sales_reports.php';
$order_status_descr = fn_get_simple_statuses(STATUSES_ORDER, true, true);
Registry::get('view')->assign('order_status_descr', $order_status_descr);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $suffix = '';
    /*
     * Reports management
     */
    // Add/update report
    if ($mode == 'update') {
        $report_id = fn_update_sales_report($_REQUEST['report_data'], $_REQUEST['report_id']);
        $suffix = ".update?report_id={$report_id}";
    }
    /*
     * Reports view
     */
    // Report view routines
Пример #5
0
function fn_qwintry_save_order_invoice($order_id, $area = AREA, $lang_code = CART_LANGUAGE)
{
    $view = Tygh::$app['view'];
    $html = array();
    $view->assign('order_status_descr', fn_get_simple_statuses(STATUSES_ORDER, true, true));
    $view->assign('profile_fields', fn_get_profile_fields('I'));
    $order_info = fn_get_order_info($order_id, false, true, false, true);
    if (empty($order_info)) {
        return;
    }
    if (fn_allowed_for('MULTIVENDOR')) {
        $view->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($order_info['products']));
    }
    list($shipments) = fn_get_shipments_info(array('order_id' => $order_info['order_id'], 'advanced_info' => true));
    $use_shipments = !fn_one_full_shipped($shipments);
    $view->assign('order_info', $order_info);
    $view->assign('shipments', $shipments);
    $view->assign('use_shipments', $use_shipments);
    $view->assign('payment_method', fn_get_payment_data(!empty($order_info['payment_method']['payment_id']) ? $order_info['payment_method']['payment_id'] : 0, $order_info['order_id'], $lang_code));
    $view->assign('order_status', fn_get_status_data($order_info['status'], STATUSES_ORDER, $order_info['order_id'], $lang_code, $order_info['company_id']));
    $view->assign('status_settings', fn_get_status_params($order_info['status']));
    $view->assign('company_data', fn_get_company_placement_info($order_info['company_id'], $lang_code));
    fn_disable_live_editor_mode();
    $html[] = $view->displayMail('orders/print_invoice.tpl', false, $area, $order_info['company_id'], $lang_code);
    $filename = QWINTRY_DIR_INVOICES . $order_id . '.pdf';
    if (Pdf::render($html, $filename, true)) {
        return $filename;
    }
    return false;
}
Пример #6
0
function fn_print_order_invoices($order_ids, $pdf = false, $area = AREA, $lang_code = CART_LANGUAGE)
{
    $view = Registry::get('view');
    $html = array();
    $view->assign('order_status_descr', fn_get_simple_statuses(STATUSES_ORDER, true, true));
    $view->assign('profile_fields', fn_get_profile_fields('I'));
    if (!is_array($order_ids)) {
        $order_ids = array($order_ids);
    }
    foreach ($order_ids as $order_id) {
        $order_info = fn_get_order_info($order_id, false, true, false, true);
        if (empty($order_info)) {
            continue;
        }
        if (fn_allowed_for('MULTIVENDOR')) {
            $view->assign('take_surcharge_from_vendor', fn_take_payment_surcharge_from_vendor($order_info['products']));
        }
        list($shipments) = fn_get_shipments_info(array('order_id' => $order_info['order_id'], 'advanced_info' => true));
        $use_shipments = !fn_one_full_shipped($shipments);
        $view->assign('order_info', $order_info);
        $view->assign('shipments', $shipments);
        $view->assign('use_shipments', $use_shipments);
        $view->assign('payment_method', fn_get_payment_data(!empty($order_info['payment_method']['payment_id']) ? $order_info['payment_method']['payment_id'] : 0, $order_info['order_id'], $lang_code));
        $view->assign('order_status', fn_get_status_data($order_info['status'], STATUSES_ORDER, $order_info['order_id'], $lang_code, $order_info['company_id']));
        $view->assign('status_settings', fn_get_status_params($order_info['status']));
        $view->assign('company_data', fn_get_company_placement_info($order_info['company_id'], $lang_code));
        if ($pdf == true) {
            fn_disable_live_editor_mode();
            $html[] = $view->displayMail('orders/print_invoice.tpl', false, $area, $order_info['company_id'], $lang_code);
        } else {
            $view->displayMail('orders/print_invoice.tpl', true, $area, $order_info['company_id'], $lang_code);
            if ($order_id != end($order_ids)) {
                echo "<div style='page-break-before: always;'>&nbsp;</div>";
            }
        }
    }
    if ($pdf == true) {
        Pdf::render($html, __('invoices') . '-' . implode('-', $order_ids));
    }
    return true;
}
Пример #7
0
function fn_reports_get_conditions($conditions)
{
    $result = array();
    foreach ($conditions as $key => $value) {
        $result[$key]['objects'] = array();
        if ($key == "order") {
            foreach ($value as $v) {
                $result[$key]['objects'][] = array('href' => 'orders.details?order_id=' . $v, 'name' => '#' . $v);
            }
            $result[$key]['name'] = __('orders');
        } elseif ($key == "status") {
            $order_status_descr = fn_get_simple_statuses(STATUSES_ORDER, true, true);
            foreach ($value as $k => $v) {
                $result[$key]['objects'][]['name'] = $order_status_descr[$v];
            }
            $result[$key]['name'] = __('status');
        } elseif ($key == "payment") {
            foreach ($value as $k => $v) {
                $result[$key]['objects'][]['name'] = db_get_field("SELECT payment FROM ?:payment_descriptions WHERE payment_id = ?i AND lang_code = ?s", $v, CART_LANGUAGE);
            }
            $result[$key]['name'] = __('payment_methods');
        } elseif ($key == "location") {
            foreach ($value as $k => $v) {
                $result[$key]['objects'][]['name'] = db_get_field("SELECT destination FROM ?:destination_descriptions WHERE destination_id = ?i AND lang_code = ?s", $v, CART_LANGUAGE);
            }
            $result[$key]['name'] = __('locations');
        } elseif ($key == "user") {
            foreach ($value as $v) {
                $result[$key]['objects'][] = array('href' => 'profiles.update?user_id=' . $v, 'name' => $v);
            }
            $result[$key]['name'] = __('users');
        } elseif ($key == "category") {
            foreach ($value as $k => $v) {
                $result[$key]['objects'][] = array('href' => 'categories.update?category_id=' . $v, 'name' => db_get_field("SELECT category FROM ?:category_descriptions WHERE category_id = ?i AND lang_code = ?s", $v, CART_LANGUAGE));
            }
            $result[$key]['name'] = __('categories');
        } elseif ($key == "product") {
            foreach ($value as $v) {
                $result[$key]['objects'][] = array('href' => 'products.update?product_id=' . $v, 'name' => $v);
            }
            $result[$key]['name'] = __('products');
        }
    }
    return $result;
}
Пример #8
0
function fn_settings_variants_addons_rus_exim_1c_exim_1c_order_statuses()
{
    $order_statuses = fn_get_simple_statuses('O', false, false, CART_LANGUAGE);
    return $order_statuses;
}
    function content_55d5c758cdc0b3_78592989($_smarty_tpl)
    {
        if (!is_callable('smarty_function_math')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.math.php';
        }
        fn_preload_lang_vars(array('general', 'packages', 'product', 'quantity', 'deleted_product', 'sku', 'no_products_for_shipment', 'options', 'shipping_method', 'tracking_number', 'carrier', 'comments', 'order_status', 'do_not_change', 'text_order_status_notification', 'send_shipment_notification_to_customer', 'text_shipping_packages_info', 'package', 'weight', 'shipping_method'));
        ?>
<script type="text/javascript">
    var packages = [];
</script>

<form action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" method="post" name="shipments_form" class="form-horizontal form-edit">
<input type="hidden" name="shipment_data[order_id]" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['order_id'], ENT_QUOTES, 'UTF-8');
        ?>
" />

<?php 
        $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
        $_smarty_tpl->tpl_vars["shipping_id"] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['order_info']->value['shipping'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
            $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
            $_smarty_tpl->tpl_vars["shipping_id"]->value = $_smarty_tpl->tpl_vars["shipping"]->key;
            ?>
    <?php 
            if ($_smarty_tpl->tpl_vars['shipping']->value['packages_info']['packages']) {
                ?>
        <?php 
                $_smarty_tpl->tpl_vars["has_packages"] = new Smarty_variable(true, null, 0);
                ?>
    <?php 
            }
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['has_packages']->value) {
            ?>
    <div class="tabs cm-j-tabs">
        <ul>
            <li id="tab_general" class="cm-js active"><a><?php 
            echo $_smarty_tpl->__("general");
            ?>
</a></li>
            <li id="tab_packages_info" class="cm-js"><a><?php 
            echo $_smarty_tpl->__("packages");
            ?>
</a></li>
        </ul>
    </div>
<?php 
        }
        ?>

<div class="cm-tabs-content" id="tabs_content">
    <div id="content_tab_general">

        <table class="table table-middle">
        <thead>
            <tr>
                <th><?php 
        echo $_smarty_tpl->__("product");
        ?>
</th>
                <th width="5%"><?php 
        echo $_smarty_tpl->__("quantity");
        ?>
</th>
            </tr>
        </thead>

        <?php 
        $_smarty_tpl->tpl_vars["shipment_products"] = new Smarty_variable(false, null, 0);
        ?>

        <?php 
        $_smarty_tpl->tpl_vars["product"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["product"]->_loop = false;
        $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['order_info']->value['products'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["product"]->key => $_smarty_tpl->tpl_vars["product"]->value) {
            $_smarty_tpl->tpl_vars["product"]->_loop = true;
            $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["product"]->key;
            ?>
            <?php 
            if ($_smarty_tpl->tpl_vars['product']->value['shipment_amount'] > 0 && (!isset($_smarty_tpl->tpl_vars['product']->value['extra']['group_key']) || $_smarty_tpl->tpl_vars['product']->value['extra']['group_key'] == $_smarty_tpl->tpl_vars['group_key']->value)) {
                ?>
            <?php 
                $_smarty_tpl->tpl_vars["shipment_products"] = new Smarty_variable(true, null, 0);
                ?>

            <tr>
                <td>
                    <?php 
                $_smarty_tpl->tpl_vars['may_display_product_update_link'] = new Smarty_variable(fn_check_view_permissions("products.update"), null, 0);
                ?>
                    <?php 
                if ($_smarty_tpl->tpl_vars['may_display_product_update_link']->value && !$_smarty_tpl->tpl_vars['product']->value['deleted_product']) {
                    ?>
<a href="<?php 
                    echo htmlspecialchars(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['product']->value['product_id']), ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                }
                echo ($tmp = @$_smarty_tpl->tpl_vars['product']->value['product']) === null || $tmp === '' ? $_smarty_tpl->__("deleted_product") : $tmp;
                if ($_smarty_tpl->tpl_vars['may_display_product_update_link']->value) {
                    ?>
</a><?php 
                }
                ?>
                    <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['product_code']) {
                    ?>
<p><?php 
                    echo $_smarty_tpl->__("sku");
                    ?>
:&nbsp;<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_code'], ENT_QUOTES, 'UTF-8');
                    ?>
</p><?php 
                }
                ?>
                    <?php 
                if ($_smarty_tpl->tpl_vars['product']->value['product_options']) {
                    ?>
<div class="options-info"><?php 
                    echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['product']->value['product_options']), 0);
                    ?>
</div><?php 
                }
                ?>
                </td>
                <td class="center" nowrap="nowrap">
                        <?php 
                echo smarty_function_math(array('equation' => "amount + 1", 'amount' => $_smarty_tpl->tpl_vars['product']->value['shipment_amount'], 'assign' => "loop_amount"), $_smarty_tpl);
                ?>

                        <?php 
                if ($_smarty_tpl->tpl_vars['loop_amount']->value <= 100) {
                    ?>
                            <select id="shipment_data_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" class="input-small cm-shipments-product" name="shipment_data[products][<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
]">
                                <option value="0">0</option>
                            <?php 
                    if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['amount'])) {
                        unset($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']);
                    }
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['name'] = 'amount';
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] = (int) 1;
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] = is_array($_loop = $_smarty_tpl->tpl_vars['loop_amount']->value) ? count($_loop) : max(0, (int) $_loop);
                    unset($_loop);
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['show'] = true;
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'];
                    $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'] = 1;
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] < 0) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] = max($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'] > 0 ? 0 : -1, $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start']);
                    } else {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] = min($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'] > 0 ? $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] : $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] - 1);
                    }
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['show']) {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total'] = min(ceil(($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'] > 0 ? $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['loop'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] : $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'] + 1) / abs($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'])), $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['max']);
                        if ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total'] == 0) {
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['show'] = false;
                        }
                    } else {
                        $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total'] = 0;
                    }
                    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['show']) {
                        for ($_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'] = 1; $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total']; $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration']++) {
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['step'];
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['first'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'] == 1;
                            $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['last'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['amount']['total'];
                            ?>
                                <option value="<?php 
                            echo htmlspecialchars($_smarty_tpl->getVariable('smarty')->value['section']['amount']['index'], ENT_QUOTES, 'UTF-8');
                            ?>
" <?php 
                            if ($_smarty_tpl->getVariable('smarty')->value['section']['amount']['last']) {
                                ?>
selected="selected"<?php 
                            }
                            ?>
><?php 
                            echo htmlspecialchars($_smarty_tpl->getVariable('smarty')->value['section']['amount']['index'], ENT_QUOTES, 'UTF-8');
                            ?>
</option>
                            <?php 
                        }
                    }
                    ?>
                            </select>
                        <?php 
                } else {
                    ?>
                            <input id="shipment_data_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
" type="text" class="input-text" size="3" name="shipment_data[products][<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
                    ?>
]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['shipment_amount'], ENT_QUOTES, 'UTF-8');
                    ?>
" />&nbsp;of&nbsp;<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['shipment_amount'], ENT_QUOTES, 'UTF-8');
                    ?>

                        <?php 
                }
                ?>
                </td>
            </tr>
            <?php 
            }
            ?>
        <?php 
        }
        ?>

        <?php 
        if (!$_smarty_tpl->tpl_vars['shipment_products']->value) {
            ?>
            <tr>
                <td colspan="2"><?php 
            echo $_smarty_tpl->__("no_products_for_shipment");
            ?>
</td>
            </tr>
        <?php 
        }
        ?>

        </table>

        <?php 
        echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("options")), 0);
        ?>


        <fieldset>
            <div class="control-group">
                <label class="control-label" for="shipping_name"><?php 
        echo $_smarty_tpl->__("shipping_method");
        ?>
</label>
                <div class="controls">
                    <select name="shipment_data[shipping_id]" id="shipping_name">
                        <?php 
        $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
        $_from = $_smarty_tpl->tpl_vars['shippings']->value;
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
            $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
            ?>
                            <option    value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8');
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="tracking_number"><?php 
        echo $_smarty_tpl->__("tracking_number");
        ?>
</label>
                <div class="controls">
                    <input type="text" name="shipment_data[tracking_number]" id="tracking_number" size="10" value="" />
                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="carrier_key"><?php 
        echo $_smarty_tpl->__("carrier");
        ?>
</label>
                <div class="controls">
                    <?php 
        echo $_smarty_tpl->getSubTemplate("common/carriers.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "carrier_key", 'name' => "shipment_data[carrier]"), 0);
        ?>

                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="shipment_comments"><?php 
        echo $_smarty_tpl->__("comments");
        ?>
</label>
                <div class="controls">
                    <textarea id="shipmentcomments" name="shipment_data[comments]" cols="55" rows="8" class="span9"></textarea>
                </div>
            </div>
            
            <div class="control-group">
                <label class="control-label" for="order_status"><?php 
        echo $_smarty_tpl->__("order_status");
        ?>
</label>
                <div class="controls">
                    <select id="order_status" name="shipment_data[order_status]">
                        <option value=""><?php 
        echo $_smarty_tpl->__("do_not_change");
        ?>
</option>
                        <?php 
        $_smarty_tpl->tpl_vars["status"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["status"]->_loop = false;
        $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable();
        $_from = fn_get_simple_statuses(@constant('STATUSES_ORDER'));
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["status"]->key => $_smarty_tpl->tpl_vars["status"]->value) {
            $_smarty_tpl->tpl_vars["status"]->_loop = true;
            $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["status"]->key;
            ?>
                            <option value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
            ?>
"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['status']->value, ENT_QUOTES, 'UTF-8');
            ?>
</option>
                        <?php 
        }
        ?>
                    </select>
                    <p class="description">
                        <?php 
        echo $_smarty_tpl->__("text_order_status_notification");
        ?>

                    </p>
                </div>
            </div>
        </fieldset>

        <div class="cm-toggle-button">
            <div class="control-group select-field notify-customer">
                <div class="controls">
                    <label for="shipment_notify_user" class="checkbox">
                    <input type="checkbox" name="notify_user" id="shipment_notify_user" value="Y" />
                    <?php 
        echo $_smarty_tpl->__("send_shipment_notification_to_customer");
        ?>
</label>
                </div>
            </div>
        </div>
    </div>
    
    <?php 
        if ($_smarty_tpl->tpl_vars['has_packages']->value) {
            ?>
        <div id="content_tab_packages_info">
            <span class="packages-info"><?php 
            echo $_smarty_tpl->__("text_shipping_packages_info");
            ?>
</span>
            <?php 
            $_smarty_tpl->tpl_vars["package_num"] = new Smarty_variable("1", null, 0);
            ?>

            <?php 
            $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
            $_smarty_tpl->tpl_vars["shipping_id"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['order_info']->value['shipping'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
                $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
                $_smarty_tpl->tpl_vars["shipping_id"]->value = $_smarty_tpl->tpl_vars["shipping"]->key;
                ?>
                <?php 
                $_smarty_tpl->tpl_vars["package"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["package"]->_loop = false;
                $_smarty_tpl->tpl_vars["package_id"] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['shipping']->value['packages_info']['packages'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["package"]->key => $_smarty_tpl->tpl_vars["package"]->value) {
                    $_smarty_tpl->tpl_vars["package"]->_loop = true;
                    $_smarty_tpl->tpl_vars["package_id"]->value = $_smarty_tpl->tpl_vars["package"]->key;
                    ?>
                    <?php 
                    $_smarty_tpl->tpl_vars["allowed"] = new Smarty_variable(true, null, 0);
                    ?>
                    
                    <?php 
                    $_smarty_tpl->_capture_stack[0][] = array("package_container", null, null);
                    ob_start();
                    ?>
                    <div class="package-container">
                        
                        
                        
                        <script type="text/javascript">
                            packages['package_<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping_id']->value, ENT_QUOTES, 'UTF-8');
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['package_id']->value, ENT_QUOTES, 'UTF-8');
                    ?>
'] = [];
                        </script>
                        <h3>
                        <?php 
                    echo $_smarty_tpl->__("package");
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['package_num']->value, ENT_QUOTES, 'UTF-8');
                    ?>
 <?php 
                    if ($_smarty_tpl->tpl_vars['package']->value['shipping_params']) {
                        ?>
(<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['package']->value['shipping_params']['box_length'], ENT_QUOTES, 'UTF-8');
                        ?>
 x <?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['package']->value['shipping_params']['box_width'], ENT_QUOTES, 'UTF-8');
                        ?>
 x <?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['package']->value['shipping_params']['box_height'], ENT_QUOTES, 'UTF-8');
                        ?>
)<?php 
                    }
                    ?>
                        </h3>
                        <ul>
                        <?php 
                    $_smarty_tpl->tpl_vars["amount"] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars["amount"]->_loop = false;
                    $_smarty_tpl->tpl_vars["cart_id"] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['package']->value['products'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars["amount"]->key => $_smarty_tpl->tpl_vars["amount"]->value) {
                        $_smarty_tpl->tpl_vars["amount"]->_loop = true;
                        $_smarty_tpl->tpl_vars["cart_id"]->value = $_smarty_tpl->tpl_vars["amount"]->key;
                        ?>
                            <script type="text/javascript">
                                packages['package_<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping_id']->value, ENT_QUOTES, 'UTF-8');
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['package_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
']['<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['cart_id']->value, ENT_QUOTES, 'UTF-8');
                        ?>
'] = '<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['amount']->value, ENT_QUOTES, 'UTF-8');
                        ?>
';
                            </script>
                            <?php 
                        if ($_smarty_tpl->tpl_vars['order_info']->value['products'][$_smarty_tpl->tpl_vars['cart_id']->value]) {
                            ?>
                                <li><span><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['amount']->value, ENT_QUOTES, 'UTF-8');
                            ?>
</span> x <?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['products'][$_smarty_tpl->tpl_vars['cart_id']->value]['product'], ENT_QUOTES, 'UTF-8');
                            ?>
 <?php 
                            if ($_smarty_tpl->tpl_vars['order_info']->value['products'][$_smarty_tpl->tpl_vars['cart_id']->value]['product_options']) {
                                ?>
(<?php 
                                echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['order_info']->value['products'][$_smarty_tpl->tpl_vars['cart_id']->value]['product_options']), 0);
                                ?>
)<?php 
                            }
                            ?>
</li>
                            <?php 
                        } else {
                            ?>
                                <?php 
                            $_smarty_tpl->tpl_vars["allowed"] = new Smarty_variable(false, null, 0);
                            ?>
                            <?php 
                        }
                        ?>
                        <?php 
                    }
                    ?>
                        </ul>
                        <span class="strong"><?php 
                    echo $_smarty_tpl->__("weight");
                    ?>
:</span> <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['package']->value['weight'], ENT_QUOTES, 'UTF-8');
                    ?>
<br />
                        <span class="strong"><?php 
                    echo $_smarty_tpl->__("shipping_method");
                    ?>
:</span> <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8');
                    ?>

                    </div>
                                        <?php 
                    list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                    if (!empty($_capture_buffer)) {
                        if (isset($_capture_assign)) {
                            $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                        }
                        if (isset($_capture_append)) {
                            $_smarty_tpl->append($_capture_append, ob_get_contents());
                        }
                        Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                    } else {
                        $_smarty_tpl->capture_error();
                    }
                    ?>
                    
                    <?php 
                    if ($_smarty_tpl->tpl_vars['allowed']->value) {
                        ?>
                        <?php 
                        echo Smarty::$_smarty_vars['capture']['package_container'];
                        ?>

                    <?php 
                    }
                    ?>
                    
                    <?php 
                    echo smarty_function_math(array('equation' => "num + 1", 'num' => $_smarty_tpl->tpl_vars['package_num']->value, 'assign' => "package_num"), $_smarty_tpl);
                    ?>

                <?php 
                }
                ?>
            <?php 
            }
            ?>
        </div>
    <?php 
        }
        ?>
</div>

<div class="buttons-container">
    <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/save_cancel.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_name' => "dispatch[shipments.add]", 'cancel_action' => "close"), 0);
        ?>

</div>


</form>


<script type="text/javascript">
    function fn_calculate_packages()
    {
        var products = [];
        
        Tygh.$('.cm-shipments-package:checked').each(function(id, elm) {
            jelm = Tygh.$(elm);
            id = jelm.prop('id');
            
            for (var i in packages[id]) {
                if (typeof(products[i]) == 'undefined') {
                    products[i] = parseInt(packages[id][i]);
                } else {
                    products[i] += parseInt(packages[id][i]);
                }
            }
        });
        
        // Set the values of the ship products to 0. We will change the values to the correct variants after
        Tygh.$('.cm-shipments-product').each(function() {
            Tygh.$(this).val(0);
        });
        
        if (products.length > 0) {
            for (var i in products) {
                Tygh.$('#shipment_data_' + i).val(products[i]);
            }
        }
    }
    Tygh.$(document).ready(function() {
        Tygh.$('.cm-shipments-package').on('change', fn_calculate_packages);
    });
</script>

<?php 
    }
Пример #10
0
    }
    if ($mode == 'delete' && !empty($_REQUEST['return_id'])) {
        fn_delete_return($_REQUEST['return_id']);
        $suffix = '.returns';
    }
    if ($mode == 'delete_property') {
        if (!empty($_REQUEST['property_id'])) {
            fn_rma_delete_property($_REQUEST['property_id']);
        }
        $suffix = '.properties?property_type=' . $_REQUEST['property_type'];
    }
    return array(CONTROLLER_STATUS_OK, 'rma' . $suffix);
}
if ($mode == 'properties') {
    $property_type = !empty($_REQUEST['property_type']) ? $_REQUEST['property_type'] : RMA_REASON;
    fn_rma_generate_sections($property_type == RMA_REASON ? 'reasons' : 'actions');
    Tygh::$app['view']->assign('properties', fn_get_rma_properties($property_type, DESCR_SL));
} elseif ($mode == 'confirmation') {
    $change_return_status = $_SESSION['change_return_status'];
    unset($_SESSION['change_return_status']);
    if ($change_return_status['recalculate_order'] == 'R') {
        $additional_data = db_get_hash_single_array("SELECT type,data FROM ?:order_data WHERE order_id = ?i", array('type', 'data'), $change_return_status['order_id']);
        $shipping_info = @unserialize($additional_data['L']);
        Tygh::$app['view']->assign('shipping_info', $shipping_info);
    } else {
        $total = db_get_field("SELECT SUM(amount*price) FROM ?:rma_return_products WHERE return_id = ?i AND type = ?s", $change_return_status['return_id'], RETURN_PRODUCT_ACCEPTED);
        $change_return_status['total'] = $change_return_status['inventory_to'] == 'I' && !($change_return_status['inventory_from'] == 'I' && $change_return_status['status_to'] == RMA_DEFAULT_STATUS) ? -$total : $total;
    }
    Tygh::$app['view']->assign('change_return_status', $change_return_status);
    Tygh::$app['view']->assign('status_descr', fn_get_simple_statuses(STATUSES_RETURN));
}
    function content_55d5c758ebe784_57079803($_smarty_tpl)
    {
        fn_preload_lang_vars(array('expand_sublist_of_items', 'collapse_sublist_of_items', 'returns_info', 'status', 'amount'));
        if ($_smarty_tpl->tpl_vars['oi']->value['returns_info']) {
            ?>
    <?php 
            if (!$_smarty_tpl->tpl_vars['return_statuses']->value) {
                $_smarty_tpl->tpl_vars["return_statuses"] = new Smarty_variable(fn_get_simple_statuses(@constant('STATUSES_RETURN')), null, 0);
            }
            ?>

    <p class="shift-top">
        <i title="<?php 
            echo $_smarty_tpl->__("expand_sublist_of_items");
            ?>
" id="on_ret_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="hand cm-combination exicon-expand"></i>
        <i title="<?php 
            echo $_smarty_tpl->__("collapse_sublist_of_items");
            ?>
" id="off_ret_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="hand hidden cm-combination exicon-collapse"></i>
        <a id="sw_ret_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
            ?>
" class="cm-combination"><?php 
            echo $_smarty_tpl->__("returns_info");
            ?>
</a>
    </p>
    <table width="100%" class="table table-condensed table-no-bg hidden" id="ret_<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['key']->value, ENT_QUOTES, 'UTF-8');
            ?>
">
    <thead>
    <tr>
        <th>&nbsp;<?php 
            echo $_smarty_tpl->__("status");
            ?>
</th>
        <th><?php 
            echo $_smarty_tpl->__("amount");
            ?>
</th>
    </tr>
    </thead>
    <tbody>
        <?php 
            $_smarty_tpl->tpl_vars["amount"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["amount"]->_loop = false;
            $_smarty_tpl->tpl_vars["status"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['oi']->value['returns_info'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["amount"]->key => $_smarty_tpl->tpl_vars["amount"]->value) {
                $_smarty_tpl->tpl_vars["amount"]->_loop = true;
                $_smarty_tpl->tpl_vars["status"]->value = $_smarty_tpl->tpl_vars["amount"]->key;
                ?>
        <tr>
            <td><?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['return_statuses']->value[$_smarty_tpl->tpl_vars['status']->value]) === null || $tmp === '' ? '' : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
</td>
            <td><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['amount']->value, ENT_QUOTES, 'UTF-8');
                ?>
</td>
        </tr>
        <?php 
            }
            ?>
    </tbody>
    </table>
<?php 
        }
    }
Пример #12
0
        }
        $suffix = ".details?return_id={$change_return_status['return_id']}";
    }
    return array(CONTROLLER_STATUS_OK, "rma{$suffix}");
}
if ($mode == 'properties') {
    $property_type = !empty($_REQUEST['property_type']) ? $_REQUEST['property_type'] : RMA_REASON;
    fn_rma_generate_sections($property_type == RMA_REASON ? 'reasons' : 'actions');
    Registry::get('view')->assign('properties', fn_get_rma_properties($property_type, DESCR_SL));
} elseif ($mode == 'delete' && !empty($_REQUEST['return_id'])) {
    fn_delete_return($_REQUEST['return_id']);
    return array(CONTROLLER_STATUS_REDIRECT, "rma.returns");
} elseif ($mode == 'confirmation') {
    $change_return_status = $_SESSION['change_return_status'];
    unset($_SESSION['change_return_status']);
    if ($change_return_status['recalculate_order'] == 'R') {
        $additional_data = db_get_hash_single_array("SELECT type,data FROM ?:order_data WHERE order_id = ?i", array('type', 'data'), $change_return_status['order_id']);
        $shipping_info = @unserialize($additional_data['L']);
        Registry::get('view')->assign('shipping_info', $shipping_info);
    } else {
        $total = db_get_field("SELECT SUM(amount*price) FROM ?:rma_return_products WHERE return_id = ?i AND type = ?s", $change_return_status['return_id'], RETURN_PRODUCT_ACCEPTED);
        $change_return_status['total'] = $change_return_status['inventory_to'] == 'I' && !($change_return_status['inventory_from'] == 'I' && $change_return_status['status_to'] == RMA_DEFAULT_STATUS) ? -$total : $total;
    }
    Registry::get('view')->assign('change_return_status', $change_return_status);
    Registry::get('view')->assign('status_descr', fn_get_simple_statuses(STATUSES_RETURN));
} elseif ($mode == 'delete_property') {
    if (!empty($_REQUEST['property_id'])) {
        fn_rma_delete_property($_REQUEST['property_id']);
    }
    return array(CONTROLLER_STATUS_REDIRECT, "rma.properties?property_type={$_REQUEST['property_type']}");
}
    function content_55d5c545983fe1_75208923($_smarty_tpl)
    {
        if (!is_callable('smarty_function_html_options')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.html_options.php';
        }
        if (!is_callable('smarty_function_html_checkboxes')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.html_checkboxes.php';
        }
        if (!is_callable('smarty_function_set_id')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/function.set_id.php';
        }
        if ($_smarty_tpl->tpl_vars['runtime']->value['customization_mode']['design'] == "Y" && @constant('AREA') == "C") {
            $_smarty_tpl->_capture_stack[0][] = array("template_content", null, null);
            ob_start();
            if (!$_smarty_tpl->tpl_vars['order_status_descr']->value) {
                ?>
    <?php 
                if (!$_smarty_tpl->tpl_vars['status_type']->value) {
                    $_smarty_tpl->tpl_vars["status_type"] = new Smarty_variable(@constant('STATUSES_ORDER'), null, 0);
                }
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["order_status_descr"] = new Smarty_variable(fn_get_simple_statuses($_smarty_tpl->tpl_vars['status_type']->value), null, 0);
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['display']->value == "view") {
                echo htmlspecialchars($_smarty_tpl->tpl_vars['order_status_descr']->value[$_smarty_tpl->tpl_vars['status']->value], ENT_QUOTES, 'UTF-8');
            } elseif ($_smarty_tpl->tpl_vars['display']->value == "select") {
                echo smarty_function_html_options(array('name' => $_smarty_tpl->tpl_vars['name']->value, 'options' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'selected' => $_smarty_tpl->tpl_vars['status']->value, 'id' => $_smarty_tpl->tpl_vars['select_id']->value), $_smarty_tpl);
            } elseif ($_smarty_tpl->tpl_vars['display']->value == "checkboxes") {
                ?>
<div class="ty-status-info"><?php 
                echo smarty_function_html_checkboxes(array('name' => $_smarty_tpl->tpl_vars['name']->value, 'options' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'selected' => $_smarty_tpl->tpl_vars['status']->value, 'columns' => 4), $_smarty_tpl);
                ?>
</div><?php 
            }
            list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
            if (!empty($_capture_buffer)) {
                if (isset($_capture_assign)) {
                    $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                }
                if (isset($_capture_append)) {
                    $_smarty_tpl->append($_capture_append, ob_get_contents());
                }
                Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
            } else {
                $_smarty_tpl->capture_error();
            }
            if (trim(Smarty::$_smarty_vars['capture']['template_content'])) {
                if ($_smarty_tpl->tpl_vars['auth']->value['area'] == "A") {
                    ?>
<span class="cm-template-box template-box" data-ca-te-template="common/status.tpl" id="<?php 
                    echo smarty_function_set_id(array('name' => "common/status.tpl"), $_smarty_tpl);
                    ?>
"><div class="cm-template-icon icon-edit ty-icon-edit hidden"></div><?php 
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                    ?>
<!--[/tpl_id]--></span><?php 
                } else {
                    echo Smarty::$_smarty_vars['capture']['template_content'];
                }
            }
        } else {
            if (!$_smarty_tpl->tpl_vars['order_status_descr']->value) {
                ?>
    <?php 
                if (!$_smarty_tpl->tpl_vars['status_type']->value) {
                    $_smarty_tpl->tpl_vars["status_type"] = new Smarty_variable(@constant('STATUSES_ORDER'), null, 0);
                }
                ?>
    <?php 
                $_smarty_tpl->tpl_vars["order_status_descr"] = new Smarty_variable(fn_get_simple_statuses($_smarty_tpl->tpl_vars['status_type']->value), null, 0);
            }
            ?>

<?php 
            if ($_smarty_tpl->tpl_vars['display']->value == "view") {
                echo htmlspecialchars($_smarty_tpl->tpl_vars['order_status_descr']->value[$_smarty_tpl->tpl_vars['status']->value], ENT_QUOTES, 'UTF-8');
            } elseif ($_smarty_tpl->tpl_vars['display']->value == "select") {
                echo smarty_function_html_options(array('name' => $_smarty_tpl->tpl_vars['name']->value, 'options' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'selected' => $_smarty_tpl->tpl_vars['status']->value, 'id' => $_smarty_tpl->tpl_vars['select_id']->value), $_smarty_tpl);
            } elseif ($_smarty_tpl->tpl_vars['display']->value == "checkboxes") {
                ?>
<div class="ty-status-info"><?php 
                echo smarty_function_html_checkboxes(array('name' => $_smarty_tpl->tpl_vars['name']->value, 'options' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'selected' => $_smarty_tpl->tpl_vars['status']->value, 'columns' => 4), $_smarty_tpl);
                ?>
</div><?php 
            }
        }
    }
    function content_55d5c52c0f4b99_17469338($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php';
        }
        fn_preload_lang_vars(array('text_admin_new_orders', 'incompleted_orders', 'orders', 'id', 'status', 'date', 'customer', 'phone', 'total', 'order', 'invoice', 'credit_memo', 'view', 'edit', 'delete', 'no_data', 'for_this_page_orders', 'gross_total', 'totally_paid', 'for_all_found_orders', 'gross_total', 'totally_paid', 'add_order', 'bulk_print_invoice', 'bulk_print_pdf', 'bulk_print_packing_slip', 'view_purchased_products', 'export_selected', 'view_all_orders', 'incompleted_orders'));
        $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null);
        ob_start();
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['runtime']->value['mode'] == "new") {
            ?>
    <p><?php 
            echo $_smarty_tpl->__("text_admin_new_orders");
            ?>
</p>
<?php 
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("sidebar", null, null);
        ob_start();
        ?>
    <?php 
        echo $_smarty_tpl->getSubTemplate("common/saved_search.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('dispatch' => "orders.manage", 'view_type' => "orders"), 0);
        ?>

    <?php 
        echo $_smarty_tpl->getSubTemplate("views/orders/components/orders_search_form.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('dispatch' => "orders.manage"), 0);
        ?>

<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<form action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" method="post" target="_self" name="orders_list_form">

<?php 
        echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('save_current_page' => true, 'save_current_url' => true, 'div_id' => $_REQUEST['content_id']), 0);
        ?>


<?php 
        $_smarty_tpl->tpl_vars["c_url"] = new Smarty_variable(fn_query_remove($_smarty_tpl->tpl_vars['config']->value['current_url'], "sort_by", "sort_order"), null, 0);
        $_smarty_tpl->tpl_vars["c_icon"] = new Smarty_variable("<i class=\"exicon-" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev'] . "\"></i>", null, 0);
        $_smarty_tpl->tpl_vars["c_dummy"] = new Smarty_variable("<i class=\"exicon-dummy\"></i>", null, 0);
        ?>

<?php 
        $_smarty_tpl->tpl_vars["rev"] = new Smarty_variable(($tmp = @$_REQUEST['content_id']) === null || $tmp === '' ? "pagination_contents" : $tmp, null, 0);
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['incompleted_view']->value) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["page_title"] = new Smarty_variable($_smarty_tpl->__("incompleted_orders"), null, 0);
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["get_additional_statuses"] = new Smarty_variable(true, null, 0);
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["page_title"] = new Smarty_variable($_smarty_tpl->__("orders"), null, 0);
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["get_additional_statuses"] = new Smarty_variable(false, null, 0);
        }
        $_smarty_tpl->tpl_vars["order_status_descr"] = new Smarty_variable(fn_get_simple_statuses(@constant('STATUSES_ORDER'), $_smarty_tpl->tpl_vars['get_additional_statuses']->value, true), null, 0);
        $_smarty_tpl->tpl_vars["extra_status"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
        $_smarty_tpl->tpl_vars['statuses'] = new Smarty_variable(array(), null, 0);
        $_smarty_tpl->tpl_vars["order_statuses"] = new Smarty_variable(fn_get_statuses(@constant('STATUSES_ORDER'), $_smarty_tpl->tpl_vars['statuses']->value, $_smarty_tpl->tpl_vars['get_additional_statuses']->value, true), null, 0);
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['orders']->value) {
            ?>
<table width="100%" class="table table-middle">
<thead>
<tr>
    <th  class="left">
    <?php 
            echo $_smarty_tpl->getSubTemplate("common/check_items.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('check_statuses' => $_smarty_tpl->tpl_vars['order_status_descr']->value), 0);
            ?>

    </th>
    <th width="17%"><a class="cm-ajax" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=order_id&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id=<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['rev']->value, ENT_QUOTES, 'UTF-8');
            ?>
><?php 
            echo $_smarty_tpl->__("id");
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "order_id") {
                echo $_smarty_tpl->tpl_vars['c_icon']->value;
            } else {
                echo $_smarty_tpl->tpl_vars['c_dummy']->value;
            }
            ?>
</a></th>
    <th width="17%"><a class="cm-ajax" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=status&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id=<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['rev']->value, ENT_QUOTES, 'UTF-8');
            ?>
><?php 
            echo $_smarty_tpl->__("status");
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "status") {
                echo $_smarty_tpl->tpl_vars['c_icon']->value;
            } else {
                echo $_smarty_tpl->tpl_vars['c_dummy']->value;
            }
            ?>
</a></th>
    <th width="15%"><a class="cm-ajax" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=date&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id=<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['rev']->value, ENT_QUOTES, 'UTF-8');
            ?>
><?php 
            echo $_smarty_tpl->__("date");
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "date") {
                echo $_smarty_tpl->tpl_vars['c_icon']->value;
            } else {
                echo $_smarty_tpl->tpl_vars['c_dummy']->value;
            }
            ?>
</a></th>
    <th width="20%"><a class="cm-ajax" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=customer&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id=<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['rev']->value, ENT_QUOTES, 'UTF-8');
            ?>
><?php 
            echo $_smarty_tpl->__("customer");
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "customer") {
                echo $_smarty_tpl->tpl_vars['c_icon']->value;
            }
            ?>
</a></th>
    <th width="15%"><a class="cm-ajax" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=phone&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id=<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['rev']->value, ENT_QUOTES, 'UTF-8');
            ?>
><?php 
            echo $_smarty_tpl->__("phone");
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "phone") {
                echo $_smarty_tpl->tpl_vars['c_icon']->value;
            }
            ?>
</a></th>

    <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:manage_header"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "orders:manage_header"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "orders:manage_header"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>


    <th>&nbsp;</th>
    <th width="14%" class="right"><a class="cm-ajax<?php 
            if ($_smarty_tpl->tpl_vars['search']->value['sort_by'] == "total") {
                ?>
 sort-link-<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['search']->value['sort_order_rev'], ENT_QUOTES, 'UTF-8');
            }
            ?>
" href="<?php 
            echo htmlspecialchars(fn_url((string) $_smarty_tpl->tpl_vars['c_url']->value . "&sort_by=total&sort_order=" . (string) $_smarty_tpl->tpl_vars['search']->value['sort_order_rev']), ENT_QUOTES, 'UTF-8');
            ?>
" data-ca-target-id=<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['rev']->value, ENT_QUOTES, 'UTF-8');
            ?>
><?php 
            echo $_smarty_tpl->__("total");
            ?>
</a></th>

</tr>
</thead>
<?php 
            $_smarty_tpl->tpl_vars["o"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["o"]->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['orders']->value;
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["o"]->key => $_smarty_tpl->tpl_vars["o"]->value) {
                $_smarty_tpl->tpl_vars["o"]->_loop = true;
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:order_row"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "orders:order_row"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

<tr>
    <td class="left">
        <input type="checkbox" name="order_ids[]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['o']->value['order_id'], ENT_QUOTES, 'UTF-8');
                    ?>
" class="cm-item cm-item-status-<?php 
                    echo htmlspecialchars(mb_strtolower($_smarty_tpl->tpl_vars['o']->value['status'], 'UTF-8'), ENT_QUOTES, 'UTF-8');
                    ?>
" /></td>
    <td>
        <a href="<?php 
                    echo htmlspecialchars(fn_url("orders.details?order_id=" . (string) $_smarty_tpl->tpl_vars['o']->value['order_id']), ENT_QUOTES, 'UTF-8');
                    ?>
" class="underlined"><?php 
                    echo $_smarty_tpl->__("order");
                    ?>
 #<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['o']->value['order_id'], ENT_QUOTES, 'UTF-8');
                    ?>
</a>
        <?php 
                    if ($_smarty_tpl->tpl_vars['order_statuses_data']->value[$_smarty_tpl->tpl_vars['o']->value['status']]['params']['appearance_type'] == "I" && $_smarty_tpl->tpl_vars['o']->value['invoice_id']) {
                        ?>
            <p class="small-note"><?php 
                        echo $_smarty_tpl->__("invoice");
                        ?>
 #<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['o']->value['invoice_id'], ENT_QUOTES, 'UTF-8');
                        ?>
</p>
        <?php 
                    } elseif ($_smarty_tpl->tpl_vars['order_statuses_data']->value[$_smarty_tpl->tpl_vars['o']->value['status']]['params']['appearance_type'] == "C" && $_smarty_tpl->tpl_vars['o']->value['credit_memo_id']) {
                        ?>
            <p class="small-note"><?php 
                        echo $_smarty_tpl->__("credit_memo");
                        ?>
 #<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['o']->value['credit_memo_id'], ENT_QUOTES, 'UTF-8');
                        ?>
</p>
        <?php 
                    }
                    ?>
        <?php 
                    echo $_smarty_tpl->getSubTemplate("views/companies/components/company_name.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('object' => $_smarty_tpl->tpl_vars['o']->value), 0);
                    ?>

    </td>
    <td>
        <?php 
                    if (fn_allowed_for("MULTIVENDOR")) {
                        ?>
            <?php 
                        $_smarty_tpl->tpl_vars["notify_vendor"] = new Smarty_variable(true, null, 0);
                        ?>
        <?php 
                    } else {
                        ?>
            <?php 
                        $_smarty_tpl->tpl_vars["notify_vendor"] = new Smarty_variable(false, null, 0);
                        ?>
        <?php 
                    }
                    ?>

        <?php 
                    echo $_smarty_tpl->getSubTemplate("common/select_popup.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('suffix' => "o", 'order_info' => $_smarty_tpl->tpl_vars['o']->value, 'id' => $_smarty_tpl->tpl_vars['o']->value['order_id'], 'status' => $_smarty_tpl->tpl_vars['o']->value['status'], 'items_status' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'update_controller' => "orders", 'notify' => true, 'notify_department' => true, 'notify_vendor' => $_smarty_tpl->tpl_vars['notify_vendor']->value, 'status_target_id' => "orders_total," . (string) $_smarty_tpl->tpl_vars['rev']->value, 'extra' => "&return_url=" . (string) $_smarty_tpl->tpl_vars['extra_status']->value, 'statuses' => $_smarty_tpl->tpl_vars['order_statuses']->value, 'btn_meta' => mb_strtolower("btn btn-info o-status-" . (string) $_smarty_tpl->tpl_vars['o']->value['status'] . " btn-small", 'UTF-8')), 0);
                    ?>

    </td>
    <td><?php 
                    echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['o']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8');
                    ?>
</td>
    <td>
        <?php 
                    if ($_smarty_tpl->tpl_vars['o']->value['email']) {
                        ?>
<a href="mailto:<?php 
                        echo htmlspecialchars(rawurlencode($_smarty_tpl->tpl_vars['o']->value['email']), ENT_QUOTES, 'UTF-8');
                        ?>
">@</a> <?php 
                    }
                    ?>
        <?php 
                    if ($_smarty_tpl->tpl_vars['o']->value['user_id']) {
                        ?>
<a href="<?php 
                        echo htmlspecialchars(fn_url("profiles.update?user_id=" . (string) $_smarty_tpl->tpl_vars['o']->value['user_id']), ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                    }
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['o']->value['lastname'], ENT_QUOTES, 'UTF-8');
                    ?>
 <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['o']->value['firstname'], ENT_QUOTES, 'UTF-8');
                    if ($_smarty_tpl->tpl_vars['o']->value['user_id']) {
                        ?>
</a><?php 
                    }
                    ?>
    </td>
    <td><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['o']->value['phone'], ENT_QUOTES, 'UTF-8');
                    ?>
</td>

    <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:manage_data"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "orders:manage_data"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "orders:manage_data"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>


    <td width="5%" class="center">
        <?php 
                    $_smarty_tpl->_capture_stack[0][] = array("tools_items", null, null);
                    ob_start();
                    ?>
            <li><?php 
                    ob_start();
                    echo $_smarty_tpl->__("view");
                    $_tmp1 = ob_get_clean();
                    smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "orders.details?order_id=" . (string) $_smarty_tpl->tpl_vars['o']->value['order_id'], 'text' => $_tmp1));
                    ?>
</li>
            <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:list_extra_links"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "orders:list_extra_links"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

                <li><?php 
                        ob_start();
                        echo $_smarty_tpl->__("edit");
                        $_tmp2 = ob_get_clean();
                        smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "order_management.edit?order_id=" . (string) $_smarty_tpl->tpl_vars['o']->value['order_id'], 'text' => $_tmp2));
                        ?>
</li>
                <?php 
                        $_smarty_tpl->tpl_vars["current_redirect_url"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
                        ?>
                <li><?php 
                        ob_start();
                        echo $_smarty_tpl->__("delete");
                        $_tmp3 = ob_get_clean();
                        smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "orders.delete?order_id=" . (string) $_smarty_tpl->tpl_vars['o']->value['order_id'] . "&redirect_url=" . (string) $_smarty_tpl->tpl_vars['current_redirect_url']->value, 'class' => "cm-confirm", 'text' => $_tmp3));
                        ?>
</li>
            <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "orders:list_extra_links"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>

        <?php 
                    list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                    if (!empty($_capture_buffer)) {
                        if (isset($_capture_assign)) {
                            $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                        }
                        if (isset($_capture_append)) {
                            $_smarty_tpl->append($_capture_append, ob_get_contents());
                        }
                        Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                    } else {
                        $_smarty_tpl->capture_error();
                    }
                    ?>
        <div class="hidden-tools">
            <?php 
                    smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_items']));
                    ?>

        </div>
    </td>
    <td class="right">
        <?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['o']->value['total']), 0);
                    ?>

    </td>
</tr>
<?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "orders:order_row"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

<?php 
            }
            ?>
</table>
<?php 
        } else {
            ?>
    <p class="no-items"><?php 
            echo $_smarty_tpl->__("no_data");
            ?>
</p>
<?php 
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['orders']->value) {
            ?>
    <div class="statistic clearfix" id="orders_total">
        <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:statistic_list"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "orders:statistic_list"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

        <table class="pull-right ">
            <?php 
                if ($_smarty_tpl->tpl_vars['total_pages']->value > 1 && $_smarty_tpl->tpl_vars['search']->value['page'] != "full_list") {
                    ?>
                <tr>
                    <td>&nbsp;</td>
                    <td width="100px"><?php 
                    echo $_smarty_tpl->__("for_this_page_orders");
                    ?>
:</td>
                </tr>
                <tr>
                    <td><?php 
                    echo $_smarty_tpl->__("gross_total");
                    ?>
:</td>
                    <td><?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['display_totals']->value['gross_total']), 0);
                    ?>
</td>
                </tr>
                <?php 
                    if (!$_smarty_tpl->tpl_vars['incompleted_view']->value) {
                        ?>
                    <tr>
                        <td><?php 
                        echo $_smarty_tpl->__("totally_paid");
                        ?>
:</td>
                        <td><?php 
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['display_totals']->value['totally_paid']), 0);
                        ?>
</td>
                    </tr>
                <?php 
                    }
                    ?>
                <hr />
                <tr>
                    <td><?php 
                    echo $_smarty_tpl->__("for_all_found_orders");
                    ?>
:</td>
                </tr>
            <?php 
                }
                ?>
            <tr>
                <td><?php 
                echo $_smarty_tpl->__("gross_total");
                ?>
:</td>
                <td><?php 
                echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['totals']->value['gross_total']), 0);
                ?>
</td>
            </tr>
            <?php 
                $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:totals_stats"));
                $_block_repeat = true;
                echo smarty_block_hook(array('name' => "orders:totals_stats"), null, $_smarty_tpl, $_block_repeat);
                while ($_block_repeat) {
                    ob_start();
                    ?>

                <?php 
                    if (!$_smarty_tpl->tpl_vars['incompleted_view']->value) {
                        ?>
                    <tr>
                        <td><h4><?php 
                        echo $_smarty_tpl->__("totally_paid");
                        ?>
:</h4></td>
                        <td class="price"><?php 
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['totals']->value['totally_paid']), 0);
                        ?>
</td>
                    </tr>
                <?php 
                    }
                    ?>
            <?php 
                    $_block_content = ob_get_clean();
                    $_block_repeat = false;
                    echo smarty_block_hook(array('name' => "orders:totals_stats"), $_block_content, $_smarty_tpl, $_block_repeat);
                }
                array_pop($_smarty_tpl->smarty->_tag_stack);
                ?>

        </table>
        <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "orders:statistic_list"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

    <!--orders_total--></div>
<?php 
        }
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate("common/pagination.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('div_id' => $_REQUEST['content_id']), 0);
        ?>



<?php 
        $_smarty_tpl->_capture_stack[0][] = array("adv_buttons", null, null);
        ob_start();
        ?>
    <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:manage_tools"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:manage_tools"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

        <?php 
            echo $_smarty_tpl->getSubTemplate("common/tools.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('tool_href' => "order_management.new", 'prefix' => "bottom", 'hide_tools' => "true", 'title' => __("add_order"), 'icon' => "icon-plus"), 0);
            ?>

    <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:manage_tools"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

</form>
<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null);
        ob_start();
        ?>
    <?php 
        $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null);
        ob_start();
        ?>
        <?php 
        if ($_smarty_tpl->tpl_vars['orders']->value) {
            ?>
            <li><?php 
            ob_start();
            echo $_smarty_tpl->__("bulk_print_invoice");
            $_tmp4 = ob_get_clean();
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_tmp4, 'dispatch' => "dispatch[orders.bulk_print]", 'form' => "orders_list_form", 'class' => "cm-new-window"));
            ?>
</li>
            <li><?php 
            ob_start();
            echo $_smarty_tpl->__("bulk_print_pdf");
            $_tmp5 = ob_get_clean();
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_tmp5, 'dispatch' => "dispatch[orders.bulk_print..pdf]", 'form' => "orders_list_form"));
            ?>
</li>            
            <li><?php 
            ob_start();
            echo $_smarty_tpl->__("bulk_print_packing_slip");
            $_tmp6 = ob_get_clean();
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_tmp6, 'dispatch' => "dispatch[orders.packing_slip]", 'form' => "orders_list_form", 'class' => "cm-new-window"));
            ?>
</li>
            <li><?php 
            ob_start();
            echo $_smarty_tpl->__("view_purchased_products");
            $_tmp7 = ob_get_clean();
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_tmp7, 'dispatch' => "dispatch[orders.products_range]", 'form' => "orders_list_form"));
            ?>
</li>
            
            <li class="divider"></li>
            <li><?php 
            ob_start();
            echo $_smarty_tpl->__("export_selected");
            $_tmp8 = ob_get_clean();
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_tmp8, 'dispatch' => "dispatch[orders.export_range]", 'form' => "orders_list_form"));
            ?>
</li>
            <?php 
            if ($_smarty_tpl->tpl_vars['incompleted_view']->value) {
                ?>
                <li><?php 
                ob_start();
                echo $_smarty_tpl->__("view_all_orders");
                $_tmp9 = ob_get_clean();
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "orders.manage", 'text' => $_tmp9));
                ?>
</li>
            <?php 
            } else {
                ?>
                <li><?php 
                ob_start();
                echo $_smarty_tpl->__("incompleted_orders");
                $_tmp10 = ob_get_clean();
                smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'href' => "orders.manage?skip_view=Y&status=" . (string) @constant('STATUS_INCOMPLETED_ORDER'), 'text' => $_tmp10, 'form' => "orders_list_form"));
                ?>
</li>
            <?php 
            }
            ?>
            <?php 
            if ($_smarty_tpl->tpl_vars['orders']->value && !$_smarty_tpl->tpl_vars['runtime']->value['company_id']) {
                ?>
                <li class="divider"></li>
                <li><?php 
                smarty_template_function_btn($_smarty_tpl, array('type' => "delete_selected", 'dispatch' => "dispatch[orders.m_delete]", 'form' => "orders_list_form"));
                ?>
</li>
            <?php 
            }
            ?>
        <?php 
        }
        ?>
        <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:list_tools"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:list_tools"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

        <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:list_tools"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

    <?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>
    <?php 
        smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_list']));
        ?>

<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => $_smarty_tpl->tpl_vars['page_title']->value, 'sidebar' => Smarty::$_smarty_vars['capture']['sidebar'], 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'buttons' => Smarty::$_smarty_vars['capture']['buttons'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons'], 'content_id' => "manage_orders"), 0);
        ?>

<?php 
    }
 }
 //
 // Prepare order status info
 //
 $get_additional_statuses = false;
 if (!empty($cart['order_id'])) {
     $order_info = fn_get_order_short_info($cart['order_id']);
     $cart['order_status'] = $order_info['status'];
     if ($cart['order_status'] == STATUS_INCOMPLETED_ORDER) {
         $get_additional_statuses = true;
     }
     if (!empty($order_info['issuer_id'])) {
         $cart['issuer_data'] = fn_get_user_short_info($order_info['issuer_id']);
     }
 }
 $order_statuses = fn_get_simple_statuses(STATUSES_ORDER, $get_additional_statuses, true);
 Registry::get('view')->assign('order_statuses', $order_statuses);
 //
 // Prepare customer info
 //
 $profile_fields = fn_get_profile_fields('O', $customer_auth);
 $cart['profile_id'] = empty($cart['profile_id']) ? 0 : $cart['profile_id'];
 Registry::get('view')->assign('profile_fields', $profile_fields);
 //Get user profiles
 $user_profiles = fn_get_user_profiles($customer_auth['user_id']);
 Registry::get('view')->assign('user_profiles', $user_profiles);
 //Get countries and states
 Registry::get('view')->assign('countries', fn_get_simple_countries(true, CART_LANGUAGE));
 Registry::get('view')->assign('states', fn_get_all_states());
 Registry::get('view')->assign('usergroups', fn_get_usergroups('C', DESCR_SL));
 if (!empty($customer_auth['user_id']) && (empty($cart['user_data']) || !empty($_REQUEST['profile_id']) && $cart['profile_id'] != $_REQUEST['profile_id'])) {
Пример #16
0
function fn_rma_print_packing_slips($return_ids, $auth, $area = AREA)
{
    $view = Registry::get('view');
    $passed = false;
    if (!is_array($return_ids)) {
        $return_ids = array($return_ids);
    }
    $view->assign('reasons', fn_get_rma_properties(RMA_REASON));
    $view->assign('actions', fn_get_rma_properties(RMA_ACTION));
    $view->assign('order_status_descr', fn_get_simple_statuses(STATUSES_RETURN));
    foreach ($return_ids as $return_id) {
        $return_info = fn_get_return_info($return_id);
        if (empty($return_info) || $area == 'C' && $return_info['user_id'] != $auth['user_id']) {
            continue;
        }
        $order_info = fn_get_order_info($return_info['order_id']);
        if (empty($order_info)) {
            continue;
        }
        $passed = true;
        $view->assign('return_info', $return_info);
        $view->assign('order_info', $order_info);
        $view->assign('company_data', fn_get_company_placement_info($order_info['company_id']));
        $view->displayMail('addons/rma/print_slip.tpl', true, $area, $order_info['company_id']);
        if ($return_id != end($return_ids)) {
            echo "<div style='page-break-before: always;'>&nbsp;</div>";
        }
    }
    return $passed;
}
    function content_55d5c758c30951_62619282($_smarty_tpl)
    {
        if (!is_callable('smarty_block_hook')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/block.hook.php';
        }
        if (!is_callable('smarty_modifier_date_format')) {
            include '/home/coriolan/public_html/lead/app/functions/smarty_plugins/modifier.date_format.php';
        }
        if (!is_callable('smarty_function_math')) {
            include '/home/coriolan/public_html/lead/app/lib/other/smarty/plugins/function.math.php';
        }
        fn_preload_lang_vars(array('new_shipment', 'new_shipment', 'product', 'price', 'quantity', 'discount', 'tax', 'subtotal', 'sku', 'ls_shipping_estimation', 'free', 'shipped', 'free', 'ls_shipping_estimation', 'totals', 'subtotal', 'shipping_cost', 'including_discount', 'order_discount', 'discount_coupon', 'taxes', 'included', 'tax_exempt', 'payment_surcharge', 'total', 'customer_notes', 'staff_only_notes', 'status', 'payment_information', 'method', 'credit_card', 'expiry_date', 'remove_cc_info', 'shipping_information', 'none', 'method', 'new_shipment', 'new_shipment', 'shipments', 'tracking_number', 'carrier', 'shipments', 'new_shipment', 'new_shipment', 'shipments', 'filename', 'activation_mode', 'downloads_max_left', 'download_key_expiry', 'active', 'manually', 'immediately', 'after_full_payment', 'none', 'time_unlimited_download', 'download_key_expiry', 'prolongate_download_key', 'file_doesnt_have_key', 'active', 'not_active', 'order', 'total', 'invoice', 'credit_memo', 'print_credit_memo', 'print_pdf_credit_memo', 'print_order_details', 'print_pdf_order_details', 'print_invoice', 'print_pdf_invoice', 'print_packing_slip', 'print_pdf_packing_slip', 'edit_order', 'notify_customer', 'notify_orders_department', 'notify_vendor'));
        if ($_smarty_tpl->tpl_vars['order_info']->value['shipping']) {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
            $_smarty_tpl->tpl_vars["shipping_id"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['order_info']->value['shipping'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
                $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
                $_smarty_tpl->tpl_vars["shipping_id"]->value = $_smarty_tpl->tpl_vars["shipping"]->key;
                ?>
        <?php 
                if ($_smarty_tpl->tpl_vars['use_shipments']->value) {
                    ?>
            <?php 
                    $_smarty_tpl->_capture_stack[0][] = array("add_new_picker", null, null);
                    ob_start();
                    ?>
                <?php 
                    echo $_smarty_tpl->getSubTemplate("views/shipments/components/new_shipment.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('group_key' => $_smarty_tpl->tpl_vars['shipping']->value['group_key']), 0);
                    ?>

            <?php 
                    list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                    if (!empty($_capture_buffer)) {
                        if (isset($_capture_assign)) {
                            $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                        }
                        if (isset($_capture_append)) {
                            $_smarty_tpl->append($_capture_append, ob_get_contents());
                        }
                        Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                    } else {
                        $_smarty_tpl->capture_error();
                    }
                    ?>
            <?php 
                    echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_shipment_" . (string) $_smarty_tpl->tpl_vars['shipping']->value['group_key'], 'content' => Smarty::$_smarty_vars['capture']['add_new_picker'], 'text' => __("new_shipment"), 'act' => "hidden"), 0);
                    ?>

        <?php 
                }
                ?>
    <?php 
            }
        } else {
            ?>
    <?php 
            $_smarty_tpl->tpl_vars["group"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["group"]->_loop = false;
            $_smarty_tpl->tpl_vars["group_id"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['order_info']->value['product_groups'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["group"]->key => $_smarty_tpl->tpl_vars["group"]->value) {
                $_smarty_tpl->tpl_vars["group"]->_loop = true;
                $_smarty_tpl->tpl_vars["group_id"]->value = $_smarty_tpl->tpl_vars["group"]->key;
                ?>
        <?php 
                if ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping']) {
                    ?>
            <?php 
                    if ($_smarty_tpl->tpl_vars['use_shipments']->value) {
                        ?>
                <?php 
                        $_smarty_tpl->_capture_stack[0][] = array("add_new_picker", null, null);
                        ob_start();
                        ?>
                    <?php 
                        echo $_smarty_tpl->getSubTemplate("views/shipments/components/new_shipment.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('group_key' => 0), 0);
                        ?>

                <?php 
                        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
                        if (!empty($_capture_buffer)) {
                            if (isset($_capture_assign)) {
                                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
                            }
                            if (isset($_capture_append)) {
                                $_smarty_tpl->append($_capture_append, ob_get_contents());
                            }
                            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
                        } else {
                            $_smarty_tpl->capture_error();
                        }
                        ?>
                <?php 
                        echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_shipment_0", 'content' => Smarty::$_smarty_vars['capture']['add_new_picker'], 'text' => __("new_shipment"), 'act' => "hidden"), 0);
                        ?>

            <?php 
                    }
                    ?>
        <?php 
                }
                ?>
    <?php 
            }
        }
        ?>
<form action="<?php 
        echo htmlspecialchars(fn_url(''), ENT_QUOTES, 'UTF-8');
        ?>
" method="post" name="order_info_form" class="form-horizontal form-edit form-table">
<input type="hidden" name="order_id" value="<?php 
        echo htmlspecialchars($_REQUEST['order_id'], ENT_QUOTES, 'UTF-8');
        ?>
" />
<input type="hidden" name="order_status" value="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['status'], ENT_QUOTES, 'UTF-8');
        ?>
" />
<input type="hidden" name="result_ids" value="content_general" />
<input type="hidden" name="selected_section" value="<?php 
        echo htmlspecialchars($_REQUEST['selected_section'], ENT_QUOTES, 'UTF-8');
        ?>
" />

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("mainbox", null, null);
        ob_start();
        $_smarty_tpl->_capture_stack[0][] = array("tabsbox", null, null);
        ob_start();
        ?>
<div id="content_general">
    <div class="row-fluid">
        <div class="span8">
            
            <table width="100%" class="table table-middle">
            <thead>
                <tr>
                    <th width="50%"><?php 
        echo $_smarty_tpl->__("product");
        ?>
</th>
                    <th width="10%"><?php 
        echo $_smarty_tpl->__("price");
        ?>
</th>
                    <th class="center" width="10%"><?php 
        echo $_smarty_tpl->__("quantity");
        ?>
</th>
                    <?php 
        if ($_smarty_tpl->tpl_vars['order_info']->value['use_discount']) {
            ?>
                    <th width="5%"><?php 
            echo $_smarty_tpl->__("discount");
            ?>
</th>
                    <?php 
        }
        ?>
                    <?php 
        if ($_smarty_tpl->tpl_vars['order_info']->value['taxes'] && $_smarty_tpl->tpl_vars['settings']->value['General']['tax_calculation'] != "subtotal") {
            ?>
                    <th width="10%">&nbsp;<?php 
            echo $_smarty_tpl->__("tax");
            ?>
</th>
                    <?php 
        }
        ?>
                    <th width="10%" class="right">&nbsp;<?php 
        echo $_smarty_tpl->__("subtotal");
        ?>
</th>
                </tr>
            </thead>
            <?php 
        $_smarty_tpl->tpl_vars["oi"] = new Smarty_Variable();
        $_smarty_tpl->tpl_vars["oi"]->_loop = false;
        $_smarty_tpl->tpl_vars["key"] = new Smarty_Variable();
        $_from = $_smarty_tpl->tpl_vars['order_info']->value['products'];
        if (!is_array($_from) && !is_object($_from)) {
            settype($_from, 'array');
        }
        foreach ($_from as $_smarty_tpl->tpl_vars["oi"]->key => $_smarty_tpl->tpl_vars["oi"]->value) {
            $_smarty_tpl->tpl_vars["oi"]->_loop = true;
            $_smarty_tpl->tpl_vars["key"]->value = $_smarty_tpl->tpl_vars["oi"]->key;
            ?>
            <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:items_list_row"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "orders:items_list_row"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

            <?php 
                if (!$_smarty_tpl->tpl_vars['oi']->value['extra']['parent']) {
                    ?>
                <span style="display:none"><?php 
                    echo htmlspecialchars(var_dump($_smarty_tpl->tpl_vars['order_info']->value['products']), ENT_QUOTES, 'UTF-8');
                    ?>
</span>
            <tr>
                <td>
                    <?php 
                    if (!$_smarty_tpl->tpl_vars['oi']->value['deleted_product']) {
                        ?>
<a href="<?php 
                        echo htmlspecialchars(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['oi']->value['product_id']), ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                    }
                    echo $_smarty_tpl->tpl_vars['oi']->value['product'];
                    if (!$_smarty_tpl->tpl_vars['oi']->value['deleted_product']) {
                        ?>
</a><?php 
                    }
                    ?>
                    <div class="products-hint">
                    <?php 
                    $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:product_info"));
                    $_block_repeat = true;
                    echo smarty_block_hook(array('name' => "orders:product_info"), null, $_smarty_tpl, $_block_repeat);
                    while ($_block_repeat) {
                        ob_start();
                        ?>

                        <?php 
                        if ($_smarty_tpl->tpl_vars['oi']->value['product_code']) {
                            ?>
<p><?php 
                            echo $_smarty_tpl->__("sku");
                            ?>
:<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['product_code'], ENT_QUOTES, 'UTF-8');
                            ?>
</p><?php 
                        }
                        ?>
                    <?php 
                        $_block_content = ob_get_clean();
                        $_block_repeat = false;
                        echo smarty_block_hook(array('name' => "orders:product_info"), $_block_content, $_smarty_tpl, $_block_repeat);
                    }
                    array_pop($_smarty_tpl->smarty->_tag_stack);
                    ?>

                    </div>
                    <?php 
                    if ($_smarty_tpl->tpl_vars['oi']->value['product_options']) {
                        ?>
<div class="options-info"><?php 
                        echo $_smarty_tpl->getSubTemplate("common/options_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('product_options' => $_smarty_tpl->tpl_vars['oi']->value['product_options']), 0);
                        ?>
</div><?php 
                    }
                    ?>
                    <?php 
                    if ($_smarty_tpl->tpl_vars['oi']->value['ls_individual_estimation']) {
                        ?>
                    <div class="ls_individual_estimation"><b><?php 
                        echo $_smarty_tpl->__("ls_shipping_estimation");
                        ?>
:</b><br> 
                                
                                <?php 
                        echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['oi']->value['ls_individual_estimation'], "%e %B %Y"), ENT_QUOTES, 'UTF-8');
                        ?>

                    </div>
                    <?php 
                    }
                    ?>
                </td>
                <td class="nowrap">
                    <?php 
                    if ($_smarty_tpl->tpl_vars['oi']->value['extra']['exclude_from_calculate']) {
                        echo $_smarty_tpl->__("free");
                    } else {
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['oi']->value['original_price']), 0);
                    }
                    ?>
</td>
                <td class="center">
                    <?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['amount'], ENT_QUOTES, 'UTF-8');
                    ?>
<br />
                    <?php 
                    if (!fn_allowed_for("ULTIMATE:FREE") && $_smarty_tpl->tpl_vars['use_shipments']->value && $_smarty_tpl->tpl_vars['oi']->value['shipped_amount'] > 0) {
                        ?>
                        &nbsp;<span class="muted"><small>(<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['shipped_amount'], ENT_QUOTES, 'UTF-8');
                        ?>
&nbsp;<?php 
                        echo $_smarty_tpl->__("shipped");
                        ?>
)</small></span>
                    <?php 
                    }
                    ?>
                </td>
                <?php 
                    if ($_smarty_tpl->tpl_vars['order_info']->value['use_discount']) {
                        ?>
                <td class="nowrap">
                    <?php 
                        if (floatval($_smarty_tpl->tpl_vars['oi']->value['extra']['discount'])) {
                            echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['oi']->value['extra']['discount']), 0);
                        } else {
                            ?>
-<?php 
                        }
                        ?>
</td>
                <?php 
                    }
                    ?>
                <?php 
                    if ($_smarty_tpl->tpl_vars['order_info']->value['taxes'] && $_smarty_tpl->tpl_vars['settings']->value['General']['tax_calculation'] != "subtotal") {
                        ?>
                <td class="nowrap">
                    <?php 
                        if (floatval($_smarty_tpl->tpl_vars['oi']->value['tax_value'])) {
                            echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['oi']->value['tax_value']), 0);
                        } else {
                            ?>
-<?php 
                        }
                        ?>
</td>
                <?php 
                    }
                    ?>
                <td class="right"><span><?php 
                    if ($_smarty_tpl->tpl_vars['oi']->value['extra']['exclude_from_calculate']) {
                        echo $_smarty_tpl->__("free");
                    } else {
                        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['oi']->value['display_subtotal']), 0);
                    }
                    ?>
</span></td>
            </tr>
            <?php 
                }
                ?>
            <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "orders:items_list_row"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

            <?php 
        }
        ?>
            <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:extra_list"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:extra_list"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

            <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:extra_list"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

            </table>

            <!---->
            <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:totals"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:totals"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

            <div class="order-notes statistic">

            <div class="clearfix">
            <table class="pull-left">
                <tr class="totals">
                    <td width="200px"><h4><?php 
            echo $_smarty_tpl->__("ls_shipping_estimation");
            ?>
</h4></td>
                    <td>&nbsp;</td>
                </tr>
                <tr>
                    <td data-ct-totals="subtotal">
                         
                        <?php 
            echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['ls_shipping_estimation_value']->value, "%e %B %Y"), ENT_QUOTES, 'UTF-8');
            ?>

                    </td>
                    <td>&nbsp;</td>
                </tr>
            </table>    
            <table class="pull-right">
                <tr class="totals">
                    <td>&nbsp;</td>
                    <td width="100px"><h4><?php 
            echo $_smarty_tpl->__("totals");
            ?>
</h4></td>
                </tr>

                <tr>
                    <td><?php 
            echo $_smarty_tpl->__("subtotal");
            ?>
:</td>
                    <td data-ct-totals="subtotal"><?php 
            echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['display_subtotal']), 0);
            ?>
</td>
                </tr>

                <?php 
            if (floatval($_smarty_tpl->tpl_vars['order_info']->value['display_shipping_cost'])) {
                ?>
                    <tr>
                        <td><?php 
                echo $_smarty_tpl->__("shipping_cost");
                ?>
:</td>
                        <td data-ct-totals="shipping_cost"><?php 
                echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['display_shipping_cost']), 0);
                ?>
</td>
                    </tr>
                <?php 
            }
            ?>

                <?php 
            if (floatval($_smarty_tpl->tpl_vars['order_info']->value['discount'])) {
                ?>
                    <tr>
                        <td><?php 
                echo $_smarty_tpl->__("including_discount");
                ?>
:</td>
                        <td data-ct-totals="including_discount"><?php 
                echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['discount']), 0);
                ?>
</td>
                    </tr>
                <?php 
            }
            ?>

                <?php 
            if (floatval($_smarty_tpl->tpl_vars['order_info']->value['subtotal_discount'])) {
                ?>
                    <tr>
                        <td><?php 
                echo $_smarty_tpl->__("order_discount");
                ?>
:</td>
                        <td data-ct-totals="order_discount"><?php 
                echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['subtotal_discount']), 0);
                ?>
</td>
                    </tr>
                <?php 
            }
            ?>

                <?php 
            if ($_smarty_tpl->tpl_vars['order_info']->value['coupons']) {
                ?>
                    <?php 
                $_smarty_tpl->tpl_vars["_c"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["_c"]->_loop = false;
                $_smarty_tpl->tpl_vars["coupon"] = new Smarty_Variable();
                $_from = $_smarty_tpl->tpl_vars['order_info']->value['coupons'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["_c"]->key => $_smarty_tpl->tpl_vars["_c"]->value) {
                    $_smarty_tpl->tpl_vars["_c"]->_loop = true;
                    $_smarty_tpl->tpl_vars["coupon"]->value = $_smarty_tpl->tpl_vars["_c"]->key;
                    ?>
                        <tr>
                            <td><?php 
                    echo $_smarty_tpl->__("discount_coupon");
                    ?>
:</td>
                            <td data-ct-totals="discount_coupon"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['coupon']->value, ENT_QUOTES, 'UTF-8');
                    ?>
</td>
                        </tr>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>

                <?php 
            if ($_smarty_tpl->tpl_vars['order_info']->value['taxes']) {
                ?>
                    <tr>
                        <td><?php 
                echo $_smarty_tpl->__("taxes");
                ?>
:</td>
                        <td>&nbsp;</td>
                    </tr>

                    <?php 
                $_smarty_tpl->tpl_vars["tax_data"] = new Smarty_Variable();
                $_smarty_tpl->tpl_vars["tax_data"]->_loop = false;
                $_from = $_smarty_tpl->tpl_vars['order_info']->value['taxes'];
                if (!is_array($_from) && !is_object($_from)) {
                    settype($_from, 'array');
                }
                foreach ($_from as $_smarty_tpl->tpl_vars["tax_data"]->key => $_smarty_tpl->tpl_vars["tax_data"]->value) {
                    $_smarty_tpl->tpl_vars["tax_data"]->_loop = true;
                    ?>
                        <tr>
                            <td><span>&middot;</span>&nbsp;<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['tax_data']->value['description'], ENT_QUOTES, 'UTF-8');
                    ?>
&nbsp;<?php 
                    echo $_smarty_tpl->getSubTemplate("common/modifier.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('mod_value' => $_smarty_tpl->tpl_vars['tax_data']->value['rate_value'], 'mod_type' => $_smarty_tpl->tpl_vars['tax_data']->value['rate_type']), 0);
                    if ($_smarty_tpl->tpl_vars['tax_data']->value['price_includes_tax'] == "Y" && ($_smarty_tpl->tpl_vars['settings']->value['Appearance']['cart_prices_w_taxes'] != "Y" || $_smarty_tpl->tpl_vars['settings']->value['General']['tax_calculation'] == "subtotal")) {
                        ?>
&nbsp;<?php 
                        echo $_smarty_tpl->__("included");
                    }
                    if ($_smarty_tpl->tpl_vars['tax_data']->value['regnumber']) {
                        ?>
&nbsp;(<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['tax_data']->value['regnumber'], ENT_QUOTES, 'UTF-8');
                        ?>
)<?php 
                    }
                    ?>
</td>
                            <td data-ct-totals="taxes-<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['tax_data']->value['description'], ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['tax_data']->value['tax_subtotal']), 0);
                    ?>
</td>
                        </tr>
                    <?php 
                }
                ?>
                <?php 
            }
            ?>

                <?php 
            if ($_smarty_tpl->tpl_vars['order_info']->value['tax_exempt'] == "Y") {
                ?>
                    <tr>
                        <td><?php 
                echo $_smarty_tpl->__("tax_exempt");
                ?>
</td>
                        <td>&nbsp;</td>
                    </tr>
                <?php 
            }
            ?>

                <?php 
            if (floatval($_smarty_tpl->tpl_vars['order_info']->value['payment_surcharge']) && !$_smarty_tpl->tpl_vars['take_surcharge_from_vendor']->value) {
                ?>
                    <tr>
                        <td><?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['order_info']->value['payment_method']['surcharge_title']) === null || $tmp === '' ? $_smarty_tpl->__("payment_surcharge") : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
:</td>
                        <td data-ct-totals="payment_surcharge"><?php 
                echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['payment_surcharge']), 0);
                ?>
</td>
                    </tr>
                <?php 
            }
            ?>

                <?php 
            $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:totals_content"));
            $_block_repeat = true;
            echo smarty_block_hook(array('name' => "orders:totals_content"), null, $_smarty_tpl, $_block_repeat);
            while ($_block_repeat) {
                ob_start();
                ?>

                <?php 
                $_block_content = ob_get_clean();
                $_block_repeat = false;
                echo smarty_block_hook(array('name' => "orders:totals_content"), $_block_content, $_smarty_tpl, $_block_repeat);
            }
            array_pop($_smarty_tpl->smarty->_tag_stack);
            ?>

                <tr>
                    <td><h4><?php 
            echo $_smarty_tpl->__("total");
            ?>
:</h4></td>
                    <td class="price" data-ct-totals="total"><?php 
            echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['total']), 0);
            ?>
</td>
                </tr>
            </table>
            </div>

            <div class="note clearfix">
                <div class="span6">
                    <label for="details"><?php 
            echo $_smarty_tpl->__("customer_notes");
            ?>
</label>
                    <textarea class="span12" name="update_order[notes]" id="notes" cols="40" rows="5"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['notes'], ENT_QUOTES, 'UTF-8');
            ?>
</textarea>
                </div>
                <div class="span6">
                    <label for="details"><?php 
            echo $_smarty_tpl->__("staff_only_notes");
            ?>
</label>
                    <textarea class="span12" name="update_order[details]" id="details" cols="40" rows="5"><?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['details'], ENT_QUOTES, 'UTF-8');
            ?>
</textarea>
                </div>
            </div>

            </div>
            <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:totals"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


            <!---->
    
    <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:staff_only_note"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:staff_only_note"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

    <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:staff_only_note"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


        </div>
        <div class="span4">
            <div class="well orders-right-pane form-horizontal">
                <div class="control-group">
                    <div class="control-label"><h4 class="subheader"><?php 
        echo $_smarty_tpl->__("status");
        ?>
</h4></div>
                    <div class="controls">
                        <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:order_status"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:order_status"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

                            <?php 
            if ($_smarty_tpl->tpl_vars['order_info']->value['status'] == @constant('STATUS_INCOMPLETED_ORDER')) {
                ?>
                                <?php 
                $_smarty_tpl->tpl_vars["get_additional_statuses"] = new Smarty_variable(true, null, 0);
                ?>
                            <?php 
            } else {
                ?>
                                <?php 
                $_smarty_tpl->tpl_vars["get_additional_statuses"] = new Smarty_variable(false, null, 0);
                ?>
                            <?php 
            }
            ?>
                            <?php 
            $_smarty_tpl->tpl_vars["order_status_descr"] = new Smarty_variable(fn_get_simple_statuses(@constant('STATUSES_ORDER'), $_smarty_tpl->tpl_vars['get_additional_statuses']->value, true), null, 0);
            ?>
                            <?php 
            $_smarty_tpl->tpl_vars["extra_status"] = new Smarty_variable(rawurlencode($_smarty_tpl->tpl_vars['config']->value['current_url']), null, 0);
            ?>
                            <?php 
            if (fn_allowed_for("MULTIVENDOR")) {
                ?>
                                <?php 
                $_smarty_tpl->tpl_vars["notify_vendor"] = new Smarty_variable(true, null, 0);
                ?>
                            <?php 
            } else {
                ?>
                                <?php 
                $_smarty_tpl->tpl_vars["notify_vendor"] = new Smarty_variable(false, null, 0);
                ?>
                            <?php 
            }
            ?>

                            <?php 
            $_smarty_tpl->tpl_vars['statuses'] = new Smarty_variable(array(), null, 0);
            ?>
                            <?php 
            $_smarty_tpl->tpl_vars["order_statuses"] = new Smarty_variable(fn_get_statuses(@constant('STATUSES_ORDER'), $_smarty_tpl->tpl_vars['statuses']->value, $_smarty_tpl->tpl_vars['get_additional_statuses']->value, true), null, 0);
            ?>
                            <?php 
            echo $_smarty_tpl->getSubTemplate("common/select_popup.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('suffix' => "o", 'id' => $_smarty_tpl->tpl_vars['order_info']->value['order_id'], 'status' => $_smarty_tpl->tpl_vars['order_info']->value['status'], 'items_status' => $_smarty_tpl->tpl_vars['order_status_descr']->value, 'update_controller' => "orders", 'notify' => true, 'notify_department' => true, 'notify_vendor' => $_smarty_tpl->tpl_vars['notify_vendor']->value, 'status_target_id' => "content_downloads", 'extra' => "&return_url=" . (string) $_smarty_tpl->tpl_vars['extra_status']->value, 'statuses' => $_smarty_tpl->tpl_vars['order_statuses']->value, 'popup_additional_class' => "dropleft"), 0);
            ?>

                        <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:order_status"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

                    </div>
                </div>

                <div class="control-group shift-top">
                    <div class="control-label">
                        <?php 
        echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("payment_information")), 0);
        ?>

                    </div>
                </div>
                <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:payment_info"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:payment_info"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

                
                <?php 
            if ($_smarty_tpl->tpl_vars['order_info']->value['payment_id']) {
                ?>
                    <div class="control-group">
                        <div class="control-label"><?php 
                echo $_smarty_tpl->__("method");
                ?>
</div>
                        <div id="tygh_payment_info" class="controls"><?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['payment_method']['payment'], ENT_QUOTES, 'UTF-8');
                if ($_smarty_tpl->tpl_vars['order_info']->value['payment_method']['description']) {
                    ?>
(<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['payment_method']['description'], ENT_QUOTES, 'UTF-8');
                    ?>
)<?php 
                }
                ?>
                        </div>
                    </div>

                    <?php 
                if ($_smarty_tpl->tpl_vars['order_info']->value['payment_info']) {
                    ?>
                        <?php 
                    $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable();
                    $_smarty_tpl->tpl_vars['item']->_loop = false;
                    $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable();
                    $_from = $_smarty_tpl->tpl_vars['order_info']->value['payment_info'];
                    if (!is_array($_from) && !is_object($_from)) {
                        settype($_from, 'array');
                    }
                    foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value) {
                        $_smarty_tpl->tpl_vars['item']->_loop = true;
                        $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
                        ?>
                        <div class="control-group">
                            <?php 
                        if ($_smarty_tpl->tpl_vars['item']->value && $_smarty_tpl->tpl_vars['key']->value != "expiry_year") {
                            ?>
                                <div class="control-label">
                                <?php 
                            if ($_smarty_tpl->tpl_vars['key']->value == "card_number") {
                                $_smarty_tpl->tpl_vars["cc_exists"] = new Smarty_variable(true, null, 0);
                                echo $_smarty_tpl->__("credit_card");
                            } elseif ($_smarty_tpl->tpl_vars['key']->value == "expiry_month") {
                                echo $_smarty_tpl->__("expiry_date");
                            } else {
                                echo $_smarty_tpl->__($_smarty_tpl->tpl_vars['key']->value);
                            }
                            ?>
                                </div>
                                <div class="controls">
                                    <?php 
                            if ($_smarty_tpl->tpl_vars['key']->value == "order_status") {
                                ?>
                                        <?php 
                                echo $_smarty_tpl->getSubTemplate("common/status.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('status' => $_smarty_tpl->tpl_vars['item']->value, 'display' => "view", 'status_type' => ''), 0);
                                ?>

                                    <?php 
                            } elseif ($_smarty_tpl->tpl_vars['key']->value == "reason_text") {
                                ?>
                                        <?php 
                                echo htmlspecialchars(nl2br($_smarty_tpl->tpl_vars['item']->value), ENT_QUOTES, 'UTF-8');
                                ?>

                                    <?php 
                            } elseif ($_smarty_tpl->tpl_vars['key']->value == "expiry_month") {
                                ?>
                                        <?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value, ENT_QUOTES, 'UTF-8');
                                ?>
/<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['payment_info']['expiry_year'], ENT_QUOTES, 'UTF-8');
                                ?>

                                    <?php 
                            } else {
                                ?>
                                        <?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['item']->value, ENT_QUOTES, 'UTF-8');
                                ?>

                                    <?php 
                            }
                            ?>
                                </div>
                            <?php 
                        }
                        ?>
                        </div>
                        <?php 
                    }
                    ?>

                        <?php 
                    if ($_smarty_tpl->tpl_vars['cc_exists']->value) {
                        ?>
                        <div class="control-group">
                            <div class="control-label">
                                <input type="hidden" name="order_ids[]" value="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['order_id'], ENT_QUOTES, 'UTF-8');
                        ?>
" />
                                <?php 
                        echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_text' => __("remove_cc_info"), 'but_meta' => "cm-ajax cm-comet", 'but_name' => "dispatch[orders.remove_cc_info]"), 0);
                        ?>

                            </div>
                        </div>
                        <?php 
                    }
                    ?>
                    <?php 
                }
                ?>
                   <?php 
            }
            ?>
                <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:payment_info"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


                
                <?php 
        if ($_smarty_tpl->tpl_vars['order_info']->value['shipping']) {
            ?>
                    <div class="control-group shift-top">
                        <div class="control-label">
                            <?php 
            echo $_smarty_tpl->getSubTemplate("common/subheader.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => __("shipping_information")), 0);
            ?>

                        </div>
                    </div>
                    <?php 
            $_smarty_tpl->tpl_vars["is_group_shippings"] = new Smarty_variable(count($_smarty_tpl->tpl_vars['order_info']->value['shipping']) > 1, null, 0);
            ?>

                    <?php 
            $_smarty_tpl->tpl_vars["shipping"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["shipping"]->_loop = false;
            $_smarty_tpl->tpl_vars["shipping_id"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['order_info']->value['shipping'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["shipping"]->key => $_smarty_tpl->tpl_vars["shipping"]->value) {
                $_smarty_tpl->tpl_vars["shipping"]->_loop = true;
                $_smarty_tpl->tpl_vars["shipping_id"]->value = $_smarty_tpl->tpl_vars["shipping"]->key;
                ?>

                        <div class="control-group" >
                            <span> <?php 
                echo htmlspecialchars(($tmp = @$_smarty_tpl->tpl_vars['shipping']->value['group_name']) === null || $tmp === '' ? $_smarty_tpl->__("none") : $tmp, ENT_QUOTES, 'UTF-8');
                ?>
</span>
                        </div>

                        <div class="control-group">
                            <div class="control-label"><?php 
                echo $_smarty_tpl->__("method");
                ?>
</div>
                                <div id="tygh_shipping_info" class="controls">
                                    <?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping'], ENT_QUOTES, 'UTF-8');
                ?>

                                </div>
                        </div>

                        <?php 
                if ($_smarty_tpl->tpl_vars['use_shipments']->value) {
                    ?>
                            <div class="clearfix">
                                <?php 
                    if ($_smarty_tpl->tpl_vars['shipping']->value['need_shipment']) {
                        ?>
                                    <?php 
                        if (!fn_allowed_for("ULTIMATE:FREE")) {
                            ?>
                                        <div class="pull-left">
                                            <?php 
                            echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_shipment_" . (string) $_smarty_tpl->tpl_vars['shipping']->value['group_key'], 'content' => '', 'but_text' => __("new_shipment"), 'act' => "create", 'but_meta' => "btn"), 0);
                            ?>

                                        </div>
                                    <?php 
                        } else {
                            ?>
                                        <div class="pull-left">
                                            <?php 
                            echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => "action", 'but_meta' => "cm-promo-popup", 'allow_href' => false, 'but_text' => __("new_shipment")), 0);
                            ?>

                                        </div>
                                    <?php 
                        }
                        ?>
                                <?php 
                    }
                    ?>
                                <?php 
                    if (!$_smarty_tpl->tpl_vars['is_group_shippings']->value) {
                        ?>
                                    <a class="pull-right" href="<?php 
                        echo htmlspecialchars(fn_url("shipments.manage?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id']), ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        echo $_smarty_tpl->__("shipments");
                        ?>
&nbsp;(<?php 
                        echo htmlspecialchars(count($_smarty_tpl->tpl_vars['order_info']->value['shipment_ids']), ENT_QUOTES, 'UTF-8');
                        ?>
)</a>
                                <?php 
                    }
                    ?>
                            </div>
                            <?php 
                    if ($_smarty_tpl->tpl_vars['is_group_shippings']->value) {
                        ?>
<hr><?php 
                    }
                    ?>
                        <?php 
                } else {
                    ?>
                            <div class="control-group">
                                <label class="control-label" for="tracking_number"><?php 
                    echo $_smarty_tpl->__("tracking_number");
                    ?>
</label>
                                <div class="controls">
                                    <input id="tracking_number" class="input-small" type="text" name="update_shipping[<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['group_key'], ENT_QUOTES, 'UTF-8');
                    ?>
][shipment_data][tracking_number]" size="45" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipments']->value[$_smarty_tpl->tpl_vars['shipping']->value['group_key']]['tracking_number'], ENT_QUOTES, 'UTF-8');
                    ?>
" />
                                    <input type="hidden" name="update_shipping[<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['group_key'], ENT_QUOTES, 'UTF-8');
                    ?>
][shipment_id]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipments']->value[$_smarty_tpl->tpl_vars['shipping']->value['group_key']]['shipment_id'], ENT_QUOTES, 'UTF-8');
                    ?>
" />
                                    <input type="hidden" name="update_shipping[<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['group_key'], ENT_QUOTES, 'UTF-8');
                    ?>
][shipment_data][shipping_id]" value="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['shipping']->value['shipping_id'], ENT_QUOTES, 'UTF-8');
                    ?>
" />
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="carrier_key"><?php 
                    echo $_smarty_tpl->__("carrier");
                    ?>
</label>
                                <div class="controls">
                                    <?php 
                    echo $_smarty_tpl->getSubTemplate("common/carriers.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "carrier_key", 'meta' => "input-small", 'name' => "update_shipping[" . (string) $_smarty_tpl->tpl_vars['shipping']->value['group_key'] . "][shipment_data][carrier]", 'carrier' => $_smarty_tpl->tpl_vars['shipments']->value[$_smarty_tpl->tpl_vars['shipping']->value['group_key']]['carrier']), 0);
                    ?>

                                </div>
                            </div>
                        <?php 
                }
                ?>
                    <?php 
            }
            ?>

                    <?php 
            if ($_smarty_tpl->tpl_vars['is_group_shippings']->value) {
                ?>
                    <div class="clearfix">
                        <a class="pull-right" href="<?php 
                echo htmlspecialchars(fn_url("shipments.manage?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id']), ENT_QUOTES, 'UTF-8');
                ?>
"><?php 
                echo $_smarty_tpl->__("shipments");
                ?>
&nbsp;(<?php 
                echo htmlspecialchars(count($_smarty_tpl->tpl_vars['order_info']->value['shipment_ids']), ENT_QUOTES, 'UTF-8');
                ?>
)</a>
                    </div>
                    <?php 
            }
            ?>
                <?php 
        } else {
            ?>

                    <?php 
            $_smarty_tpl->tpl_vars["group"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["group"]->_loop = false;
            $_smarty_tpl->tpl_vars["group_id"] = new Smarty_Variable();
            $_from = $_smarty_tpl->tpl_vars['order_info']->value['product_groups'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["group"]->key => $_smarty_tpl->tpl_vars["group"]->value) {
                $_smarty_tpl->tpl_vars["group"]->_loop = true;
                $_smarty_tpl->tpl_vars["group_id"]->value = $_smarty_tpl->tpl_vars["group"]->key;
                ?>
                         <?php 
                if ($_smarty_tpl->tpl_vars['group']->value['all_free_shipping']) {
                    ?>

                             <?php 
                    if ($_smarty_tpl->tpl_vars['use_shipments']->value) {
                        ?>
                                 <div class="clearfix">
                                     <?php 
                        if ($_smarty_tpl->tpl_vars['order_info']->value['need_shipment']) {
                            ?>
                                         <?php 
                            if (!fn_allowed_for("ULTIMATE:FREE")) {
                                ?>
                                             <div class="pull-left">
                                                 <?php 
                                echo $_smarty_tpl->getSubTemplate("common/popupbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('id' => "add_shipment_0", 'content' => '', 'but_text' => __("new_shipment"), 'act' => "create", 'but_meta' => "btn"), 0);
                                ?>

                                             </div>
                                         <?php 
                            } else {
                                ?>
                                             <div class="pull-left">
                                                 <?php 
                                echo $_smarty_tpl->getSubTemplate("buttons/button.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_role' => "action", 'but_meta' => "cm-promo-popup", 'allow_href' => false, 'but_text' => __("new_shipment")), 0);
                                ?>

                                             </div>
                                         <?php 
                            }
                            ?>
                                     <?php 
                        }
                        ?>

                                     <a class="pull-right" href="<?php 
                        echo htmlspecialchars(fn_url("shipments.manage?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id']), ENT_QUOTES, 'UTF-8');
                        ?>
"><?php 
                        echo $_smarty_tpl->__("shipments");
                        ?>
&nbsp;(<?php 
                        echo htmlspecialchars(count($_smarty_tpl->tpl_vars['order_info']->value['shipment_ids']), ENT_QUOTES, 'UTF-8');
                        ?>
)</a>
                                 </div>
                             <?php 
                    }
                    ?>
                         <?php 
                }
                ?>
                    <?php 
            }
            ?>
                <?php 
        }
        ?>
            </div>
            <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:customer_shot_info"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:customer_shot_info"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

            <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:customer_shot_info"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

        </div>
    </div>
<!--content_general--></div>

<div id="content_addons">

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:customer_info"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:customer_info"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:customer_info"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


<!--content_addons--></div>

<?php 
        if ($_smarty_tpl->tpl_vars['downloads_exist']->value) {
            ?>
<div id="content_downloads">
    <input type="hidden" name="order_id" value="<?php 
            echo htmlspecialchars($_REQUEST['order_id'], ENT_QUOTES, 'UTF-8');
            ?>
" />
    <input type="hidden" name="order_status" value="<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['status'], ENT_QUOTES, 'UTF-8');
            ?>
" />
    <?php 
            $_smarty_tpl->tpl_vars["oi"] = new Smarty_Variable();
            $_smarty_tpl->tpl_vars["oi"]->_loop = false;
            $_from = $_smarty_tpl->tpl_vars['order_info']->value['products'];
            if (!is_array($_from) && !is_object($_from)) {
                settype($_from, 'array');
            }
            foreach ($_from as $_smarty_tpl->tpl_vars["oi"]->key => $_smarty_tpl->tpl_vars["oi"]->value) {
                $_smarty_tpl->tpl_vars["oi"]->_loop = true;
                ?>
    <?php 
                if ($_smarty_tpl->tpl_vars['oi']->value['extra']['is_edp'] == "Y") {
                    ?>
    <p><a href="<?php 
                    echo htmlspecialchars(fn_url("products.update?product_id=" . (string) $_smarty_tpl->tpl_vars['oi']->value['product_id']), ENT_QUOTES, 'UTF-8');
                    ?>
"><?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['product'], ENT_QUOTES, 'UTF-8');
                    ?>
</a></p>
        <?php 
                    if ($_smarty_tpl->tpl_vars['oi']->value['files']) {
                        ?>
        <input type="hidden" name="files_exists[]" value="<?php 
                        echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['product_id'], ENT_QUOTES, 'UTF-8');
                        ?>
" />
        <table cellpadding="5" cellspacing="0" border="0" class="table">
        <tr>
            <th><?php 
                        echo $_smarty_tpl->__("filename");
                        ?>
</th>
            <th><?php 
                        echo $_smarty_tpl->__("activation_mode");
                        ?>
</th>
            <th><?php 
                        echo $_smarty_tpl->__("downloads_max_left");
                        ?>
</th>
            <th><?php 
                        echo $_smarty_tpl->__("download_key_expiry");
                        ?>
</th>
            <th><?php 
                        echo $_smarty_tpl->__("active");
                        ?>
</th>
        </tr>
        <?php 
                        $_smarty_tpl->tpl_vars["file"] = new Smarty_Variable();
                        $_smarty_tpl->tpl_vars["file"]->_loop = false;
                        $_from = $_smarty_tpl->tpl_vars['oi']->value['files'];
                        if (!is_array($_from) && !is_object($_from)) {
                            settype($_from, 'array');
                        }
                        foreach ($_from as $_smarty_tpl->tpl_vars["file"]->key => $_smarty_tpl->tpl_vars["file"]->value) {
                            $_smarty_tpl->tpl_vars["file"]->_loop = true;
                            ?>
        <tr>
            <td><?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['file_name'], ENT_QUOTES, 'UTF-8');
                            ?>
</td>
            <td>
                <?php 
                            if ($_smarty_tpl->tpl_vars['file']->value['activation_type'] == "M") {
                                echo $_smarty_tpl->__("manually");
                                ?>
</label><?php 
                            } elseif ($_smarty_tpl->tpl_vars['file']->value['activation_type'] == "I") {
                                echo $_smarty_tpl->__("immediately");
                            } else {
                                echo $_smarty_tpl->__("after_full_payment");
                            }
                            ?>
            </td>
            <td><?php 
                            if ($_smarty_tpl->tpl_vars['file']->value['max_downloads']) {
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['max_downloads'], ENT_QUOTES, 'UTF-8');
                                ?>
 / <input type="text" name="edp_downloads[<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['ekey'], ENT_QUOTES, 'UTF-8');
                                ?>
][<?php 
                                echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['file_id'], ENT_QUOTES, 'UTF-8');
                                ?>
]" value="<?php 
                                echo smarty_function_math(array('equation' => "a-b", 'a' => $_smarty_tpl->tpl_vars['file']->value['max_downloads'], 'b' => ($tmp = @$_smarty_tpl->tpl_vars['file']->value['downloads']) === null || $tmp === '' ? 0 : $tmp), $_smarty_tpl);
                                ?>
" size="3" /><?php 
                            } else {
                                echo $_smarty_tpl->__("none");
                            }
                            ?>
</td>
            <td>
                <?php 
                            if ($_smarty_tpl->tpl_vars['oi']->value['extra']['unlimited_download'] == 'Y') {
                                ?>
                    <?php 
                                echo $_smarty_tpl->__("time_unlimited_download");
                                ?>

                <?php 
                            } elseif ($_smarty_tpl->tpl_vars['file']->value['ekey']) {
                                ?>
                <p><label><?php 
                                echo $_smarty_tpl->__("download_key_expiry");
                                ?>
: </label><span><?php 
                                echo htmlspecialchars(($tmp = @smarty_modifier_date_format($_smarty_tpl->tpl_vars['file']->value['ttl'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'] . ", " . (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format'])) === null || $tmp === '' ? "n/a" : $tmp, ENT_QUOTES, 'UTF-8');
                                ?>
</span></p>
                
                <p><label><?php 
                                echo $_smarty_tpl->__("prolongate_download_key");
                                ?>
: </label><?php 
                                echo $_smarty_tpl->getSubTemplate("common/calendar.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('date_id' => "prolongate_date_" . (string) $_smarty_tpl->tpl_vars['file']->value['file_id'], 'date_name' => "prolongate_data[" . (string) $_smarty_tpl->tpl_vars['file']->value['ekey'] . "]", 'date_val' => ($tmp = @$_smarty_tpl->tpl_vars['file']->value['ttl']) === null || $tmp === '' ? @constant('TIME') : $tmp, 'start_year' => $_smarty_tpl->tpl_vars['settings']->value['Company']['company_start_year']), 0);
                                ?>
</p>
                <?php 
                            } else {
                                echo $_smarty_tpl->__("file_doesnt_have_key");
                            }
                            ?>
            </td>
            <td>
                <select name="activate_files[<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['oi']->value['product_id'], ENT_QUOTES, 'UTF-8');
                            ?>
][<?php 
                            echo htmlspecialchars($_smarty_tpl->tpl_vars['file']->value['file_id'], ENT_QUOTES, 'UTF-8');
                            ?>
]">
                    <option value="Y" <?php 
                            if ($_smarty_tpl->tpl_vars['file']->value['active'] == "Y") {
                                ?>
selected="selected"<?php 
                            }
                            ?>
><?php 
                            echo $_smarty_tpl->__("active");
                            ?>
</option>
                    <option value="N" <?php 
                            if ($_smarty_tpl->tpl_vars['file']->value['active'] != "Y") {
                                ?>
selected="selected"<?php 
                            }
                            ?>
><?php 
                            echo $_smarty_tpl->__("not_active");
                            ?>
</option>
                </select>
            </td>
        </tr>
        <?php 
                        }
                        ?>
        </table>
        <?php 
                    }
                    ?>
    <?php 
                }
                ?>
    <?php 
            }
            ?>
<!--content_downloads--></div>
<?php 
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['order_info']->value['promotions']) {
            ?>
<div id="content_promotions">
    <?php 
            echo $_smarty_tpl->getSubTemplate("views/orders/components/promotions.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('promotions' => $_smarty_tpl->tpl_vars['order_info']->value['promotions']), 0);
            ?>

<!--content_promotions--></div>
<?php 
        }
        ?>

<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:tabs_content"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:tabs_content"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:tabs_content"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


<?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:tabs_extra"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:tabs_extra"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

<?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:tabs_extra"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>


<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        echo $_smarty_tpl->getSubTemplate("common/tabsbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('content' => Smarty::$_smarty_vars['capture']['tabsbox'], 'active_tab' => $_REQUEST['selected_section'], 'track' => true), 0);
        ?>


<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        $_smarty_tpl->_capture_stack[0][] = array("mainbox_title", null, null);
        ob_start();
        ?>
    <?php 
        echo $_smarty_tpl->__("order");
        ?>
 #<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['order_id'], ENT_QUOTES, 'UTF-8');
        ?>
 <span class="f-middle"><?php 
        echo $_smarty_tpl->__("total");
        ?>
: <span><?php 
        echo $_smarty_tpl->getSubTemplate("common/price.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('value' => $_smarty_tpl->tpl_vars['order_info']->value['total']), 0);
        ?>
</span><?php 
        if ($_smarty_tpl->tpl_vars['order_info']->value['company_id']) {
            ?>
 / <?php 
            echo htmlspecialchars(fn_get_company_name($_smarty_tpl->tpl_vars['order_info']->value['company_id']), ENT_QUOTES, 'UTF-8');
        }
        ?>
</span>

    <span class="f-small">
    <?php 
        if ($_smarty_tpl->tpl_vars['status_settings']->value['appearance_type'] == "I" && $_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']]) {
            ?>
        (<?php 
            echo $_smarty_tpl->__("invoice");
            ?>
 #<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']], ENT_QUOTES, 'UTF-8');
            ?>
)
    <?php 
        } elseif ($_smarty_tpl->tpl_vars['status_settings']->value['appearance_type'] == "C" && $_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']]) {
            ?>
        (<?php 
            echo $_smarty_tpl->__("credit_memo");
            ?>
 #<?php 
            echo htmlspecialchars($_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']], ENT_QUOTES, 'UTF-8');
            ?>
)
    <?php 
        }
        ?>
    <?php 
        $_smarty_tpl->tpl_vars["timestamp"] = new Smarty_variable(rawurlencode(smarty_modifier_date_format($_smarty_tpl->tpl_vars['order_info']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format'])), null, 0);
        ?>
    / <?php 
        echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['order_info']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['date_format']), ENT_QUOTES, 'UTF-8');
        ?>
,<?php 
        echo htmlspecialchars(smarty_modifier_date_format($_smarty_tpl->tpl_vars['order_info']->value['timestamp'], (string) $_smarty_tpl->tpl_vars['settings']->value['Appearance']['time_format']), ENT_QUOTES, 'UTF-8');
        ?>

    </span>
<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("sidebar", null, null);
        ob_start();
        ?>
    
    <?php 
        echo $_smarty_tpl->getSubTemplate("views/order_management/components/issuer_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('user_data' => $_smarty_tpl->tpl_vars['order_info']->value['issuer_data']), 0);
        ?>

    
    <?php 
        echo $_smarty_tpl->getSubTemplate("views/order_management/components/profiles_info.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('user_data' => $_smarty_tpl->tpl_vars['order_info']->value, 'location' => "I"), 0);
        ?>

<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array("buttons", null, null);
        ob_start();
        ?>
  
    <?php 
        echo $_smarty_tpl->getSubTemplate("common/view_tools.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('url' => "orders.details?order_id="), 0);
        ?>


    <?php 
        if ($_smarty_tpl->tpl_vars['status_settings']->value['appearance_type'] == "C" && $_smarty_tpl->tpl_vars['order_info']->value['doc_ids'][$_smarty_tpl->tpl_vars['status_settings']->value['appearance_type']]) {
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["print_order"] = new Smarty_variable($_smarty_tpl->__("print_credit_memo"), null, 0);
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["print_pdf_order"] = new Smarty_variable($_smarty_tpl->__("print_pdf_credit_memo"), null, 0);
            ?>
    <?php 
        } elseif ($_smarty_tpl->tpl_vars['status_settings']->value['appearance_type'] == "O") {
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["print_order"] = new Smarty_variable($_smarty_tpl->__("print_order_details"), null, 0);
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["print_pdf_order"] = new Smarty_variable($_smarty_tpl->__("print_pdf_order_details"), null, 0);
            ?>
    <?php 
        } else {
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["print_order"] = new Smarty_variable($_smarty_tpl->__("print_invoice"), null, 0);
            ?>
        <?php 
            $_smarty_tpl->tpl_vars["print_pdf_order"] = new Smarty_variable($_smarty_tpl->__("print_pdf_invoice"), null, 0);
            ?>
    <?php 
        }
        ?>
    <?php 
        $_smarty_tpl->_capture_stack[0][] = array("tools_list", null, null);
        ob_start();
        ?>
        <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:details_tools"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:details_tools"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

            <li><?php 
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_smarty_tpl->tpl_vars['print_order']->value, 'href' => "orders.print_invoice?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'], 'class' => "cm-new-window"));
            ?>
</li>
            <li><?php 
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => $_smarty_tpl->tpl_vars['print_pdf_order']->value, 'href' => "orders.print_invoice?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'] . "&format=pdf"));
            ?>
</li>
            <li><?php 
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("print_packing_slip"), 'href' => "orders.print_packing_slip?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'], 'class' => "cm-new-window"));
            ?>
</li>
            <li><?php 
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("print_pdf_packing_slip"), 'href' => "orders.print_packing_slip?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id'] . "&format=pdf", 'class' => "cm-new-window"));
            ?>
</li>
            <li><?php 
            smarty_template_function_btn($_smarty_tpl, array('type' => "list", 'text' => __("edit_order"), 'href' => "order_management.edit?order_id=" . (string) $_smarty_tpl->tpl_vars['order_info']->value['order_id']));
            ?>
</li>
            <?php 
            echo Smarty::$_smarty_vars['capture']['adv_tools'];
            ?>

        <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:details_tools"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

    <?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>
    <?php 
        smarty_template_function_dropdown($_smarty_tpl, array('content' => Smarty::$_smarty_vars['capture']['tools_list']));
        ?>


    <div class="btn-group btn-hover dropleft">
        <?php 
        echo $_smarty_tpl->getSubTemplate("buttons/save_changes.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('but_meta' => "cm-no-ajax dropdown-toggle", 'but_role' => "submit-link", 'but_target_form' => "order_info_form", 'but_name' => "dispatch[orders.update_details]", 'save' => true), 0);
        ?>

        <ul class="dropdown-menu">
            <li><a><input type="checkbox" name="notify_user" id="notify_user" value="Y" />
                <?php 
        echo $_smarty_tpl->__("notify_customer");
        ?>
</a></li>
            <li><a><input type="checkbox" name="notify_department" id="notify_department" value="Y" />
                <?php 
        echo $_smarty_tpl->__("notify_orders_department");
        ?>
</a></li>
            <?php 
        if (fn_allowed_for("MULTIVENDOR")) {
            ?>
            <li>
                <a><input type="checkbox" name="notify_vendor" id="notify_vendor" value="Y" />
                    <?php 
            echo $_smarty_tpl->__("notify_vendor");
            ?>
</a>
            </li>
            <?php 
        }
        ?>
            <?php 
        $_smarty_tpl->smarty->_tag_stack[] = array('hook', array('name' => "orders:notify_checkboxes"));
        $_block_repeat = true;
        echo smarty_block_hook(array('name' => "orders:notify_checkboxes"), null, $_smarty_tpl, $_block_repeat);
        while ($_block_repeat) {
            ob_start();
            ?>

            <?php 
            $_block_content = ob_get_clean();
            $_block_repeat = false;
            echo smarty_block_hook(array('name' => "orders:notify_checkboxes"), $_block_content, $_smarty_tpl, $_block_repeat);
        }
        array_pop($_smarty_tpl->smarty->_tag_stack);
        ?>

        </ul>
    </div>
<?php 
        list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]);
        if (!empty($_capture_buffer)) {
            if (isset($_capture_assign)) {
                $_smarty_tpl->assign($_capture_assign, ob_get_contents());
            }
            if (isset($_capture_append)) {
                $_smarty_tpl->append($_capture_append, ob_get_contents());
            }
            Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean();
        } else {
            $_smarty_tpl->capture_error();
        }
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate("common/mainbox.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array('title' => Smarty::$_smarty_vars['capture']['mainbox_title'], 'content' => Smarty::$_smarty_vars['capture']['mainbox'], 'buttons' => Smarty::$_smarty_vars['capture']['buttons'], 'adv_buttons' => Smarty::$_smarty_vars['capture']['adv_buttons'], 'sidebar' => Smarty::$_smarty_vars['capture']['sidebar'], 'sidebar_position' => "left"), 0);
        ?>


</form>
<?php 
    }