HEX
Server: Apache/2.2.15 (CentOS)
System: Linux ip-10-0-2-146.eu-west-1.compute.internal 2.6.32-754.35.1.el6.centos.plus.x86_64 #1 SMP Sat Nov 7 11:33:42 UTC 2020 x86_64
User: root (0)
PHP: 5.6.40
Disabled: NONE
Upload Files
File: //www/exchange0old/exchange/cache/%%E0^E05^E05904FC%%post_trade_documents.html.php
<?php /* Smarty version 2.6.19, created on 2024-06-16 07:41:55
         compiled from post_trade_documents.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'siteUrl', 'post_trade_documents.html', 9, false),array('modifier', 'date_format', 'post_trade_documents.html', 39, false),array('modifier', 'storage', 'post_trade_documents.html', 53, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>:: Credebt Exchange ::</title>
    <link rel="stylesheet" href="/exchange/admin/css/stylesheet.css" type="text/css" />
    <link type="text/css" href="/exchange/css/bootstrap.min.css?ver=2" rel="stylesheet" />

    <script type="text/javascript" src="<?php echo ((is_array($_tmp='/js/jquery.js')) ? $this->_run_mod_handler('siteUrl', true, $_tmp) : smarty_modifier_siteUrl($_tmp)); ?>
"></script>
    <script type="text/javascript" src="/exchange/js/bootstrap-datepicker-1.7.min.js"></script>
    <link type="text/css" href="/exchange/css/bootstrap-datepicker3.standalone.min.css" rel="stylesheet" />
    <style type="text/css">
        input[type="file"] {
            display: inline-block;
        }
    </style>
</head>
<body style="background: none;">
<h4 style="color: #FFF;background: #555;margin: 0;padding: 15px 0 15px 0;">Post Trade Documents</h4>
<form action="index.php?do=post-trade-documents&invoice_id=<?php echo $this->_tpl_vars['invoice_id']; ?>
" method="post" enctype="multipart/form-data" id="documents_form">
    <table cellpadding="0" cellspacing="0" border="0" width="100%" class="table table-hover table-striped table-responsive">
        <tbody>
        <tr>
            <td colspan="4" style="padding: 0!important;">
                <table class="table table-hover table-striped table-responsive" style="margin: 0" border="1">
                    <tbody id="po_list">
                    <?php $_from = $this->_tpl_vars['documents']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['document']):
?>
                    <tr>
                        <td colspan="4" style="padding: 0!important;">
                            <table class="table table-hover table-striped table-responsive" style="margin: 0">
                                <tr>
                                    <td colspan="4">
                                        <b><?php echo $this->_tpl_vars['document']['name']; ?>
 (Outstanding Days: <?php echo $this->_tpl_vars['document']['date_diff']; ?>
)</b>
                                    </td>
                                </tr>
                                <tr>
                                    <td>Requested Date <sup class="txt_12_red">*</sup></td>
                                    <td>
                                        <?php echo ((is_array($_tmp=$this->_tpl_vars['document']['requested_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>

                                    </td>
                                    <td>Expected Date <sup class="txt_12_red">*</sup></td>
                                    <td>
                                        <?php echo ((is_array($_tmp=$this->_tpl_vars['document']['expected_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>

                                    </td>
                                </tr>
                                <tr>
                                    <td>Document attachment <sup class="txt_12_red">*</sup></td>
                                    <td>
                                        <?php $this->assign('fieldName', "document[".($this->_tpl_vars['document']['document_id'])."][file]"); ?>
                                        <input type="file" class="browse" value="" style="width:auto;" name="<?php echo $this->_tpl_vars['fieldName']; ?>
" <?php if (! $this->_tpl_vars['document']['path']): ?>data-attr="new_document_file"<?php endif; ?>>
                                        <?php if ($this->_tpl_vars['document']['path']): ?>
                                        <input type="hidden" name="document[<?php echo $this->_tpl_vars['document']['document_id']; ?>
][exist_document]" value="1"/>
                                        <button onclick="window.open('<?php echo ((is_array($_tmp=$this->_tpl_vars['document']['path'])) ? $this->_run_mod_handler('storage', true, $_tmp, "debtor-documents") : smarty_modifier_storage($_tmp, "debtor-documents")); ?>
'); return false;"><span class="glyphicon glyphicon-search" aria-hidden="true"></span>&nbsp;View</button>
                                        <?php endif; ?>
                                        <br/>
                                        <span style="color:#FF0000;"> <?php echo $this->_tpl_vars['Errors'][$this->_tpl_vars['fieldName']]; ?>
</span>
                                    </td>
                                    <td>Document amount <sup class="txt_12_red">*</sup></td>
                                    <td>
                                        <?php $this->assign('fieldName', "document[".($this->_tpl_vars['document']['document_id'])."][amount]"); ?>
                                        <input type="text" class="text_b" name="<?php echo $this->_tpl_vars['fieldName']; ?>
" value="<?php echo $this->_tpl_vars['document']['amount']; ?>
" />
                                        <br/>
                                        <span style="color:#FF0000;"> <?php echo $this->_tpl_vars['Errors'][$this->_tpl_vars['fieldName']]; ?>
</span>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <?php endforeach; endif; unset($_from); ?>
                    </tbody>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="4" align="center">
                <input name="save" value="Save " class="btn btn-primary" type="submit"
                       onclick="submitForm();return false;">
            </td>
        </tr>
        </tbody>
    </table>
</form>
<script>
    function submitForm() {
        var $form = $('#documents_form'),
            $fileData = {};
        $form.find('span').each(function () {
            $(this).html('');
        });
        $('input[data-attr=new_document_file]').each(function () {
            $fileData[$(this).attr('name')] = $(this).val();
        });
        $.ajax({
            url: $form.attr('action'),
            type: 'post',
            data: $form.serialize() + '&' + $.param($fileData),
            success: function (data) {
                data = $.parseJSON(data);
                console.log(data);
                if(data.success){
                    $form.submit();
                }else{
                    $.each(data.errors, function (key, value) {
                        $('[name="' + key + '"]').parent().find('span').html(value);
                    })
                }
            }
        });
    }

    $(document).ready(function () {
        $('.input-expected-date').datepicker({
            format: "yyyy-mm-dd",
            startDate: "0d",
            todayHighlight: true
        });
        $('.input-orpa-date').datepicker({
            endDate: "0d",
            startDate: "-365d",
            format: "yyyy-mm-dd",
            todayHighlight: true
        });
        $('.input-po-date').datepicker({
            startDate: "0d",
            format: "yyyy-mm-dd",
            todayHighlight: true
        });
    });


</script>
</body>
</html>