commitall
This commit is contained in:
69
account/application/views/products/category.php
Normal file
69
account/application/views/products/category.php
Normal 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>
|
40
account/application/views/products/category_add.php
Normal file
40
account/application/views/products/category_add.php
Normal 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>
|
39
account/application/views/products/index.php
Normal file
39
account/application/views/products/index.php
Normal 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>
|
37
account/application/views/products/products_add.php
Normal file
37
account/application/views/products/products_add.php
Normal 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>
|
Reference in New Issue
Block a user