heama
@ -44,12 +44,10 @@ $routes->get("user_list/", "Users::index");
|
||||
$routes->get("user_page/(:any)", "Users::user_page/$1");
|
||||
$routes->post("user_synchronization", "Users::user_synchronization");
|
||||
|
||||
$routes->get("user_confirmation", "Users::user_confirmation");
|
||||
|
||||
# Books Routes
|
||||
$routes->get("book_list/", "Books::index");
|
||||
$routes->get("book_page/(:any)", "Books::book_page/$1");
|
||||
$routes->post("book_synchronization", "Books::book_synchronization");
|
||||
$routes->post("insert_books", "Books::insert_books");
|
||||
|
||||
# Site-Setting Routes
|
||||
$routes->get("sitesetting_list/", "Settings::index");
|
||||
@ -63,6 +61,7 @@ $routes->post("insert_business/", "Business::insert_business");
|
||||
$routes->get("delete_business/(:any)", "Business::delete_business/$1");
|
||||
|
||||
|
||||
|
||||
$routes->get("subscribers_list/", "Home::subscribers_list");
|
||||
$routes->get("add_subscribers/", "Home::add_subscribers");
|
||||
$routes->get("edit_subscribers/", "Home::edit_subscribers");
|
||||
@ -71,6 +70,7 @@ $routes->get("edit_subscribers/", "Home::edit_subscribers");
|
||||
$routes->get("customer_list/", "Customer::index");
|
||||
$routes->get("new_customer/(:any)", "Customer::new_customer/$1");
|
||||
$routes->post("insert_customer/", "Customer::insert_customer");
|
||||
$routes->get("delete_customer/(:any)", "Customer::delete_customer/$1");
|
||||
#scheme routes
|
||||
$routes->get("scheme_list/", "Scheme::index");
|
||||
$routes->get("new_scheme/(:any)", "Scheme::new_scheme/$1");
|
||||
|
||||
@ -32,6 +32,7 @@ class Authentication extends BaseController
|
||||
$password = $this->request->getPost('password');
|
||||
|
||||
$user = $auth_model->where('email', $username)->first();
|
||||
// print_r($user);die;
|
||||
if (is_null($user)) {
|
||||
return redirect()->back()->with('error', 'Invalid username or password.');
|
||||
// return redirect()->back()->withInput()->with('error', 'Invalid username or password.');
|
||||
|
||||
@ -33,43 +33,99 @@ class Books extends BaseController
|
||||
## To Load Book Add/Update page
|
||||
public function book_page($id)
|
||||
{
|
||||
helper('session');
|
||||
$data['session_bid'] = get_business_id();
|
||||
if ($id === '0') {
|
||||
$data['page_name'] = 'Add Book';
|
||||
$data['details'] = [];
|
||||
} else if ($id !== '0') {
|
||||
$data['page_name'] = 'Edit Book';
|
||||
$model = new BooksModel();
|
||||
$model->setTable('books');
|
||||
$details = $model->where(['book_id' => $id, 'isactive' => 1])->first();
|
||||
$model = new UsersModel();
|
||||
$model->setTable('users');
|
||||
$details = $model->where(['user_id' => $id, 'isactive' => 1])->first();
|
||||
$data['details'] = $details;
|
||||
}
|
||||
$this->render_page('book_form', $data);
|
||||
$this->render_page('user_form', $data);
|
||||
}
|
||||
|
||||
|
||||
## To Save/Update Book Data on DB.
|
||||
public function book_synchronization()
|
||||
public function insert_books()
|
||||
{
|
||||
helper('session');
|
||||
$model = new BooksModel();
|
||||
$model->setTable('books');
|
||||
if ($this->request->is('post')) {
|
||||
$requestData = $this->request->getVar();
|
||||
$session_uid = get_logged_user_id();
|
||||
$session_bid = get_business_id();
|
||||
|
||||
// print_r($_FILES);die();
|
||||
$validationRule = [
|
||||
'userfile' => [
|
||||
'label' => 'Image File',
|
||||
'rules' => [
|
||||
'uploaded[coverpicture]',
|
||||
'is_image[coverpicture]',
|
||||
'mime_in[coverpicture,image/jpg,image/jpeg,image/gif,image/png,image/webp]',
|
||||
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
if (!$this->validate($validationRule) && $this->request->getPost('coverpicture') === '') {
|
||||
$data = ['errors' => $this->validator->getErrors()];
|
||||
print_r($data);
|
||||
return 'hello';
|
||||
}
|
||||
$requestData['business_id'] = get_business_id('business_id');
|
||||
if ($requestData['book_id']) {
|
||||
#edit
|
||||
$requestData['updated_by'] = get_logged_user_id();
|
||||
$requestData['isactive'] = isset($requestData['isactive']) && $requestData['isactive'] == 'on' ? 1 : 0;
|
||||
$model->saveData($requestData, $requestData['book_id']);
|
||||
$alert_message = "Book details successfully updated.";
|
||||
$img = $this->request->getFile('coverpicture');
|
||||
$book_id = $this->request->getPost('book_id');
|
||||
$business_id = $this->request->getPost('business_id');
|
||||
$filePath ='public/uploads/' . $this->request->getPost('coverpicture');
|
||||
|
||||
## 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 ($book_id) {
|
||||
$previousFileName = $this->request->getPost('previous_file');
|
||||
if ($previousFileName && is_file('public/uploads/' . $previousFileName)) {
|
||||
link('public/uploads/' . $previousFileName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#add
|
||||
$requestData['created_by'] = get_logged_user_id();
|
||||
$requestData['isactive'] = 1;
|
||||
$model->saveData($requestData, null);
|
||||
$alert_message = "Book details successfully created.";
|
||||
$fileName = $this->request->getPost('previous_file', ''); // Use the previous filename if no new image is provided
|
||||
}
|
||||
return redirect()->route('book_list')->with('success', $alert_message);
|
||||
|
||||
|
||||
$BooksModel = new BooksModel();
|
||||
$data = [
|
||||
|
||||
'title' => $this->request->getPost('title'),
|
||||
'cover_picture' => $fileName,
|
||||
'publication_date' => $this->request->getPost('publication_date'),
|
||||
'publisher' => $this->request->getPost('publisher'),
|
||||
'genre' => $this->request->getPost('genre'),
|
||||
'language' => $this->request->getPost('language'),
|
||||
'description' => $this->request->getPost('description'),
|
||||
'page_count'=> $this->request->getPost('page_count'),
|
||||
'price'=> $this->request->getPost('price'),
|
||||
'business_id'=>$business_id
|
||||
];
|
||||
$book_id = $this->request->getPost('book_id'); // Get the business ID for update
|
||||
|
||||
if (empty($book_id)) {
|
||||
// It's an insert operation
|
||||
$data['isactive'] = 1;
|
||||
$data['created_by'] = $session_uid;
|
||||
//print_r($data);die;
|
||||
$BooksModel->insert($data);
|
||||
} else {
|
||||
// It's an update operation
|
||||
$isactive = $this->request->getPost('bcheckbox');
|
||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$BooksModel->update($book_id, $data);
|
||||
}
|
||||
return redirect()->route('book_list');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -50,7 +50,7 @@ class Business extends BaseController
|
||||
|
||||
// print_r($_FILES);die();
|
||||
$validationRule = [
|
||||
'userfile' => [
|
||||
'user' => [
|
||||
'label' => 'Image File',
|
||||
'rules' => [
|
||||
'uploaded[bfile]',
|
||||
@ -67,24 +67,26 @@ class Business extends BaseController
|
||||
return 'hello';
|
||||
}
|
||||
$img = $this->request->getFile('bfile');
|
||||
$filePath = WRITEPATH . 'uploads/' . $this->request->getPost('bfile');
|
||||
$business_id = $this->request->getPost('business_id');
|
||||
$filePath ='public/uploads/' . $this->request->getPost('bfile');
|
||||
|
||||
## File Already Existing or not
|
||||
if (!is_file($filePath)) {
|
||||
## echo 'File not Existing'
|
||||
if (!$img->hasMoved()) {
|
||||
## echo 'File not Existing and Not Moved'
|
||||
// $filepath = WRITEPATH . 'uploads/Business_files' . $img->store();
|
||||
// $fileName = $img->getName();
|
||||
$fileName = $img->getName();
|
||||
$img->move(WRITEPATH . 'uploads', $fileName);
|
||||
} else {
|
||||
## display the error file not uploaded like that...
|
||||
if ($img->isValid() && !$img->hasMoved()) {
|
||||
$fileName = $img->getName();
|
||||
$img->move('public/uploads/', $fileName);
|
||||
|
||||
|
||||
// Delete the previous image file if it exists
|
||||
if ($business_id) {
|
||||
$previousFileName = $this->request->getPost('previous_bfile');
|
||||
if ($previousFileName && is_file('public/uploads/' . $previousFileName)) {
|
||||
link('public/uploads/' . $previousFileName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
## echo 'File Existing'
|
||||
$fileName = $this->request->getPost('bfile');
|
||||
$fileName = $this->request->getPost('previous_bfile', ''); // Use the previous filename if no new image is provided
|
||||
}
|
||||
|
||||
|
||||
$BusinessModel = new BusinessModel();
|
||||
$data = [
|
||||
@ -113,6 +115,7 @@ class Business extends BaseController
|
||||
}
|
||||
return redirect()->route('business_list');
|
||||
}
|
||||
|
||||
public function delete_business($id)
|
||||
{
|
||||
$BusinessModel = new BusinessModel();
|
||||
@ -124,8 +127,13 @@ class Business extends BaseController
|
||||
return redirect()->route('business_list');
|
||||
}
|
||||
|
||||
helper('session');
|
||||
$session_uid = get_logged_user_id();
|
||||
// Delete the business record
|
||||
$BusinessModel->delete($id);
|
||||
$data['isactive'] = 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$BusinessModel->update($id, $data);
|
||||
//$BusinessModel->delete($id);
|
||||
|
||||
// return redirect()->to(base_url('Business/index'))->with('success', 'Business deleted successfully.');
|
||||
return redirect()->route('business_list');
|
||||
|
||||
@ -100,7 +100,28 @@ class Customer extends BaseController
|
||||
return redirect()->route('customer_list');
|
||||
}
|
||||
}
|
||||
public function delete_customer($id)
|
||||
{
|
||||
$CustomerModel =new CustomerModel();
|
||||
|
||||
|
||||
$existingCustomer = $CustomerModel->find($id);
|
||||
if (!$existingCustomer) {
|
||||
|
||||
return redirect()->route('customer_list');
|
||||
}
|
||||
|
||||
helper('session');
|
||||
$session_uid = get_logged_user_id();
|
||||
|
||||
$data['isactive'] = 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$CustomerModel->update($id, $data);
|
||||
print_r($data); die();
|
||||
return redirect()->route('customer_list');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -65,76 +65,84 @@ class Users extends BaseController
|
||||
public function user_synchronization()
|
||||
{
|
||||
helper('session');
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
$session_bid = get_business_id();
|
||||
|
||||
// print_r($_FILES);die();
|
||||
$validationRule = [
|
||||
'profile_picture' => [
|
||||
'userfile' => [
|
||||
'label' => 'Image File',
|
||||
'rules' => [
|
||||
'uploaded[profile_picture]',
|
||||
'is_image[profile_picture]',
|
||||
'mime_in[profile_picture,image/jpg,image/jpeg,image/gif,image/png,image/webp]',
|
||||
'max_size[profile_picture,100]',
|
||||
'max_dims[profile_picture,1024,768]',
|
||||
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
if (! $this->validate($validationRule)) {
|
||||
$data['success'] = '';
|
||||
$data['errors'] = $this->validator->getErrors();
|
||||
if (!$this->validate($validationRule) && $this->request->getPost('profile_picture') === '') {
|
||||
$data = ['errors' => $this->validator->getErrors()];
|
||||
print_r($data);
|
||||
return 'hello';
|
||||
}
|
||||
|
||||
$img = $this->request->getFile('profile_picture');
|
||||
$filePath = WRITEPATH . 'uploads/' . $this->request->getPost('profile_picture');
|
||||
$user_id = $this->request->getPost('user_id');
|
||||
$business_id = $this->request->getPost('business_id');
|
||||
$filePath ='public/uploads/' . $this->request->getPost('profile_picture');
|
||||
|
||||
## File Already Existing or not
|
||||
if (!is_file($filePath)) {
|
||||
if (! $img->hasMoved()) {
|
||||
// $filepath = WRITEPATH . 'uploads/' . $img->store();
|
||||
// $data['uploaded_fileinfo'] = new File($filepath);
|
||||
$fileName = $img->getName();
|
||||
$img->move(WRITEPATH . 'uploads', $fileName);
|
||||
$data['success'] = 'User Profile Uploaded';
|
||||
$data['errors'] = '';
|
||||
}else{
|
||||
$data['success'] = '';
|
||||
$data['errors'] = 'The file has already been moved.';
|
||||
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_file');
|
||||
if ($previousFileName && is_file('public/uploads/' . $previousFileName)) {
|
||||
link('public/uploads/' . $previousFileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$model = new UsersModel();
|
||||
$model->setTable('users');
|
||||
if ($this->request->is('post')) {
|
||||
$requestData = $this->request->getVar();
|
||||
}
|
||||
$requestData['business_id'] = $session_bid;
|
||||
if ($requestData['user_id']) {
|
||||
#edit
|
||||
$requestData['updated_by'] = $session_uid;
|
||||
$requestData['isactive'] = isset($requestData['isactive']) && $requestData['isactive'] == 'on' ? 1 : 0;
|
||||
unset($requestData['password']);
|
||||
$model->saveData($requestData, $requestData['user_id']);
|
||||
$data['success'] = 'User successfully updated.';
|
||||
$data['errors'] = '';
|
||||
$alert_message = "User successfully updated.";
|
||||
} else {
|
||||
#add
|
||||
$hash_password = password_hash($requestData['password'], PASSWORD_DEFAULT);
|
||||
$requestData['password'] = $hash_password;
|
||||
$requestData['created_by'] = $session_uid;
|
||||
$requestData['isactive'] = 1;
|
||||
$model->saveData($requestData, null);
|
||||
$data['success'] = 'User successfully created.';
|
||||
$data['errors'] = '';
|
||||
$alert_message = "User successfully created.";
|
||||
$fileName = $this->request->getPost('previous_file', ''); // 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'),
|
||||
'state' => $this->request->getPost('state'),
|
||||
'postal_code' => $this->request->getPost('postal_code'),
|
||||
'country' => $this->request->getPost('country'),
|
||||
'role' => $this->request->getPost('role'),
|
||||
'first_name' => $this->request->getPost('first_name'),
|
||||
'last_name' => $this->request->getPost('last_name'),
|
||||
'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
|
||||
];
|
||||
$user_id = $this->request->getPost('user_id'); // Get the business ID for update
|
||||
|
||||
if (empty($user_id)) {
|
||||
// It's an insert operation
|
||||
$data['isactive'] = 1;
|
||||
$data['created_by'] = $session_uid;
|
||||
//print_r($data);die;
|
||||
$UsersModel->insert($data);
|
||||
} else {
|
||||
// It's an update operation
|
||||
$isactive = $this->request->getPost('bcheckbox');
|
||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
$BooksModel->update($book_id, $data);
|
||||
}
|
||||
// $data['page_name'] = 'User Confirmation';
|
||||
// if(!empty($data['success'])){
|
||||
// $this->render_page('user_confirmation', $data);
|
||||
// }else{
|
||||
return redirect()->route('user_list');
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,7 @@ class AuthenticationModel extends Model
|
||||
{
|
||||
protected $table = 'users';
|
||||
protected $primaryKey = 'user_id';
|
||||
protected $allowedFields = ['user_id','user_name','email','first_name','last_name','password','mobile_no','date_of_birth','address','gender','profile_picture','city','state','postal_code','country','role','isactive'];
|
||||
protected $allowedFields = ['user_id','user_name','email','first_name','last_name','password','mobile_no','date_of_birth','address','gender','profile_picture','city','state','postal_code','country','role','isactive','business_id'];
|
||||
|
||||
public function getheringDetailsForHeader($user_id)
|
||||
{
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
<?php if (session()->getFlashdata('success')): ?>
|
||||
<div class="alert alert-success"><?= session()->getFlashdata('success') ?></div>
|
||||
<?php endif; ?>
|
||||
<form action="<?= base_url()."book_synchronization"; ?>" method="post">
|
||||
<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">
|
||||
@ -30,24 +30,30 @@
|
||||
<label for="publication_date" class="col-form-label">Publication Date<span class="text-danger">*</span></label>
|
||||
<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-6">
|
||||
<label for="cover_picture" class="col-form-label">Book Cover Picture<span class="text-danger">*</span></label>
|
||||
<label for="coverpicture" class="col-form-label">Book Cover Picture<span class="text-danger">*</span></label>
|
||||
<br/>
|
||||
<input type="file" id="cover_picture" name="cover_picture" placeholder="Book Cover picture Name" required value="<?= isset($details['cover_picture']) ? $details['cover_picture'] : '' ?>" />
|
||||
<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>
|
||||
</div>
|
||||
<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" value="<?= isset($details['genre']) ? $details['genre'] : '' ?>" rows="5"></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>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="description" class="col-form-label">Description<span class="text-danger">*</span></label>
|
||||
<textarea class="form-control" id="description" name="description" placeholder="Description" rows="5" required value="<?= isset($details['description']) ? $details['description'] : '' ?>"></textarea>
|
||||
<textarea class="form-control" id="description" name="description" placeholder="Description" rows="5" required><?= isset($details['description']) ? $details['description'] : '' ?></textarea>
|
||||
<!-- <input type="text" class="form-control" id="description" name="description" placeholder="Description" required value="<?= isset($details['description']) ? $details['description'] : '' ?>" /> -->
|
||||
</div>
|
||||
</div>
|
||||
@ -62,7 +68,7 @@
|
||||
</div>
|
||||
</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="<?= isset($details['business_id']) ? $details['business_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' : '' ?>>
|
||||
|
||||
@ -1,3 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<style>
|
||||
/* CSS for the preview image */
|
||||
.preview-image {
|
||||
display: block; /* Ensure the image is displayed as a block element */
|
||||
width: 120px; /* Set the desired width for passport size */
|
||||
height: 160px; /* Set the desired height for passport size */
|
||||
object-fit: cover; /* Maintain the aspect ratio and fill the container */
|
||||
margin-top: 10px; /* Add a top margin for spacing */
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
@ -46,17 +67,19 @@
|
||||
<input type="text" class="form-control" name="bzip" value="<?= isset($businesses['postal_code']) ? $businesses['postal_code'] : '' ?>" placeholder="Postal Code (Eg: Pincode)" required />
|
||||
</div>
|
||||
</div>
|
||||
<?php if (!empty($businesses['business_logo'])) { ?>
|
||||
<div class="form-group col-md-12">
|
||||
<label for="bfile" class="col-form-label">Current Business Logo</label>
|
||||
<img src="<?= base_url('public/uploads/'. $businesses['business_logo']) ?>" alt="Business Logo" class="preview-image" />
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-12">
|
||||
<label for="bfile" class="col-form-label">File</label>
|
||||
<!-- <input type="file" class="form-control" style="border: 0px !important;" id="bfile" name="bfile" value="<?= isset($businesses['cover_picture']) ? $businesses['cover_picture'] : '' ?>" multiple /> -->
|
||||
<?php if (isset($businesses['business_logo']) && $businesses['business_logo']) { ?>
|
||||
<input type="text" class="form-control" id="bfile" name="bfile" value="<?= $businesses['business_logo']; ?>" readonly />
|
||||
<?php } else { ?>
|
||||
<input type="file" class="form-control" style="border: 0px !important;" id="bfile" name="bfile" value="<?= isset($businesses['business_logo']) ? $businesses['business_logo'] : '' ?>" multiple />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<input type="file" class="form-control" style="border: 0px !important;" id="bfile" name="bfile" value="<?= isset($businesses['business_logo']) ? $businesses['business_logo'] : '' ?>" multiple />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= isset($businesses['business_id']) ? $businesses['business_id'] : '' ?>" />
|
||||
|
||||
<?php if (!empty($businesses)) { ?>
|
||||
|
||||
@ -7,100 +7,96 @@
|
||||
<form method="POST" enctype="multipart/form-data" action="<?php echo base_url(); ?>insert_customer">
|
||||
<div class="form-group">
|
||||
<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 />
|
||||
<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 />
|
||||
</div>
|
||||
<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 />
|
||||
<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 />
|
||||
</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 />
|
||||
</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 />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="cfile" class="col-form-label">File<span class="text-danger">*</span></label>
|
||||
|
||||
<input type="file" name="cfile"class="form-control"value="<?= isset($customer['profile_picture']) ? $customer['profile_picture'] : '' ?>" multiple />
|
||||
|
||||
</div>
|
||||
|
||||
<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>
|
||||
<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="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 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="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 />
|
||||
<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>
|
||||
|
||||
<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 />
|
||||
</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 >
|
||||
<option>Choose</option>
|
||||
<option> 1</option>
|
||||
<option> 2</option>
|
||||
<option> 3</option>
|
||||
<select name="cstate" class="form-control" value="<?= isset($customer['state']) ? $customer['state'] : '' ?>" required>
|
||||
<option>Choose</option>
|
||||
<option> 1</option>
|
||||
<option> 2</option>
|
||||
<option> 3</option>
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</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">
|
||||
|
||||
|
||||
<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>
|
||||
<input type="hidden" id="customer_id" name="customer_id" placeholder="hidden for business id" value="<?= isset($customer['customer_id']) ? $customer['customer_id'] : '' ?>" />
|
||||
<?php if(!empty($customer)){ ?>
|
||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||
<input type="checkbox" id="isactivce" name="isactivce" class="form-control" <?= isset($customer) && $customer['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="isactive"> Is Active</label>
|
||||
</div>
|
||||
<br>
|
||||
<input type="hidden" id="customer_id" name="customer_id" placeholder="hidden for business id" value="<?= isset($customer['customer_id']) ? $customer['customer_id'] : '' ?>" />
|
||||
<?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>
|
||||
<?php } ?>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-success waves-effect waves-light mr-1" type="submit">
|
||||
@ -111,22 +107,9 @@
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary waves-effect">Cancel</button>
|
||||
</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>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end card-body-->
|
||||
</div> <!-- end card-->
|
||||
</div> <!-- end col-->
|
||||
</div>
|
||||
@ -63,18 +63,21 @@
|
||||
<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>
|
||||
<?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 class="form-group col-md-3">
|
||||
<label for="profile_picture" class="col-form-label">Profile Picture<span class="text-danger">*</span></label>
|
||||
<?php if (isset($details['profile_picture']) && $details['profile_picture']) { ?>
|
||||
|
||||
<!-- <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'] : '' ?>" /> -->
|
||||
<br></t><a href="" data-toggle="modal" data-target="#standard-modal"><i class="fas fa-image"></i><?= isset($details['profile_picture']) ? " " . $details['profile_picture'] : '' ?></a>
|
||||
<input type="hidden" name="profile_picture" placeholder="hidden Field for profile picture" readonly value="<?= isset($details['profile_picture']) ? $details['profile_picture'] : '' ?>" />
|
||||
<?php } else { ?>
|
||||
<input type="file" class="form-control" style="border: 0px !important;" id="profile_picture" name="profile_picture" placeholder="Profile picture Name" required value="<?= isset($details['profile_picture']) ? $details['profile_picture'] : '' ?>" />
|
||||
<div class="invalid-feedback"> Please provide. </div>
|
||||
<?php } ?>
|
||||
|
||||
<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-group">
|
||||
<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'] : '' ?>" />
|
||||
|
||||
@ -22,7 +22,9 @@
|
||||
<th>Email</th>
|
||||
<th>Role</th>
|
||||
<th>Mobile Number</th>
|
||||
<th>File</th>
|
||||
<th>Address</th>
|
||||
|
||||
<th>Status</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
@ -46,6 +48,8 @@
|
||||
<td><?php echo $row['email'] ; ?></td>
|
||||
<td><?php echo $row['role'] ; ?></td>
|
||||
<td><?php echo $row['mobile_no'] ; ?></td>
|
||||
<td><?php echo $row['profile_picture'] ; ?></td>
|
||||
|
||||
<td><?php echo $row['address'].', '.$row['city'].', '.$row['state'].'- '.$row['postal_code'].'. '.$row['country'] ; ?></td>
|
||||
<td>
|
||||
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
|
||||
|
||||
BIN
public/uploads/1693203788_5939497d95031acba789.png
Normal file
|
After Width: | Height: | Size: 282 KiB |
BIN
public/uploads/1693204048_927cac1f0d5a7277dbe0.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/1693204080_cfd45864443e51f665c9.png
Normal file
|
After Width: | Height: | Size: 282 KiB |
BIN
public/uploads/1693215642_9587976d52c1854d0419.png
Normal file
|
After Width: | Height: | Size: 275 KiB |
BIN
public/uploads/2023-05-19 (1).png
Normal file
|
After Width: | Height: | Size: 486 KiB |
BIN
public/uploads/2023-05-19 (1)_1.png
Normal file
|
After Width: | Height: | Size: 486 KiB |
BIN
public/uploads/2023-05-19 (1)_2.png
Normal file
|
After Width: | Height: | Size: 486 KiB |
BIN
public/uploads/2023-05-19 (1)_3.png
Normal file
|
After Width: | Height: | Size: 486 KiB |
BIN
public/uploads/2023-05-19 (1)_4.png
Normal file
|
After Width: | Height: | Size: 486 KiB |
BIN
public/uploads/2023-06-17.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_1.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_10.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_11.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_12.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_13.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_2.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_3.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_4.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_5.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_6.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_7.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_8.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-06-17_9.png
Normal file
|
After Width: | Height: | Size: 139 KiB |
BIN
public/uploads/2023-07-01.png
Normal file
|
After Width: | Height: | Size: 368 KiB |
BIN
public/uploads/2023-07-01_1.png
Normal file
|
After Width: | Height: | Size: 368 KiB |
BIN
public/uploads/2023-07-01_2.png
Normal file
|
After Width: | Height: | Size: 368 KiB |
BIN
public/uploads/2023-07-01_3.png
Normal file
|
After Width: | Height: | Size: 368 KiB |
BIN
public/uploads/2023-07-01_4.png
Normal file
|
After Width: | Height: | Size: 368 KiB |
BIN
public/uploads/Screenshot 2023-07-19 170426.png
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
public/uploads/Screenshot 2023-07-19 170426_1.png
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
public/uploads/Screenshot 2023-07-19 170426_2.png
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
public/uploads/Screenshot 2023-07-19 170426_3.png
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
public/uploads/Screenshot 2023-07-19 170426_4.png
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
public/uploads/Screenshot 2023-07-19 170426_5.png
Normal file
|
After Width: | Height: | Size: 259 KiB |
BIN
public/uploads/Screenshot 2023-07-20 170514.png
Normal file
|
After Width: | Height: | Size: 282 KiB |
BIN
public/uploads/Screenshot 2023-07-21 100328.png
Normal file
|
After Width: | Height: | Size: 50 KiB |
BIN
public/uploads/Screenshot 2023-07-21 115438.png
Normal file
|
After Width: | Height: | Size: 883 KiB |
BIN
public/uploads/Screenshot 2023-07-21 115438_1.png
Normal file
|
After Width: | Height: | Size: 883 KiB |
BIN
public/uploads/Screenshot 2023-08-03 152103.png
Normal file
|
After Width: | Height: | Size: 285 KiB |
BIN
public/uploads/Screenshot 2023-08-18 125558.png
Normal file
|
After Width: | Height: | Size: 242 KiB |
BIN
public/uploads/Screenshot 2023-08-18 125558_1.png
Normal file
|
After Width: | Height: | Size: 242 KiB |
BIN
public/uploads/Screenshot 2023-08-28 143009.png
Normal file
|
After Width: | Height: | Size: 312 KiB |
BIN
public/uploads/Screenshot 2023-08-28 143009_1.png
Normal file
|
After Width: | Height: | Size: 312 KiB |