Merge branch 'uat' of bitbucket.org:venbainformationtechnology/vb_book into uat

This commit is contained in:
VE10-Sanjeev 2023-10-12 17:52:49 +05:30
commit d0e889162e
13 changed files with 144 additions and 68 deletions

View File

@ -79,7 +79,7 @@ abstract class BaseController extends Controller
$data['loggedin_person_role'] = $details[0]['role']; $data['loggedin_person_role'] = $details[0]['role'];
$data['favicon'] = !empty($details[0]['favicon']) && file_exists(FCPATH."public/uploads/".$details[0]['favicon']) ? base_url("public/uploads/".$details[0]['favicon']) : base_url("public/uploads/default.ico"); $data['favicon'] = !empty($details[0]['favicon']) && file_exists(FCPATH."public/uploads/".$details[0]['favicon']) ? base_url("public/uploads/".$details[0]['favicon']) : base_url("public/uploads/default.ico");
$data['profile_picture'] = !empty($details[0]['profile_picture']) && file_exists(FCPATH."public/uploads/".$details[0]['profile_picture']) ? base_url("public/uploads/" . $details[0]['profile_picture']) : base_url("public/uploads/avatar.png"); $data['profile_picture'] = !empty($details[0]['profile_picture']) && file_exists(FCPATH."public/uploads/".$details[0]['profile_picture']) ? base_url("public/uploads/" . $details[0]['profile_picture']) : base_url("public/assets/images/users/avatar-9.jpg");
$data['company_logo_small'] = !empty($details[0]['company_logo_small']) && file_exists(FCPATH."public/uploads/".$details[0]['company_logo_small']) ? base_url("public/uploads/" . $details[0]['company_logo_small']) : base_url("public/uploads/default_logo.png"); $data['company_logo_small'] = !empty($details[0]['company_logo_small']) && file_exists(FCPATH."public/uploads/".$details[0]['company_logo_small']) ? base_url("public/uploads/" . $details[0]['company_logo_small']) : base_url("public/uploads/default_logo.png");
$data['company_logo_large'] = !empty($details[0]['company_logo_large']) && file_exists(FCPATH."public/uploads/".$details[0]['company_logo_large']) ? base_url("public/uploads/" . $details[0]['company_logo_large']) : base_url("public/uploads/default.png"); $data['company_logo_large'] = !empty($details[0]['company_logo_large']) && file_exists(FCPATH."public/uploads/".$details[0]['company_logo_large']) ? base_url("public/uploads/" . $details[0]['company_logo_large']) : base_url("public/uploads/default.png");
$data['browser_title'] = $data['company_name'] . ' | ' . $data['company_short_name'] . ' ' . $data['page_name']; $data['browser_title'] = $data['company_name'] . ' | ' . $data['company_short_name'] . ' ' . $data['page_name'];
@ -87,7 +87,7 @@ abstract class BaseController extends Controller
$data['loggedin_person'] = $session_uname; $data['loggedin_person'] = $session_uname;
$session_bid = get_business_id(); $session_bid = get_business_id();
$data['bid'] = $session_bid; $data['bid'] = $session_bid;
$data['footer_about'] = $details[0]['footer_about'];
echo view('template/header.php', $data); echo view('template/header.php', $data);
echo view('template/topbar.php', $data); echo view('template/topbar.php', $data);

View File

@ -23,7 +23,7 @@ class Customer extends BaseController
$CustomerModel = new CustomerModel(); $CustomerModel = new CustomerModel();
$data['page_name'] = 'Customer Listing'; $data['page_name'] = 'Customer Listing';
$data['customer'] = $CustomerModel->where($where)->findAll(); $data['customer'] = $CustomerModel->where($where)->orderBy('customer_id', 'DESC')->findAll();
// print_r($data); die(); // print_r($data); die();
@ -93,7 +93,6 @@ class Customer extends BaseController
'state' => $this->request->getPost('cstate'), 'state' => $this->request->getPost('cstate'),
'postal_code' => $this->request->getPost('czip'), 'postal_code' => $this->request->getPost('czip'),
'country' => $this->request->getPost('ccountry'), 'country' => $this->request->getPost('ccountry'),
'type' => $this->request->getPost('ctype'),
'date_of_birth' => $this->request->getPost('dob'), 'date_of_birth' => $this->request->getPost('dob'),
'gender' => $this->request->getPost('gen'), 'gender' => $this->request->getPost('gen'),
'profile_picture' => $this->request->getPost('cfile'), 'profile_picture' => $this->request->getPost('cfile'),

View File

@ -23,7 +23,8 @@ class Scheme extends BaseController
$SchemeModel = new SchemeModel(); $SchemeModel = new SchemeModel();
$data['page_name'] = 'Scheme Listing'; $data['page_name'] = 'Scheme Listing';
$data['scheme'] = $SchemeModel->where($where)->findAll(); $data['scheme'] = $SchemeModel->where($where)->orderBy('book_id', 'DESC')->findAll();
$this->render_page('scheme_list', $data); $this->render_page('scheme_list', $data);
} else { } else {
@ -65,6 +66,7 @@ class Scheme extends BaseController
'description' => $this->request->getPost('sdescription'), 'description' => $this->request->getPost('sdescription'),
'price' => $this->request->getPost('sprice'), 'price' => $this->request->getPost('sprice'),
'duration' => $this->request->getPost('sduration'), 'duration' => $this->request->getPost('sduration'),
'sku' => $this->request->getPost('sku'),
'business_id' => $this->request->getPost('business_id') 'business_id' => $this->request->getPost('business_id')
]; ];
@ -73,10 +75,33 @@ class Scheme extends BaseController
if (empty($scheme_id)) { if (empty($scheme_id)) {
// It's an insert operation // It's an insert operation
$data['isactive'] = 1; $data['isactive'] = 1;
$data['category'] = 2;
$data['created_by'] = $session_uid; $data['created_by'] = $session_uid;
$SchemeModel->insert($data); $SchemeModel->insert($data);
} else { // $last_inserted_id = 100;
$last_inserted_id = $SchemeModel->insertID();
// Retrieve the category name 'membership'
$category_name = 'membership';
// Find the category ID for 'membership' from the category table
$db = db_connect();
$category = $db->table('category')
->select('id')
->where('name', $category_name)
->get()
->getRow();
// Check if the category exists
if ($category) {
// Insert data into book_categories table
$db->table('book_categories')->insert([
'book_id' => $last_inserted_id,
'category_id' => $category->id
]);
}
}
else {
// It's an update operation // It's an update operation
$isactive = $this->request->getPost('isactive'); $isactive = $this->request->getPost('isactive');
$data['isactive'] = ($isactive == 'on') ? 1 : 0; $data['isactive'] = ($isactive == 'on') ? 1 : 0;

View File

@ -10,7 +10,7 @@ class AuthenticationModel extends Model
public function getheringDetailsForHeader($user_id) public function getheringDetailsForHeader($user_id)
{ {
$builder = $this->db->table('users'); $builder = $this->db->table('users');
$builder->select('users.user_id,users.business_id,users.profile_picture,users.role,settings.site_name,settings.site_title,settings.favicon,settings.logo as company_logo_large,business.business_logo as company_logo_small,business.email as company_email,business.address as company_address,business.mobile_no as company_mobile_no,business.title,settings.footer_about'); $builder->select('users.user_id,users.business_id,users.profile_picture,users.role,settings.site_name,settings.site_title,settings.favicon,settings.logo as company_logo_large,business.business_logo as company_logo_small,business.email as company_email,business.address as company_address,business.mobile_no as company_mobile_no,business.title');
$builder->join('settings', 'settings.business_id = users.business_id', 'left'); $builder->join('settings', 'settings.business_id = users.business_id', 'left');
$builder->join('business', 'business.business_id = users.business_id', 'left'); $builder->join('business', 'business.business_id = users.business_id', 'left');
$builder->where('user_id', $user_id); $builder->where('user_id', $user_id);

View File

@ -162,3 +162,4 @@ public function insertSubscriptionData($data)

View File

@ -9,7 +9,7 @@ class SchemeModel extends Model
{ {
protected $table = 'books'; protected $table = 'books';
protected $primaryKey = 'book_id'; protected $primaryKey = 'book_id';
protected $allowedFields = ['book_id ','title','description','price','features','duration','business_id','updated_by','category','isactive']; protected $allowedFields = ['book_id ','title','sku','description','price','features','duration','business_id','updated_by','category','isactive'];
public function insertScheme($data) public function insertScheme($data)
{ {
@ -102,6 +102,23 @@ public function getAllSchemes()
{ {
return $this->findAll(); return $this->findAll();
} }
public function getCategoryName($book_id)
{
$builder = $this->builder();
$builder->select('category.name AS category_name');
$builder->join('book_categories', 'book_categories.book_id = books.book_id');
$builder->join('category', 'category.id = book_categories.category_id');
$builder->where('books.book_id', $book_id);
$query = $builder->get();
if ($query->getNumRows() === 1) {
$row = $query->getRow();
return $row->category_name;
} else {
return null;
}
}
} }

View File

@ -75,8 +75,7 @@
</div> </div>
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="dob" class="col-form-label">Date Of Birth<span <label for="dob" class="col-form-label">Date Of Birth</label>
class="text-danger">*</span></label>
<input type="date" class="form-control" name="dob" <input type="date" class="form-control" name="dob"
value="<?= isset($customer['date_of_birth']) ? $customer['date_of_birth'] : '' ?>" value="<?= isset($customer['date_of_birth']) ? $customer['date_of_birth'] : '' ?>"
placeholder="Date Of Birth" /> placeholder="Date Of Birth" />
@ -94,15 +93,8 @@
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-6">
<label for="ctype" class="col-form-label">Type<span class="text-danger">*</span></label> <div class="form-group col-md-4">
<select class="form-control" name="ctype" required>
<option value="customer" <?= isset($customer['type']) && $customer['type'] == 'customer' ? 'selected' : '' ?>>Customer</option>
<option value="subscriber" <?= isset($customer['type']) && $customer['type'] == 'subscriber' ? 'selected' : '' ?>>Member</option>
</select>
<div class="invalid-feedback"> Please provide. </div>
</div>
<div class="form-group col-md-6">
<label for="cmode" class="col-form-label">Mode<span class="text-danger">*</span></label> <label for="cmode" class="col-form-label">Mode<span class="text-danger">*</span></label>
<select class="form-control" name="cmode" required> <select class="form-control" name="cmode" required>
<option value="offline" <?= isset($customer['mode']) && $customer['mode'] == 'offline' ? 'selected' : '' ?>>Offline</option> <option value="offline" <?= isset($customer['mode']) && $customer['mode'] == 'offline' ? 'selected' : '' ?>>Offline</option>

View File

@ -11,22 +11,23 @@
<table id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th hidden></th>
<th>First Name</th> <th>First Name</th>
<th>Last Name</th> <th>Last Name</th>
<th>Mobile Number</th> <th>Mobile Number</th>
<th>Email</th> <th>Email</th>
<th>Type</th>
<th>Mode</th> <th>Mode</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
<?php foreach ($customer as $value) :?> <?php foreach ($customer as $value) :?>
<tr> <tr>
<td hidden><?$value['customer_id'];?></td>
<td><?= $value['first_name']; ?></td> <td><?= $value['first_name']; ?></td>
<td><?= $value['last_name']; ?></td> <td><?= $value['last_name']; ?></td>
<td><?= $value['mobile_no']; ?></td> <td><?= $value['mobile_no']; ?></td>
<td><?= $value['email']; ?></td> <td><?= $value['email']; ?></td>
<td><?= $value['type']; ?></td>
<td><?= $value['mode']; ?></td> <td><?= $value['mode']; ?></td>
<td> <td>
<a href="<?= "new_customer/" . $value['customer_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a> <a href="<?= "new_customer/" . $value['customer_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
@ -43,3 +44,11 @@
</div> </div>
<!-- end row--> <!-- end row-->
<script>
$(document).ready(function() {
$('#scroll-horizontal-datatable_wrapper').DataTable({
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
});
});
</script>

View File

@ -55,9 +55,10 @@
<?php endif; ?> <?php endif; ?>
<?php endif; ?> <?php endif; ?>
<div class="table-responsive"> <div class="table-responsive">
<table id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table id="scroll-horizontal-datatable_wrapper" class="table w-100 nowrap">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th hidden></th>
<th>Invoice Number</th> <th>Invoice Number</th>
<th>Invoice Date</th> <th>Invoice Date</th>
<th>Customer Name</th> <th>Customer Name</th>
@ -76,6 +77,7 @@
<tbody> <tbody>
<?php foreach ($invoice as $row): ?> <?php foreach ($invoice as $row): ?>
<tr> <tr>
<td hidden><?= $row['invoice_id'] ?></td>
<td><?= $row['invoice_number']; ?></td> <td><?= $row['invoice_number']; ?></td>
<td><?= $row['invoice_date']; ?></td> <td><?= $row['invoice_date']; ?></td>
<td><?= $row['customer_name']; ?></td> <td><?= $row['customer_name']; ?></td>
@ -133,6 +135,14 @@ $(document).ready(function() {
}); });
}); });
</script> </script>
<script>
$(document).ready(function() {
$('#scroll-horizontal-datatable_wrapper').DataTable({
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
});
});
</script>

View File

@ -26,6 +26,11 @@
<input type="text" class="form-control" name="sduration" value="<?= isset($scheme['duration']) ? $scheme['duration'] : '' ?>" placeholder="Duration (eg: 1 Month / 3 months / 1 Year ... )" required /> <input type="text" class="form-control" name="sduration" value="<?= isset($scheme['duration']) ? $scheme['duration'] : '' ?>" placeholder="Duration (eg: 1 Month / 3 months / 1 Year ... )" required />
<div class="invalid-feedback"> Please provide. </div> <div class="invalid-feedback"> Please provide. </div>
</div> </div>
<div class="form-group col-md-6">
<label for="sku" class="col-form-label">Sku ID<span class="text-danger">*</span></label>
<input type="text" class="form-control" name="sku" value="<?= isset($scheme['sku']) ? $scheme['sku'] : '' ?>" placeholder="Duration (eg: 1 Month / 3 months / 1 Year ... )" required />
<div class="invalid-feedback"> Please provide. </div>
</div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="sdescription" class="col-form-label">Description<span class="text-danger"></span></label> <label for="sdescription" class="col-form-label">Description<span class="text-danger"></span></label>
@ -33,7 +38,7 @@
</div> </div>
</div> </div>
<input type="hidden" id="scheme_id" name="scheme_id" placeholder="hidden for scheme id" value="<?= isset($scheme['book_id']) ? $scheme['book_id'] : '' ?>" /> <input type="hidden" id="book_id" name="book_id" placeholder="hidden for scheme id" value="<?= isset($scheme['book_id']) ? $scheme['book_id'] : '' ?>" />
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" /> <input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
<?php if (!empty($scheme)) { ?> <?php if (!empty($scheme)) { ?>
<div class="form-group text-right m-b-0 checkbox checkbox-purple"> <div class="form-group text-right m-b-0 checkbox checkbox-purple">

View File

@ -12,6 +12,7 @@
<table id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th hidden></th>
<th>Scheme Name</th> <th>Scheme Name</th>
<th>Price</th> <th>Price</th>
<th>Duration</th> <th>Duration</th>
@ -19,7 +20,11 @@
</tr> </tr>
</thead> </thead>
<?php foreach ($scheme as $value) :?> <?php foreach ($scheme as $value) :?>
<tr> <tr>
<td hidden><? $value['book_id'];?></td>
<td><?= $value['title']; ?></td> <td><?= $value['title']; ?></td>
<td><?= $value['price']; ?></td> <td><?= $value['price']; ?></td>
<td><?= $value['duration']; ?></td> <td><?= $value['duration']; ?></td>
@ -36,3 +41,11 @@
</div> <!-- end card --> </div> <!-- end card -->
</div><!-- end col--> </div><!-- end col-->
</div><!-- end row--> </div><!-- end row-->
<script>
$(document).ready(function() {
$('#scroll-horizontal-datatable_wrapper').DataTable({
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
});
});
</script>

View File

@ -9,19 +9,14 @@
<form class="parsley-examples" action="<?= base_url() . "insert_users"; ?>" method="post" enctype="multipart/form-data"> <form class="parsley-examples" action="<?= base_url() . "insert_users"; ?>" method="post" enctype="multipart/form-data">
<div class="form-group"> <div class="form-group">
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-6">
<label for="user_name" class="col-form-label">User Name<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="user_name" name="user_name" value="<?= isset($details['user_name']) ? $details['user_name'] : '' ?>" placeholder="User Name" required autofocus />
</div>
<div class="form-group col-md-4">
<label for="email" class="col-form-label">Email<span class="text-danger">*</span></label> <label for="email" class="col-form-label">Email<span class="text-danger">*</span></label>
<input type="email" class="form-control" id="email" name="email" placeholder="Email" value="<?= isset($details['email']) ? $details['email'] : '' ?>" required /> <input type="email" class="form-control" id="email" name="email" placeholder="Email" value="<?= isset($details['email']) ? $details['email'] : '' ?>" required />
</div> </div>
<?php if (empty($details)) { ?> <?php if (empty($details)) { ?>
<div class="form-group col-md-4"> <div class="form-group col-md-6">
<label for="password" class="col-form-label">Password<span class="text-danger">*</span></label> <label for="password" class="col-form-label">Password<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="password" name="password" placeholder="Password" value="<?= isset($details['password']) ? $details['password'] : '' ?>" required /> <input type="text" class="form-control" id="password" name="password" placeholder="Password" value="<?= isset($details['password']) ? $details['password'] : '' ?>" required />
@ -34,8 +29,8 @@
<input data-parsley-type="alphanum" type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name" value="<?= isset($details['first_name']) ? $details['first_name'] : '' ?>" required /> <input data-parsley-type="alphanum" type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name" value="<?= isset($details['first_name']) ? $details['first_name'] : '' ?>" required />
</div> </div>
<div class="form-group col-md-6"> <div class="form-group col-md-6">
<label for="last_name" class="col-form-label">Last Name<span class="text-danger">*</span></label> <label for="last_name" class="col-form-label">Last Name<span class="text-danger"></span></label>
<input data-parsley-type="alphanum" type="text" class="form-control" id="last_name" name="last_name" placeholder="Last Name" value="<?= isset($details['last_name']) ? $details['last_name'] : '' ?>" required /> <input data-parsley-type="alphanum" type="text" class="form-control" id="last_name" name="last_name" placeholder="Last Name" value="<?= isset($details['last_name']) ? $details['last_name'] : '' ?>" />
</div> </div>
<!-- <div class="form-group col-md-4"> <!-- <div class="form-group col-md-4">
<label for="date_of_birth" class="col-form-label">Date Of Birth<span class="text-danger">*</span></label> <label for="date_of_birth" class="col-form-label">Date Of Birth<span class="text-danger">*</span></label>
@ -47,20 +42,10 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="mobile_no" class="col-form-label">Mobile Number<span class="text-danger">*</span></label> <label for="mobile_no" class="col-form-label">Mobile Number<span class="text-danger">*</span></label>
<input type="text" class="form-control" id="mobile_no" name="mobile_no" placeholder="Mobile Number (Enter only numbers)" data-toggle="input-mask" data-mask-format="0000000000" value="<?= isset($details['mobile_no']) ? $details['mobile_no'] : '' ?>" autofocus> <input type="text" class="form-control" id="mobile_no" name="mobile_no" placeholder="Mobile Number (Enter only numbers)" data-toggle="input-mask" data-mask-format="0000000000" value="<?= isset($details['mobile_no']) ? $details['mobile_no'] : '' ?>" autofocus required>
</div> </div>
<!-- ... (other form elements) ... --> <!-- ... (other form elements) ... -->
<div class="form-group col-md-4">
<label for="gender" class="col-form-label">Gender<span class="text-danger">*</span></label>
<select id="gender" name="gender" class="form-control" required>
<option value="">Select Gender</option>
<option value="male" <?= isset($details['gender']) && $details['gender'] === 'male' ? 'selected' : '' ?>>Male</option>
<option value="female" <?= isset($details['gender']) && $details['gender'] === 'female' ? 'selected' : '' ?>>Female</option>
</select>
</div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="role" class="col-form-label">Role<span class="text-danger">*</span></label> <label for="role" class="col-form-label">Role<span class="text-danger">*</span></label>
<select id="role" name="role" class="form-control" required> <select id="role" name="role" class="form-control" required>
@ -69,30 +54,40 @@
<option value="manager" <?= isset($details['role']) && $details['role'] === 'manager' ? 'selected' : '' ?>>Manager</option> <option value="manager" <?= isset($details['role']) && $details['role'] === 'manager' ? 'selected' : '' ?>>Manager</option>
</select> </select>
</div> </div>
<div class="form-group col-md-4">
<label for="gender" class="col-form-label">Gender<span class="text-danger"></span></label>
<select id="gender" name="gender" class="form-control" >
<option value="">Select Gender</option>
<option value="male" <?= isset($details['gender']) && $details['gender'] === 'male' ? 'selected' : '' ?>>Male</option>
<option value="female" <?= isset($details['gender']) && $details['gender'] === 'female' ? 'selected' : '' ?>>Female</option>
</select>
</div>
</div> </div>
<!-- ... (rest of the form) ... --> <!-- ... (rest of the form) ... -->
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="address" class="col-form-label">Address<span class="text-danger">*</span></label> <label for="address" class="col-form-label">Address<span class="text-danger"></span></label>
<input type="text" class="form-control" id="address" name="address" placeholder="Address (eg : 1234 Main St)" required value="<?= isset($details['address']) ? $details['address'] : '' ?>" /> <input type="text" class="form-control" id="address" name="address" placeholder="Address (eg : 1234 Main St)" value="<?= isset($details['address']) ? $details['address'] : '' ?>" />
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="city" class="col-form-label">City<span class="text-danger">*</span></label> <label for="city" class="col-form-label">City<span class="text-danger"></span></label>
<input type="text" class="form-control" id="city" name="city" placeholder="City" required value="<?= isset($details['city']) ? $details['city'] : '' ?>" /> <input type="text" class="form-control" id="city" name="city" placeholder="City" value="<?= isset($details['city']) ? $details['city'] : '' ?>" />
</div> </div>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="state" class="col-form-label">State<span class="text-danger">*</span></label> <label for="state" class="col-form-label">State<span class="text-danger"></span></label>
<input type="text" class="form-control" id="state" name="state" placeholder="State" required value="<?= isset($details['state']) ? $details['state'] : '' ?>" /> <input type="text" class="form-control" id="state" name="state" placeholder="State" value="<?= isset($details['state']) ? $details['state'] : '' ?>" />
</div> </div>
</div> </div>
<div class="form-row"> <div class="form-row">
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="postal_code" class="col-form-label">Postal Code<span class="text-danger">*</span></label> <label for="postal_code" class="col-form-label">Postal Code<span class="text-danger"></span></label>
<input data-parsley-type="number" type="text" class="form-control" id="postal_code" name="postal_code" placeholder="Postal Code (PIN)" required value="<?= isset($details['postal_code']) ? $details['postal_code'] : '' ?>" pattern="[0-9]{6}" maxlength="6" /> <input data-parsley-type="number" type="text" class="form-control" id="postal_code" name="postal_code" placeholder="Postal Code (PIN)" value="<?= isset($details['postal_code']) ? $details['postal_code'] : '' ?>" pattern="[0-9]{6}" maxlength="6" />
</div> </div>
<?php if (!empty($details['profile_picture'])) { ?> <?php if (!empty($details['profile_picture'])) { ?>
<div class="form-group col-md-4 mt-3"> <div class="form-group col-md-4 mt-3">
@ -113,7 +108,7 @@
<?php if ($loggedin_person_role === 'sadmin') { ?> <?php if ($loggedin_person_role === 'sadmin') { ?>
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="business_id" class="col-form-label">Buiness<span class="text-danger">*</span></label> <label for="business_id" class="col-form-label">Buiness<span class="text-danger"></span></label>
<select id="business_id" name="business_id" class="form-control" required> <select id="business_id" name="business_id" class="form-control" required>
<option value="">Choose your Buiness</option> <option value="">Choose your Buiness</option>
<?php foreach ($business_details as $value) { ?> <?php foreach ($business_details as $value) { ?>

View File

@ -31,6 +31,7 @@
<table id="scroll-horizontal-datatable" class="table w-100 nowrap"> <table id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="thead-light"> <thead class="thead-light">
<tr> <tr>
<th hidden></th>
<th>Name</th> <th>Name</th>
<th>Email</th> <th>Email</th>
<th>Role</th> <th>Role</th>
@ -56,6 +57,7 @@
?> ?>
<tr> <tr>
<td hidden><?= $row['user_id'] ?></td>
<td><?php echo $row['first_name'].' '.$row['last_name'] ; ?></td> <td><?php echo $row['first_name'].' '.$row['last_name'] ; ?></td>
<td><?php echo $row['email'] ; ?></td> <td><?php echo $row['email'] ; ?></td>
<td><?php echo $row['role'] ; ?></td> <td><?php echo $row['role'] ; ?></td>
@ -80,3 +82,11 @@
</div><!-- end col--> </div><!-- end col-->
</div> </div>
<!-- end row--> <!-- end row-->
<script>
$(document).ready(function() {
$('#scroll-horizontal-datatable_wrapper').DataTable({
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
});
});
</script>