Skip to content

Instantly share code, notes, and snippets.

@jalcine
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jalcine/e053098415cf294a5a19 to your computer and use it in GitHub Desktop.
Save jalcine/e053098415cf294a5a19 to your computer and use it in GitHub Desktop.
<?php
/** The '<?=' is the same as '<?php echo'. A shortcut. */
$record_text = __('Viewing {0} - {1} of {2}');
$invoices_url = url_for('account_billing/getInvoices') . '?year=';
$vat_entries = <<<VAT_INFO
{name:'invoice_amount', index:'invoice_amount', width:150, sortable:false, resizable:false, align:'right'},
{name:'vat_amount', index:'vat_amount', width:150, sortable:false, resizable:false, align:'right'},
VAT_INFO;
?>
<script type='text/javascript'>
function showgrid() {
/* jqGrid */
var recordtext = '<?= $record_text ?>';
var selectYear = $('#accountBillingYearSelect').val();
initGrid( $('#InvoiceList'),
"<?= $invoices_url ?>"+ selectYear,
[ {name:'invoice_date', index:'invoice_date', width:150, sortable:false, resizable:false, align:'center'},
{name:'invoice_no', index:'invoice_no', width:150, sortable:false, resizable:false, align:'center'},
{name:'invoice_type', index:'invoice_type', width:150, sortable:false, resizable:false, align:'left'},
<?= ($show_vat) ? $vat_text : '' ?>
{name:'total', index:'total', width:150, sortable:false, resizable:false, align:'right'},
{name:'due_date', index:'due_date', width:150, sortable:false, resizable:false, align:'center'},
{name:'status', index:'status', width:150, sortable:false, resizable:false, align:'center'}
<?= ($status == "Unpaid") ? '{name: 'card_pay', index: 'card_pay', width:150 }' : '' ?>
],
['<?= __('Invoice Date') ?>',
'<?= __('Invoice Number') ?>',
'<?= __('Invoice Type') ?>',
<? if ($show_vat) : ?>
'<?= __('Amount') ?>',
<?= ($sf_user->getNid() == BL_Network::AU_NID) ? __('GST Amount') : __('VAT Amount') ?>',
<?php endif;?>
<?php endif; ?>
'<?=__('Total') ?>',
'<?= __('Due Date') ?>',
'<?= __('Status') ?>'],
'<?= sfConfig::get('app_cpi_cookie_name') ?>',
recordtext
);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment