135 lines
3.6 KiB
PHP
135 lines
3.6 KiB
PHP
<?php
|
|
function ledger($values)
|
|
{
|
|
|
|
$CI =& get_instance();
|
|
$CI->load->model('commonsql_model');
|
|
$tableName="ledger";
|
|
$whereData=array('status'=>1,'type'=>$values);$order="ledger_id";
|
|
$seller=$CI->commonsql_model->selectTable($tableName, $whereData,'',$order);
|
|
|
|
?>
|
|
<div class="portlet-body">
|
|
<div class="tab-content">
|
|
<div class="tab-pane active" id="portlet_comments_1">
|
|
<!-- BEGIN: Comments -->
|
|
<div class="portlet box green">
|
|
<div class="portlet-title">
|
|
<div class="caption">
|
|
<?php
|
|
if($values=='0')
|
|
{
|
|
echo "Customer";
|
|
}
|
|
else
|
|
{
|
|
echo "Seller";
|
|
}
|
|
?>
|
|
</div>
|
|
<?php
|
|
if(!pageaccess('Ledger','page_insert'))
|
|
{
|
|
?><div class="tools">
|
|
<a href="<?=base_url();?>add-ledger"><i class="fa fa-plus"id="add"></i></a>
|
|
</div>
|
|
<?php
|
|
} ?>
|
|
</div>
|
|
<div class="portlet-body">
|
|
<div class="table-scrollable">
|
|
<table class="table table-striped table-hover">
|
|
<thead>
|
|
<tr>
|
|
<th>S NO</th>
|
|
<th><?php
|
|
if($values=='0')
|
|
{
|
|
echo "Customer Name";
|
|
}
|
|
else
|
|
{
|
|
echo "Company Name";
|
|
}
|
|
?></th>
|
|
<th>Contact Number</th>
|
|
<th>Email</th>
|
|
<th>Address</th>
|
|
<?php
|
|
if(!pageaccess('Ledger','page_edit','page_delete'))
|
|
{
|
|
?> <th>ACTION </th><?php
|
|
}
|
|
?>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php
|
|
|
|
if(isset($seller)&& $seller->num_rows()>0)
|
|
{
|
|
|
|
$i=1;
|
|
foreach($seller->result() as $b)
|
|
{
|
|
$id=$b->ledger_id;
|
|
$cname=$b->customer_name;
|
|
$name=$b->company;
|
|
$contact=$b->contact_number;
|
|
$email=$b->email;
|
|
$address=$b->address;
|
|
$status=$b->status;
|
|
?>
|
|
<tr id="customer_<?=$id;?>">
|
|
<td><?=$i;?></td>
|
|
<td><?php
|
|
if($values=='0')
|
|
{
|
|
echo $cname;
|
|
}
|
|
else
|
|
{
|
|
echo $name;
|
|
}
|
|
?></td>
|
|
<td><?=$contact;?></td>
|
|
<td><?=$email;?></td>
|
|
<td><?=$address;?></td>
|
|
<td>
|
|
<?php
|
|
if(!pageaccess('Ledger','page_edit'))
|
|
{
|
|
?><a href="<?=base_url();?>edit-ledger/<?=$id;?>" id="" class="update_cus"><i id="edit" class="fa fa-pencil" aria-hidden="true"></i></i></a><?php
|
|
} ?>
|
|
<?php
|
|
if(!pageaccess('Ledger','page_delete'))
|
|
{
|
|
?><a href="<?=base_url();?>delete-ledger/<?=$id;?>" id="<?=$id;?>" class="delete_sku" data-toggle="confirmation" data-singleton="true"><i id="delete" class="fa fa-trash" aria-hidden="true"></i></a><br/><?php
|
|
} ?></td>
|
|
|
|
</tr>
|
|
<?php
|
|
}
|
|
}
|
|
else
|
|
{
|
|
?><tr><td>No record found</td></tr><?php
|
|
}
|
|
?>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- END: Comments -->
|
|
</div>
|
|
<!-- END: Comments -->
|
|
|
|
|
|
</div>
|
|
</div>
|
|
<?php
|
|
}
|
|
?>
|