policybot/application/helpers/financial_year_helper.php
2021-11-30 16:26:55 +05:30

91 lines
2.6 KiB
PHP

<?php
function view_table($values)
{
$get_controller_start=$values['start'];
//echo $get_controller_start;exit;
$get_controller_end=$values['end'];
?>
<!------------------Table------------------------>
<div class="col-md-12">
<table class="table table-striped table-bordered table-hover table-checkable order-column" id="sample_1">
<thead>
<tr>
<th>
<label class="mt-checkbox mt-checkbox-single mt-checkbox-outline">
<input type="checkbox" id="main_checkbox" class="group-checkable" data-set="#sample_1 .checkboxes" />
<span></span>
</label>
</th>
<th> Ledger Name </th>
<th> Opening Balance </th>
<th> Closing Balance </th>
</tr>
</thead>
<tbody>
<?php
$CI =& get_instance();
$CI->load->model('Finance_model');
$table=$CI->Finance_model->show_date($get_controller_start,$get_controller_end);
if(isset($table) && $table->num_rows()>0)
{
$i=1;
foreach($table->result() as $rep)
{
$ledger_id=$rep->ledger_id;
$ledger_name=$rep->ledger_name;
$opening_balance=$rep->opening_balance;
$ob_debit_credit_id=$rep->ob_debit_credit_id;
$closing_balance=$rep->closing_balance;
$cb_debit_credit=$rep->cb_debit_credit;
if($ob_debit_credit_id==1)
{
$ob_debit_credit_id="Dr";
}
else
{
$ob_debit_credit_id="Cr";
}
if($cb_debit_credit==1)
{
$cb_debit_credit="Dr";
}
else
{
$cb_debit_credit="Cr";
}
?>
<tr class="odd gradeX">
<td>
<label class="mt-checkbox mt-checkbox-single mt-checkbox-outline">
<input type="checkbox" class="ledger_checkbox" class="checkboxes" value="1" />
<span></span>
</label>
</td>
<td> <?=$ledger_name;?> </td>
<input type="hidden" value="<?=$ledger_id;?>" name="ledger_id[]"/>
<input type="hidden" value="<?=$ledger_name;?>" name="ledger_name[]"/>
<td>
<a> <?=$opening_balance.' '.$ob_debit_credit_id;?></a>
<input type="hidden" value="<?=$opening_balance;?>" name="opening_balance[]"/>
<input type="hidden" value="<?=$ob_debit_credit_id;?>" name="opening_dr_cr[]"/>
</td>
<td>
<span class="label label-sm label-success"> <?=$closing_balance.' '.$cb_debit_credit;?></span>
<input type="hidden" value="<?=$closing_balance;?>" name="closing_balance[]"/>
<input type="hidden" value="<?=$cb_debit_credit;?>" name="closing_dr_cr[]"/>
</td>
</tr>
<?php $i++; } } else { ?> <tr><td colspan="11" style= "color: red; text-align: center;"><h4>No result found</h4></td> </tr> <?php } ?>
</tbody>
</table>
</div>
<!------------------Table------------------------>
<?php } ?>