File: /www/exchange0old/exchange/admin/cache/%%D6^D61^D6116716%%add_response_popup.html.php
<?php /* Smarty version 2.6.19, created on 2024-06-14 23:03:49
compiled from reports/rav/add_response_popup.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'siteUrl', 'reports/rav/add_response_popup.html', 30, false),)), $this); ?>
<div id="add_response_dialog" style="display: none">
<div style="width: 90%; margin: 10px;">
<table class="table table-striped table-responsive">
<tr>
<td width="150"><label>Amount: </label></td>
<td><input type="text" style="height: 22px; border: 1px solid rgb(169, 169, 169); " id="response-rva-amount" size="25"></td>
</tr>
<tr>
<td><label>Notes: </label></td>
<td><textarea class="input-small" id="response-rva-note" rows="5" cols="70"></textarea></td>
</tr>
<tr>
<td><label>Manual status: </label></td>
<td>
<select id="response-rva-status">
<option value="">-------</option>
<?php $_from = $this->_tpl_vars['sub_statuses']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
foreach ($_from as $this->_tpl_vars['item']):
?>
<option value="<?php echo $this->_tpl_vars['item']['transaction_id']; ?>
"><?php echo $this->_tpl_vars['item']['transaction_name']; ?>
</option>
<?php endforeach; endif; unset($_from); ?>
</select>
</td>
</tr>
</table>
<input type="hidden" id="response-rva-id" value="0">
<div class="row">
<button type="submit" class="btn btn-default" style="margin-top: 20px;" id="report-response-button">Submit</button>
<img src="<?php echo ((is_array($_tmp='/images/loading.gif')) ? $this->_run_mod_handler('siteUrl', true, $_tmp) : smarty_modifier_siteUrl($_tmp)); ?>
" id="loading_data" style="display: none;" />
</div>
</div>
</div>
<script>
var addResponseDialog;
function addResponse(rva_id)
{
$('#response-rva-id').val(rva_id);
addResponseDialog.dialog('open');
}
$(function () {
$('#report-response-button').click(function () {
var amount = $('#response-rva-amount').val();
var rva_id = $('#response-rva-id').val();
var notes = $('#response-rva-note').val();
var status = $('#response-rva-status').val();
if (amount.length == 0 || amount == '0') {
return alert("Amount cannot be empty!");
}
$('#loading_data').show();
$.ajax({
url: "?do=rav_response",
type: "POST",
dataType: 'json',
data: {
rva_id: rva_id,
amount: amount,
note: notes,
status: status
},
success: function (res) {
if (typeof(res.success) == 'undefined' || !res.success) {
alert('RAV status update error. Please contact support');
$('#add_response_dialog').dialog('close');
}
else {
alert('RAV response added successfully');
document.location.reload(true);
}
}
});
});
addResponseDialog = $("#add_response_dialog").dialog({
autoOpen: false,
width: 900,
height: 300,
modal: true,
title: 'Add Response',
open: function () {
}
});
});
</script>