heama
This commit is contained in:
parent
7d37861f74
commit
32a142162b
@ -48,6 +48,7 @@ $routes->post("user_synchronization", "Users::user_synchronization");
|
||||
$routes->get("book_list/", "Books::index");
|
||||
$routes->get("book_page/(:any)", "Books::book_page/$1");
|
||||
$routes->post("insert_books", "Books::insert_books");
|
||||
$routes->get("delete_books/(:any)", "Books::delete_books/$1");
|
||||
|
||||
# Site-Setting Routes
|
||||
$routes->get("sitesetting_list/", "Settings::index");
|
||||
@ -69,6 +70,7 @@ $routes->get("delete_customer/(:any)", "Customer::delete_customer/$1");
|
||||
$routes->get("scheme_list/", "Scheme::index");
|
||||
$routes->get("new_scheme/(:any)", "Scheme::new_scheme/$1");
|
||||
$routes->post("insert_scheme/", "Scheme::insert_scheme");
|
||||
$routes->get("delete_scheme/(:any)", "Scheme::delete_scheme/$1");
|
||||
|
||||
# Api integration
|
||||
$routes->get("apiintegration", "Home::apiintegration");
|
||||
|
||||
@ -13,9 +13,11 @@ class Books extends BaseController
|
||||
$session_role = get_user_role();
|
||||
$session_bid = get_business_id();
|
||||
|
||||
$where = ['books.isactive' => 1];
|
||||
if (!empty($session_role) && $session_role !== "sadmin") {
|
||||
$where = ['books.business_id' => $session_bid, 'books.isactive' => 1];
|
||||
}else{
|
||||
$where = ['books.isactive !=' => NULL];
|
||||
|
||||
}
|
||||
|
||||
$model = new BooksModel();
|
||||
@ -121,14 +123,14 @@ class Books extends BaseController
|
||||
$BooksModel->insert($data);
|
||||
} else {
|
||||
// It's an update operation
|
||||
$isactive = $this->request->getPost('bcheckbox');
|
||||
$isactive = $this->request->getPost('isactive');
|
||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$BooksModel->update($book_id, $data);
|
||||
}
|
||||
return redirect()->route('book_list');
|
||||
}
|
||||
public function delete_book($id)
|
||||
public function delete_books($id)
|
||||
{
|
||||
$BooksModel = new BooksModel();
|
||||
|
||||
|
||||
@ -7,23 +7,34 @@ use App\Models\CustomerModel;
|
||||
class Customer extends BaseController
|
||||
{
|
||||
|
||||
## For Business Listing
|
||||
## For Customer Listing
|
||||
public function index()
|
||||
{
|
||||
helper('session');
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
if (is_session_active()) {
|
||||
$session_role = get_user_role();
|
||||
$session_bid = get_business_id();
|
||||
if (!empty($session_role) && $session_role !== "sadmin") {
|
||||
$where = ['isactive'=>1,'business_id'=>(int)$session_bid];
|
||||
}else{ $where = ['isactive != '=>NULL];}
|
||||
$CustomerModel = new CustomerModel();
|
||||
|
||||
$data['page_name'] = 'Customer Listing';
|
||||
$data['customer'] = $CustomerModel->where($where)->findAll();
|
||||
|
||||
// print_r($data); die();
|
||||
|
||||
$this->render_page('customer_list', $data);
|
||||
}else{
|
||||
return redirect()->to('login');
|
||||
}
|
||||
|
||||
$CustomerModel =new CustomerModel();
|
||||
|
||||
$data['page_name'] = 'Customer Listing';
|
||||
$data['customer'] = $CustomerModel->findAll();
|
||||
// print_r($data); die();
|
||||
|
||||
$this->render_page('customer_list', $data);
|
||||
}
|
||||
## load Customer page
|
||||
public function new_customer($id)
|
||||
{
|
||||
helper('session');
|
||||
$session_bid = get_business_id();
|
||||
if ($id === '0') {
|
||||
$data['page_name'] = 'Add Customer';
|
||||
$data['customer'] = [];
|
||||
@ -32,96 +43,78 @@ class Customer extends BaseController
|
||||
$model = new CustomerModel();
|
||||
$model->setTable('customers');
|
||||
$edit_user_details = $model->where(['customer_id' => $id])->first();
|
||||
|
||||
|
||||
$data['customer'] = $edit_user_details;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$data['session_bid'] = $session_bid;
|
||||
$this->render_page('customer_form', $data);
|
||||
}
|
||||
## insert and updation for customer
|
||||
public function insert_customer()
|
||||
{
|
||||
helper('session');
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
$validationRule = [
|
||||
'userfile' => [
|
||||
'label' => 'Image File',
|
||||
'rules' => [
|
||||
'uploaded[cfile]',
|
||||
'is_image[cfile]',
|
||||
'mime_in[cfile,image/jpg,image/jpeg,image/gif,image/png,image/webp]',
|
||||
$model = new CustomerModel();
|
||||
$data = [
|
||||
'first_name' => $this->request->getPost('cfname'),
|
||||
'last_name' => $this->request->getPost('csname'),
|
||||
'mobile_no' => $this->request->getPost('cmobile'),
|
||||
'address' => $this->request->getPost('address'),
|
||||
'city' => $this->request->getPost('ccity'),
|
||||
'email' => $this->request->getPost('cmail'),
|
||||
'state' => $this->request->getPost('cstate'),
|
||||
'postal_code' => $this->request->getPost('czip'),
|
||||
'country' => $this->request->getPost('ccountry'),
|
||||
'type' => $this->request->getPost('ctype'),
|
||||
'date_of_birth' => $this->request->getPost('dob'),
|
||||
'gender' => $this->request->getPost('gen'),
|
||||
'profile_picture' => $this->request->getPost('cfile'),
|
||||
'mode' => $this->request->getPost('cmode'),
|
||||
'business_id' => $this->request->getPost('business_id')
|
||||
|
||||
],
|
||||
],
|
||||
];
|
||||
if (!$this->validate($validationRule)) {
|
||||
$data = ['errors' => $this->validator->getErrors()];
|
||||
print_r($data);
|
||||
return 'hello';
|
||||
}
|
||||
$img = $this->request->getFile('cfile');
|
||||
|
||||
if (!$img->hasMoved()) {
|
||||
$filepath = WRITEPATH . 'uploads/' . $img->store();
|
||||
$fileName = $img->getName();
|
||||
$CustomerModel =new CustomerModel();
|
||||
$data = [
|
||||
'first_name' => $this->request->getPost('cfname'),
|
||||
'last_name' => $this->request->getPost('csname'),
|
||||
'mobile_no' => $this->request->getPost('cmobile'),
|
||||
'address' => $this->request->getPost('address'),
|
||||
'city' => $this->request->getPost('ccity'),
|
||||
'email' => $this->request->getPost('cmail'),
|
||||
'state' => $this->request->getPost('cstate'),
|
||||
'postal_code' => $this->request->getPost('czip'),
|
||||
'country'=> $this->request->getPost('ccountry'),
|
||||
'type'=> $this->request->getPost('ctype'),
|
||||
'date_of_birth'=> $this->request->getPost('dob'),
|
||||
'gender'=>$this->request->getPost('gen'),
|
||||
'profile_picture'=>$this->request->getPost('cfile'),
|
||||
'mode'=>$this->request->getPost('cmode'),
|
||||
'isactive' => $this->request->getPost('ccheckbox') ? 1 : 0
|
||||
];
|
||||
$customer_id = $this->request->getPost('customer_id'); // Get the business ID for update
|
||||
$customer_id = $this->request->getPost('customer_id'); // Get the business ID for update
|
||||
|
||||
if (empty($customer_id)) {
|
||||
// It's an insert operation
|
||||
$data['isactive'] = 1;
|
||||
$data['created_by'] = $session_uid;
|
||||
$CustomerModel->insert($data);
|
||||
} else {
|
||||
// It's an update operation
|
||||
$isactive = $this->request->getPost('isactivce');
|
||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$CustomerModel->update($customer_id, $data);
|
||||
}
|
||||
return redirect()->route('customer_list');
|
||||
if (empty($customer_id)) {
|
||||
// It's an insert operation
|
||||
$data['isactive'] = 1;
|
||||
$data['created_by'] = $session_uid;
|
||||
//print_r($data);die;
|
||||
$model->insert($data);
|
||||
} else {
|
||||
// It's an update operation
|
||||
$isactive = $this->request->getPost('isactivce');
|
||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$model->update($customer_id, $data);
|
||||
}
|
||||
return redirect()->route('customer_list');
|
||||
}
|
||||
|
||||
## delete for customer
|
||||
public function delete_customer($id)
|
||||
{
|
||||
$CustomerModel =new CustomerModel();
|
||||
|
||||
$CustomerModel = new CustomerModel();
|
||||
|
||||
// Check if the business ID exists
|
||||
$existingCustomer = $CustomerModel->find($id);
|
||||
if (!$existingCustomer) {
|
||||
|
||||
// return redirect()->to(base_url('Business/index'))->with('error', 'Business not found.');
|
||||
return redirect()->route('customer_list');
|
||||
}
|
||||
|
||||
helper('session');
|
||||
$session_uid = get_logged_user_id();
|
||||
|
||||
// Delete the business record
|
||||
$data['isactive'] = 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$CustomerModel->update($id, $data);
|
||||
print_r($data); die();
|
||||
$data['updated_by'] = $session_uid;
|
||||
$CustomerModel->update($id, $data);
|
||||
//$BusinessModel->delete($id);
|
||||
|
||||
// return redirect()->to(base_url('Business/index'))->with('success', 'Business deleted successfully.');
|
||||
return redirect()->route('customer_list');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -69,4 +69,27 @@ class Scheme extends BaseController
|
||||
}
|
||||
return redirect()->route('scheme_list');
|
||||
}
|
||||
}
|
||||
public function delete_scheme($id)
|
||||
{
|
||||
$SchemeModel = new SchemeModel();
|
||||
|
||||
// Check if the business ID exists
|
||||
$existingCustomer = $SchemeModel->find($id);
|
||||
if (!$existingCustomer) {
|
||||
// return redirect()->to(base_url('Business/index'))->with('error', 'Business not found.');
|
||||
return redirect()->route('scheme_list');
|
||||
}
|
||||
|
||||
helper('session');
|
||||
$session_uid = get_logged_user_id();
|
||||
// Delete the business record
|
||||
$data['isactive'] = 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$SchemeModel->update($id, $data);
|
||||
//$BusinessModel->delete($id);
|
||||
|
||||
// return redirect()->to(base_url('Business/index'))->with('success', 'Business deleted successfully.');
|
||||
return redirect()->route('scheme_list');
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,16 +89,16 @@ class Users extends BaseController
|
||||
return 'hello';
|
||||
}
|
||||
$img = $this->request->getFile('profile_picture');
|
||||
$user_id = $this->request->getPost('user_id');
|
||||
$user_id = $this->request->getPost('user_id');
|
||||
$business_id = $this->request->getPost('business_id');
|
||||
$filePath ='public/uploads/' . $this->request->getPost('profile_picture');
|
||||
$filePath = 'public/uploads/' . $this->request->getPost('profile_picture');
|
||||
|
||||
## File Already Existing or not
|
||||
if ($img->isValid() && !$img->hasMoved()) {
|
||||
$fileName = $img->getName();
|
||||
$img->move('public/uploads/', $fileName);
|
||||
|
||||
|
||||
|
||||
|
||||
// Delete the previous image file if it exists
|
||||
if ($user_id) {
|
||||
$previousFileName = $this->request->getPost('previous_ufile');
|
||||
@ -109,11 +109,11 @@ class Users extends BaseController
|
||||
} else {
|
||||
$fileName = $this->request->getPost('previous_ufile', ''); // Use the previous filename if no new image is provided
|
||||
}
|
||||
|
||||
|
||||
|
||||
$UsersModel = new UsersModel();
|
||||
$data = [
|
||||
|
||||
|
||||
'user_name' => $this->request->getPost('user_name'),
|
||||
'profile_picture' => $fileName,
|
||||
'city' => $this->request->getPost('city'),
|
||||
@ -127,9 +127,9 @@ class Users extends BaseController
|
||||
'password' => $this->request->getPost('password'),
|
||||
'mobile_no' => $this->request->getPost('mobile_no'),
|
||||
'date_of_birth' => $this->request->getPost('date_of_birth'),
|
||||
'address'=> $this->request->getPost('address'),
|
||||
'gender'=> $this->request->getPost('gender'),
|
||||
'business_id'=>$business_id
|
||||
'address' => $this->request->getPost('address'),
|
||||
'gender' => $this->request->getPost('gender'),
|
||||
'business_id' => $business_id
|
||||
];
|
||||
$user_id = $this->request->getPost('user_id'); // Get the business ID for update
|
||||
|
||||
@ -148,4 +148,4 @@ class Users extends BaseController
|
||||
}
|
||||
return redirect()->route('user_list');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ class CustomerModel extends Model
|
||||
{
|
||||
protected $table = 'customers';
|
||||
protected $primaryKey = 'customer_id ';
|
||||
protected $allowedFields = ['customer_id ','first_name','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','type','isactive'];
|
||||
protected $allowedFields = ['customer_id ','first_name','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','type','isactive','business_id'];
|
||||
|
||||
public function insertCustomer($data)
|
||||
{
|
||||
|
||||
@ -4,10 +4,10 @@
|
||||
<div class="card-body">
|
||||
<h4 class="header-title"><?= $page_name; ?></h4>
|
||||
<p class="sub-header"> </p>
|
||||
<?php if (session()->getFlashdata('success')): ?>
|
||||
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
|
||||
<?php if (session()->getFlashdata('success')) : ?>
|
||||
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
|
||||
<?php endif; ?>
|
||||
<form method="post" enctype="multipart/form-data" action="<?= base_url()."insert_books"; ?>" >
|
||||
<form method="post" enctype="multipart/form-data" action="<?= base_url() . "insert_books"; ?>">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
@ -31,14 +31,14 @@
|
||||
<input type="date" class="form-control" id="publication_date" name="publication_date" placeholder="Publication Date (format : DD/MM/YYYY)" required data-toggle="input-mask" data-mask-format="00/00/0000" value="<?= isset($details['publication_date']) ? $details['publication_date'] : '' ?>" />
|
||||
</div>
|
||||
<?php if (!empty($details['cover_picture'])) { ?>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="cover_picture" class="col-form-label">Logo</label>
|
||||
<img src="<?= base_url('public/uploads/'. $details['cover_picture']) ?>" alt="coverpicture" class="preview-image" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="cover_picture" class="col-form-label">Logo</label>
|
||||
<img src="<?= base_url('public/uploads/' . $details['cover_picture']) ?>" alt="coverpicture" class="preview-image" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="coverpicture" class="col-form-label">Book Cover Picture<span class="text-danger">*</span></label>
|
||||
<br/>
|
||||
<br />
|
||||
<input type="file" id="cover_picture" name="coverpicture" placeholder="Book Cover picture Name" required value="<?= isset($details['cover_picture']) ? $details['cover_picture'] : '' ?>" />
|
||||
<!-- <input type="text" class="form-control" id="cover_picture" name="cover_picture" placeholder="Book Cover picture Name" required value="<?= isset($details['cover_picture']) ? $details['cover_picture'] : '' ?>" /> -->
|
||||
</div>
|
||||
@ -46,7 +46,7 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="genre" class="col-form-label">Genre</label>
|
||||
<textarea class="form-control" id="genre" name="genre" placeholder="Genre" rows="5"><?= isset($details['genre']) ? $details['genre'] : '' ?></textarea>
|
||||
<textarea class="form-control" id="genre" name="genre" placeholder="Genre" rows="5"><?= isset($details['genre']) ? $details['genre'] : '' ?></textarea>
|
||||
<!-- <input type="text" class="form-control" id="genre" name="genre" placeholder="Genre" value="<?= isset($details['genre']) ? $details['genre'] : '' ?>" /> -->
|
||||
</div>
|
||||
</div>
|
||||
@ -69,12 +69,12 @@
|
||||
</div>
|
||||
<input type="hidden" id="book_id" name="book_id" placeholder="hidden for book id" value="<?= isset($details['book_id']) ? $details['book_id'] : '' ?>" />
|
||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
|
||||
<?php if(!empty($details)){ ?>
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
<input type="checkbox" id="isactive" name="isactive" class="form-control" <?= isset($details) && $details['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="isactive"> Is Active</label>
|
||||
</div>
|
||||
<br>
|
||||
<?php if (!empty($details)) { ?>
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
<input type="checkbox" id="isactive" name="isactive" class="form-control" <?= isset($details) && $details['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="isactive"> Is Active</label>
|
||||
</div>
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
|
||||
@ -3,8 +3,10 @@
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="float-right">
|
||||
<a href="<?= base_url()."book_page/0"; ?>" class="btn btn-primary waves-effect"> <span> <i class="mdi mdi-book-plus"></i></span> Add New </a>
|
||||
<a href="<?= base_url()."apiintegration"; ?>" class="btn btn-primary waves-effect"> <span> <i class="mdi mdi-gesture-swipe-down"></i></span> Api integration </a>
|
||||
<a href="<?= base_url()."book_page/0"; ?>" class="btn btn-primary waves-effect"> <span> <i
|
||||
class="mdi mdi-book-plus"></i></span> Add New </a>
|
||||
<a href="<?= base_url()."apiintegration"; ?>" class="btn btn-primary waves-effect"> <span> <i
|
||||
class="mdi mdi-gesture-swipe-down"></i></span> Api integration </a>
|
||||
</div>
|
||||
<br>
|
||||
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
||||
@ -13,7 +15,7 @@
|
||||
<!-- <table id="alternative-page-datatable" class="table table-borderless table-hover table-centered m-0"> -->
|
||||
<!-- <table class="table table-borderless table-hover table-centered m-0"> -->
|
||||
<!-- <table id="basic-datatable" class="table dt-responsive w-100"> -->
|
||||
<table id="datatable-buttons" class="table dt-responsive w-100">
|
||||
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
|
||||
<thead class="thead-light">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
@ -28,7 +30,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($details as $row):
|
||||
<?php foreach ($details as $row):
|
||||
if ($row['isactive']) {
|
||||
$class = 'badge badge-soft-success';
|
||||
$message = 'Active';
|
||||
@ -50,16 +52,16 @@
|
||||
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<ul class="list-inline table-action m-0">
|
||||
<li class="list-inline-item">
|
||||
<a href="<?php echo $edit_page_route; ?>" class="action-icon px-1"> <i class="ri ri-edit-box-fill"></i></a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<a href="<?php echo $edit_page_route; ?>" class="edit-button"> <i
|
||||
class="ri-pencil-line"></i></a>
|
||||
<a href="<?php echo "delete_books/".$row['book_id']; ?>"
|
||||
class="delete-button"><i class="ri-delete-bin-line"></i></a>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -9,63 +9,89 @@
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="cfname" class="col-form-label">First Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="cfname" name="cfname" value="<?= isset($customer['first_name']) ? $customer['first_name'] : '' ?>" placeholder=" Name" required />
|
||||
<label for="cfname" class="col-form-label">First Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="cfname" name="cfname"
|
||||
value="<?= isset($customer['first_name']) ? $customer['first_name'] : '' ?>"
|
||||
placeholder=" Name" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="csname" class="col-form-label">Last Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="csname" value="<?= isset($customer['last_name']) ? $customer['last_name'] : '' ?>" placeholder="" required />
|
||||
<label for="csname" class="col-form-label">Last Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="csname"
|
||||
value="<?= isset($customer['last_name']) ? $customer['last_name'] : '' ?>"
|
||||
placeholder="" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="cmail" class="col-form-label">Email<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="cmail" value="<?= isset($customer['email']) ? $customer['email'] : '' ?>" placeholder="" required />
|
||||
<label for="cmail" class="col-form-label">Email<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="cmail"
|
||||
value="<?= isset($customer['email']) ? $customer['email'] : '' ?>" placeholder=""
|
||||
required />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="cmobile" class="col-form-label">Mobile<span class="text-danger">*</span></label>
|
||||
<input type="number" class="form-control" name="cmobile" value="<?= isset($customer['mobile_no']) ? $customer['mobile_no'] : '' ?>" placeholder="" required />
|
||||
<label for="cmobile" class="col-form-label">Mobile<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="number" class="form-control" name="cmobile"
|
||||
value="<?= isset($customer['mobile_no']) ? $customer['mobile_no'] : '' ?>"
|
||||
placeholder="" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="dob" class="col-form-label">D.O.B<span class="text-danger">*</span></label>
|
||||
<input type="date" class="form-control" name="dob" value="<?= isset($customer['date_of_birth']) ? $customer['date_of_birth'] : '' ?>" placeholder="" required />
|
||||
<input type="date" class="form-control" name="dob"
|
||||
value="<?= isset($customer['date_of_birth']) ? $customer['date_of_birth'] : '' ?>"
|
||||
placeholder="" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="gen" class="col-form-label">Gender<span class="text-danger">*</span></label>
|
||||
<input type="rad" class="form-control" name="gen" value="<?= isset($customer['gender']) ? $customer['gender'] : '' ?>" placeholder="" required />
|
||||
<input type="rad" class="form-control" name="gen"
|
||||
value="<?= isset($customer['gender']) ? $customer['gender'] : '' ?>" placeholder=""
|
||||
required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="caddress" class="col-form-label">Address<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="address" value="<?= isset($customer['address']) ? $customer['address'] : '' ?>" placeholder="1234 Main St" required />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="ccountry" class="col-form-label">Country<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="ccountry" value="<?= isset($customer['country']) ? $customer['country'] : '' ?>" placeholder="country" required />
|
||||
</div>
|
||||
<label for="caddress" class="col-form-label">Address<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="address"
|
||||
value="<?= isset($customer['address']) ? $customer['address'] : '' ?>"
|
||||
placeholder="1234 Main St" required />
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="ccountry" class="col-form-label">Country<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="ccountry"
|
||||
value="<?= isset($customer['country']) ? $customer['country'] : '' ?>"
|
||||
placeholder="country" required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="ccity" class="col-form-label">City<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="ccity" value="<?= isset($customer['city']) ? $customer['city'] : '' ?>" placeholder="city" required />
|
||||
<input type="text" class="form-control" name="ccity"
|
||||
value="<?= isset($customer['city']) ? $customer['city'] : '' ?>" placeholder="city"
|
||||
required />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="cstate" class="col-form-label">State<span class="text-danger">*</span></label>
|
||||
<select name="cstate" class="form-control" value="<?= isset($customer['state']) ? $customer['state'] : '' ?>" required>
|
||||
<label for="cstate" class="col-form-label">State<span
|
||||
class="text-danger">*</span></label>
|
||||
<select name="cstate" class="form-control"
|
||||
value="<?= isset($customer['state']) ? $customer['state'] : '' ?>" required>
|
||||
<option>Choose</option>
|
||||
<option> 1</option>
|
||||
<option> 2</option>
|
||||
@ -73,30 +99,39 @@
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="czip" class="col-form-label">Zip<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="czip" value="<?= isset($customer['postal_code']) ? $customer['postal_code'] : '' ?>" placeholder="Zip" required />
|
||||
<input type="text" class="form-control" name="czip"
|
||||
value="<?= isset($customer['postal_code']) ? $customer['postal_code'] : '' ?>"
|
||||
placeholder="Zip" required />
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="ctype" class="col-form-label">Type<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="ctype" value="<?= isset($customer['type']) ? $customer['type'] : '' ?>" placeholder="customer/subscriebr" required />
|
||||
<input type="text" class="form-control" name="ctype"
|
||||
value="<?= isset($customer['type']) ? $customer['type'] : '' ?>"
|
||||
placeholder="customer/subscriebr" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="cmode" class="col-form-label">Mode<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="cmode" value="<?= isset($customer['mode']) ? $customer['mode'] : '' ?>" placeholder="" required />
|
||||
<input type="text" class="form-control" name="cmode"
|
||||
value="<?= isset($customer['mode']) ? $customer['mode'] : '' ?>" placeholder=""
|
||||
required />
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="customer_id" name="customer_id" placeholder="hidden for business id" value="<?= isset($customer['customer_id']) ? $customer['customer_id'] : '' ?>" />
|
||||
<input type="hidden" id="customer_id" name="customer_id" placeholder="hidden for book id"
|
||||
value="<?= isset($customer['customer_id']) ? $customer['customer_id'] : '' ?>" />
|
||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
|
||||
<?php if (!empty($customer)) { ?>
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
<input type="checkbox" id="ccheckbox" name="ccheckbox" class="form-control" <?= isset($customer) && $customer['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="ccheckbox"> Is Active</label>
|
||||
</div>
|
||||
<br>
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
<input type="checkbox" id="isactive" name="isactive" class="form-control"
|
||||
<?= isset($customer) && $customer['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="isactive"> Is Active</label>
|
||||
</div>
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
@ -108,8 +143,8 @@
|
||||
<button type="button" class="btn btn-secondary waves-effect">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</form>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
@ -7,36 +7,52 @@
|
||||
<form method="POST" enctype="multipart/form-data" action="<?php echo base_url(); ?>insert_scheme">
|
||||
<div class="form-group">
|
||||
<div class="form-row">
|
||||
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="sname" class="col-form-label">Scheme Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="sname" name="sname"value="<?= isset($scheme['scheme_name']) ? $scheme['scheme_name'] : '' ?>" placeholder=" Name" required />
|
||||
<label for="sname" class="col-form-label">Scheme Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="sname" name="sname"
|
||||
value="<?= isset($scheme['scheme_name']) ? $scheme['scheme_name'] : '' ?>"
|
||||
placeholder=" Name" required />
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="sprice" class="col-form-label">Price<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="sprice"value="<?= isset($scheme['price']) ? $scheme['price'] : '' ?>" placeholder="" required />
|
||||
</div>
|
||||
<label for="sprice" class="col-form-label">Price<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="sprice"
|
||||
value="<?= isset($scheme['price']) ? $scheme['price'] : '' ?>" placeholder=""
|
||||
required />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="sduration" class="col-form-label">Duration<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="sduration"value="<?= isset($scheme['duration']) ? $scheme['duration'] : '' ?>" placeholder="" required />
|
||||
<label for="sduration" class="col-form-label">Duration<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" name="sduration"
|
||||
value="<?= isset($scheme['duration']) ? $scheme['duration'] : '' ?>" placeholder=""
|
||||
required />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="sdescription" class="col-form-label">Description<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="number" class="form-control" name="sdescription"
|
||||
value="<?= isset($scheme['description']) ? $scheme['description'] : '' ?>"
|
||||
placeholder="" required />
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="sdescription" class="col-form-label">Description<span class="text-danger">*</span></label>
|
||||
<input type="number" class="form-control" name="sdescription" value="<?= isset($scheme['description']) ? $scheme['description'] : '' ?>"placeholder="" required />
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="scheme_id" name="scheme_id" placeholder="hidden for scheme id" value="<?= isset($scheme['scheme_id']) ? $scheme['scheme_id'] : '' ?>" />
|
||||
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
<input type="checkbox" id="isactive" name="isactive" class="form-control" <?= isset($scheme) && $scheme['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="isactive"> Is Active</label>
|
||||
</div>
|
||||
<input type="hidden" id="scheme_id" name="scheme_id" placeholder="hidden for scheme id"
|
||||
value="<?= isset($scheme['scheme_id']) ? $scheme['scheme_id'] : '' ?>" />
|
||||
|
||||
<?php if (!empty($scheme)) { ?>
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
<input type="checkbox" id="isactive" name="isactive" class="form-control" <?= isset($scheme) && $scheme['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="isactive"> Is Active</label>
|
||||
</div>
|
||||
<br>
|
||||
<?php } ?>
|
||||
<br>
|
||||
|
||||
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
Submit
|
||||
@ -46,22 +62,11 @@
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end row -->
|
||||
<script src="../assets/js/vendor.min.js"></script>
|
||||
|
||||
<!-- Plugins js -->
|
||||
|
||||
|
||||
<!-- App js -->
|
||||
<script src="../assets/js/app.min.js"></script>
|
||||
<!-- end row -->
|
||||
@ -40,7 +40,7 @@
|
||||
<td><?= $value['duration'] ; ?></td>
|
||||
<td>
|
||||
<a href="<?= "new_scheme/" . $value['scheme_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
|
||||
<a href="<?= "new_scheme/" . $value['scheme_id']; ?>" class="edit-button"><i class="ri-trash-line"></i></a>
|
||||
<a href="<?php echo "delete_scheme/".$value['scheme_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
|
||||
|
||||
</td>
|
||||
|
||||
|
||||
@ -38,7 +38,6 @@
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<<<<<<< HEAD
|
||||
<label for="first_name" class="col-form-label">First Name<span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name"
|
||||
@ -184,120 +183,9 @@
|
||||
</a>
|
||||
<!-- <button id="cancelButton" type="button" class="btn btn-secondary waves-effect">Cancel</button> -->
|
||||
</div>
|
||||
=======
|
||||
<label for="first_name" class="col-form-label">First Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="first_name" name="first_name" placeholder="First Name" value="<?= isset($details['first_name']) ? $details['first_name'] : '' ?>" required />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="last_name" class="col-form-label">Last Name<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="last_name" name="last_name" placeholder="Last Name" value="<?= isset($details['last_name']) ? $details['last_name'] : '' ?>" required />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<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>
|
||||
<input type="date" class="form-control" id="date_of_birth" name="date_of_birth" placeholder="Date Of birth (format : DD/MM/YYYY)" required data-toggle="input-mask" data-mask-format="00/00/0000" value="<?= isset($details['date_of_birth']) ? $details['date_of_birth'] : '' ?>" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-4">
|
||||
<label for="mobile_no" class="col-form-label">Mobile Number<span class="text-danger">*</span></label>
|
||||
<input type="number" class="form-control" id="mobile_no" name="mobile_no" placeholder="Mobile Number (Enter only numbers)" required data-parsley-type="number" value="<?= isset($details['mobile_no']) ? $details['mobile_no'] : '' ?>" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="gender" class="col-form-label">Gender</label>
|
||||
<input type="text" class="form-control" id="gender" name="gender" placeholder="Gender" value="<?= isset($details['gender']) ? $details['gender'] : '' ?>" />
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<label for="role" class="col-form-label">Role<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="role" name="role" placeholder="Role" required value="<?= isset($details['role']) ? $details['role'] : '' ?>" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<?php if (!empty($details['profile_picture'])) { ?>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="profile_picture" class="col-form-label">Current Business Logo</label>
|
||||
<img src="<?= base_url('public/uploads/' . $details['profile_picture']) ?>" alt="Business Logo" class="preview-image" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="profile_picture" class="col-form-label">Profile Picture<span class="text-danger">*</span></label>
|
||||
<!-- <input type="text" class="form-control" id="profile_picture" name="profile_picture" placeholder="Profile picture Name" readonly value="<?= isset($details['profile_picture']) ? $details['profile_picture'] : '' ?>" /> -->
|
||||
<input type="file" name="profile_picture" placeholder="hidden Field for profile picture" readonly value="<?= isset($details['profile_picture']) ? $details['profile_picture'] : '' ?>" />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<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'] : '' ?>" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<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'] : '' ?>" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-4">
|
||||
<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'] : '' ?>" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
<div class="form-group col-md-2">
|
||||
<label for="postal_code" class="col-form-label">Postal Code<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="postal_code" name="postal_code" placeholder="Postal Code (PIN)" required value="<?= isset($details['postal_code']) ? $details['postal_code'] : '' ?>" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if ($loggedin_person_role === 'sadmin') { ?>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<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">
|
||||
<option value=null>Choose your Buiness</option>
|
||||
<?php foreach ($business_details as $value) { ?>
|
||||
<option value="<?php echo $value['business_id']; ?>" <?php if (isset($details['business_id']) && ($details['business_id'] === $value['business_id'])) echo "selected"; ?>><?php echo $value['title']; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<?php } else { ?>
|
||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= isset($details['business_id']) ? $details['business_id'] : '' ?>" />
|
||||
<?php } ?>
|
||||
<input type="hidden" id="user_id" name="user_id" placeholder="hidden for user id" value="<?= isset($details['user_id']) ? $details['user_id'] : '' ?>" />
|
||||
<?php if (!empty($details)) { ?>
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
<input type="checkbox" id="isactive" name="isactive" class="form-control" <?= isset($details) && $details['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="isactive"> Is Active</label>
|
||||
</div>
|
||||
<br>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
Submit
|
||||
</button>
|
||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||
Reset
|
||||
</button>
|
||||
<a href="<?= base_url() . "user_list"; ?>" class="btn btn-secondary waves-effect">Cancel </a>
|
||||
<!-- <button id="cancelButton" type="button" class="btn btn-secondary waves-effect">Cancel</button> -->
|
||||
</div>
|
||||
>>>>>>> ee8a2ba619d361191bbd1f7670242697a47ecea7
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
<<<<<<< HEAD
|
||||
</div><!-- end row -->
|
||||
=======
|
||||
</div>
|
||||
<!-- end row -->
|
||||
>>>>>>> ee8a2ba619d361191bbd1f7670242697a47ecea7
|
||||
|
||||
Loading…
Reference in New Issue
Block a user