52 lines
3.1 KiB
PHP
Raw Normal View History

2024-07-10 18:28:19 +05:45
<div class="content-wrapper">
<div class="content">
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="card card-primary card-outline">
<div class="card-header">
2024-10-07 11:41:27 +05:45
<!-- <h5 class="m-0"><?php echo $pageTitle; ?> <?php showCreateButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/add", "Create New " . $pageTitle); ?></h5> -->
2024-07-10 18:28:19 +05:45
</div>
<div class="card-body">
<?php $TableData = $this->db->query("select * from tbl_purchases where status=1")->result(); ?>
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
2024-08-08 19:07:57 +05:45
<th width="3%" class="text-center"><?php myLang('S.N'); ?></th>
<th width="10%" class="col-1"><?php myLang('Date'); ?></th>
<th class="table-col col-9"><?php myLang('Purchase Transaction'); ?></th>
<th width="8%"class="col-2"><?php myLang('Amount'); ?></th>
2024-07-10 18:28:19 +05:45
2024-08-08 19:07:57 +05:45
<td class="col-1 text-center"><b>Action</b></th>
2024-07-10 18:28:19 +05:45
</tr>
</thead>
<tbody>
2024-10-07 11:41:27 +05:45
<?php $a = 0; $n=0;
2024-07-10 18:28:19 +05:45
foreach ($PurchaseRecords as $TableRow) : $a++;
$id = $TableRow->purchase_id; ?>
<tr>
2024-10-07 11:41:27 +05:45
<td><?php echo ++$n; ?></td>
2024-07-10 18:28:19 +05:45
<td><?php echo $TableRow->purchase_date; ?></td>
2024-10-07 11:41:27 +05:45
<td><?php echo ($this->myaccounts->getAccountDetails($TableRow->accounts_id)->account_name) ?? ""; ?></td>
2024-07-10 18:28:19 +05:45
<td><?php echo myCurrency($TableRow->TotalPurchase); ?></td>
2024-08-08 19:07:57 +05:45
<td class="text-center"><?php showDetailsButton($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/details/$id"); ?>
2024-07-10 18:28:19 +05:45
<?php showDeleteButton($id); ?>
</td>
</tr>
<?php endforeach; ?>
<tbody>
</table>
<script>
function doDelete(id) {
if (confirm('Are you sure to delete?')) {
window.location = '<?php echo site_url($this->uri->segment(1) . "/" . $this->uri->segment(2) . "/delete/"); ?>' + id;
}
}
</script>
</div>
</div>
</div>
</div>
</div>
</div>
</div>