commitall

This commit is contained in:
Sampanna Rimal
2024-07-10 18:28:19 +05:45
parent 140abda4e6
commit 9cd05ef3cb
15723 changed files with 4818733 additions and 0 deletions

View File

@ -0,0 +1,69 @@
<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">
<h5 class="m-0"><?php echo $pageTitle; ?></h5>
</div>
<div class="card-body">
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th>Category ID</th>
<th>Category Name</th>
<th>Created On</th>
<th>Created By</th>
<th>Remarks</th>
<th>Status</th>
<th>Action</th> <!-- New column for action buttons -->
</tr>
</thead>
<tbody>
<?php foreach ($Categories as $category) : ?>
<tr>
<td><?php echo $category->category_id; ?></td>
<td><?php echo $category->category_name; ?></td>
<td><?php echo $category->created_on; ?></td>
<td><?php echo $category->created_by; ?></td>
<td><?php echo $category->remarks; ?></td>
<td><?php echo $category->status; ?></td>
<td>
<!-- Edit Button with AJAX -->
<a class="btn btn-sm btn-primary" href="<?php echo site_url("products/categories/edit/" . $category->category_id); ?>">Edit</a>
<!-- Delete Button with AJAX -->
<button class="btn btn-sm btn-danger" onclick="deleteCategory(<?php echo $category->category_id; ?>)">Delete</button>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function deleteCategory(categoryId) {
if (confirm('Are you sure you want to delete this category?')) {
$.ajax({
url: '<?php echo site_url('products/categories/delete/'); ?>' + categoryId,
success: function(response) {
$('#categoryRow_' + categoryId).remove();
alert('Category deleted successfully!');
window.location.reload();
},
error: function(xhr, ajaxOptions, thrownError) {
console.error(xhr.status + ': ' + thrownError);
}
});
}
}
</script>

View File

@ -0,0 +1,40 @@
<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">
<h5 class="m-0"><?php echo $pageTitle; ?></h5>
</div>
<div class="card-body">
<form action="<?php echo site_url("products/categories/create"); ?>" method="post">
<div class="form-group">
<label for="categoryName">Category Name</label>
<input type="text" class="form-control" id="categoryName" name="categoryName" value="<?php echo isset($category->category_name) ? $category->category_name : ''; ?>">
</div>
<div class="form-group">
<label for="createdBy">Created By</label>
<input type="text" class="form-control" id="createdBy" name="createdBy" value="<?php echo isset($category->created_by) ? $category->created_by : ''; ?>">
</div>
<div class="form-group">
<label for="remarks">Remarks</label>
<textarea class="form-control" id="remarks" name="remarks"><?php echo isset($category->remarks) ? $category->remarks : ''; ?></textarea>
</div>
<div class="form-group">
<label for="status">Status</label>
<select class="form-control" id="status" name="status">
<option value="1" <?php echo isset($category->status) && $category->status == '1' ? 'selected' : ''; ?>>Active</option>
<option value="0" <?php echo isset($category->status) && $category->status == '0' ? 'selected' : ''; ?>>Inactive</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?php echo site_url('products/categories/list'); ?>" class="btn btn-secondary">Cancel</a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,39 @@
<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">
<h5 class="m-0"><?php echo $pageTitle; ?></h5>
</div>
<div class="card-body">
<table class="table table-bordered table-striped dataTable">
<thead>
<tr>
<th>Product Code</th>
<th>Product Name</th>
<th>Description</th>
<th>Quantity</th>
<th>Unit Price</th>
</tr>
</thead>
<tbody>
<?php foreach ($products as $product) : ?>
<tr>
<td><?php echo $product->product_code; ?></td>
<td><?php echo $product->product_name; ?></td>
<td><?php echo $product->description; ?></td>
<td><?php echo $product->quantity; ?></td>
<td><?php echo $product->unit_price; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,37 @@
<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">
<h5 class="m-0"><?php echo $pageTitle; ?></h5>
</div>
<div class="card-body">
<form action="<?php echo site_url("products/items/create"); ?>" method="post">
<div class="form-group">
<label for="productName">Product Name</label>
<input type="text" class="form-control" id="productName" name="productName" value="<?php echo isset($product->product_name) ? $product->product_name : ''; ?>">
</div>
<div class="form-group">
<label for="description">Description</label>
<textarea class="form-control" id="description" name="description"><?php echo isset($product->description) ? $product->description : ''; ?></textarea>
</div>
<div class="form-group">
<label for="quantity">Quantity</label>
<input type="text" class="form-control" id="quantity" name="quantity" value="<?php echo isset($product->quantity) ? $product->quantity : ''; ?>">
</div>
<div class="form-group">
<label for="unitPrice">Unit Price</label>
<input type="text" class="form-control" id="unitPrice" name="unitPrice" value="<?php echo isset($product->unit_price) ? $product->unit_price : ''; ?>">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
<a href="<?php echo site_url('products'); ?>" class="btn btn-secondary">Cancel</a>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>