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/templates/showinvoicequeue.html
<AJDF:output>include file="header.html"</AJDF:output>
<script type="text/javascript" src="https://www.credebtexchange.com/js/jquery.ui.core.js"></script>
<script type="text/javascript" src="https://www.credebtexchange.com/js/ui.datepicker.js"></script>
<script type="text/javascript" src="<AJDF:output>'/js/jquery.form.js'|siteUrl</AJDF:output>"></script>
<table cellspacing="0" cellpadding="0" border="0" width="100%">
  <tbody>
    <tr>
      <td align="left" valign="top">

        <table cellspacing="0" cellpadding="0" border="0" width="100%">
          <tbody> 

            <tr>
              <td align="center" valign="top">&nbsp;</td>
            </tr>
            <tr>
              <td align="left" valign="middle" class="login_bg">
                <table cellspacing="0" cellpadding="0" border="0" width="100%">
                  <tbody>
                    <tr>
                      <td align="left" width="" valign="middle" class="login_bg_t">Exchange Trade Centre | Invoice Data</td>
                      <td width="" align="left" valign="middle" class="txt_11">Originator Organisation ID: <AJDF:output>$smarty.session.user.org_ref_id</AJDF:output>  </td>
                      <td align="right" width="" valign="middle" class="txt_11"><AJDF:output>include file='originator_top_dashboard_links.html'</AJDF:output></td>
                    </tr>
                  </tbody>
                </table>
              </td>
            </tr>
            <tr> 

              <td align="center" valign="top" class="about_c">

                <table cellspacing="5" cellpadding="5" border="0" width="100%">
                  <tbody>

                    <tr>

                      <td align="left" width="18%" valign="top"><AJDF:output>include file='left_sidebar.html'</AJDF:output></td>
                      <td align="right" width="82%" valign="top"  id="tool">

                        <form name="form" action="index.php?do=updateinvoice" method="post" enctype="multipart/form-data">
                          <table cellspacing="0" cellpadding="0" border="0" width="100%" class="hdr_center">
                            <tbody>
                              <tr>
                                <td align="left" valign="top" class="inves_top1" colspan="3">Invoice Queue</td>
                              </tr>
                              <AJDF:output>if $smarty.session.success neq ''</AJDF:output>
                              <tr>
                                <td colspan="3">
                                 
                                  <div class="success-msgbox">
                                    <AJDF:output>$smarty.session.success</AJDF:output>
                                  </div>
                                  
                                </td>
                              </tr>
                              <AJDF:output>/if</AJDF:output>

                              <AJDF:output>if count($errmsg) gt 0</AJDF:output>
                              <tr>
                                <td colspan="3">
                                 
                                  <div class="error-msgbox">
                                     <AJDF:output>$errmsg.apiid</AJDF:output>
                                  </div>
                                  
                                </td>
                              </tr>
                              <AJDF:output>/if</AJDF:output>

                             

                              <tr>
                                <td colspan="3" valign="top">
                                 
                                  <table width="100%" cellspacing="0" cellpadding="3" border="0" id="listDebtor">

                                   <tr class="grays_bg4">
                                    <td valign="top"  width="10%" align="left"><b>Created</b></td>
                                    <td valign="top"  width="20%" align="left"><b>Debtor ID</b></td>
                                    <td valign="top"  width="25%" align="left"><b>Debtor Name</b></td>
                                    <td valign="top"  width="10%" align="right"><b>Face Value</b></td>
                                    <!-- <td valign="top"  width="15%" align="center"><b>Options</b></td> -->
                                    <td valign="top"  width="5%" align="center"></td>
                                    
                                  </tr>

                                  <AJDF:output>$invoicedata</AJDF:output>

                                </table>

                         
                              </td>
                            </tr>


                            <tr>
                              <td colspan="3" id="clsAckNots">&nbsp;</td>
                            </tr>
                          </tbody>

                        </table>
                      </form>
                    </td>

                  </tr>

                </tbody>

              </table>
            </td>

          </tr>

        </tbody> 

      </table>
    </td>

  </tr>

  <tr>
    <td align="left" valign="top">&nbsp;</td>
  </tr>
</tbody>

</table>
<script>


$("#face_value").bind('blur keyup',function(){
    calCurrencyRate($('#debtor_id').val());
});


function calCurrencyRate(val)
{  
  $.post(
    "?do=calcurrencyrate",
    {id:val,rev:'1'},
    function(responseText){

      responseText = responseText.split("+");

      $("#currency_country_id").val(responseText[0]);
    });
}

