books
This commit is contained in:
commit
69a7ff7e4a
@ -16,8 +16,10 @@ class Customer extends BaseController
|
||||
$session_role = get_user_role();
|
||||
$session_bid = get_business_id();
|
||||
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];
|
||||
} else {
|
||||
$this->logger->info("Customer: Listing In Super-admin role .");
|
||||
$where = ['isactive != ' => NULL];
|
||||
}
|
||||
$CustomerModel = new CustomerModel();
|
||||
@ -73,90 +75,123 @@ class Customer extends BaseController
|
||||
$data['session_bid'] = $session_bid;
|
||||
$this->render_page('customer_form', $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
## For inserting/updating details of customer
|
||||
public function insert_customer()
|
||||
{
|
||||
helper('session');
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
$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'),
|
||||
'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')
|
||||
];
|
||||
$this->logger->info("Customer: Inserting/Updating Details");
|
||||
try {
|
||||
helper('session');
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
$session_role = get_user_role();
|
||||
$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'),
|
||||
'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')
|
||||
];
|
||||
|
||||
$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;
|
||||
//print_r($data);die;
|
||||
$model->insert($data);
|
||||
$FK_CID = $model->insertID(); // for Customer ADDRESS Table
|
||||
} else {
|
||||
// It's an update operation
|
||||
$isactive = $this->request->getPost('isactive');
|
||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||
$data['updated_by'] = $session_uid;
|
||||
// $model->update($customer_id, $data);
|
||||
$FK_CID = $customer_id; // for Customer ADDRESS Table
|
||||
$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;
|
||||
if ($model->insert($data)) {
|
||||
session()->setFlashdata('success', 'Customer has been added successfully.');
|
||||
$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 {
|
||||
// It's an update operation
|
||||
if ($session_role !== 'manager') {
|
||||
$isactive = $this->request->getPost('isactive');
|
||||
$data['isactive'] = ($isactive == 'on') ? 1 : 0;
|
||||
}
|
||||
$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();
|
||||
$bill_addr = $this->save_customer_addresses($customer_id_for_addresses, $requestData, 'b');
|
||||
$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());
|
||||
}
|
||||
$requestData = $this->request->getPost();
|
||||
$this->save_customer_addresses($FK_CID,$requestData,'b');
|
||||
$this->save_customer_addresses($FK_CID,$requestData,'s');
|
||||
return redirect()->route('customer_list');
|
||||
}
|
||||
|
||||
public function save_customer_addresses($id,$requestData,$letteringflag){
|
||||
|
||||
$addressType = ($letteringflag == 'b') ? 1 : 2;
|
||||
$getAddressdetails = $this->get_customer_address($id,$addressType);
|
||||
$CAid = $requestData[$letteringflag.'customer_address_id']; // Available Address IDS in Form Fields.
|
||||
$model = new CustomerModel();
|
||||
## 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;
|
||||
$this->logger->info("Customer: Addresses Lettering Flag = " . $letteringflag . " Customer address type = " . $addressType);
|
||||
$getAddressdetails = $this->get_customer_address($id, $addressType);
|
||||
$CAid = $requestData[$letteringflag . 'customer_address_id']; // Available Address IDS in Form Fields.
|
||||
$session_uid = get_logged_user_id();
|
||||
$model = new CustomerModel();
|
||||
|
||||
// Compare Address Input Field PKIDS With Existing PKIDS
|
||||
// IF Any Missing value Means that values are Inactive here....
|
||||
if(!empty($CAid)){
|
||||
## IF Any Missing value Means that values are Inactive here....
|
||||
if(!empty($CAid)){
|
||||
$this->logger->info("Customer: Primary Addresses ID = ".implode(",",$CAid));
|
||||
$filteringAddressIds = [];
|
||||
for ($y = 0; $y < count($getAddressdetails); $y++) {
|
||||
for ($y = 0; $y < count($getAddressdetails); $y++) {
|
||||
$filteringAddressIds[$y] = $getAddressdetails[$y]['customer_address_id'];
|
||||
}
|
||||
if(!empty($filteringAddressIds)){
|
||||
if (!empty($filteringAddressIds)) {
|
||||
$A = $filteringAddressIds;
|
||||
$B = $CAid;
|
||||
$missingValues = array_diff($A,$B);
|
||||
if(!empty($missingValues)){
|
||||
$where = ['isactive'=>1,'customer_id'=>(int)$id,'address_type'=>$addressType];
|
||||
$model->inactiveMissingAddressDetails($where,$missingValues);
|
||||
$missingValues = array_diff($A, $B);
|
||||
if (!empty($missingValues)) {
|
||||
$where = ['isactive' => 1, 'customer_id' => (int)$id, 'address_type' => $addressType];
|
||||
$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'];
|
||||
$baddress2 = $requestData[$letteringflag.'address2'];
|
||||
$bcountry = $requestData[$letteringflag.'country'];
|
||||
$bcity = $requestData[$letteringflag.'city'];
|
||||
$bstate = $requestData[$letteringflag.'state'];
|
||||
$bzip = $requestData[$letteringflag.'zip'];
|
||||
}
|
||||
|
||||
|
||||
$baddress1 = $requestData[$letteringflag . 'address1'];
|
||||
$baddress2 = $requestData[$letteringflag . 'address2'];
|
||||
$bcountry = $requestData[$letteringflag . 'country'];
|
||||
$bcity = $requestData[$letteringflag . 'city'];
|
||||
$bstate = $requestData[$letteringflag . 'state'];
|
||||
$bzip = $requestData[$letteringflag . 'zip'];
|
||||
$count = count($CAid);
|
||||
$address_array = [];
|
||||
if($count > 0){
|
||||
for ($x = 0; $x < $count; $x++) {
|
||||
if ($count > 0) {
|
||||
for ($x = 0; $x < $count; $x++) {
|
||||
$address_array[$x]['first_name'] = $requestData['cfname'];
|
||||
$address_array[$x]['last_name'] = $requestData['csname'];
|
||||
// $address_array[$x]['company'] = "";
|
||||
@ -170,36 +205,60 @@ class Customer extends BaseController
|
||||
$address_array[$x]['postal_code'] = $bzip[$x];
|
||||
$address_array[$x]['customer_id'] = $id;
|
||||
$address_array[$x]['address_type'] = $addressType;
|
||||
$address_array[$x]['created_by'] = $session_uid;
|
||||
$address_array[$x]['updated_by'] = $CAid[$x] ? $session_uid : null;
|
||||
$address_array[$x]['customer_address_id'] = $CAid[$x];
|
||||
}
|
||||
$statement = $model->saveAddressDetails($address_array);
|
||||
$address_array[$x]['created_by'] = $session_uid;
|
||||
$address_array[$x]['updated_by'] = $CAid[$x] ? $session_uid : null;
|
||||
$address_array[$x]['customer_address_id'] = $CAid[$x];
|
||||
}
|
||||
$statement = !empty($address_array) ? $model->saveAddressDetails($address_array) : ["No data found For addresses"];
|
||||
$this->logger->info("Customer: Address Final message = " . implode(",",$statement));
|
||||
}
|
||||
return $statement;
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->error("Customer: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
|
||||
$statement = ['Message: ' . $e->getMessage()];
|
||||
}
|
||||
return $statement;
|
||||
}
|
||||
|
||||
## For delete the customer details (Which means inactive the details)
|
||||
public function delete_customer($id)
|
||||
{
|
||||
$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');
|
||||
try {
|
||||
helper('session');
|
||||
$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
|
||||
if ($CustomerModel->update($id, $data)) {
|
||||
$billAddressdetails = $this->get_customer_address($id, 1);
|
||||
if(!empty($billAddressdetails)){
|
||||
for ($y = 0; $y < count($billAddressdetails); $y++) {
|
||||
$billAddressIds[$y] = $billAddressdetails[$y]['customer_address_id'];
|
||||
}
|
||||
$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());
|
||||
}
|
||||
|
||||
helper('session');
|
||||
$session_uid = get_logged_user_id();
|
||||
// Delete the business record
|
||||
$data['isactive'] = 0;
|
||||
$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');
|
||||
}
|
||||
|
||||
|
||||
@ -60,35 +60,50 @@ public function new_event($id)
|
||||
|
||||
$this->render_page('event_form', $data);
|
||||
}
|
||||
public function insert_event()
|
||||
{
|
||||
helper('session');
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
public function insert_event()
|
||||
{
|
||||
$this->logger->info("Event: Inserting/Updating Details");
|
||||
try {
|
||||
helper('session');
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
$EventModel = new EventModel();
|
||||
$data = [
|
||||
'event_name' => $this->request->getPost('ename'),
|
||||
'next_id' => $this->request->getPost('nextid'),
|
||||
'left_pad' => $this->request->getPost('leftpad'),
|
||||
'id_formating' => $this->request->getPost('formating'),
|
||||
'business_id' => $this->request->getPost('business_id')
|
||||
];
|
||||
$event_id = $this->request->getPost('id'); // Get the business ID for update
|
||||
|
||||
$EventModel = new EventModel();
|
||||
$data = [
|
||||
'event_name' => $this->request->getPost('ename'),
|
||||
'next_id' => $this->request->getPost('nextid'),
|
||||
'left_pad' => $this->request->getPost('leftpad'),
|
||||
'id_formating' => $this->request->getPost('formating'),
|
||||
'business_id' => $this->request->getPost('business_id')
|
||||
|
||||
];
|
||||
$event_id = $this->request->getPost('id'); // Get the business ID for update
|
||||
|
||||
if (empty($event_id)) {
|
||||
// It's an insert operation
|
||||
$data['created_by'] = $session_uid;
|
||||
$EventModel->insert($data);
|
||||
} else {
|
||||
// It's an update operation
|
||||
|
||||
$data['updated_by'] = $session_uid;
|
||||
|
||||
$EventModel->update($event_id, $data);
|
||||
if (empty($event_id)) {
|
||||
// It's an insert operation
|
||||
$data['created_by'] = $session_uid;
|
||||
// $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 {
|
||||
// It's an update operation
|
||||
$data['updated_by'] = $session_uid;
|
||||
if ($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');
|
||||
$session_role = get_user_role();
|
||||
$session_bid = get_business_id();
|
||||
$session_uid = get_logged_user_id();
|
||||
if ($id === '0') {
|
||||
$this->logger->info("Users: In Add page");
|
||||
$data['page_name'] = 'Add User';
|
||||
$business_details = $this->business_details();
|
||||
$render_page_name = 'user_form';
|
||||
$data['details'] = [];
|
||||
} else if ($id !== '0') {
|
||||
$this->logger->info("Users: In Edit page");
|
||||
$data['page_name'] = 'Edit User';
|
||||
$model = new UsersModel();
|
||||
$model->setTable('users');
|
||||
if (!empty($session_role) && $session_role === "sadmin") {
|
||||
$where = ['users.user_id' => $id, 'users.isactive !=' => NULL];
|
||||
} else {
|
||||
$where = ['users.user_id' => $id, 'users.isactive =' => 1];
|
||||
if (!empty($session_role)){
|
||||
switch ($session_role) {
|
||||
case "sadmin":
|
||||
$where = ['users.user_id' => $id, 'users.isactive !=' => NULL];
|
||||
$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';
|
||||
}
|
||||
}
|
||||
$edit_user_details = $model->where($where)->first();
|
||||
$data['details'] = $edit_user_details;
|
||||
}
|
||||
$business_details = !empty($session_role) && $session_role === "sadmin" ? $this->business_details() : [];
|
||||
$data['business_details'] = $business_details;
|
||||
$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
|
||||
@ -146,7 +174,6 @@ class Users extends BaseController
|
||||
}
|
||||
|
||||
$data = [
|
||||
'user_name' => $this->request->getPost('user_name'),
|
||||
'profile_picture' => $final_img_name,
|
||||
'city' => $this->request->getPost('city'),
|
||||
'state' => $this->request->getPost('state'),
|
||||
@ -185,12 +212,11 @@ class Users extends BaseController
|
||||
} else {
|
||||
// It's an update operation
|
||||
$isactive = $this->request->getPost('isactive');
|
||||
$data['updated_by'] = $session_uid;
|
||||
$data['isactive'] = ($isactive == 'on') ? 1 : 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!....");
|
||||
}
|
||||
$data['updated_by'] = $session_uid;
|
||||
// $UsersModel->update($user_id, $data);
|
||||
if ($UsersModel->update($user_id, $data)) {
|
||||
session()->setFlashdata('success', 'User has been updated successfully.');
|
||||
$this->logger->info("Users: has been updated successfully. Updated ID = ".$user_id);
|
||||
|
||||
@ -9,7 +9,11 @@ class CustomerModel extends Model
|
||||
{
|
||||
protected $table = 'customers';
|
||||
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','type','isactive','business_id','created_by','updated_by'];
|
||||
>>>>>>> caaaaa0ffd2a11af5f49570cb1fadb521e89b52f
|
||||
|
||||
public function insertCustomer($data)
|
||||
{
|
||||
@ -73,15 +77,14 @@ class CustomerModel extends Model
|
||||
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
|
||||
$affectedRows = $this->db->affectedRows();
|
||||
$statement[$i] = "address - ".$id." ".$affectedRows ? " Updated":" Not Updated";
|
||||
$statement[$i] = "address - ".$id." ". ($affectedRows ? " Updated":" Nothing to Updated");
|
||||
}else{
|
||||
|
||||
$this->db->table('customer_addresses')->insert($row);
|
||||
$insertID = $this->db->insertID();
|
||||
$statement[$i] = "address - ".$insertID." Inserted";
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
return $statement;
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@ class UsersModel 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','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)
|
||||
{
|
||||
|
||||
@ -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-->
|
||||
<br>
|
||||
<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">
|
||||
<table id="scroll-horizontal-datatable_customer" class="table w-100 nowrap">
|
||||
<thead class="thead-light">
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||
<div class="row">
|
||||
<div class="col-xl-3 col-md-6">
|
||||
<div class="card">
|
||||
@ -88,4 +89,5 @@
|
||||
</div><!-- end col -->
|
||||
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!-- end row -->
|
||||
@ -7,6 +7,24 @@
|
||||
</div><!-- end col-->
|
||||
<br>
|
||||
<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">
|
||||
|
||||
|
||||
|
||||
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>
|
||||
</a>
|
||||
</li>
|
||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."scheme_list"; ?>">
|
||||
<i class="ri-currency-line"></i>
|
||||
<span> Scheme </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."book_list"; ?>">
|
||||
<i class="ri-book-open-line"></i>
|
||||
<span> Products </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."user_list"; ?>">
|
||||
<i class="ri-user-line"></i>
|
||||
<span> Users </span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<?php if($loggedin_person_role === 'sadmin'){ ?>
|
||||
<?php endif; ?>
|
||||
<?php if ($loggedin_person_role === 'sadmin') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."sitesetting_list"; ?>">
|
||||
<i class="ri-list-settings-line"></i>
|
||||
<span> Site Setting </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."event_list"; ?>">
|
||||
|
||||
@ -170,20 +174,16 @@
|
||||
<span> Campaign </span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php endif; ?>
|
||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||
<li>
|
||||
<a href="<?= base_url()."mail_custom_notifications"; ?>">
|
||||
<i class="ri-notification-3-fill"></i>
|
||||
<span> Custom Notifications </span>
|
||||
</a>
|
||||
</li>
|
||||
<?php endif; ?>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
@ -237,11 +237,11 @@
|
||||
<i class="ri-account-circle-line"></i>
|
||||
<span>My Account</span>
|
||||
</a>
|
||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||
<a href="<?= base_url()."new_bussiness/".$bid; ?>"class="dropdown-item notify-item">
|
||||
|
||||
<i class="ri-briefcase-4-fill"></i>
|
||||
<span> Business Setting </span>
|
||||
</a>
|
||||
<i class="ri-briefcase-4-fill"></i><span> Business Setting </span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
||||
|
||||
@ -120,7 +120,8 @@
|
||||
<?php } ?>
|
||||
</div>
|
||||
<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">
|
||||
<input type="checkbox" id="isactive" name="isactive" class="form-control" <?= isset($details) && $details['isactive'] == 1 ? 'checked' : '' ?>>
|
||||
<label for="isactive"> Is Active</label>
|
||||
@ -134,8 +135,9 @@
|
||||
<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>
|
||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||
<a href="<?= base_url() . "user_list"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@ -64,7 +64,7 @@
|
||||
<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><?php echo $row['address'] ? $row['address'].', '.$row['city'].', '.$row['state'].'- '.$row['postal_code'].'. '.$row['country'] : "" ; ?></td>
|
||||
<td>
|
||||
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
|
||||
</td>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user