I have one amount column in my table and I want to show that amount by category credit or debit I only receive credit amount.
Controller
<?php foreach($modResult as $voucher):?>
<tr>
<th>Voucher No.</th>
<th>Voucher Amount BY CR.</th>
<th>Voucher Amount BY DR.</th>
<tr>
<tr>
<td><?php echo $voucher['voucher_no'];?></td>
<td><?php echo $voucher['voucher_amount'] = $voucher['voucher_transaction_type']=='CR' ? $voucher['voucher_amount'] : '';?></td>
<td><?php echo $voucher['voucher_amount'] = $voucher['voucher_transaction_type']=='DR' ? $voucher['voucher_amount'] : '';?></td>
</tr>
<?php endforeach; ?>
Model
$this->db->select('*');
$this->db->from('ts_voucher');
$this->db->where('voucher_category','cash_receipt');
$this->db->or_where('voucher_category','cash_payment');
$query=$this->db->get();
return $query->result_array();
How I can show DR value in Voucher Amount BY DR column