function get_account_list($data = '') { $ci =& get_instance(); $ci->db->where('status', 1); $query = $ci->db->get('accounts')->result_array(); ?> <table cellpadding="0" cellspacing="0" border="0" class="table table-hover table-bordered table-condensed dataTable_noExcel_noLength_noInformation"> <thead> <tr> <th width="1"></th> <th><?php lang('Account Code'); ?> </th> <th><?php lang('Account Name'); ?> </th> <th><?php lang('City'); ?> </th> <th><?php lang('Gsm'); ?> </th> <th><?php lang('Balance'); ?> </th> </tr> </thead> <tbody> <?php foreach ($query as $account) { ?> <tr> <td width="1"> <a href="javascript:;" class="btn btn-xs btn-default btnSelected" data-account_id='<?php echo $account['id']; ?> ' data-account_code='<?php echo $account['name']; ?> ' data-account_name='<?php echo $account['name']; ?> ' data-account_name_surname='<?php echo $account['name_surname']; ?> ' data-account_balance='<?php echo number_format($account['balance'], 2); ?> ' data-account_phone='<?php echo $account['phone']; ?> ' data-account_gsm='<?php echo $account['gsm']; ?> ' data-account_email='<?php echo $account['email']; ?> ' data-account_address='<?php echo $account['address']; ?> ' data-account_city='<?php echo $account['city']; ?> ' data-account_county='<?php echo $account['county']; ?> ' > <?php lang('Choose'); ?> </a> </td> <td><?php echo $account['code']; ?> </td> <td><?php echo $account['name']; ?> </td> <td><?php echo $account['city']; ?> </td> <td><?php echo $account['gsm']; ?> </td> <td class="text-right"><?php echo get_account_balance($account['balance']); ?> </td> </tr> <?php } ?> </tbody> </table> <script> $('.btnSelected').click(function() { <?php if (isset($data['account_id'])) { ?> $('#<?php echo $data['account_id']; ?> ').val($(this).attr('data-account_id'));<?php } ?> <?php if (isset($data['account_code'])) { ?> $('#<?php echo $data['account_code']; ?> ').val($(this).attr('data-account_code'));<?php } ?> <?php if (isset($data['account_name'])) { ?> $('#<?php echo $data['account_name']; ?> ').val($(this).attr('data-account_name'));<?php } ?> <?php if (isset($data['account_name_surname'])) { ?> $('#<?php echo $data['account_name_surname']; ?> ').val($(this).attr('data-account_name_surname'));<?php } ?> <?php if (isset($data['account_balance'])) { ?> $('#<?php echo $data['account_balance']; ?> ').val($(this).attr('data-account_balance'));<?php } ?> <?php if (isset($data['account_phone'])) { ?> $('#<?php echo $data['account_phone']; ?> ').val($(this).attr('data-account_phone'));<?php } ?> <?php if (isset($data['account_gsm'])) { ?> $('#<?php echo $data['account_gsm']; ?> ').val($(this).attr('data-account_gsm'));<?php } ?> <?php if (isset($data['account_email'])) { ?> $('#<?php echo $data['account_email']; ?> ').val($(this).attr('data-account_email'));<?php } ?> <?php if (isset($data['account_address'])) { ?> $('#<?php echo $data['account_address']; ?> ').val($(this).attr('data-account_address'));<?php } ?> <?php if (isset($data['account_city'])) { ?> $('#<?php echo $data['account_city']; ?> ').val($(this).attr('data-account_city'));<?php } ?> <?php if (isset($data['account_county'])) { ?> $('#<?php echo $data['account_county']; ?> ').val($(this).attr('data-account_county'));<?php } ?> <?php if (isset($data['RUN'])) { echo $data['RUN']; } ?> $('.close').click(); }); </script> <?php }
echo $account['name']; ?> </td> <td><?php echo $account['name_surname']; ?> </td> <td><?php echo $account['city']; ?> </td> <td><?php echo $account['phone']; ?> </td> <td class="text-right"><?php echo get_account_balance($account['balance']); ?> </td> </tr> <?php } ?> </tbody> </table> </div> <!-- /.col-md-12 --> </div> <!-- /.row --> <div class="h20"></div>
</ul> </div> <br />'; $custom_title = get_lang('Account Card') . ': ' . $account['name']; } if (isset($_GET['invoice_id'])) { $invoice = get_invoice($_GET['invoice_id']); $account = get_account(array('id' => $invoice['account_id'])); $plus_content = ' <div class="bs-callout bs-callout-danger"> <h4>' . get_lang('Invoice') . ': <a href="' . site_url('invoice/view/' . $invoice['id']) . '" target="_blank">#' . $invoice['id'] . '</a> / <small>' . $account['name'] . '</small></h4> <br /> <ul> <li>' . get_lang('Invoice') . ': <code><a href="' . site_url('invoice/view/' . $invoice['id']) . '" target="_blank">#' . $invoice['id'] . '</a></code></li> <li>' . get_lang('Account Card') . ': <code><a href="' . site_url('account/get_account/' . $account['id']) . '" target="_blank">' . $account['code'] . '</a></code></li> <li>' . get_lang('Grand Total') . ': <code>' . get_account_balance($invoice['grand_total']) . '</code></li> </ul> '; $this->db->where('status', 1); $this->db->where('invoice_id', $invoice['id']); $items = $this->db->get('invoice_items')->result_array(); $plus_content = $plus_content . ' <br /> <table class="table table-bordered table-condensed table-hover" style="background-color:#fff;"> <thead> <tr> <th>' . get_lang('Product Name') . '</th> <th>' . get_lang('Quantity') . '</th> <th>' . get_lang('Total') . '</th> <th>' . get_lang('Tax') . '</th> <th>' . get_lang('Sub Total') . '</th>
<?php } ?> </tbody> <tfoot> <?php $this->db->where('status', 1); $this->db->order_by('ID', 'DESC'); $this->db->where('account_id', $account['id']); $this->db->select_sum('grand_total'); $grand_total = $this->db->get('invoices')->row_array(); ?> <tr> <th colspan="5"></th> <th class="text-right fs-16 text-danger"><?php echo get_account_balance($grand_total['grand_total']); ?> </th> </tr> </tfoot> </table> <!-- /.table --> </div> <!-- /#invoices --> <!-- history --> <div class="tab-pane fade in" id="history"> <?php