books
This commit is contained in:
commit
69a7ff7e4a
@ -16,8 +16,10 @@ class Customer extends BaseController
|
|||||||
$session_role = get_user_role();
|
$session_role = get_user_role();
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
if (!empty($session_role) && $session_role !== "sadmin") {
|
if (!empty($session_role) && $session_role !== "sadmin") {
|
||||||
|
$this->logger->info("Customer: Listing In admin role . BID = ".$session_bid);
|
||||||
$where = ['isactive' => 1, 'business_id' => (int)$session_bid];
|
$where = ['isactive' => 1, 'business_id' => (int)$session_bid];
|
||||||
} else {
|
} else {
|
||||||
|
$this->logger->info("Customer: Listing In Super-admin role .");
|
||||||
$where = ['isactive != ' => NULL];
|
$where = ['isactive != ' => NULL];
|
||||||
}
|
}
|
||||||
$CustomerModel = new CustomerModel();
|
$CustomerModel = new CustomerModel();
|
||||||
@ -78,9 +80,12 @@ class Customer extends BaseController
|
|||||||
## For inserting/updating details of customer
|
## For inserting/updating details of customer
|
||||||
public function insert_customer()
|
public function insert_customer()
|
||||||
{
|
{
|
||||||
|
$this->logger->info("Customer: Inserting/Updating Details");
|
||||||
|
try {
|
||||||
helper('session');
|
helper('session');
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
$session_uid = get_logged_user_id();
|
$session_uid = get_logged_user_id();
|
||||||
|
$session_role = get_user_role();
|
||||||
$model = new CustomerModel();
|
$model = new CustomerModel();
|
||||||
$data = [
|
$data = [
|
||||||
'first_name' => $this->request->getPost('cfname'),
|
'first_name' => $this->request->getPost('cfname'),
|
||||||
@ -104,33 +109,62 @@ class Customer extends BaseController
|
|||||||
// It's an insert operation
|
// It's an insert operation
|
||||||
$data['isactive'] = 1;
|
$data['isactive'] = 1;
|
||||||
$data['created_by'] = $session_uid;
|
$data['created_by'] = $session_uid;
|
||||||
//print_r($data);die;
|
if ($model->insert($data)) {
|
||||||
$model->insert($data);
|
session()->setFlashdata('success', 'Customer has been added successfully.');
|
||||||
$FK_CID = $model->insertID(); // for Customer ADDRESS Table
|
$this->logger->info("Customer : has been added successfully. Inserted ID = " . $model->insertID());
|
||||||
|
$customer_id_for_addresses = $model->insertID();// for Customer ADDRESS Table
|
||||||
|
} else {
|
||||||
|
session()->setFlashdata('error', 'Customer could not be added. Please try again..');
|
||||||
|
$this->logger->error("Customer: Err could not be added. Please try again.");
|
||||||
|
$customer_id_for_addresses = "";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// It's an update operation
|
// It's an update operation
|
||||||
|
if ($session_role !== 'manager') {
|
||||||
$isactive = $this->request->getPost('isactive');
|
$isactive = $this->request->getPost('isactive');
|
||||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||||
$data['updated_by'] = $session_uid;
|
|
||||||
// $model->update($customer_id, $data);
|
|
||||||
$FK_CID = $customer_id; // for Customer ADDRESS Table
|
|
||||||
}
|
}
|
||||||
|
$data['updated_by'] = $session_uid;
|
||||||
|
$customer_id_for_addresses = $customer_id; // for Customer ADDRESS Table
|
||||||
|
if ($model->update($customer_id, $data)) {
|
||||||
|
session()->setFlashdata('success', 'Customer has been updated successfully.');
|
||||||
|
$this->logger->info("Customer: has been updated successfully. Updated Customer ID = " . $customer_id_for_addresses);
|
||||||
|
} else {
|
||||||
|
session()->setFlashdata('error', 'Customer update failed. Please try again.');
|
||||||
|
$this->logger->error("Customer: Err Failed to update ID =" . $customer_id_for_addresses);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($customer_id_for_addresses != ""){
|
||||||
|
$this->logger->info("Customer: i got customer id for addresses = " . $customer_id_for_addresses);
|
||||||
$requestData = $this->request->getPost();
|
$requestData = $this->request->getPost();
|
||||||
$this->save_customer_addresses($FK_CID,$requestData,'b');
|
$bill_addr = $this->save_customer_addresses($customer_id_for_addresses, $requestData, 'b');
|
||||||
$this->save_customer_addresses($FK_CID,$requestData,'s');
|
$this->logger->info("Customer: bill addr final message = " .implode(" ",$bill_addr));
|
||||||
|
$ship_addr = $this->save_customer_addresses($customer_id_for_addresses, $requestData, 's');
|
||||||
|
$this->logger->info("Customer: Ship addr final message = " . implode(" ",$ship_addr));
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->logger->error("Customer : Err Occur =" . $e->getMessage());
|
||||||
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
|
}
|
||||||
return redirect()->route('customer_list');
|
return redirect()->route('customer_list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function save_customer_addresses($id,$requestData,$letteringflag){
|
## For Save the customer addresses details (Using Letting Flag and Customer ID)
|
||||||
|
public function save_customer_addresses($id, $requestData, $letteringflag)
|
||||||
|
{
|
||||||
|
try {
|
||||||
$addressType = ($letteringflag == 'b') ? 1 : 2;
|
$addressType = ($letteringflag == 'b') ? 1 : 2;
|
||||||
|
$this->logger->info("Customer: Addresses Lettering Flag = " . $letteringflag . " Customer address type = " . $addressType);
|
||||||
$getAddressdetails = $this->get_customer_address($id, $addressType);
|
$getAddressdetails = $this->get_customer_address($id, $addressType);
|
||||||
$CAid = $requestData[$letteringflag . 'customer_address_id']; // Available Address IDS in Form Fields.
|
$CAid = $requestData[$letteringflag . 'customer_address_id']; // Available Address IDS in Form Fields.
|
||||||
|
$session_uid = get_logged_user_id();
|
||||||
$model = new CustomerModel();
|
$model = new CustomerModel();
|
||||||
|
|
||||||
// Compare Address Input Field PKIDS With Existing PKIDS
|
## IF Any Missing value Means that values are Inactive here....
|
||||||
// IF Any Missing value Means that values are Inactive here....
|
|
||||||
if(!empty($CAid)){
|
if(!empty($CAid)){
|
||||||
|
$this->logger->info("Customer: Primary Addresses ID = ".implode(",",$CAid));
|
||||||
$filteringAddressIds = [];
|
$filteringAddressIds = [];
|
||||||
for ($y = 0; $y < count($getAddressdetails); $y++) {
|
for ($y = 0; $y < count($getAddressdetails); $y++) {
|
||||||
$filteringAddressIds[$y] = $getAddressdetails[$y]['customer_address_id'];
|
$filteringAddressIds[$y] = $getAddressdetails[$y]['customer_address_id'];
|
||||||
@ -142,10 +176,11 @@ class Customer extends BaseController
|
|||||||
if (!empty($missingValues)) {
|
if (!empty($missingValues)) {
|
||||||
$where = ['isactive' => 1, 'customer_id' => (int)$id, 'address_type' => $addressType];
|
$where = ['isactive' => 1, 'customer_id' => (int)$id, 'address_type' => $addressType];
|
||||||
$model->inactiveMissingAddressDetails($where, $missingValues);
|
$model->inactiveMissingAddressDetails($where, $missingValues);
|
||||||
|
$this->logger->info("Customer: Inactived Missing Addresses Count = " . count($missingValues)." That Primary Addresses ID = ".implode(",",$CAid));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$session_uid = get_logged_user_id();
|
|
||||||
|
|
||||||
$baddress1 = $requestData[$letteringflag . 'address1'];
|
$baddress1 = $requestData[$letteringflag . 'address1'];
|
||||||
$baddress2 = $requestData[$letteringflag . 'address2'];
|
$baddress2 = $requestData[$letteringflag . 'address2'];
|
||||||
@ -174,7 +209,12 @@ class Customer extends BaseController
|
|||||||
$address_array[$x]['updated_by'] = $CAid[$x] ? $session_uid : null;
|
$address_array[$x]['updated_by'] = $CAid[$x] ? $session_uid : null;
|
||||||
$address_array[$x]['customer_address_id'] = $CAid[$x];
|
$address_array[$x]['customer_address_id'] = $CAid[$x];
|
||||||
}
|
}
|
||||||
$statement = $model->saveAddressDetails($address_array);
|
$statement = !empty($address_array) ? $model->saveAddressDetails($address_array) : ["No data found For addresses"];
|
||||||
|
$this->logger->info("Customer: Address Final message = " . implode(",",$statement));
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->logger->error("Customer: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
|
||||||
|
$statement = ['Message: ' . $e->getMessage()];
|
||||||
}
|
}
|
||||||
return $statement;
|
return $statement;
|
||||||
}
|
}
|
||||||
@ -182,24 +222,43 @@ class Customer extends BaseController
|
|||||||
## For delete the customer details (Which means inactive the details)
|
## For delete the customer details (Which means inactive the details)
|
||||||
public function delete_customer($id)
|
public function delete_customer($id)
|
||||||
{
|
{
|
||||||
$CustomerModel = new CustomerModel();
|
try {
|
||||||
|
|
||||||
// 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');
|
helper('session');
|
||||||
$session_uid = get_logged_user_id();
|
$session_uid = get_logged_user_id();
|
||||||
|
$CustomerModel = new CustomerModel();
|
||||||
|
$where = ['customer_id' => (int)$id, 'isactive =' => 1];
|
||||||
|
// Check if the business ID exists
|
||||||
|
$existingCustomer = $CustomerModel->where($where)->find($id);
|
||||||
|
if ($existingCustomer) {
|
||||||
|
$this->logger->Info("Customer: Going to Inactive ID = ".$id);
|
||||||
|
$data = ['isactive' => 0 , 'updated_by' => $session_uid];
|
||||||
// Delete the business record
|
// Delete the business record
|
||||||
$data['isactive'] = 0;
|
if ($CustomerModel->update($id, $data)) {
|
||||||
$data['updated_by'] = $session_uid;
|
$billAddressdetails = $this->get_customer_address($id, 1);
|
||||||
$CustomerModel->update($id, $data);
|
if(!empty($billAddressdetails)){
|
||||||
//$BusinessModel->delete($id);
|
for ($y = 0; $y < count($billAddressdetails); $y++) {
|
||||||
|
$billAddressIds[$y] = $billAddressdetails[$y]['customer_address_id'];
|
||||||
// return redirect()->to(base_url('Business/index'))->with('success', 'Business deleted successfully.');
|
}
|
||||||
|
$CustomerModel->inactiveMissingAddressDetails($where, $billAddressIds);
|
||||||
|
}
|
||||||
|
$shipAddressdetails = $this->get_customer_address($id, 2);
|
||||||
|
if(!empty($shipAddressdetails)){
|
||||||
|
for ($z = 0; $z < count($shipAddressdetails); $z++) {
|
||||||
|
$shipAddressIds[$z] = $shipAddressdetails[$z]['customer_address_id'];
|
||||||
|
}
|
||||||
|
$CustomerModel->inactiveMissingAddressDetails($where, $shipAddressIds);
|
||||||
|
}
|
||||||
|
session()->setFlashdata('success', 'Deleted successfully.');
|
||||||
|
$this->logger->info("Customer: has been Inactived successfully. Inactived ID = " . $id);
|
||||||
|
} else {
|
||||||
|
$this->logger->error("Customer: Not able to Inactive ID =" . $id);
|
||||||
|
throw new \Exception("Data Not able to Deleted");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->logger->error("Customer: Err Occur = " . $e->getMessage());
|
||||||
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
|
}
|
||||||
return redirect()->route('customer_list');
|
return redirect()->route('customer_list');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -62,10 +62,11 @@ public function new_event($id)
|
|||||||
}
|
}
|
||||||
public function insert_event()
|
public function insert_event()
|
||||||
{
|
{
|
||||||
|
$this->logger->info("Event: Inserting/Updating Details");
|
||||||
|
try {
|
||||||
helper('session');
|
helper('session');
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
$session_uid = get_logged_user_id();
|
$session_uid = get_logged_user_id();
|
||||||
|
|
||||||
$EventModel = new EventModel();
|
$EventModel = new EventModel();
|
||||||
$data = [
|
$data = [
|
||||||
'event_name' => $this->request->getPost('ename'),
|
'event_name' => $this->request->getPost('ename'),
|
||||||
@ -73,20 +74,34 @@ public function insert_event()
|
|||||||
'left_pad' => $this->request->getPost('leftpad'),
|
'left_pad' => $this->request->getPost('leftpad'),
|
||||||
'id_formating' => $this->request->getPost('formating'),
|
'id_formating' => $this->request->getPost('formating'),
|
||||||
'business_id' => $this->request->getPost('business_id')
|
'business_id' => $this->request->getPost('business_id')
|
||||||
|
|
||||||
];
|
];
|
||||||
$event_id = $this->request->getPost('id'); // Get the business ID for update
|
$event_id = $this->request->getPost('id'); // Get the business ID for update
|
||||||
|
|
||||||
if (empty($event_id)) {
|
if (empty($event_id)) {
|
||||||
// It's an insert operation
|
// It's an insert operation
|
||||||
$data['created_by'] = $session_uid;
|
$data['created_by'] = $session_uid;
|
||||||
$EventModel->insert($data);
|
// $EventModel->insert($data);
|
||||||
|
if ($EventModel->insert($data)) {
|
||||||
|
session()->setFlashdata('success', 'Event has been added successfully.');
|
||||||
|
$this->logger->info("Event : has been added successfully. Inserted ID = " . $EventModel->insertID());
|
||||||
|
} else {
|
||||||
|
session()->setFlashdata('error', 'Event could not be added. Please try again..');
|
||||||
|
$this->logger->error("Event: Err data could not be added. Please try again.");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// It's an update operation
|
// It's an update operation
|
||||||
|
|
||||||
$data['updated_by'] = $session_uid;
|
$data['updated_by'] = $session_uid;
|
||||||
|
if ($EventModel->update($event_id, $data)) {
|
||||||
$EventModel->update($event_id, $data);
|
session()->setFlashdata('success', 'Event has been updated successfully.');
|
||||||
|
$this->logger->info("Event: has been updated successfully. Updated Event ID = " . $event_id);
|
||||||
|
} else {
|
||||||
|
session()->setFlashdata('error', 'Event update failed. Please try again.');
|
||||||
|
$this->logger->error("Event: Err Failed to update ID =" . $event_id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->logger->error("Event: Err Occur = " . $e->getMessage() . " Line = " . $e->getLine() . " File = " . $e->getFile());
|
||||||
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
return redirect()->route('event_list');
|
return redirect()->route('event_list');
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,27 +38,55 @@ class Users extends BaseController
|
|||||||
helper('session');
|
helper('session');
|
||||||
$session_role = get_user_role();
|
$session_role = get_user_role();
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
|
$session_uid = get_logged_user_id();
|
||||||
if ($id === '0') {
|
if ($id === '0') {
|
||||||
$this->logger->info("Users: In Add page");
|
$this->logger->info("Users: In Add page");
|
||||||
$data['page_name'] = 'Add User';
|
$data['page_name'] = 'Add User';
|
||||||
|
$business_details = $this->business_details();
|
||||||
|
$render_page_name = 'user_form';
|
||||||
$data['details'] = [];
|
$data['details'] = [];
|
||||||
} else if ($id !== '0') {
|
} else if ($id !== '0') {
|
||||||
$this->logger->info("Users: In Edit page");
|
$this->logger->info("Users: In Edit page");
|
||||||
$data['page_name'] = 'Edit User';
|
|
||||||
$model = new UsersModel();
|
$model = new UsersModel();
|
||||||
$model->setTable('users');
|
$model->setTable('users');
|
||||||
if (!empty($session_role) && $session_role === "sadmin") {
|
if (!empty($session_role)){
|
||||||
|
switch ($session_role) {
|
||||||
|
case "sadmin":
|
||||||
$where = ['users.user_id' => $id, 'users.isactive !=' => NULL];
|
$where = ['users.user_id' => $id, 'users.isactive !=' => NULL];
|
||||||
} else {
|
|
||||||
$where = ['users.user_id' => $id, 'users.isactive =' => 1];
|
|
||||||
}
|
|
||||||
$edit_user_details = $model->where($where)->first();
|
$edit_user_details = $model->where($where)->first();
|
||||||
|
$business_details = $this->business_details();
|
||||||
|
$render_page_name = 'user_form';
|
||||||
|
$data['page_name'] = 'Edit User';
|
||||||
|
break;
|
||||||
|
case "admin":
|
||||||
|
$where = ['users.user_id' => $id, 'users.isactive =' => 1];
|
||||||
|
$edit_user_details = $model->where($where)->first();
|
||||||
|
$business_details = [];
|
||||||
|
$render_page_name = 'user_form';
|
||||||
|
$data['page_name'] = 'Edit User';
|
||||||
|
break;
|
||||||
|
case "manager":
|
||||||
|
$where = ['users.user_id' => $id, 'users.isactive =' => 1];
|
||||||
|
$edit_user_details = $model->where($where)->first();
|
||||||
|
$business_details = [];
|
||||||
|
if($session_uid === $id && $session_role === "manager"){
|
||||||
|
$data['page_name'] = 'Edit User';
|
||||||
|
$render_page_name = 'user_form';
|
||||||
|
}else{
|
||||||
|
$data['page_name'] = 'Page Not Found';
|
||||||
|
$render_page_name = 'pages_404';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$data['page_name'] = 'Page Not Found';
|
||||||
|
$render_page_name = 'pages_404';
|
||||||
|
}
|
||||||
|
}
|
||||||
$data['details'] = $edit_user_details;
|
$data['details'] = $edit_user_details;
|
||||||
}
|
}
|
||||||
$business_details = !empty($session_role) && $session_role === "sadmin" ? $this->business_details() : [];
|
|
||||||
$data['business_details'] = $business_details;
|
$data['business_details'] = $business_details;
|
||||||
$data['session_bid'] = $session_bid;
|
$data['session_bid'] = $session_bid;
|
||||||
$this->render_page('user_form', $data);
|
$this->render_page($render_page_name, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
## For SuperAdmin Role business Dropdown displayed on Userpage.otherwise Hidden fields
|
## For SuperAdmin Role business Dropdown displayed on Userpage.otherwise Hidden fields
|
||||||
@ -146,7 +174,6 @@ class Users extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'user_name' => $this->request->getPost('user_name'),
|
|
||||||
'profile_picture' => $final_img_name,
|
'profile_picture' => $final_img_name,
|
||||||
'city' => $this->request->getPost('city'),
|
'city' => $this->request->getPost('city'),
|
||||||
'state' => $this->request->getPost('state'),
|
'state' => $this->request->getPost('state'),
|
||||||
@ -185,12 +212,11 @@ class Users extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
// It's an update operation
|
// It's an update operation
|
||||||
$isactive = $this->request->getPost('isactive');
|
$isactive = $this->request->getPost('isactive');
|
||||||
|
$data['updated_by'] = $session_uid;
|
||||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||||
if($session_uid == $user_id && $data['isactive'] == 0){
|
if($session_uid == $user_id && $data['isactive'] == 0){
|
||||||
throw new \Exception("Cant able to Update Because logged-In persons can't remove. Please Contact your Admin!....");
|
throw new \Exception("Cant able to Update Because logged-In persons can't remove. Please Contact your Admin!....");
|
||||||
}
|
}
|
||||||
$data['updated_by'] = $session_uid;
|
|
||||||
// $UsersModel->update($user_id, $data);
|
|
||||||
if ($UsersModel->update($user_id, $data)) {
|
if ($UsersModel->update($user_id, $data)) {
|
||||||
session()->setFlashdata('success', 'User has been updated successfully.');
|
session()->setFlashdata('success', 'User has been updated successfully.');
|
||||||
$this->logger->info("Users: has been updated successfully. Updated ID = ".$user_id);
|
$this->logger->info("Users: has been updated successfully. Updated ID = ".$user_id);
|
||||||
|
|||||||
@ -9,7 +9,11 @@ class CustomerModel extends Model
|
|||||||
{
|
{
|
||||||
protected $table = 'customers';
|
protected $table = 'customers';
|
||||||
protected $primaryKey = 'customer_id ';
|
protected $primaryKey = 'customer_id ';
|
||||||
|
<<<<<<< HEAD
|
||||||
protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','isactive','business_id'];
|
protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','isactive','business_id'];
|
||||||
|
=======
|
||||||
|
protected $allowedFields = ['customer_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','type','isactive','business_id','created_by','updated_by'];
|
||||||
|
>>>>>>> caaaaa0ffd2a11af5f49570cb1fadb521e89b52f
|
||||||
|
|
||||||
public function insertCustomer($data)
|
public function insertCustomer($data)
|
||||||
{
|
{
|
||||||
@ -73,15 +77,14 @@ class CustomerModel extends Model
|
|||||||
unset($row['created_by']); // bcoz here data Updating here.
|
unset($row['created_by']); // bcoz here data Updating here.
|
||||||
$this->db->table('customer_addresses')->where('customer_address_id', $id)->update($row);// Update the row with the specified id
|
$this->db->table('customer_addresses')->where('customer_address_id', $id)->update($row);// Update the row with the specified id
|
||||||
$affectedRows = $this->db->affectedRows();
|
$affectedRows = $this->db->affectedRows();
|
||||||
$statement[$i] = "address - ".$id." ".$affectedRows ? " Updated":" Not Updated";
|
$statement[$i] = "address - ".$id." ". ($affectedRows ? " Updated":" Nothing to Updated");
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$this->db->table('customer_addresses')->insert($row);
|
$this->db->table('customer_addresses')->insert($row);
|
||||||
$insertID = $this->db->insertID();
|
$insertID = $this->db->insertID();
|
||||||
$statement[$i] = "address - ".$insertID." Inserted";
|
$statement[$i] = "address - ".$insertID." Inserted";
|
||||||
}
|
}
|
||||||
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $statement;
|
return $statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@ class UsersModel extends Model
|
|||||||
{
|
{
|
||||||
protected $table = 'users';
|
protected $table = 'users';
|
||||||
protected $primaryKey = 'user_id';
|
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','business_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','business_id','created_by','updated_by'];
|
||||||
|
|
||||||
public function saveData($data, $id = null)
|
public function saveData($data, $id = null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<body>
|
|
||||||
<h1>Dummy API Integration</h1>
|
|
||||||
|
|
||||||
<h3>GET - List Of Books</h3>
|
|
||||||
<?php
|
|
||||||
echo $books;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h3>GET - Single Book</h3>
|
|
||||||
<?php
|
|
||||||
echo $book;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h3>POST - Create New Book</h3>
|
|
||||||
<?php
|
|
||||||
echo $new_book;
|
|
||||||
?>
|
|
||||||
|
|
||||||
<h3>PUT - Update Book</h3>
|
|
||||||
<?php
|
|
||||||
echo $update_book;
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -7,6 +7,24 @@
|
|||||||
</div><!-- end col-->
|
</div><!-- end col-->
|
||||||
<br>
|
<br>
|
||||||
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
||||||
|
<?php if (session()->getFlashdata('success') || session()->getFlashdata('error')) : ?>
|
||||||
|
<?php if (session()->getFlashdata('success')) : ?>
|
||||||
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||||
|
<?= session('success') ?>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if (session()->getFlashdata('error')) : ?>
|
||||||
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||||
|
<?= session('error') ?>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table id="scroll-horizontal-datatable_customer" class="table w-100 nowrap">
|
<table id="scroll-horizontal-datatable_customer" class="table w-100 nowrap">
|
||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xl-3 col-md-6">
|
<div class="col-xl-3 col-md-6">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@ -88,4 +89,5 @@
|
|||||||
</div><!-- end col -->
|
</div><!-- end col -->
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
@ -7,6 +7,24 @@
|
|||||||
</div><!-- end col-->
|
</div><!-- end col-->
|
||||||
<br>
|
<br>
|
||||||
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
|
||||||
|
<?php if (session()->getFlashdata('success') || session()->getFlashdata('error')) : ?>
|
||||||
|
<?php if (session()->getFlashdata('success')) : ?>
|
||||||
|
<div class="alert alert-success alert-dismissible fade show" role="alert">
|
||||||
|
<?= session('success') ?>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if (session()->getFlashdata('error')) : ?>
|
||||||
|
<div class="alert alert-danger alert-dismissible fade show" role="alert">
|
||||||
|
<?= session('error') ?>
|
||||||
|
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php endif; ?>
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
26
app/Views/pages_404.php
Normal file
26
app/Views/pages_404.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-lg-6 col-xl-4">
|
||||||
|
<div class="error-text-box mt-0">
|
||||||
|
<svg viewBox="0 0 600 200">
|
||||||
|
<!-- Symbol-->
|
||||||
|
<symbol id="s-text">
|
||||||
|
<text text-anchor="middle" x="50%" y="50%" dy=".35em">404!</text>
|
||||||
|
</symbol>
|
||||||
|
<!-- Duplicate symbols-->
|
||||||
|
<use class="text" xlink:href="#s-text"></use>
|
||||||
|
<use class="text" xlink:href="#s-text"></use>
|
||||||
|
<use class="text" xlink:href="#s-text"></use>
|
||||||
|
<use class="text" xlink:href="#s-text"></use>
|
||||||
|
<use class="text" xlink:href="#s-text"></use>
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="text-center">
|
||||||
|
<h3 class="mt-0 mb-2">Whoops! Page not found </h3>
|
||||||
|
<!-- <p class="text-muted mb-3">It's looking like you may have taken a wrong turn. Don't worry...
|
||||||
|
it happens to the best of us. You might want to check your internet connection.
|
||||||
|
Here's a little tip that might help you get back on track.</p>
|
||||||
|
|
||||||
|
<a href="<?= base_url()."dashboard"; ?>" class="btn btn-success waves-effect waves-light">Back to Dashboard</a> -->
|
||||||
|
</div>
|
||||||
|
</div> <!-- end col -->
|
||||||
|
</div><!-- end row -->
|
||||||
@ -134,35 +134,39 @@
|
|||||||
<span>Membership </span>
|
<span>Membership </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."scheme_list"; ?>">
|
<a href="<?= base_url()."scheme_list"; ?>">
|
||||||
<i class="ri-currency-line"></i>
|
<i class="ri-currency-line"></i>
|
||||||
<span> Scheme </span>
|
<span> Scheme </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."book_list"; ?>">
|
<a href="<?= base_url()."book_list"; ?>">
|
||||||
<i class="ri-book-open-line"></i>
|
<i class="ri-book-open-line"></i>
|
||||||
<span> Products </span>
|
<span> Products </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."user_list"; ?>">
|
<a href="<?= base_url()."user_list"; ?>">
|
||||||
<i class="ri-user-line"></i>
|
<i class="ri-user-line"></i>
|
||||||
<span> Users </span>
|
<span> Users </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
<?php if($loggedin_person_role === 'sadmin'){ ?>
|
<?php if ($loggedin_person_role === 'sadmin') : ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."sitesetting_list"; ?>">
|
<a href="<?= base_url()."sitesetting_list"; ?>">
|
||||||
<i class="ri-list-settings-line"></i>
|
<i class="ri-list-settings-line"></i>
|
||||||
<span> Site Setting </span>
|
<span> Site Setting </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php endif; ?>
|
||||||
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."event_list"; ?>">
|
<a href="<?= base_url()."event_list"; ?>">
|
||||||
|
|
||||||
@ -170,20 +174,16 @@
|
|||||||
<span> Campaign </span>
|
<span> Campaign </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."mail_custom_notifications"; ?>">
|
<a href="<?= base_url()."mail_custom_notifications"; ?>">
|
||||||
<i class="ri-notification-3-fill"></i>
|
<i class="ri-notification-3-fill"></i>
|
||||||
<span> Custom Notifications </span>
|
<span> Custom Notifications </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -237,11 +237,11 @@
|
|||||||
<i class="ri-account-circle-line"></i>
|
<i class="ri-account-circle-line"></i>
|
||||||
<span>My Account</span>
|
<span>My Account</span>
|
||||||
</a>
|
</a>
|
||||||
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
<a href="<?= base_url()."new_bussiness/".$bid; ?>"class="dropdown-item notify-item">
|
<a href="<?= base_url()."new_bussiness/".$bid; ?>"class="dropdown-item notify-item">
|
||||||
|
<i class="ri-briefcase-4-fill"></i><span> Business Setting </span>
|
||||||
<i class="ri-briefcase-4-fill"></i>
|
|
||||||
<span> Business Setting </span>
|
|
||||||
</a>
|
</a>
|
||||||
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -120,7 +120,8 @@
|
|||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" id="user_id" name="user_id" placeholder="hidden for user id" value="<?= isset($details['user_id']) ? $details['user_id'] : '' ?>" />
|
<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)) { ?>
|
|
||||||
|
<?php if (!empty($details) && $loggedin_person_role !== 'manager') { ?>
|
||||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
<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' : '' ?>>
|
<input type="checkbox" id="isactive" name="isactive" class="form-control" <?= isset($details) && $details['isactive'] == 1 ? 'checked' : '' ?>>
|
||||||
<label for="isactive"> Is Active</label>
|
<label for="isactive"> Is Active</label>
|
||||||
@ -134,8 +135,9 @@
|
|||||||
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
<button type="reset" class="btn btn-primary waves-effect mr-1">
|
||||||
Reset
|
Reset
|
||||||
</button>
|
</button>
|
||||||
<a href="<?= base_url() . "user_list"; ?>" class="btn btn-secondary waves-effect">Cancel
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
</a>
|
<a href="<?= base_url() . "user_list"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
||||||
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -64,7 +64,7 @@
|
|||||||
<td><?php echo $row['mobile_no'] ; ?></td>
|
<td><?php echo $row['mobile_no'] ; ?></td>
|
||||||
<td><?php echo $row['profile_picture'] ; ?></td>
|
<td><?php echo $row['profile_picture'] ; ?></td>
|
||||||
|
|
||||||
<td><?php echo $row['address'].', '.$row['city'].', '.$row['state'].'- '.$row['postal_code'].'. '.$row['country'] ; ?></td>
|
<td><?php echo $row['address'] ? $row['address'].', '.$row['city'].', '.$row['state'].'- '.$row['postal_code'].'. '.$row['country'] : "" ; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
|
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user