function checkNoA(str){

  $.post(  
    "?do=getAckNotice",  
    {id: str},  
    function(responseText){
      if(responseText == '3'){
        $("#clsAckNot").hide(); 
        $("#clsAckNots").hide(); 
      }else{
        $("#clsAckNot").show(); 
        $("#clsAckNots").show();  
      }
    },  
    "html"  
    );  

}

$('.savefile').on('click',function(e){

  var thiss = $(this);
  var span = $(this).parents('td').first().find('span');
  var viewlinks = $(this).parents('td').first().find('.viewlink');
  var filename = $(this).attr('alt');
  var postname = '#'+$(this).attr('title');
  var flagname = $(this).data('flag');



  if($('#'+filename).val()!=''){
    if(viewlinks != 'undefined') viewlinks.remove();
    $('<img>',{
      src:'<AJDF:output>'/images/loading1.gif'|siteUrl</AJDF:output>',
      height: '18',
      border:'0'
    }).insertAfter(thiss).css({'margin':'4px 10px 0 10px', 'vertical-align':'top'}).addClass('clsimg');

    $('#opentrade').ajaxSubmit({
      target: '#output' ,
      action:'index.php?do=fileupload',
      files_name: filename,
      complete: function(xhr) {

//window.location.reload();


if(xhr.responseText =='0'){
//thiss.parent('td').find('.clsimg').remove();
span.html('Only PDF documents can be attached.  Please attach a PDF');    
}
else if(xhr.responseText =='1'){
//thiss.parent('td').find('.clsimg').remove();
span.html('This document probably uses a compression technique which is not supported.');   
}else if(xhr.responseText > 0){
  span.html('File Upload Error, Please Try Again');   
}else{
//thiss.parent('td').find('.clsimg').remove();
span.html('');  
$(postname).val(xhr.responseText);
var anchors = '<a target="_blank" class="viewlink" href="../documents/debtor/'+xhr.responseText+'" style="border:1px solid #000; padding:1px 5px; margin-left:4px;">View</a>';
$(anchors).insertAfter(thiss);

$('#'+filename).val('');

$('#'+flagname).val('1');

}
}
});
    thiss.parents('td').first().find('.clsimg').remove();

  }
e.preventDefault(); // <-- important

return false;

});

function loadFields(str)
{
  if(str !=''){
    $.post("?do=getfacevalue",{id:str,flag:0},  
      function(responseText){

        var spl=responseText.split("::");

        var totalValue = Number(spl[0]);
        var faceValue  = Number($('#face_value').val());
        $('#totalFaceValue').val(totalValue);
        $('#remainValue').html('');
        $('#payment').val(spl[1]);
        totalValue1 = addCommas(totalValue.toFixed(2));
        $('#totalValue').html(totalValue1);
        if(faceValue > 0){
          var remainValue = Number(totalValue - faceValue);
          remainValue = addCommas(remainValue.toFixed(2));
          $('#remainValue').html(remainValue);
        }else{
          $('#remainValue').html(totalValue1);
        }

      },"html"  
      ); 

  }

  return false;
}

$('#face_value').on('keyup keypress blur change',function(){

  var faceValue  = Number($(this).val());
  var totalValue  = Number($('#totalFaceValue').val());


// && totalValue > 0

if(faceValue > 0 ){


  var remainValue = Number(totalValue - faceValue);

  remainValue = addCommas(remainValue.toFixed(2));
  $('#remainValue').html(remainValue);

}else{


  totalValue  = addCommas(totalValue.toFixed(2));
  $('#remainValue').html(totalValue);
}
});


function addCommas(nStr)
{
  nStr += '';
  x = nStr.split('.');
  x1 = x[0];
  x2 = x.length > 1 ? '.' + x[1] : '';
  var rgx = /(\d+)(\d{3})/;
  while (rgx.test(x1)) {
    x1 = x1.replace(rgx, '$1' + ',' + '$2');
  }
  return x1 + x2;
}


function toggleChecked(status) {
$(".chkbox").each( function() {
$(this).attr("checked",status);
})
}

<AJDF:output>if !empty($messages)</AJDF:output>
var debtor = '<AJDF:output>$values.debtor_id</AJDF:output>';
loadFields(debtor);
<AJDF:output>/if</AJDF:output>


<AJDF:output>if $values.debtor_id ne ''</AJDF:output>
calCurrencyRate('<AJDF:output>$values.debtor_id</AJDF:output>');
<AJDF:output>/if</AJDF:output>

</script>
<style>

.clsrm td{
  line-height:normal;
  padding:0 !important;
}
.none{
  display:none; 
}
.Clstr_hints, .Clstr_hints:hover{
  font-size:10px !important;
}
.text_dd_code{
  width:15px; 
}
#listDebtor td {
  font-size: 11px;
  padding: 5px;
}

</style>
<AJDF:output>include file="footer.html"</AJDF:output>