UI_CHANGES : RV
This commit is contained in:
parent
c41e6e378f
commit
cf4fe7383e
17
.env
17
.env
@ -15,13 +15,13 @@
|
|||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
# CI_ENVIRONMENT = production
|
# CI_ENVIRONMENT = production
|
||||||
#CI_ENVIRONMENT = development
|
CI_ENVIRONMENT = development
|
||||||
#LOCAL_FOLDER = 'donation'
|
#LOCAL_FOLDER = 'donation'
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# APP
|
# APP
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|
||||||
# app.baseURL = 'http://localhost/donation/'
|
app.baseURL = 'http://localhost/donation/'
|
||||||
# app.baseURL ='https://venbainfotech.com/donr/'
|
# app.baseURL ='https://venbainfotech.com/donr/'
|
||||||
# app.forceGlobalSecureRequests = false
|
# app.forceGlobalSecureRequests = false
|
||||||
|
|
||||||
@ -63,6 +63,19 @@
|
|||||||
# database.tests.password = root
|
# database.tests.password = root
|
||||||
# database.tests.DBDriver = MySQLi
|
# database.tests.DBDriver = MySQLi
|
||||||
|
|
||||||
|
|
||||||
|
database.default.hostname = localhost
|
||||||
|
database.default.database = doner_management
|
||||||
|
database.default.username = root
|
||||||
|
database.default.password = ''
|
||||||
|
database.default.DBDriver = MySQLi
|
||||||
|
|
||||||
|
database.tests.hostname = localhost
|
||||||
|
database.tests.database = doner_management
|
||||||
|
database.tests.username = root
|
||||||
|
database.tests.password = ''
|
||||||
|
database.tests.DBDriver = MySQLi
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# CONTENT SECURITY POLICY
|
# CONTENT SECURITY POLICY
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@ -48,3 +48,5 @@ Thumbs.db
|
|||||||
*.mov
|
*.mov
|
||||||
*.wmv
|
*.wmv
|
||||||
|
|
||||||
|
writable/session/
|
||||||
|
writable/debugbar/
|
||||||
|
|||||||
@ -71,9 +71,9 @@ $routes->get("new_bussiness/(:any)", "Business::new_bussiness/$1");
|
|||||||
$routes->post("insert_business/", "Business::insert_business");
|
$routes->post("insert_business/", "Business::insert_business");
|
||||||
$routes->get("delete_business/(:any)", "Business::delete_business/$1");
|
$routes->get("delete_business/(:any)", "Business::delete_business/$1");
|
||||||
|
|
||||||
# Doner Routes
|
# Donor Routes
|
||||||
$routes->get("doner_list/", "Customer::index");
|
$routes->get("Donor_list/", "Customer::index");
|
||||||
$routes->get("new_doner/(:any)", "Customer::new_doner/$1");
|
$routes->get("new_Donor/(:any)", "Customer::new_Donor/$1");
|
||||||
$routes->post("insert_customer", "Customer::insert_customer");
|
$routes->post("insert_customer", "Customer::insert_customer");
|
||||||
$routes->get("delete_customer/(:any)", "Customer::delete_customer/$1");
|
$routes->get("delete_customer/(:any)", "Customer::delete_customer/$1");
|
||||||
|
|
||||||
|
|||||||
@ -248,7 +248,9 @@ class Authentication extends BaseController
|
|||||||
$this->response->setHeader('Pragma', 'no-cache');
|
$this->response->setHeader('Pragma', 'no-cache');
|
||||||
$this->response->setHeader('Expires', 'Fri, 01 Jan 1990 00:00:00 GMT');
|
$this->response->setHeader('Expires', 'Fri, 01 Jan 1990 00:00:00 GMT');
|
||||||
$data = [];
|
$data = [];
|
||||||
return view('auth_logout', $data);
|
|
||||||
|
return redirect()->route('login');
|
||||||
|
// return view('auth_logout', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
## Lock Screen - holded
|
## Lock Screen - holded
|
||||||
|
|||||||
@ -79,6 +79,8 @@ abstract class BaseController extends Controller
|
|||||||
$session_uid = get_logged_user_id();
|
$session_uid = get_logged_user_id();
|
||||||
$session_uname = get_logged_name();
|
$session_uname = get_logged_name();
|
||||||
|
|
||||||
|
// echo $session_uname; die;
|
||||||
|
|
||||||
$mergedData = array_merge($data, $this->authData);
|
$mergedData = array_merge($data, $this->authData);
|
||||||
$mergedData['browser_title']= $mergedData['company_name'] . ' | ' . $mergedData['company_short_name'] . ' ' . $mergedData['page_name'];
|
$mergedData['browser_title']= $mergedData['company_name'] . ' | ' . $mergedData['company_short_name'] . ' ' . $mergedData['page_name'];
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class Books extends BaseController
|
|||||||
$causes_id = $BooksModel->insert($data);
|
$causes_id = $BooksModel->insert($data);
|
||||||
|
|
||||||
|
|
||||||
if ($BooksModel->insert($data)) {
|
if ($causes_id) {
|
||||||
session()->setFlashdata('success', 'causes successfully created.');
|
session()->setFlashdata('success', 'causes successfully created.');
|
||||||
$this->logger->info("Books: has been added successfully. Inserted ID = " . $BooksModel->insertID());
|
$this->logger->info("Books: has been added successfully. Inserted ID = " . $BooksModel->insertID());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class Business extends BaseController
|
|||||||
}
|
}
|
||||||
$BusinessModel = new BusinessModel();
|
$BusinessModel = new BusinessModel();
|
||||||
$data['page_name'] = 'Organization Details';
|
$data['page_name'] = 'Organization Details';
|
||||||
$data['businesses'] = $BusinessModel->where($where)->findAll();
|
$data['businesses'] = $BusinessModel->where($where)->where('business_id !=', 0)->findAll();
|
||||||
// $data['lastQuery'] = $BusinessModel->getLastQuery();
|
// $data['lastQuery'] = $BusinessModel->getLastQuery();
|
||||||
// print_r($data);die;
|
// print_r($data);die;
|
||||||
$this->render_page('business_list', $data);
|
$this->render_page('business_list', $data);
|
||||||
@ -34,9 +34,12 @@ class Business extends BaseController
|
|||||||
## To Load Business Form (Add/Update)
|
## To Load Business Form (Add/Update)
|
||||||
public function new_bussiness($id)
|
public function new_bussiness($id)
|
||||||
{
|
{
|
||||||
|
helper('session');
|
||||||
|
$session_role = get_user_role();
|
||||||
|
|
||||||
if ($id === '0') {
|
if ($id === '0') {
|
||||||
$data['page_name'] = 'Add Organization';
|
$data['page_name'] = 'Add Organization';
|
||||||
|
$data['loged_user'] = $session_role;
|
||||||
$data['businesses'] = [];
|
$data['businesses'] = [];
|
||||||
} else if ($id !== '0') {
|
} else if ($id !== '0') {
|
||||||
$data['page_name'] = 'Edit Organization';
|
$data['page_name'] = 'Edit Organization';
|
||||||
@ -59,6 +62,7 @@ class Business extends BaseController
|
|||||||
$session_uid = get_logged_user_id();
|
$session_uid = get_logged_user_id();
|
||||||
$session_role = get_user_role();
|
$session_role = get_user_role();
|
||||||
|
|
||||||
|
|
||||||
$img = $this->request->getFile('bfile');
|
$img = $this->request->getFile('bfile');
|
||||||
$business_id = $this->request->getPost('business_id');
|
$business_id = $this->request->getPost('business_id');
|
||||||
$filePath = 'public/uploads/' . $this->request->getPost('bfile');
|
$filePath = 'public/uploads/' . $this->request->getPost('bfile');
|
||||||
@ -111,7 +115,12 @@ class Business extends BaseController
|
|||||||
$BusinessModel->update($business_id, $data);
|
$BusinessModel->update($business_id, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (empty($business_id)) {
|
||||||
|
return redirect()->route('business_list');
|
||||||
|
}else{
|
||||||
return redirect()->route('dashboard');
|
return redirect()->route('dashboard');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
## For delete the business details (Which means inactive the details)
|
## For delete the business details (Which means inactive the details)
|
||||||
|
|||||||
@ -16,15 +16,15 @@ 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("Doner: Listing In admin role . BID = ".$session_bid);
|
$this->logger->info("Donor: 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("Doner: Listing In Super-admin role .");
|
$this->logger->info("Donor: Listing In Super-admin role .");
|
||||||
$where = ['isactive != ' => NULL];
|
$where = ['isactive != ' => NULL];
|
||||||
}
|
}
|
||||||
$CustomerModel = new CustomerModel();
|
$CustomerModel = new CustomerModel();
|
||||||
|
|
||||||
$data['page_name'] = 'Doner Details';
|
$data['page_name'] = 'Donor Details';
|
||||||
$data['customer'] = $CustomerModel->where($where)->orderBy('doner_id', 'DESC')->findAll();
|
$data['customer'] = $CustomerModel->where($where)->orderBy('doner_id', 'DESC')->findAll();
|
||||||
|
|
||||||
// print_r($data); die();
|
// print_r($data); die();
|
||||||
@ -35,22 +35,21 @@ class Customer extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
## To Load Doner Form (Add/Update)
|
## To Load Donor Form (Add/Update)
|
||||||
public function new_doner($id)
|
public function new_Donor($id)
|
||||||
{
|
{
|
||||||
helper('session');
|
helper('session');
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
|
|
||||||
if ($id === '0') {
|
if ($id === '0') {
|
||||||
// Add Doner
|
// Add Donor
|
||||||
$data['page_name'] = 'Add Doner Details';
|
$data['page_name'] = 'Add Donor Details';
|
||||||
$data['customer'] = [];
|
$data['customer'] = [];
|
||||||
|
|
||||||
} else if ($id !== '0') {
|
} else if ($id !== '0') {
|
||||||
// Edit Doner
|
|
||||||
$data['page_name'] = 'Edit Doner Details';
|
|
||||||
|
|
||||||
// Load your Customer Model
|
// Edit Donor
|
||||||
|
$data['page_name'] = 'Edit Donor Details';
|
||||||
$customerModel = new CustomerModel();
|
$customerModel = new CustomerModel();
|
||||||
|
|
||||||
// Retrieve customer details by customer ID
|
// Retrieve customer details by customer ID
|
||||||
@ -74,7 +73,7 @@ class Customer extends BaseController
|
|||||||
{
|
{
|
||||||
$requestData = $this->request->getPost();
|
$requestData = $this->request->getPost();
|
||||||
// print_r($requestData);die;
|
// print_r($requestData);die;
|
||||||
$this->logger->info("Doner: Inserting/Updating Details");
|
$this->logger->info("Donor: Inserting/Updating Details");
|
||||||
try {
|
try {
|
||||||
helper('session');
|
helper('session');
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
@ -90,7 +89,7 @@ class Customer extends BaseController
|
|||||||
'email' => $this->request->getPost('cmail'),
|
'email' => $this->request->getPost('cmail'),
|
||||||
'date_of_birth' => $dob,
|
'date_of_birth' => $dob,
|
||||||
'pan_no' => $this->request->getPost('pan_no'),
|
'pan_no' => $this->request->getPost('pan_no'),
|
||||||
'doner_type' => $this->request->getPost('donerType'),
|
'doner_type' => $this->request->getPost('DonorType'),
|
||||||
'org_name' => $this->request->getPost('org_name') !== '' || $this->request->getPost('org_name') !== null ? $this->request->getPost('org_name') : NULL,
|
'org_name' => $this->request->getPost('org_name') !== '' || $this->request->getPost('org_name') !== null ? $this->request->getPost('org_name') : NULL,
|
||||||
'address' => $this->request->getPost('address'),
|
'address' => $this->request->getPost('address'),
|
||||||
'city' => $this->request->getPost('city'),
|
'city' => $this->request->getPost('city'),
|
||||||
@ -110,12 +109,12 @@ class Customer extends BaseController
|
|||||||
$data['isactive'] = 1;
|
$data['isactive'] = 1;
|
||||||
$data['created_by'] = $session_uid;
|
$data['created_by'] = $session_uid;
|
||||||
if ($model->insert($data)) {
|
if ($model->insert($data)) {
|
||||||
session()->setFlashdata('success', 'Doner successfully created.');
|
session()->setFlashdata('success', 'Donor successfully created.');
|
||||||
$this->logger->info("Doner : has been added successfully. Inserted ID = " . $model->insertID());
|
$this->logger->info("Donor : has been added successfully. Inserted ID = " . $model->insertID());
|
||||||
$doner_id_for_addresses = $model->insertID();// for Doner ADDRESS Table
|
$doner_id_for_addresses = $model->insertID();// for Donor ADDRESS Table
|
||||||
} else {
|
} else {
|
||||||
session()->setFlashdata('error', 'Doner could not be added. Please try again..');
|
session()->setFlashdata('error', 'Donor could not be added. Please try again..');
|
||||||
$this->logger->error("Doner: Err could not be added. Please try again.");
|
$this->logger->error("Donor: Err could not be added. Please try again.");
|
||||||
$doner_id_for_addresses = "";
|
$doner_id_for_addresses = "";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -127,98 +126,31 @@ class Customer extends BaseController
|
|||||||
$data['updated_by'] = $session_uid;
|
$data['updated_by'] = $session_uid;
|
||||||
$doner_id_for_addresses = $doner_id; // for Customer ADDRESS Table
|
$doner_id_for_addresses = $doner_id; // for Customer ADDRESS Table
|
||||||
if ($model->update($doner_id, $data)) {
|
if ($model->update($doner_id, $data)) {
|
||||||
session()->setFlashdata('success', 'Doner successfully updated');
|
session()->setFlashdata('success', 'Donor successfully updated');
|
||||||
$this->logger->info("Doner: has been updated successfully. Updated Doner ID = " . $doner_id_for_addresses);
|
$this->logger->info("Donor: has been updated successfully. Updated Donor ID = " . $doner_id_for_addresses);
|
||||||
} else {
|
} else {
|
||||||
session()->setFlashdata('error', 'Doner updation failed. Please try again.');
|
session()->setFlashdata('error', 'Donor updation failed. Please try again.');
|
||||||
$this->logger->error("Doner: Err Failed to update ID =" . $doner_id_for_addresses);
|
$this->logger->error("Donor: Err Failed to update ID =" . $doner_id_for_addresses);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// if($doner_id_for_addresses != ""){
|
// if($doner_id_for_addresses != ""){
|
||||||
// $this->logger->info("Doner: i got Doner id for addresses = " . $doner_id_for_addresses);
|
// $this->logger->info("Donor: i got Donor id for addresses = " . $doner_id_for_addresses);
|
||||||
// $requestData = $this->request->getPost();
|
// $requestData = $this->request->getPost();
|
||||||
// $bill_addr = $this->save_customer_addresses($doner_id_for_addresses, $requestData, 'b');
|
// $bill_addr = $this->save_customer_addresses($doner_id_for_addresses, $requestData, 'b');
|
||||||
// $this->logger->info("Customer: bill addr final message = " .implode(" ",$bill_addr));
|
// $this->logger->info("Customer: bill addr final message = " .implode(" ",$bill_addr));
|
||||||
// $ship_addr = $this->save_customer_addresses($doner_id_for_addresses, $requestData, 's');
|
// $ship_addr = $this->save_customer_addresses($doner_id_for_addresses, $requestData, 's');
|
||||||
// $this->logger->info("Doner: Ship addr final message = " . implode(" ",$ship_addr));
|
// $this->logger->info("Donor: Ship addr final message = " . implode(" ",$ship_addr));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->logger->error("Doner : Err Occur =" . $e->getMessage());
|
$this->logger->error("Donor : Err Occur =" . $e->getMessage());
|
||||||
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
return redirect()->route('doner_list');
|
return redirect()->route('Donor_list');
|
||||||
}
|
}
|
||||||
|
|
||||||
## 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("Doner: Addresses Lettering Flag = " . $letteringflag . " Doner 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();
|
|
||||||
|
|
||||||
// ## IF Any Missing value Means that values are Inactive here....
|
|
||||||
// if(!empty($CAid)){
|
|
||||||
// $this->logger->info("Doner: Primary Addresses ID = ".implode(",",$CAid));
|
|
||||||
// $filteringAddressIds = [];
|
|
||||||
// for ($y = 0; $y < count($getAddressdetails); $y++) {
|
|
||||||
// $filteringAddressIds[$y] = $getAddressdetails[$y]['customer_address_id'];
|
|
||||||
// }
|
|
||||||
// if (!empty($filteringAddressIds)) {
|
|
||||||
// $A = $filteringAddressIds;
|
|
||||||
// $B = $CAid;
|
|
||||||
// $missingValues = array_diff($A, $B);
|
|
||||||
// if (!empty($missingValues)) {
|
|
||||||
// $where = ['isactive' => 1, 'doner_id' => (int)$id, 'address_type' => $addressType];
|
|
||||||
// $model->inactiveMissingAddressDetails($where, $missingValues);
|
|
||||||
// $this->logger->info("Doner: Inactived Missing Addresses Count = " . count($missingValues)." That Primary Addresses ID = ".implode(",",$CAid));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
// $baddress1 = $requestData[$letteringflag . 'address1'];
|
|
||||||
// $baddress2 = $requestData[$letteringflag . 'address2'];
|
|
||||||
// $bcountry = $requestData[$letteringflag . 'country'];
|
|
||||||
// $bcity = $requestData[$letteringflag . 'city'];
|
|
||||||
// $binputstate = $requestData[$letteringflag . 'istate'];
|
|
||||||
// $bdropdownstate = $requestData[$letteringflag . 'dstate'];
|
|
||||||
// $bzip = $requestData[$letteringflag . 'zip'];
|
|
||||||
// $count = count($CAid);
|
|
||||||
// $address_array = [];
|
|
||||||
// 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'] = "";
|
|
||||||
// $address_array[$x]['email'] = $requestData['cmail'];
|
|
||||||
// $address_array[$x]['mobile_no'] = $requestData['cmobile'];
|
|
||||||
// $address_array[$x]['address_1'] = $baddress1[$x];
|
|
||||||
// $address_array[$x]['address_2'] = $baddress2[$x];
|
|
||||||
// $address_array[$x]['city'] = $bcity[$x];
|
|
||||||
// $address_array[$x]['state'] = $bcountry[$x] === 'IN' ? $bdropdownstate[$x] : $binputstate[$x] ;
|
|
||||||
// $address_array[$x]['country'] = $bcountry[$x];
|
|
||||||
// $address_array[$x]['postal_code'] = $bzip[$x];
|
|
||||||
// $address_array[$x]['doner_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 = !empty($address_array) ? $model->saveAddressDetails($address_array) : ["No data found For addresses"];
|
|
||||||
// $this->logger->info("Doner: Address Final message = " . implode(",",$statement));
|
|
||||||
// }
|
|
||||||
// } catch (\Exception $e) {
|
|
||||||
// $this->logger->error("Doner: 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)
|
## For delete the customer details (Which means inactive the details)
|
||||||
public function delete_customer($id)
|
public function delete_customer($id)
|
||||||
@ -228,31 +160,18 @@ class Customer extends BaseController
|
|||||||
$session_uid = get_logged_user_id();
|
$session_uid = get_logged_user_id();
|
||||||
$CustomerModel = new CustomerModel();
|
$CustomerModel = new CustomerModel();
|
||||||
$where = ['doner_id' => (int)$id, 'isactive =' => 1];
|
$where = ['doner_id' => (int)$id, 'isactive =' => 1];
|
||||||
|
|
||||||
// Check if the business ID exists
|
// Check if the business ID exists
|
||||||
$existingCustomer = $CustomerModel->where($where)->find($id);
|
$existingCustomer = $CustomerModel->where($where)->find($id);
|
||||||
if ($existingCustomer) {
|
if ($existingCustomer) {
|
||||||
$this->logger->Info("Doner: Going to Inactive ID = ".$id);
|
$this->logger->Info("Donor: Going to Inactive ID = ".$id);
|
||||||
$data = ['isactive' => 0 , 'updated_by' => $session_uid];
|
$data = ['isactive' => 0 , 'updated_by' => $session_uid];
|
||||||
// Delete the business record
|
// Delete the business record
|
||||||
if ($CustomerModel->update($id, $data)) {
|
if ($CustomerModel->update($id, $data)) {
|
||||||
$billAddressdetails = $this->get_customer_address($id, 1);
|
session()->setFlashdata('success', 'Donor successfully deleted.');
|
||||||
if(!empty($billAddressdetails)){
|
$this->logger->info("Donor: has been Inactived successfully. Inactived ID = " . $id);
|
||||||
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', 'Doner successfully deleted.');
|
|
||||||
$this->logger->info("Doner: has been Inactived successfully. Inactived ID = " . $id);
|
|
||||||
} else {
|
} else {
|
||||||
$this->logger->error("Doner: Not able to Inactive ID =" . $id);
|
$this->logger->error("Donor: Not able to Inactive ID =" . $id);
|
||||||
throw new \Exception("Data Not able to Deleted");
|
throw new \Exception("Data Not able to Deleted");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -260,7 +179,7 @@ class Customer extends BaseController
|
|||||||
$this->logger->error("Customer: Err Occur = " . $e->getMessage());
|
$this->logger->error("Customer: Err Occur = " . $e->getMessage());
|
||||||
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
return redirect()->route('doner_list');
|
return redirect()->route('Donor_list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function get_customer_address($id,$type){
|
public function get_customer_address($id,$type){
|
||||||
@ -288,25 +207,27 @@ class Customer extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function customer_group(){
|
public function customer_group(){
|
||||||
$data['page_name'] = 'Doner Group Details';
|
|
||||||
|
$session_bid = get_business_id();
|
||||||
|
$data['page_name'] = 'Donor Group Details';
|
||||||
$model = new CustomerModel();
|
$model = new CustomerModel();
|
||||||
$data['customer_group'] = $model->getGroupDetails();
|
$data['customer_group'] = $model->getGroupDetails($session_bid);
|
||||||
$this->render_page('customer_group', $data);
|
$this->render_page('customer_group', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function view_customer_group($id){
|
public function view_customer_group($id){
|
||||||
|
|
||||||
helper('session');
|
helper('session');
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
|
|
||||||
$data['field'] = [
|
$data['field'] = [
|
||||||
['value'=>'','fieldflag'=>1,'text'=> 'Choose the Field','disable' => false],
|
['value'=>'', 'fieldflag'=>1, 'text'=> 'Choose the Field', 'disable' => false],
|
||||||
['value'=>'C.type','fieldflag'=>1,'text'=> 'Type','disable' => false],
|
['value'=>'C.doner_type', 'fieldflag'=>1, 'text'=> 'Donor Type', 'disable' => false],
|
||||||
['value'=>'CA.city','fieldflag'=>1,'text'=> 'City','disable' => false],
|
['value'=>'C.city', 'fieldflag'=>1, 'text'=> 'City', 'disable' => false],
|
||||||
// ['value'=>'CA.state','fieldflag'=>1,'text'=> 'State','disable' => false],
|
['value'=>'C.postal_code', 'fieldflag'=>1, 'text'=> 'Postal Code', 'disable' => false],
|
||||||
['value'=>'CA.postal_code','fieldflag'=>1,'text'=> 'Postal Code','disable' => false],
|
['value'=>'I.receipt_date', 'fieldflag'=>2, 'text'=> 'Receipt Date', 'disable' => false],
|
||||||
['value'=>'C.mode','fieldflag'=>3,'text'=> 'Mode','disable' => false],
|
];
|
||||||
['value'=>'CM.name','fieldflag'=>1,'text'=> 'Category','disable' => false],
|
|
||||||
['value'=>'I.invoice_date','fieldflag'=>2,'text'=> 'Invoice Date','disable' => false],
|
|
||||||
['value'=>'S.to_subscription','fieldflag'=>2,'text'=> 'Expiry Date','disable' => false]];
|
|
||||||
|
|
||||||
$data['operator'] = [
|
$data['operator'] = [
|
||||||
'' => 'Choose the operator',
|
'' => 'Choose the operator',
|
||||||
@ -324,12 +245,13 @@ class Customer extends BaseController
|
|||||||
'is not null' => 'Is Not NULL',
|
'is not null' => 'Is Not NULL',
|
||||||
];
|
];
|
||||||
$data['customer_group'] = [];
|
$data['customer_group'] = [];
|
||||||
|
|
||||||
if ($id === '0') {
|
if ($id === '0') {
|
||||||
// Add Customer
|
// Add Customer
|
||||||
$data['page_name'] = 'Add Doner Group';
|
$data['page_name'] = 'Add Donor Group';
|
||||||
} else if ($id !== '0') {
|
} else if ($id !== '0') {
|
||||||
// Edit Customer
|
// Edit Customer
|
||||||
$data['page_name'] = 'Edit Doner Group';
|
$data['page_name'] = 'Edit Donor Group';
|
||||||
|
|
||||||
// Load your Customer Model
|
// Load your Customer Model
|
||||||
$model = new CustomerModel();
|
$model = new CustomerModel();
|
||||||
@ -348,6 +270,8 @@ class Customer extends BaseController
|
|||||||
}
|
}
|
||||||
$this->render_page('customer_group_form', $data);
|
$this->render_page('customer_group_form', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function preview_customer_group($id){
|
public function preview_customer_group($id){
|
||||||
try {
|
try {
|
||||||
helper('session');
|
helper('session');
|
||||||
@ -357,7 +281,7 @@ class Customer extends BaseController
|
|||||||
$result = $model->where($where)->findAll();
|
$result = $model->where($where)->findAll();
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
$sql = (string)$result[0]['group_query'];
|
$sql = (string)$result[0]['group_query'];
|
||||||
//print_r($sql);die;
|
|
||||||
if($sql){
|
if($sql){
|
||||||
$query = $db->query($sql);
|
$query = $db->query($sql);
|
||||||
$results = $query->getResultArray();
|
$results = $query->getResultArray();
|
||||||
@ -371,7 +295,7 @@ class Customer extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->logger->error("Doner Group: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
|
$this->logger->error("Donor Group: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
|
||||||
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -384,7 +308,7 @@ class Customer extends BaseController
|
|||||||
$where = ['isactive' => 1,'group_id'=>(int)$id];
|
$where = ['isactive' => 1,'group_id'=>(int)$id];
|
||||||
$result = $model->where($where)->findAll();
|
$result = $model->where($where)->findAll();
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$this->logger->Info("Doner Group: Going to Inactive ID = ".$id);
|
$this->logger->Info("Donor Group: Going to Inactive ID = ".$id);
|
||||||
$data = ['isactive' => 0 , 'updated_by' => $session_uid,'group_id'=>(int)$id];
|
$data = ['isactive' => 0 , 'updated_by' => $session_uid,'group_id'=>(int)$id];
|
||||||
$statement = $model->saveGroupDetails($data);// just updating Inactive status only.
|
$statement = $model->saveGroupDetails($data);// just updating Inactive status only.
|
||||||
if ($statement['success']) {
|
if ($statement['success']) {
|
||||||
@ -394,34 +318,37 @@ class Customer extends BaseController
|
|||||||
session()->setFlashdata('error', $statement['error']);
|
session()->setFlashdata('error', $statement['error']);
|
||||||
$this->logger->error($statement['log']);
|
$this->logger->error($statement['log']);
|
||||||
}else{
|
}else{
|
||||||
throw new \Exception("Doner Group: Err Occur on data the Doner Group Inactive");
|
throw new \Exception("Donor Group: Err Occur on data the Donor Group Inactive");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->logger->error("Doner Group: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
|
$this->logger->error("Donor Group: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
|
||||||
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
return redirect()->route('customer_group');
|
return redirect()->route('customer_group');
|
||||||
|
|
||||||
}
|
}
|
||||||
public function insert_customer_group(){
|
public function insert_customer_group(){
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->logger->info("Doner Group: Inserting/Updating Details");
|
$this->logger->info("Donor Group: Inserting/Updating Details");
|
||||||
helper('session');
|
helper('session');
|
||||||
$session_uid = get_logged_user_id();
|
$session_uid = get_logged_user_id();
|
||||||
$request_data = $this->request->getPost();
|
$request_data = $this->request->getPost();
|
||||||
$string_flag = $request_data['string_flag'];
|
$string_flag = $request_data['string_flag'];
|
||||||
// $this->logger->info("Customer Group: Request data = ".json_encode($request_data));
|
// $this->logger->info("Customer Group: Request data = ".json_encode($request_data));
|
||||||
|
|
||||||
|
$session_bid = get_business_id();
|
||||||
$model = new CustomerModel();
|
$model = new CustomerModel();
|
||||||
// Array ( [groupname] => nil [column] => Array ( [0] => city [1] => state ) [operator] => Array ( [0] => not contain [1] => not equal ) [values] => Array ( [0] => 2 [1] => 3 ) )
|
// Array ( [groupname] => nil [column] => Array ( [0] => city [1] => state ) [operator] => Array ( [0] => not contain [1] => not equal ) [values] => Array ( [0] => 2 [1] => 3 ) )
|
||||||
$data = [
|
$data = [
|
||||||
'group_name' => $request_data['groupname'],
|
'group_name' => $request_data['groupname'],
|
||||||
'column' => serialize($request_data['column']),
|
'column' => serialize($request_data['column']),
|
||||||
'operator' => serialize($request_data['operator']),
|
'operator' => serialize($request_data['operator']),
|
||||||
'value' => serialize($request_data['values'])
|
'value' => serialize($request_data['values']),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
$data['business_id'] = $session_bid;
|
||||||
|
|
||||||
// Initialize an empty array to store the conditions
|
// Initialize an empty array to store the conditions
|
||||||
$conditions = array();
|
$conditions = array();
|
||||||
|
|
||||||
@ -488,15 +415,15 @@ class Customer extends BaseController
|
|||||||
// Now you can use $whereCondition in your SQL query
|
// Now you can use $whereCondition in your SQL query
|
||||||
$db = \Config\Database::connect();
|
$db = \Config\Database::connect();
|
||||||
// $sql = "SELECT doner_id,CONCAT(first_name,'',last_name) as customer_name,email,mobile_no FROM customers WHERE ".$whereCondition;
|
// $sql = "SELECT doner_id,CONCAT(first_name,'',last_name) as customer_name,email,mobile_no FROM customers WHERE ".$whereCondition;
|
||||||
$sql = "SELECT CA.city,CA.state,I.invoice_date,C.doner_id,CONCAT(C.first_name,'',C.last_name) as customer_name,C.email,C.mobile_no ,S.to_subscription as due_date, C.isactive ,count(I.invoice_id) as invoice_count_raised_by_customer, S.scheme_id , CM.name
|
$sql = "SELECT C.city, C.state, I.receipt_date, C.doner_id, CONCAT(C.first_name, ' ', C.last_name) as customer_name, C.email, C.mobile_no, C.isactive, COUNT(I.receipt_id) as invoice_count_raised_by_customer FROM customers as C
|
||||||
FROM customers as C
|
LEFT JOIN receipt I ON I.doner_id = C.doner_id and I.isactive = 1
|
||||||
LEFT JOIN invoice I on I.doner_id = C.doner_id and I.isactive = 1
|
WHERE C.isactive = 1 AND " . $whereCondition . "
|
||||||
LEFT JOIN customer_addresses CA on CA.doner_id = C.doner_id and CA.address_type = 1 and CA.isactive = 1
|
GROUP BY C.doner_id";
|
||||||
LEFT JOIN subscription S on S.doner_id = C.doner_id
|
|
||||||
LEFT JOIN book_categories BC on BC.book_id = S.scheme_id
|
|
||||||
LEFT JOIN category CM on CM.id = BC.category_id
|
|
||||||
WHERE C.isactive = 1 AND ".$whereCondition." GROUP BY C.doner_id";
|
|
||||||
$this->logger->info("Customer Group: SQL = ".$sql);
|
$this->logger->info("Customer Group: SQL = ".$sql);
|
||||||
|
|
||||||
|
// echo "$sql"; die;
|
||||||
|
|
||||||
// Execute the query
|
// Execute the query
|
||||||
$query = $db->query($sql);
|
$query = $db->query($sql);
|
||||||
|
|
||||||
@ -520,7 +447,7 @@ class Customer extends BaseController
|
|||||||
session()->setFlashdata('error', $statement['error']);
|
session()->setFlashdata('error', $statement['error']);
|
||||||
$this->logger->error($statement['log']);
|
$this->logger->error($statement['log']);
|
||||||
}else{
|
}else{
|
||||||
throw new \Exception("Doner Group: Err Occur on data the Save");
|
throw new \Exception("Donor Group: Err Occur on data the Save");
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if($string_flag == "preview"){
|
}else if($string_flag == "preview"){
|
||||||
@ -529,7 +456,7 @@ class Customer extends BaseController
|
|||||||
throw new \Exception("Data Not Found");
|
throw new \Exception("Data Not Found");
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->logger->error("Doner Group: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
|
$this->logger->error("Donor Group: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
|
||||||
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
return redirect()->route('customer_group');
|
return redirect()->route('customer_group');
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class Event extends BaseController
|
|||||||
|
|
||||||
public function insert_event()
|
public function insert_event()
|
||||||
{
|
{
|
||||||
$this->logger->info("Event: Inserting/Updating Details");
|
$this->logger->info("campaign: Inserting/Updating Details");
|
||||||
try {
|
try {
|
||||||
helper('session');
|
helper('session');
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
@ -88,42 +88,30 @@ class Event extends BaseController
|
|||||||
// It's an insert operation
|
// It's an insert operation
|
||||||
$data['created_by'] = $session_uid;
|
$data['created_by'] = $session_uid;
|
||||||
|
|
||||||
// echo '<pre>';
|
|
||||||
// print_r($data);
|
|
||||||
|
|
||||||
// $value = $EventModel->insert($data);
|
|
||||||
// $builder = $EventModel;
|
|
||||||
|
|
||||||
// // Get the last run query
|
|
||||||
// $lastQuery = $builder->getLastQuery();
|
|
||||||
|
|
||||||
// // Output or log the last query
|
|
||||||
// echo $lastQuery; die;
|
|
||||||
|
|
||||||
if ($EventModel->insert($data)) {
|
if ($EventModel->insert($data)) {
|
||||||
|
|
||||||
session()->setFlashdata('success', 'Event has been added successfully.');
|
session()->setFlashdata('success', 'campaign has been added successfully.');
|
||||||
$this->logger->info("Event : has been added successfully. Inserted ID = " . $EventModel->insertID());
|
$this->logger->info("campaign : has been added successfully. Inserted ID = " . $EventModel->insertID());
|
||||||
} else {
|
} else {
|
||||||
session()->setFlashdata('error', 'Event could not be added. Please try again..');
|
session()->setFlashdata('error', 'campaign could not be added. Please try again..');
|
||||||
$this->logger->error("Event: Err data could not be added. Please try again.");
|
$this->logger->error("campaign: 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($campaign_id, $data)) {
|
if ($EventModel->update($campaign_id, $data)) {
|
||||||
session()->setFlashdata('success', 'Event has been updated successfully.');
|
session()->setFlashdata('success', 'campaign has been updated successfully.');
|
||||||
$this->logger->info("Event: has been updated successfully. Updated Event ID = " . $campaign_id);
|
$this->logger->info("campaign: has been updated successfully. Updated campaign ID = " . $campaign_id);
|
||||||
} else {
|
} else {
|
||||||
session()->setFlashdata('error', 'Event update failed. Please try again.');
|
session()->setFlashdata('error', 'campaign update failed. Please try again.');
|
||||||
$this->logger->error("Event: Err Failed to update ID =" . $campaign_id);
|
$this->logger->error("campaign: Err Failed to update ID =" . $campaign_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->logger->error("Event: Err Occur = " . $e->getMessage() . " Line = " . $e->getLine() . " File = " . $e->getFile());
|
$this->logger->error("campaign: Err Occur = " . $e->getMessage() . " Line = " . $e->getLine() . " File = " . $e->getFile());
|
||||||
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
return redirect()->route('campaign');
|
return redirect()->route('campaign_list');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function invoice_number_format($id)
|
public function invoice_number_format($id)
|
||||||
@ -181,7 +169,7 @@ class Event extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->logger->error("Event: Err Occur = " . $e->getMessage() . " Line = " . $e->getLine() . " File = " . $e->getFile());
|
$this->logger->error("campaign: Err Occur = " . $e->getMessage() . " Line = " . $e->getLine() . " File = " . $e->getFile());
|
||||||
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
|
||||||
}
|
}
|
||||||
return redirect()->to(base_url("invoice_number_format/1"));
|
return redirect()->to(base_url("invoice_number_format/1"));
|
||||||
|
|||||||
@ -13,12 +13,15 @@ class Home extends BaseController
|
|||||||
$session_role = get_user_role();
|
$session_role = get_user_role();
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
|
|
||||||
|
// echo $session_bid, $session_role; die;
|
||||||
|
|
||||||
$data['page_name'] = 'Dashboard';
|
$data['page_name'] = 'Dashboard';
|
||||||
if (!empty($session_role) && $session_role !== "sadmin") {
|
if (!empty($session_role) && $session_role == "sadmin") {
|
||||||
$where = ['isactive' => 1, 'business_id' => (int)$session_bid];
|
|
||||||
} else if (!empty($session_role) && $session_role !== "admin") {
|
|
||||||
$where = ['isactive != ' => NULL];
|
$where = ['isactive != ' => NULL];
|
||||||
} else {
|
} else if (!empty($session_role) && $session_role == "admin") {
|
||||||
|
$where = ['isactive' => 1, 'business_id' => $session_bid];
|
||||||
|
}
|
||||||
|
else {
|
||||||
$where = [];
|
$where = [];
|
||||||
}
|
}
|
||||||
$model = new HomeModel();
|
$model = new HomeModel();
|
||||||
@ -26,7 +29,7 @@ class Home extends BaseController
|
|||||||
$data['customer']['label'] = "Doners";
|
$data['customer']['label'] = "Doners";
|
||||||
|
|
||||||
// echo '<pre>';
|
// echo '<pre>';
|
||||||
// print_r($data); die;
|
// print_r($data['customer'] ); die;
|
||||||
|
|
||||||
// $data['invoice'] = $model->invoice();
|
// $data['invoice'] = $model->invoice();
|
||||||
// $data['active_category'] = array_filter($model->schemes(), function ($element) {
|
// $data['active_category'] = array_filter($model->schemes(), function ($element) {
|
||||||
|
|||||||
@ -21,7 +21,7 @@ class Invoice extends BaseController
|
|||||||
|
|
||||||
$model = new InvoiceModel();
|
$model = new InvoiceModel();
|
||||||
$where = ['business_id' => (int)get_business_id()];
|
$where = ['business_id' => (int)get_business_id()];
|
||||||
$data['doners'] = $model->getData('customers', $where);
|
$data['Donors'] = $model->getData('customers', $where);
|
||||||
$data['page_name'] = 'Receipt Details';
|
$data['page_name'] = 'Receipt Details';
|
||||||
$data['receipt'] = $model->where(["business_id"=>$session_bid])->findAll();
|
$data['receipt'] = $model->where(["business_id"=>$session_bid])->findAll();
|
||||||
|
|
||||||
@ -45,6 +45,7 @@ class Invoice extends BaseController
|
|||||||
// Get customer names for the dropdown, events details, and books details
|
// Get customer names for the dropdown, events details, and books details
|
||||||
$data['customers'] = $model->getData('customers', $where);
|
$data['customers'] = $model->getData('customers', $where);
|
||||||
$data['causes'] = $model->getData('causes', $where);
|
$data['causes'] = $model->getData('causes', $where);
|
||||||
|
$data['invoice_number_formatting'] = $model->getData('invoice_number_formatting', $where);
|
||||||
|
|
||||||
if ($id === '0') {
|
if ($id === '0') {
|
||||||
$this->logger->info("Receipt: In Add Details");
|
$this->logger->info("Receipt: In Add Details");
|
||||||
@ -57,7 +58,7 @@ class Invoice extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
// echo '<pre>';
|
// echo '<pre>';
|
||||||
// print_r($data);die;
|
// print_r($data['invoice_number_formatting']);die;
|
||||||
$this->render_page('invoice_form', $data);
|
$this->render_page('invoice_form', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -156,6 +157,16 @@ class Invoice extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($this->request->getPost('next_id')){
|
||||||
|
## Array Formation For Events Details And Updating Events also Here..
|
||||||
|
$update_events = [
|
||||||
|
'id' => 1,
|
||||||
|
'next_id' => (int)$this->request->getPost('next_id'),
|
||||||
|
'business_id' => (int)get_business_id(),
|
||||||
|
'updated_by' => get_logged_user_id()
|
||||||
|
];
|
||||||
|
$this->update_number_formatting($update_events);}
|
||||||
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->logger->error("Receipt: Err Occur =" . $e->getMessage());
|
$this->logger->error("Receipt: Err Occur =" . $e->getMessage());
|
||||||
@ -432,7 +443,7 @@ class Invoice extends BaseController
|
|||||||
// Fetch the receipt data based on $receipt_id
|
// Fetch the receipt data based on $receipt_id
|
||||||
$model = new InvoiceModel();
|
$model = new InvoiceModel();
|
||||||
$data = $model->getInvoiceData($id);
|
$data = $model->getInvoiceData($id);
|
||||||
|
// print_r($data);die;
|
||||||
|
|
||||||
// Create an mPDF object
|
// Create an mPDF object
|
||||||
$mpdf = new Mpdf();
|
$mpdf = new Mpdf();
|
||||||
@ -444,15 +455,10 @@ class Invoice extends BaseController
|
|||||||
$mpdf->SetAuthor('ORG');
|
$mpdf->SetAuthor('ORG');
|
||||||
$mpdf->SetCreator('');
|
$mpdf->SetCreator('');
|
||||||
|
|
||||||
|
|
||||||
// Set the page size to letter
|
|
||||||
// Add a page with letter size (8.5 x 11 inches)
|
|
||||||
$mpdf->AddPage('L', 'LETTER');
|
$mpdf->AddPage('L', 'LETTER');
|
||||||
|
|
||||||
// Generate the PDF content (HTML) with data
|
// Generate the PDF content (HTML) with data
|
||||||
$html = view('invoice_pdf_template', ['data' => $data]);
|
$html = view('invoice_pdf_template', ['data' => $data[0]]);
|
||||||
|
|
||||||
// echo $html; die;
|
|
||||||
|
|
||||||
// Load HTML into the mPDF instance
|
// Load HTML into the mPDF instance
|
||||||
$mpdf->WriteHTML($html);
|
$mpdf->WriteHTML($html);
|
||||||
@ -482,7 +488,7 @@ class Invoice extends BaseController
|
|||||||
'orientation' => 'P', // Portrait
|
'orientation' => 'P', // Portrait
|
||||||
];
|
];
|
||||||
$mpdf = new Mpdf($config);
|
$mpdf = new Mpdf($config);
|
||||||
$mpdf->SetTitle('Doner Address');
|
$mpdf->SetTitle('Donor Address');
|
||||||
$mpdf->SetAuthor('Venba');
|
$mpdf->SetAuthor('Venba');
|
||||||
$mpdf->SetCreator('');
|
$mpdf->SetCreator('');
|
||||||
|
|
||||||
@ -588,37 +594,7 @@ class Invoice extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// public function generate_invoice_pdf($id)
|
|
||||||
// {
|
|
||||||
// // Load the mPDF library
|
|
||||||
// $mpdf = new \Mpdf\Mpdf();
|
|
||||||
|
|
||||||
// // Fetch invoice data
|
|
||||||
// $invoice = $this->find($id);
|
|
||||||
|
|
||||||
// if ($invoice) {
|
|
||||||
// // Fetch related invoice items
|
|
||||||
// $invoiceItems = $this->getInvoiceItems($id);
|
|
||||||
|
|
||||||
// // Create the HTML content for the PDF
|
|
||||||
// $html = view('pdf/invoice_template', ['invoice' => $invoice, 'invoiceItems' => $invoiceItems]);
|
|
||||||
|
|
||||||
// // Load HTML content into mPDF
|
|
||||||
// $mpdf->WriteHTML($html);
|
|
||||||
|
|
||||||
// // Set PDF filename
|
|
||||||
// $pdfFileName = 'invoice_' . $invoice->invoice_number . '.pdf';
|
|
||||||
|
|
||||||
// // Output the PDF for download
|
|
||||||
// $mpdf->Output($pdfFileName, 'D');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// public function getInvoiceItems($invoiceId)
|
|
||||||
// {
|
|
||||||
// // Fetch invoice items related to the given invoice ID
|
|
||||||
// return $this->db->table('invoice_items')->where('receipt_id', $invoiceId)->get()->getResult();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,7 @@ class Users extends BaseController
|
|||||||
|
|
||||||
$session_role = get_user_role();
|
$session_role = get_user_role();
|
||||||
$session_bid = get_business_id();
|
$session_bid = get_business_id();
|
||||||
|
$session_role = get_user_role();
|
||||||
|
|
||||||
if (!empty($session_role) && $session_role !== "sadmin") {
|
if (!empty($session_role) && $session_role !== "sadmin") {
|
||||||
$this->logger->info("Users: Listing In admin role . BID = ".$session_bid);
|
$this->logger->info("Users: Listing In admin role . BID = ".$session_bid);
|
||||||
@ -25,10 +26,18 @@ class Users extends BaseController
|
|||||||
}
|
}
|
||||||
$model = new UsersModel();
|
$model = new UsersModel();
|
||||||
$model->setTable('users');
|
$model->setTable('users');
|
||||||
$user_details = $model->where($where)->orderBy('user_id', 'DESC')->findAll();
|
// $user_details = $model->where($where)->orderBy('user_id', 'DESC')->findAll();
|
||||||
|
$user_details = $model->select('users.*, business.title as org_name')
|
||||||
|
->join('business', 'business.business_id = users.business_id')
|
||||||
|
->where($where)->orderBy('user_id', 'DESC')->findAll();
|
||||||
|
|
||||||
$this->logger->info("Users: Listing Count .".count($user_details));
|
$this->logger->info("Users: Listing Count .".count($user_details));
|
||||||
$data['page_name'] = 'User Details';
|
$data['page_name'] = 'User Details';
|
||||||
|
$data['loged_user'] = $session_role;
|
||||||
$data['details'] = $user_details;
|
$data['details'] = $user_details;
|
||||||
|
|
||||||
|
// echo '<pre>';
|
||||||
|
// print_r($data); die;
|
||||||
$this->render_page('user_list', $data);
|
$this->render_page('user_list', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -146,13 +146,14 @@ public function saveGroupDetails($data){
|
|||||||
return $statement;
|
return $statement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getGroupDetails()
|
public function getGroupDetails($business_id)
|
||||||
{
|
{
|
||||||
return $this->db->table('customer_groups as CG' )
|
return $this->db->table('customer_groups as CG' )
|
||||||
->join('users as U1', 'U1.user_id = CG.created_by', 'left')
|
->join('users as U1', 'U1.user_id = CG.created_by', 'left')
|
||||||
->join('users as U2', 'U2.user_id = CG.updated_by', 'left')
|
->join('users as U2', 'U2.user_id = CG.updated_by', 'left')
|
||||||
->select('CG.group_id,CG.group_name,CG.created_on,CG.created_by,CG.updated_on,CG.updated_by,DATE_FORMAT(CG.created_on, "%d/%m/%Y %h:%i %p") AS formatted_created_on,concat(U1.first_name," ",U1.last_name) as created_by_name,concat(U2.first_name," ",U2.last_name) as updated_by_name,CG.isactive')
|
->select('CG.group_id,CG.group_name,CG.created_on,CG.created_by,CG.updated_on,CG.updated_by,DATE_FORMAT(CG.created_on, "%d/%m/%Y %h:%i %p") AS formatted_created_on,concat(U1.first_name," ",U1.last_name) as created_by_name,concat(U2.first_name," ",U2.last_name) as updated_by_name,CG.isactive')
|
||||||
->where(['CG.group_name != ' => 'EXPIRYDATE'])
|
->where(['CG.group_name != ' => 'EXPIRYDATE'])
|
||||||
|
->where('CG.business_id', $business_id)
|
||||||
// ->where(['CG.isactive' => 1])
|
// ->where(['CG.isactive' => 1])
|
||||||
->get()
|
->get()
|
||||||
->getResultArray();
|
->getResultArray();
|
||||||
|
|||||||
@ -5,6 +5,7 @@ class HomeModel extends Model
|
|||||||
{
|
{
|
||||||
|
|
||||||
public function customers($where) {
|
public function customers($where) {
|
||||||
|
|
||||||
$query = $this->db->table('customers');
|
$query = $this->db->table('customers');
|
||||||
|
|
||||||
$totalCustomers = $query->where($where)->countAll();
|
$totalCustomers = $query->where($where)->countAll();
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>BigBambooBookPublish | BBBP </title>
|
<title>BigBamboo Donation</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
|
<meta content="A fully featured admin theme which can be used to build CRM, CMS, etc." name="description" />
|
||||||
<meta content="Coderthemes" name="author" />
|
<meta content="Coderthemes" name="author" />
|
||||||
@ -46,7 +46,7 @@
|
|||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-muted mb-4 mt-3">Enter your email address and password to access admin panel.</p>
|
<p class="text-muted mb-4 mt-3">Enter your email address and password.</p>
|
||||||
</div>
|
</div>
|
||||||
<!-- <form action=""> -->
|
<!-- <form action=""> -->
|
||||||
<form action="<?= base_url() . "authenticate" ?>" method="post">
|
<form action="<?= base_url() . "authenticate" ?>" method="post">
|
||||||
@ -110,7 +110,7 @@
|
|||||||
<!-- end page -->
|
<!-- end page -->
|
||||||
|
|
||||||
<footer class="footer footer-alt">
|
<footer class="footer footer-alt">
|
||||||
<p> <?= date('Y') ?> © <?= "bigbamboobookpublish"; ?>.</p>
|
<p> <?= date('Y') ?> © <?= "bigbamboodonation"; ?>.</p>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
<!-- Vendor js -->
|
<!-- Vendor js -->
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="bname" class="col-form-label">Organization Name<span class="text-danger">*</span></label>
|
<label for="bname" class="col-form-label">Organization Name<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="bname" name="bname" value="<?= isset($businesses['title']) ? $businesses['title'] : '' ?>" placeholder="Business Name" required />
|
<input type="text" class="form-control" id="bname" name="bname" value="<?= isset($businesses['title']) ? $businesses['title'] : '' ?>" placeholder="Organization Name" required />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
@ -55,7 +55,7 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="bmobile" class="col-form-label">Organization Mobile Number<span class="text-danger">*</span></label>
|
<label for="bmobile" class="col-form-label">Organization Mobile Number<span class="text-danger">*</span></label>
|
||||||
<input type="number" class="form-control" name="bmobile" value="<?= isset($businesses['mobile_no']) ? $businesses['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required data-parsley-type="number" />
|
<input type="text" class="form-control" name="bmobile" value="<?= isset($businesses['mobile_no']) ? $businesses['mobile_no'] : '' ?>" placeholder="Mobile Number (Enter only numbers)" required data-parsley-type="number" maxlength="10" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
@ -63,10 +63,13 @@
|
|||||||
<input type="text" class="form-control" name="baddress" value="<?= isset($businesses['address']) ? $businesses['address'] : '' ?>" placeholder="Address (eg : 1234 Main St)" required />
|
<input type="text" class="form-control" name="baddress" value="<?= isset($businesses['address']) ? $businesses['address'] : '' ?>" placeholder="Address (eg : 1234 Main St)" required />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if (isset($businesses['loged_user'])) { ?>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="baddress" class="col-form-label">80G <span class="text-danger">*</span></label>
|
<label for="baddress" class="col-form-label">80G</label>
|
||||||
<input type="text" class="form-control" name="80G" value="<?= isset($businesses['80G']) ? $businesses['80G'] : '' ?>" placeholder="80G Tax Free" />
|
<input type="text" class="form-control" name="80G" value="<?= isset($businesses['80G']) ? $businesses['80G'] : '' ?>" placeholder="80G Tax Free" />
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
@ -84,26 +87,29 @@
|
|||||||
<input type="text" class="form-control" name="bzip" value="<?= isset($businesses['postal_code']) ? $businesses['postal_code'] : '' ?>" placeholder="Postal Code (Eg: Pincode)" required />
|
<input type="text" class="form-control" name="bzip" value="<?= isset($businesses['postal_code']) ? $businesses['postal_code'] : '' ?>" placeholder="Postal Code (Eg: Pincode)" required />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if (isset($businesses['loged_user'])) { ?>
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="bterms" class="col-form-label">Receipt Note</label>
|
<label for="bterms" class="col-form-label">Receipt Note</label>
|
||||||
<textarea class="form-control" id="terms" name="bterms" rows="5" cols="50"><?= isset($businesses['terms']) ? $businesses['terms'] : '' ?></textarea>
|
<textarea class="form-control" id="terms" name="bterms" rows="5" cols="50"><?= isset($businesses['terms']) ? $businesses['terms'] : '' ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<?php if (!empty($businesses['business_logo'])) { ?>
|
<?php if (!empty($businesses['business_logo'])) { ?>
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="bfile" class="col-form-label">Current Business Logo</label>
|
<label for="bfile" class="col-form-label">Current Organization Logo</label>
|
||||||
<img src="<?= base_url('public/uploads/' . $businesses['business_logo']) ?>" alt="Business Logo" class="preview-image" />
|
<img src="<?= base_url('public/uploads/' . $businesses['business_logo']) ?>" alt="Organization Logo" class="preview-image" />
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-12">
|
<div class="form-group col-md-12">
|
||||||
<label for="bfile" class="col-form-label">File</label>
|
<label for="bfile" class="col-form-label">Organization Logo</label>
|
||||||
<input type="file" class="form-control" style="border: 0px !important;" id="bfile" name="bfile" value="<?= isset($businesses['business_logo']) ? $businesses['business_logo'] : null ?>" multiple />
|
<input type="file" class="form-control" style="border: 0px !important;" id="bfile" name="bfile" value="<?= isset($businesses['business_logo']) ? $businesses['business_logo'] : null ?>" multiple />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= isset($businesses['business_id']) ? $businesses['business_id'] : '' ?>" />
|
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for Organization id" value="<?= isset($businesses['business_id']) ? $businesses['business_id'] : '' ?>" />
|
||||||
|
|
||||||
<?php if (!empty($businesses) && ($loggedin_person_role === 'sadmin')) { ?>
|
<?php if (!empty($businesses) && ($loggedin_person_role === 'sadmin')) { ?>
|
||||||
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
<div class="form-group text-right m-b-0 checkbox checkbox-purple">
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<thead class="thead-light">
|
<thead class="thead-light">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<th>Business Name</th>
|
<th>Organization Name</th>
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
<th>Mobile Number</th>
|
<th>Mobile Number</th>
|
||||||
<th>Address</th>
|
<th>Address</th>
|
||||||
|
|||||||
@ -27,8 +27,8 @@
|
|||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="donerType" class="col-form-label">Doner Type<span class="text-danger"> *</span></label>
|
<label for="DonorType" class="col-form-label">Donor Type<span class="text-danger"> *</span></label>
|
||||||
<select class="form-control" id="donerType" name="donerType" required>
|
<select class="form-control" id="DonorType" name="DonorType" required>
|
||||||
<option value="<?= isset($customer['doner_type']) ? $customer['doner_type'] : '' ?>"><?= isset($customer['doner_type']) ? ($customer['doner_type'] === 'option1' ? 'Individual' : ($customer['doner_type'] === 'option2' ? 'Organization' : 'Select Donor Type')) : 'Select Donor Type'; ?></option>
|
<option value="<?= isset($customer['doner_type']) ? $customer['doner_type'] : '' ?>"><?= isset($customer['doner_type']) ? ($customer['doner_type'] === 'option1' ? 'Individual' : ($customer['doner_type'] === 'option2' ? 'Organization' : 'Select Donor Type')) : 'Select Donor Type'; ?></option>
|
||||||
<option value="option1">Individual</option>
|
<option value="option1">Individual</option>
|
||||||
<option value="option2">Organization</option>
|
<option value="option2">Organization</option>
|
||||||
@ -54,13 +54,7 @@
|
|||||||
<input type="text" class="form-control" name="csname" value="<?= isset($customer['last_name']) ? $customer['last_name'] : '' ?>" placeholder="Last Name" required />
|
<input type="text" class="form-control" name="csname" value="<?= isset($customer['last_name']) ? $customer['last_name'] : '' ?>" placeholder="Last Name" required />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
|
||||||
<label for="cmail" class="col-form-label"><span class="contactPerson">Contact Person </span>Email</label>
|
|
||||||
<input type="text" class="form-control" id="cmail" name="cmail" value="<?= isset($customer['email']) ? $customer['email'] : '' ?>" placeholder="Email" onkeyup="validateEmail(this.value)" />
|
|
||||||
<span id="emailValidationMessage"></span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-row">
|
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="cmobile" class="col-form-label"><span class="contactPerson">Contact Person </span>Mobile<span class="text-danger"> *</span></label>
|
<label for="cmobile" class="col-form-label"><span class="contactPerson">Contact Person </span>Mobile<span class="text-danger"> *</span></label>
|
||||||
<div class="input-group mb-2">
|
<div class="input-group mb-2">
|
||||||
@ -71,19 +65,27 @@
|
|||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
</div>
|
||||||
<label for="dob" class="col-form-label">Date Of Birth</label>
|
|
||||||
<input type="date" class="form-control" name="dob" value="<?= isset($customer['date_of_birth']) ? $customer['date_of_birth'] : '' ?>" placeholder="Date Of Birth" />
|
<div class="form-row">
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label for="cmail" class="col-form-label"><span class="contactPerson">Contact Person </span>Email</label>
|
||||||
|
<input type="text" class="form-control" id="cmail" name="cmail" value="<?= isset($customer['email']) ? $customer['email'] : '' ?>" placeholder="Email" onkeyup="validateEmail(this.value)" />
|
||||||
|
<span id="emailValidationMessage"></span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- <div class="form-group col-md-4">
|
||||||
|
<label for="dob" class="col-form-label">Date Of Birth</label>
|
||||||
|
<input type="date" class="form-control" name="dob" value="" placeholder="Date Of Birth" />
|
||||||
|
</div> -->
|
||||||
|
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="csname" class="col-form-label">PAN<span class="text-danger"> *</span></label>
|
<label for="csname" class="col-form-label"><span class="contactPerson">Organization </span>PAN Number</label>
|
||||||
<input type="text" class="form-control" name="pan_no" value="<?= isset($customer['pan_no']) ? $customer['pan_no'] : '' ?>" placeholder="PAN Number" required />
|
<input type="text" class="form-control" name="pan_no" value="<?= isset($customer['pan_no']) ? $customer['pan_no'] : '' ?>" placeholder="PAN Number" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<input type="hidden" id="doner_id" name="doner_id" placeholder="hidden for customer id" value="<?= isset($customer['doner_id']) ? $customer['doner_id'] : '' ?>" />
|
<input type="hidden" id="doner_id" name="doner_id" placeholder="hidden for Donor id" value="<?= isset($customer['doner_id']) ? $customer['doner_id'] : '' ?>" />
|
||||||
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
|
<input type="hidden" id="business_id" name="business_id" placeholder="hidden for business id" value="<?= $session_bid ?>" />
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
|
||||||
<br />
|
<br />
|
||||||
@ -94,56 +96,40 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="baddress1" class="col-form-label">Address<span class="text-danger"> *</span></label>
|
<label for="baddress1" class="col-form-label">Address</label>
|
||||||
<textarea type="text" class="form-control" id="baddress1" name="address" placeholder="Address (eg : 1234 Main St)" required style="width:202%"><?= isset($customer['address']) ? $customer['address'] : '' ?></textarea>
|
<textarea type="text" class="form-control" id="baddress1" name="address" placeholder="Address (eg : 1234 Main St)" style="width:202%"><?= isset($customer['address']) ? $customer['address'] : '' ?></textarea>
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="bcountry" class="col-form-label">Country<span class="text-danger"> *</span></label>
|
<label for="bcountry" class="col-form-label">Country</label>
|
||||||
<select class="form-control" id="bcountry" name="country" required>
|
<select class="form-control" id="bcountry" name="country">
|
||||||
<option value=""><?= isset($customer['country']) ? $customer['country'] : ''?><?= isset($customer['country']) ? '' : 'Choose your Country';?></option>
|
<option value="<?= isset($customer['country']) ? $customer['country'] : '';?>"><?= isset($customer['country']) ? $customer['country'] : 'Choose your Country';?></option>
|
||||||
<?php foreach ($country_details as $value) { ?>
|
<?php foreach ($country_details as $value) { ?>
|
||||||
<option value="<?php echo $value['country_name']; ?>">
|
<option value="<?php echo $value['country_name']; ?>">
|
||||||
<?php
|
<?php
|
||||||
if($customer['country'] === $value['country_name']){
|
echo $value['country_name'];
|
||||||
|
|
||||||
echo $value['country_name'];
|
|
||||||
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
|
|
||||||
echo $value['country_name'];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</option>
|
</option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</select>
|
</select>
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<div id="billinput" style="display: block">
|
<div id="billinput" style="display: block">
|
||||||
<label for="bistate" class="col-form-label">State</label>
|
<label for="bistate" class="col-form-label">State</label>
|
||||||
<input type="text" class="form-control" id="bistate" name="state_text" placeholder="State" value="<?= isset($customer['state']) ? $customer['state'] : ''?>"/>
|
<input type="text" class="form-control" id="bistate" name="state_text" placeholder="State" value="<?= isset($customer['state']) ? $customer['state'] : ''?>"/>
|
||||||
<!-- <div class="invalid-feedback"> Please provide. </div> -->
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="bcity" class="col-form-label">City<span class="text-danger"> *</span></label>
|
<label for="bcity" class="col-form-label">City</label>
|
||||||
<input type="text" class="form-control" id="bcity" name="city" value="<?= isset($customer['city']) ? $customer['city'] : '' ?>" placeholder="City" required />
|
<input type="text" class="form-control" id="bcity" name="city" value="<?= isset($customer['city']) ? $customer['city'] : '' ?>" placeholder="City" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
<div class="invalid-feedback"> Please provide. </div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="bzip" class="col-form-label">Postal Code<span class="text-danger"> *</span></label>
|
<label for="bzip" class="col-form-label">Postal Code</label>
|
||||||
<input type="text" class="form-control" id="bzip" name="zip" value="<?= isset($customer['postal_code']) ? $customer['postal_code'] : '' ?>" placeholder="Postal Code" required pattern="\d*" maxlength="10" />
|
<input type="text" class="form-control" id="bzip" name="zip" value="<?= isset($customer['postal_code']) ? $customer['postal_code'] : '' ?>" placeholder="Postal Code" pattern="\d*" maxlength="10" />
|
||||||
<div class="invalid-feedback"> Please provide. </div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" id="bcustomer_address_id" name="bcustomer_address_id[]" placeholder="hidden for billing customer address id" />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
@ -158,12 +144,10 @@
|
|||||||
|
|
||||||
<div class="form-group text-right m-b-0">
|
<div class="form-group text-right m-b-0">
|
||||||
|
|
||||||
<button class="btn btn-success waves-effect waves-light mr-1" id="submitBtn" type="submit">Submit</button>
|
<button class="btn btn-success waves-effect waves-light mr-1" id="submitBtn" type="submit"><?= isset($customer['doner_id']) ? 'Update' : 'Submit' ?></button>
|
||||||
<!-- <button type="reset" class="btn btn-primary waves-effect mr-1">Reset</button> -->
|
<button type="reset" class="btn btn-primary waves-effect mr-1">Reset</button>
|
||||||
<button type="button" class="btn btn-primary waves-effect mr-1" onclick="refreshPage()">Reset</button>
|
|
||||||
<a href="<?= base_url() . "customer_list"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
<a href="<?= base_url() . "customer_list"; ?>" class="btn btn-secondary waves-effect">Cancel</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div><!-- end customer Details Tab -->
|
</div><!-- end customer Details Tab -->
|
||||||
@ -173,199 +157,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <script>
|
|
||||||
$("#addressCopiedAsShipping").on("change", function() {
|
|
||||||
var count = $(".after-shipping-addr-add-more").length;
|
|
||||||
var counter = $("#counter").val() === "" ? count : parseInt($("#counter").val(), 10);
|
|
||||||
|
|
||||||
if ($(this).is(":checked")) {
|
|
||||||
var customerAddress1 = $("#baddress1").val();
|
|
||||||
var customerAddress2 = $("#baddress2").val();
|
|
||||||
var customerCountry = $("#bcountry").val();
|
|
||||||
var customerDropdownState = $("#bdstate").val();
|
|
||||||
var customerInputState = $("#bistate").val();
|
|
||||||
var customerCity = $("#bcity").val();
|
|
||||||
var customerPostalCode = $("#bzip").val();
|
|
||||||
|
|
||||||
$("#saddress1").val(customerAddress1).prop("readonly", false);
|
|
||||||
$("#saddress2").val(customerAddress2).prop("readonly", false);
|
|
||||||
$("#scountry"+counter).val(customerCountry).prop("readonly", false);
|
|
||||||
if (customerCountry == 'IN') {
|
|
||||||
$("#sistate"+counter).val(customerInputState).css("display", "none").prop("readonly", false);
|
|
||||||
$("#sdstate"+counter).val(customerDropdownState).css("display", "block").prop("readonly", false);
|
|
||||||
} else {
|
|
||||||
$("#sistate"+counter).val(customerInputState).css("display", "block").prop("readonly", false);
|
|
||||||
$("#sdstate"+counter).val(customerDropdownState).css("display", "none").prop("readonly", false);
|
|
||||||
}
|
|
||||||
$("#scity").val(customerCity).prop("readonly", false);
|
|
||||||
$("#szip").val(customerPostalCode).prop("readonly", false);
|
|
||||||
$("#counter").val(counter++).prop("readonly", true);
|
|
||||||
} else {
|
|
||||||
// Clear the billing address fields when the checkbox is unchecked
|
|
||||||
$("#saddress1").val("").prop("readonly", false);
|
|
||||||
$("#saddress2").val("").prop("readonly", false);
|
|
||||||
$("#scity").val("").prop("readonly", false);
|
|
||||||
$("#scountry"+counter).val("").prop("readonly", false);
|
|
||||||
$("#sistate"+counter).val("").css("display", "block").prop("readonly", false);
|
|
||||||
$("#sdstate"+counter).val("").css("display", "none").prop("readonly", false);
|
|
||||||
$("#szip").val("").prop("readonly", false);
|
|
||||||
$("#scustomer_address_id").val("") // Hidden Field ressetted bcoz Adress history
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("#bcountry").on("change", function() {
|
|
||||||
var country = $("#bcountry").val();
|
|
||||||
var dropdownField = $("#billdropdown");
|
|
||||||
var textField = $("#billinput");
|
|
||||||
if (country === 'IN') {
|
|
||||||
dropdownField.show();
|
|
||||||
textField.hide();
|
|
||||||
} else {
|
|
||||||
dropdownField.hide();
|
|
||||||
textField.show();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
|
||||||
|
|
||||||
if (barray.length > 0) {
|
|
||||||
for (var i = 0; i < barray.length; i++) {
|
|
||||||
$("#baddress1").val(barray[i]['address_1']);
|
|
||||||
$("#baddress2").val(barray[i]['address_2']);
|
|
||||||
$("#bcountry").val(barray[i]['country']);
|
|
||||||
$("#bcity").val(barray[i]['city']);
|
|
||||||
if (barray[i]['country'] == 'IN') {
|
|
||||||
$("#bdstate").val(barray[i]['state']);
|
|
||||||
$("#billdropdown").show();
|
|
||||||
$("#billinput").hide();
|
|
||||||
} else {
|
|
||||||
$("#bistate").val(barray[i]['state']);
|
|
||||||
$("#billdropdown").hide();
|
|
||||||
$("#billinput").show();
|
|
||||||
|
|
||||||
}
|
|
||||||
$("#bzip").val(barray[i]['postal_code']);
|
|
||||||
$('#bcustomer_address_id').val(barray[i]['customer_address_id']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************************/
|
|
||||||
|
|
||||||
if (sarray.length > 0) {
|
|
||||||
j = 0;
|
|
||||||
for (var i = 0; i < sarray.length; i++) {
|
|
||||||
if (i == 0) {
|
|
||||||
var html = $(".after-shipping-addr-add-more").first();
|
|
||||||
} else {
|
|
||||||
var html = $(".after-shipping-addr-add-more").first().clone();
|
|
||||||
}
|
|
||||||
if ((barray[0]['address_1'] == sarray[i]['address_1']) &&
|
|
||||||
(barray[0]['city'] == sarray[i]['city']) &&
|
|
||||||
(barray[0]['state'] == sarray[i]['state']) &&
|
|
||||||
(barray[0]['country'] == sarray[i]['country']) &&
|
|
||||||
(barray[0]['postal_code'] == sarray[i]['postal_code'])) {
|
|
||||||
$("#addressCopiedAsShipping").prop("checked", true);
|
|
||||||
}
|
|
||||||
html.find('input#scustomer_address_id').val(sarray[i]['customer_address_id']);
|
|
||||||
html.find('input#saddress1').val(sarray[i]['address_1']);
|
|
||||||
html.find('input#saddress2').val(sarray[i]['address_2']);
|
|
||||||
html.find('input#scity').val(sarray[i]['city']);
|
|
||||||
html.find('select#scountry0').val(sarray[i]['country']);
|
|
||||||
html.find('select#scountry0').attr('id', 'scountry' + j);
|
|
||||||
html.find('input#counter').val(j).prop("readonly", true);
|
|
||||||
if (sarray[i]['country'] === 'IN') {
|
|
||||||
// html.find('select#sdstate0').attr('id','sdstate'+$j).val(sarray[i]['state']);
|
|
||||||
html.find('select#sdstate0').attr('id', 'sdstate' + j).css("display", "block").val(sarray[i]['state']);
|
|
||||||
html.find('input#sistate0').attr('id', 'sistate' + j).css("display", "none").val('');
|
|
||||||
} else {
|
|
||||||
html.find('input#sistate0').attr('id', 'sistate' + j).css("display", "block").val(sarray[i]['state']);
|
|
||||||
html.find('select#sdstate0').attr('id', 'sdstate' + j).css("display", "none").val('');
|
|
||||||
}
|
|
||||||
|
|
||||||
html.find('input#szip').val(sarray[i]['postal_code']);
|
|
||||||
if (i !== 0) {
|
|
||||||
html.find(".shipping-addr-div-change").html("<a class='btn btn-success waves-effect waves-light mr-1 shipping-addr-add-more'>+ Add More Shipping Address </a><a class='btn btn-danger waves-effect waves-light mr-1 shipping-addr-remove'>- Remove </a>");
|
|
||||||
html.insertAfter(".after-shipping-addr-add-more:last");
|
|
||||||
}
|
|
||||||
j++;
|
|
||||||
toggleButtons();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
toggleButtons();
|
|
||||||
}
|
|
||||||
|
|
||||||
$("body").on("click", ".shipping-addr-add-more", function() {
|
|
||||||
var html = $(".after-shipping-addr-add-more").first().clone();
|
|
||||||
var count = $(".after-shipping-addr-add-more").length;
|
|
||||||
html.find('select#scountry0').attr('id', 'scountry' + count).val('')
|
|
||||||
html.find('select#sdstate0').attr('id', 'sdstate' + count).css("display", "none").val('');
|
|
||||||
html.find('input#sistate0').attr('id', 'sistate' + count).css("display", "block").val('');
|
|
||||||
html.find('input').val(''); // Clear input values in the cloned element
|
|
||||||
html.find('input#counter').val(count).prop("readonly", true);
|
|
||||||
html.find(".shipping-addr-div-change").html("<a class='btn btn-success waves-effect waves-light mr-1 shipping-addr-add-more'>+ Add More Shipping Address </a><a class='btn btn-danger waves-effect waves-light mr-1 shipping-addr-remove'>- Remove </a>");
|
|
||||||
html.insertAfter(".after-shipping-addr-add-more:last");
|
|
||||||
toggleButtons();
|
|
||||||
});
|
|
||||||
|
|
||||||
$("body").on("click", ".shipping-addr-remove", function() {
|
|
||||||
var rows = $(".after-shipping-addr-add-more");
|
|
||||||
if (rows.length > 1) {
|
|
||||||
$(this).parents(".after-shipping-addr-add-more").remove();
|
|
||||||
} else {
|
|
||||||
alert("At least one Shipping Address must be displayed.");
|
|
||||||
}
|
|
||||||
toggleButtons();
|
|
||||||
// if($('#addressCopiedAsShipping').is(':checked')){}
|
|
||||||
// else{ $('#addressCopiedAsShipping').prop("checked", false); }
|
|
||||||
});
|
|
||||||
|
|
||||||
function toggleButtons() {
|
|
||||||
var elementCount = $(".after-shipping-addr-add-more").length;
|
|
||||||
// console.log('elementCount == ' + elementCount);
|
|
||||||
if (elementCount > 1) {
|
|
||||||
$(".shipping-addr-remove").show(); // Show the "shipping-addr-remove" buttons
|
|
||||||
} else {
|
|
||||||
$(".shipping-addr-remove").hide(); // Hide the "shipping-addr-remove" buttons
|
|
||||||
}
|
|
||||||
$(".after-shipping-addr-add-more .shipping-addr-add-more").hide();
|
|
||||||
$(".after-shipping-addr-add-more:last .shipping-addr-add-more").show();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$('#submit-button').click(function() {
|
|
||||||
// Disable the button
|
|
||||||
$(this).prop('disabled', true);
|
|
||||||
|
|
||||||
// Change the button content to a spinner
|
|
||||||
$(this).html('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> Loading...');
|
|
||||||
|
|
||||||
// Simulate a delay to demonstrate loading (you can replace this with your actual loading logic)
|
|
||||||
setTimeout(function() {
|
|
||||||
// Re-enable the button and restore the original text
|
|
||||||
$('#submit-button').prop('disabled', false);
|
|
||||||
$('#submit-button').html('Submit');
|
|
||||||
}, 3000); // Replace 3000 with the actual loading time in milliseconds
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
function changeFields(element) {
|
|
||||||
var selectedValue = $(element).val();
|
|
||||||
var elementId = $(element).attr('id');
|
|
||||||
var match = elementId.match(/\d+/);
|
|
||||||
if (match) {
|
|
||||||
var idnumber = parseInt(match[0], 10);
|
|
||||||
if (selectedValue == 'IN') {
|
|
||||||
$("#sdstate" + idnumber).show();
|
|
||||||
$("#sistate" + idnumber).hide();
|
|
||||||
} else {
|
|
||||||
$("#sdstate" + idnumber).hide();
|
|
||||||
$("#sistate" + idnumber).show();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// alert("No number found in the ID");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script> -->
|
|
||||||
<script>
|
<script>
|
||||||
document.getElementById('myForm').addEventListener('submit', function(event) {
|
document.getElementById('myForm').addEventListener('submit', function(event) {
|
||||||
var form = event.target;
|
var form = event.target;
|
||||||
@ -427,11 +219,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$('#donerType').on('change', function(){
|
$('#DonorType').on('change', function(){
|
||||||
|
|
||||||
let donerType = $(this).val();
|
let DonorType = $(this).val();
|
||||||
|
|
||||||
if(donerType === 'option2'){
|
if(DonorType === 'option2'){
|
||||||
$('#org_name').show();
|
$('#org_name').show();
|
||||||
$('.contactPerson').show();
|
$('.contactPerson').show();
|
||||||
$('#org_name_field').prop('required', true);
|
$('#org_name_field').prop('required', true);
|
||||||
@ -445,6 +237,4 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -3,7 +3,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<a href="<?= base_url()."view_customer_group/0"; ?>" class="btn btn-primary"><i class="ri-team-line"></i> Add Doner Group </a>
|
<a href="<?= base_url()."view_customer_group/0"; ?>" class="btn btn-primary"><i class="ri-team-line"></i> Add Donor Group </a>
|
||||||
</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>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<a href="<?= base_url() . "new_doner/0"; ?>" class="btn btn-primary"><i class="ri-map-pin-user-fill"></i> Add Doner </a>
|
<a href="<?= base_url() . "new_Donor/0"; ?>" class="btn btn-primary"><i class="ri-map-pin-user-fill"></i> Add Donor </a>
|
||||||
</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>
|
||||||
@ -39,11 +39,15 @@
|
|||||||
<?php foreach ($customer as $value) :?>
|
<?php foreach ($customer as $value) :?>
|
||||||
<tr>
|
<tr>
|
||||||
<td hidden><?$value['doner_id'];?></td>
|
<td hidden><?$value['doner_id'];?></td>
|
||||||
<td><?= $value['first_name'].' '.$value['last_name'] ; ?></td>
|
<?php if($value['doner_type'] == 'option2') { ?>
|
||||||
|
<td><?= $value['org_name']; ?></td>
|
||||||
|
<?php } else { ?>
|
||||||
|
<td><?= $value['first_name'].' '.$value['last_name'] ; ?></td>
|
||||||
|
<?php } ?>
|
||||||
<td><?= $value['mobile_no']; ?></td>
|
<td><?= $value['mobile_no']; ?></td>
|
||||||
<td><?= $value['email']; ?></td>
|
<td><?= $value['email']; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<a href="<?= "new_doner/" . $value['doner_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
|
<a href="<?= "new_Donor/" . $value['doner_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
|
||||||
<a href="<?= "delete_customer/" . $value['doner_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
|
<a href="<?= "delete_customer/" . $value['doner_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -13,9 +13,9 @@
|
|||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="customerName" class="col-form-label">Doner Name<span class="text-danger"> *</span></label>
|
<label for="customerName" class="col-form-label">Donor Name<span class="text-danger"> *</span></label>
|
||||||
<select class="form-control" id="customerName" name="doner_id" required data-toggle="select2">
|
<select class="form-control" id="customerName" name="doner_id" required data-toggle="select2">
|
||||||
<option value="">Select a Doner</option>
|
<option value="">Select a Donor</option>
|
||||||
<?php foreach ($customers as $customer) : ?>
|
<?php foreach ($customers as $customer) : ?>
|
||||||
<option value="<?= $customer->doner_id ?>" <?php if (isset($receipt_details['doner_id']) && ($receipt_details['doner_id'] === $customer->doner_id)) echo "selected"; ?>><?= $customer->first_name . ' ' . $customer->last_name; ?></option>
|
<option value="<?= $customer->doner_id ?>" <?php if (isset($receipt_details['doner_id']) && ($receipt_details['doner_id'] === $customer->doner_id)) echo "selected"; ?>><?= $customer->first_name . ' ' . $customer->last_name; ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@ -85,4 +85,49 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- <script>
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
var custid = "<?= isset($receipt_details['doner_id']) ? $receipt_details['doner_id'] : ""; ?>";
|
||||||
|
var inv_number = "<?= isset($receipt_details['invoice_number']) ? $receipt_details['invoice_number'] : ""; ?>";
|
||||||
|
|
||||||
|
if (inv_number != '') {
|
||||||
|
$("#invoiceNumber").val(inv_number).prop("readonly", true);
|
||||||
|
}else{
|
||||||
|
var numbering_arr = <?php echo json_encode($invoice_number_formatting); ?>;
|
||||||
|
console.log('numbering_arr', numbering_arr);
|
||||||
|
var filtered_data = $.grep(numbering_arr, function(item) {
|
||||||
|
return item.id === '1';
|
||||||
|
});
|
||||||
|
var final_sno = generateSerialNumber(filtered_data);
|
||||||
|
$("#invoiceNumber").val(final_sno).prop("readonly", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function generateSerialNumber(filtered_data) {
|
||||||
|
|
||||||
|
var next_id_string = filtered_data[0].next_id;
|
||||||
|
var left_pad_string = filtered_data[0].left_pad;
|
||||||
|
var prefix_string = String(filtered_data[0].id_formating);
|
||||||
|
|
||||||
|
var left_pad_numberic = parseInt(left_pad_string);
|
||||||
|
var next_id_numberic = parseInt(next_id_string);
|
||||||
|
|
||||||
|
var padded_id = next_id_string.padStart(left_pad_numberic, '0');
|
||||||
|
|
||||||
|
var serial_number = prefix_string + '-' + padded_id;
|
||||||
|
next_id_numberic++;
|
||||||
|
$("#hiddenNextId").val(next_id_numberic).prop("readonly", true);
|
||||||
|
|
||||||
|
return serial_number;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
</script> -->
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<th hidden></th>
|
<th hidden></th>
|
||||||
<th align="center" >Receipt Number</th>
|
<th align="center" >Receipt Number</th>
|
||||||
<th align="center" >Receipt Date</th>
|
<th align="center" >Receipt Date</th>
|
||||||
<th align="center" >Doner Name</th>
|
<th align="center" >Donor Name</th>
|
||||||
<th align="center" >Amount</th>
|
<th align="center" >Amount</th>
|
||||||
<th align="center">Action</th>
|
<th align="center">Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -45,8 +45,8 @@
|
|||||||
<td><?= $row['receipt_number']; ?></td>
|
<td><?= $row['receipt_number']; ?></td>
|
||||||
<td><?= date("d-m-Y", strtotime($row['receipt_date'])); ?> </td>
|
<td><?= date("d-m-Y", strtotime($row['receipt_date'])); ?> </td>
|
||||||
<td >
|
<td >
|
||||||
<?php foreach ($doners as $donerData) : ?>
|
<?php foreach ($Donors as $DonorData) : ?>
|
||||||
<?= $row['doner_id'] === $donerData->doner_id ? $donerData->first_name : ''; ?>
|
<?= $row['doner_id'] === $DonorData->doner_id ? $DonorData->first_name . $DonorData->last_name : ''; ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</td>
|
</td>
|
||||||
<td><?= $row['amount']; ?></td>
|
<td><?= $row['amount']; ?></td>
|
||||||
|
|||||||
@ -1,213 +1,90 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<title>Report PDF</title>
|
||||||
<style>
|
<style>
|
||||||
/* Add your CSS styles here to format the invoice for mPDF */
|
|
||||||
body {
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
font-family: 'Times New Roman', Times, sans-serif;
|
background-color: #f4f4f4;
|
||||||
|
margin: 0;
|
||||||
font-size: 12px; /* Change this value to your desired font size */
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
.page {
|
||||||
/* Style for the main table with border */
|
max-width: 800px;
|
||||||
table.main-table {
|
margin: 0 auto;
|
||||||
width: 100%;
|
background-color: #fff;
|
||||||
border-collapse: collapse;
|
border: 2px solid #000;
|
||||||
border: 1px solid black; /* Add a border around the entire invoice */
|
padding: 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start; /* Align items to the start of the flex container */
|
||||||
}
|
}
|
||||||
|
.logo {
|
||||||
table.main-table th,
|
margin-right: 20px; /* Add some space between the logo and details */
|
||||||
table.main-table td {
|
|
||||||
border: none; /* Remove borders from all cells inside the main table */
|
|
||||||
padding: 8px;
|
|
||||||
}
|
}
|
||||||
|
.company-details {
|
||||||
/* Style for the table containing business details */
|
|
||||||
table.business-details-table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.business-details-table td {
|
|
||||||
padding: 8px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Style for the business logo and title */
|
|
||||||
.business-logo-container {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
img.business-logo {
|
|
||||||
max-width: 200px; /* Adjust the size of the logo */
|
|
||||||
float: right;
|
|
||||||
position: relative;
|
|
||||||
left: 45%;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Style for the business name */
|
|
||||||
.business-name {
|
|
||||||
font-size: 16px;
|
|
||||||
font-weight: bold;
|
|
||||||
margin-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Style for the table containing invoice info */
|
|
||||||
table.invoice-info-table {
|
|
||||||
width: 100%;
|
|
||||||
font-size: large;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.invoice-info-table th,
|
|
||||||
table.invoice-info-table td {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Style for the addresses table */
|
|
||||||
table.addresses-table {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.addresses-table th {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Style for the billing and shipping addresses */
|
|
||||||
.billing-address {
|
|
||||||
width: 50%;
|
|
||||||
font-size: x-large;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Style for the invoice-related table */
|
|
||||||
table.invoice-related-table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.invoice-related-table th,
|
|
||||||
table.invoice-related-table td {
|
|
||||||
border: none; /* Remove borders from all cells in the invoice items table */
|
|
||||||
padding: 8px;
|
|
||||||
text-align: center; /* Center-align text in cells */
|
|
||||||
}
|
|
||||||
|
|
||||||
table.invoice-related-table th {
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Style for the business stamp and terms */
|
|
||||||
.business-stamp, .terms {
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 20px;
|
flex: 1; /* Allow the details to expand and take available space */
|
||||||
|
}
|
||||||
|
img.logo-img {
|
||||||
|
max-width: 200px;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
.section {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
padding-bottom: 20px;
|
||||||
|
border-bottom: 2px solid #000;
|
||||||
|
}
|
||||||
|
.section-header {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 24px;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
.section-content {
|
||||||
|
font-size: 16px;
|
||||||
|
color: #666;
|
||||||
}
|
}
|
||||||
.subtotal-table {
|
|
||||||
width: 100%;
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.subtotal-table table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
border: 1px solid black; /* Add a border around the subtotal table */
|
|
||||||
}
|
|
||||||
|
|
||||||
.subtotal-table th,
|
|
||||||
.subtotal-table td {
|
|
||||||
border: none; /* Remove borders from cells inside the subtotal table */
|
|
||||||
padding: 8px;
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
.subtotal-table th {
|
|
||||||
background-color: #f2f2f2;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.subtotal-table td:last-child {
|
|
||||||
font-weight: bold; /* Make the last column (total values) bold */
|
|
||||||
}
|
|
||||||
td.invoice-number {
|
|
||||||
font-size: 18px; /* Increase font size to your desired value */
|
|
||||||
/* Highlight background color */
|
|
||||||
font-weight: bold; /* Make the text bold */
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-details{
|
|
||||||
position: relative;
|
|
||||||
bottom: 75px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.org-receipt{
|
|
||||||
position: relative;
|
|
||||||
top: 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<table class="main-table">
|
<div class="page">
|
||||||
<tr>
|
<div class="logo">
|
||||||
<td>
|
<img src="https://images.rawpixel.com/image_800/czNmcy1wcml2YXRlL3Jhd3BpeGVsX2ltYWdlcy93ZWJzaXRlX2NvbnRlbnQvbHIvczkzLXBtLTI3NTcuanBn.jpg" alt="Company Logo" class="logo-img">
|
||||||
<table class="business-details-table">
|
</div>
|
||||||
<?php foreach ($data as $value) : ?>
|
<div class="company-details">
|
||||||
<tr>
|
<div class="section-header">Company Details</div>
|
||||||
<div class="business-logo-container">
|
<div class="section-content">
|
||||||
<img src="https://vijayabharathambooks.com/wp-content/uploads/2021/09/vijaya-bharatham-logo-8pt.png" alt="Business Logo" class="business-logo">
|
<!-- Replace this with company details -->
|
||||||
</div>
|
<p><?= $data->title ?></p>
|
||||||
</tr>
|
<p><?= $data->address ?></p>
|
||||||
<tr>
|
<p><?= $data->postal_code ?></p>
|
||||||
<td class= "org-details">
|
</div>
|
||||||
<p><h1><?= $value->title;?></h1></p>
|
</div>
|
||||||
<span><?= $value->address ?>,<br><?= $value->city ?>, <?= $value->state ?>, <?= $value->postal_code ?> . </span><br>
|
</div>
|
||||||
<span>email : <?= $value->email ?></span><br>
|
</div>
|
||||||
<span>mobile :<?= $value->mobile_no ?></span><br>
|
<div class="section">
|
||||||
</td>
|
<div class="section-header">Donation Receipt</div>
|
||||||
</tr>
|
<div class="section-content">
|
||||||
<?php endforeach; ?>
|
<!-- Replace this with customer details -->
|
||||||
</table>
|
<p>Receipt No: <?=$data->receipt_number?></p>
|
||||||
</td>
|
<p>Donor Name: <?=$data->customer_name?></p>
|
||||||
<td class="org-receipt">
|
<p>Amount: <?=$data->amount?></p>
|
||||||
<table class="invoice-info-table">
|
<p>Contact Number: <?=$data->mobile_no?></p>
|
||||||
<?php foreach ($data as $value) : ?>
|
<p>PAN No: <?=$data->pan_no?></p>
|
||||||
<tr>
|
<p>Donation Date: <?=$data->receipt_date?></p>
|
||||||
<th>Receipt # : <?= $value->receipt_number ?></th>
|
<!-- Add other customer details here -->
|
||||||
</tr>
|
</div>
|
||||||
<tr>
|
</div>
|
||||||
<th>ORG PAN Number : <?= $value->pan_no ?></th>
|
<div class="section">
|
||||||
</tr>
|
<div class="section-header">Company Contact Details</div>
|
||||||
<tr>
|
<div class="section-content">
|
||||||
<th>ORG Reg Number : <?= $value->org_reg_no ?></th>
|
<!-- Replace this with company contact details -->
|
||||||
</tr>
|
<p>Email: contact@company.com</p>
|
||||||
<?php endforeach; ?>
|
<p>Phone: +9876543210</p>
|
||||||
</table>
|
<!-- Add other contact details here -->
|
||||||
</td>
|
</div>
|
||||||
</tr>
|
</div>
|
||||||
</table>
|
|
||||||
|
|
||||||
<table class="addresses-table">
|
|
||||||
<tr>
|
|
||||||
<th class="billing-address">Donar Details</th><br><br>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class="billing-address">
|
|
||||||
<?php foreach ($data as $value) : ?>
|
|
||||||
<p><b>Donated By</b> : <?= $value->customer_name ?></p>
|
|
||||||
<p><b>Doner PAN Number</b> : <?= $value->cust_pan_no ?></p>
|
|
||||||
<p><b>Address</b> : <?= $value->address ?></p>
|
|
||||||
<p><b>Date of Donation</b> : <?= isset($value->receipt_date) ? date("d-m-Y", strtotime($value->receipt_date)) : '' ?></p>
|
|
||||||
<p><b>Donated via</b> : <?= $value->payment_mode ?></p>
|
|
||||||
<p><b>Donation Amount</b> : <?= $value->amount ?></p>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<br> <br>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -126,9 +126,9 @@
|
|||||||
</li>
|
</li>
|
||||||
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."doner_list"; ?>">
|
<a href="<?= base_url()."Donor_list"; ?>">
|
||||||
<i class="ri-map-pin-user-fill"></i>
|
<i class="ri-map-pin-user-fill"></i>
|
||||||
<span> Doners </span>
|
<span> Donors </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -140,20 +140,6 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<!-- <li>
|
|
||||||
<a href="<?= base_url()."subscribers_list"; ?>">
|
|
||||||
<i class="ri-shield-user-line"></i>
|
|
||||||
<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' && $loggedin_person_role !== 'sadmin') : ?>
|
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."causes_list"; ?>">
|
<a href="<?= base_url()."causes_list"; ?>">
|
||||||
@ -162,6 +148,14 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
<?php if ($loggedin_person_role === 'sadmin') : ?>
|
||||||
|
<li>
|
||||||
|
<a href="<?= base_url()."business_list"; ?>">
|
||||||
|
<i class="ri-map-pin-user-fill"></i>
|
||||||
|
<span> Organizations </span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<?php endif; ?>
|
||||||
<?php if ($loggedin_person_role !== 'manager') : ?>
|
<?php if ($loggedin_person_role !== 'manager') : ?>
|
||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."user_list"; ?>">
|
<a href="<?= base_url()."user_list"; ?>">
|
||||||
@ -174,15 +168,7 @@
|
|||||||
<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> ORG Settings </span>
|
<span> Org Settings </span>
|
||||||
</a>
|
|
||||||
</li>
|
|
||||||
<?php endif; ?>
|
|
||||||
<?php if ($loggedin_person_role === 'sadmin') : ?>
|
|
||||||
<li>
|
|
||||||
<a href="<?= base_url()."business_list"; ?>">
|
|
||||||
<i class="ri-list-settings-line"></i>
|
|
||||||
<span> Organizations </span>
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
@ -207,13 +193,13 @@
|
|||||||
<li>
|
<li>
|
||||||
<a href="<?= base_url()."customer_group"; ?>">
|
<a href="<?= base_url()."customer_group"; ?>">
|
||||||
<i class="ri-team-line"></i>
|
<i class="ri-team-line"></i>
|
||||||
<span> Doner Groups </span>
|
<span> Donor Groups </span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
||||||
<li>
|
<!-- <li>
|
||||||
<a href="#reportLayouts" data-toggle="collapse">
|
<a href="#reportLayouts" data-toggle="collapse">
|
||||||
<i class="ri-file-chart-fill"></i>
|
<i class="ri-file-chart-fill"></i>
|
||||||
<span> Reports </span>
|
<span> Reports </span>
|
||||||
@ -232,7 +218,7 @@
|
|||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li> -->
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
||||||
|
|||||||
@ -76,7 +76,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
<?php if ($loggedin_person_role !== 'manager' && $loggedin_person_role !== 'sadmin') : ?>
|
||||||
<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> Org Setting </span>
|
<i class="ri-briefcase-4-fill"></i><span> Profile Setting </span>
|
||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
|
|||||||
@ -9,13 +9,27 @@
|
|||||||
<form class="parsley-examples" action="<?= base_url() . "insert_users"; ?>" method="post" enctype="multipart/form-data" id="myForm">
|
<form class="parsley-examples" action="<?= base_url() . "insert_users"; ?>" method="post" enctype="multipart/form-data" id="myForm">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
|
||||||
|
<?php if ($loggedin_person_role === 'sadmin') { ?>
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label for="business_id" class="col-form-label">Organization<span class="text-danger"></span></label>
|
||||||
|
<select id="business_id" name="business_id" class="form-control" required>
|
||||||
|
<option value="">Choose Organization</option>
|
||||||
|
<?php foreach ($business_details as $value) { ?>
|
||||||
|
<option value="<?php echo $value['business_id']; ?>" <?php if (isset($details['business_id']) && ($details['business_id'] === $value['business_id'])) echo "selected"; ?>>
|
||||||
|
<?php echo $value['title']; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
<div class="form-group col-md-4">
|
||||||
<label for="email" class="col-form-label">Email<span class="text-danger">*</span></label>
|
<label for="email" class="col-form-label">Email<span class="text-danger">*</span></label>
|
||||||
<input type="email" class="form-control" id="email" name="email" placeholder="Email" value="<?= isset($details['email']) ? $details['email'] : '' ?>" required />
|
<input type="email" class="form-control" id="email" name="email" placeholder="Email" value="<?= isset($details['email']) ? $details['email'] : '' ?>" required />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if (empty($details)) { ?>
|
<?php if (empty($details)) { ?>
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-4">
|
||||||
<label for="password" class="col-form-label">Password<span class="text-danger">*</span></label>
|
<label for="password" class="col-form-label">Password<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" id="password" name="password" placeholder="Password" value="<?= isset($details['password']) ? $details['password'] : '' ?>" required />
|
<input type="text" class="form-control" id="password" name="password" placeholder="Password" value="<?= isset($details['password']) ? $details['password'] : '' ?>" required />
|
||||||
</div>
|
</div>
|
||||||
@ -80,36 +94,26 @@
|
|||||||
<label for="postal_code" class="col-form-label">Postal Code<span class="text-danger"></span></label>
|
<label for="postal_code" class="col-form-label">Postal Code<span class="text-danger"></span></label>
|
||||||
<input data-parsley-type="number" type="text" class="form-control" id="postal_code" name="postal_code" placeholder="Postal Code (PIN)" value="<?= isset($details['postal_code']) ? $details['postal_code'] : '' ?>" pattern="[0-9]{6}" maxlength="6" />
|
<input data-parsley-type="number" type="text" class="form-control" id="postal_code" name="postal_code" placeholder="Postal Code (PIN)" value="<?= isset($details['postal_code']) ? $details['postal_code'] : '' ?>" pattern="[0-9]{6}" maxlength="6" />
|
||||||
</div>
|
</div>
|
||||||
<?php if (!empty($details['profile_picture'])) { ?>
|
|
||||||
<div class="form-group col-md-4 mt-3">
|
|
||||||
<div class="media">
|
|
||||||
<img src="<?= base_url('public/uploads/' . $details['profile_picture']) ?>" alt="Business Logo" height="50" class="preview-image d-flex align-self-start rounded mr-2">
|
|
||||||
<div class="media-body">
|
|
||||||
<h5 class="mt-0">Existing Profile Picture</h5>
|
|
||||||
<p class="mb-1"><?= $details['profile_picture']; ?></p>
|
|
||||||
<input type="hidden" id="existing_profile_picture_name" name="existing_profile_picture_name" placeholder="hidden Field for profile picture name" readonly value="<?= $details['profile_picture']; ?>" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="profile_picture" class="col-form-label">Profile Picture</label>
|
<label for="profile_picture" class="col-form-label">Profile Picture</label>
|
||||||
<input type="file" name="profile_picture" value="<?= isset($details['profile_picture']) ? $details['profile_picture'] : '' ?>" accept="image/*" onchange="validateFile(this)" />
|
<input type="file" name="profile_picture" value="<?= isset($details['profile_picture']) ? $details['profile_picture'] : '' ?>" accept="image/*" onchange="validateFile(this)" />
|
||||||
<div id="error_message" style="color: red;"></div>
|
<div id="error_message" style="color: red;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if ($loggedin_person_role === 'sadmin') { ?>
|
<?php if (!empty($details['profile_picture'])) { ?>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4 mt-3">
|
||||||
<label for="business_id" class="col-form-label">Buiness<span class="text-danger"></span></label>
|
<div class="media">
|
||||||
<select id="business_id" name="business_id" class="form-control" required>
|
<img src="<?= base_url('public/uploads/' . $details['profile_picture']) ?>" alt="Business Logo" height="100" class="preview-image d-flex align-self-start rounded mr-2" style="position: relative; left: 40%;">
|
||||||
<option value="">Choose your Buiness</option>
|
<div class="media-body">
|
||||||
<?php foreach ($business_details as $value) { ?>
|
<!-- <h5 class="mt-0">Existing Profile Picture</h5> -->
|
||||||
<option value="<?php echo $value['business_id']; ?>" <?php if (isset($details['business_id']) && ($details['business_id'] === $value['business_id'])) echo "selected"; ?>>
|
<!-- <p class="mb-1"><?= $details['profile_picture']; ?></p> -->
|
||||||
<?php echo $value['title']; ?></option>
|
<input type="hidden" id="existing_profile_picture_name" name="existing_profile_picture_name" placeholder="hidden Field for profile picture name" readonly value="<?= $details['profile_picture']; ?>" />
|
||||||
<?php } ?>
|
</div>
|
||||||
</select>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?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'] : '' ?>" />
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th hidden ></th>
|
<th hidden ></th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
|
<?php if($loged_user === 'sadmin'){ ?>
|
||||||
|
<th>Org Name</th>
|
||||||
|
<?php } ?>
|
||||||
<th>Email</th>
|
<th>Email</th>
|
||||||
<th>Mobile Number</th>
|
<th>Mobile Number</th>
|
||||||
<th>Role</th>
|
<th>Role</th>
|
||||||
@ -63,6 +66,9 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td hidden><?= $row['user_id'] ?></td>
|
<td hidden><?= $row['user_id'] ?></td>
|
||||||
<td><?php echo $row['first_name'].' '.$row['last_name'] ; ?></td>
|
<td><?php echo $row['first_name'].' '.$row['last_name'] ; ?></td>
|
||||||
|
<?php if($loged_user === 'sadmin'){ ?>
|
||||||
|
<td><?php echo $row['org_name'] ; ?></td>
|
||||||
|
<?php } ?>
|
||||||
<td><?php echo $row['email'] ; ?></td>
|
<td><?php echo $row['email'] ; ?></td>
|
||||||
<td><?php echo $row['mobile_no'] ; ?></td>
|
<td><?php echo $row['mobile_no'] ; ?></td>
|
||||||
<td><?php echo $row['role'] ; ?></td>
|
<td><?php echo $row['role'] ; ?></td>
|
||||||
|
|||||||
@ -18,7 +18,7 @@ SET time_zone = "+00:00";
|
|||||||
/*!40101 SET NAMES utf8mb4 */;
|
/*!40101 SET NAMES utf8mb4 */;
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Database: `doner_management`
|
-- Database: `Donor_management`
|
||||||
--
|
--
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
@ -1051,9 +1051,9 @@ CREATE TABLE `settings` (
|
|||||||
--
|
--
|
||||||
|
|
||||||
INSERT INTO `settings` (`business_id`, `setting_id`, `site_name`, `site_title`, `favicon`, `logo`, `terms_service`, `footer_about`, `admin_email`, `mobile`, `copyright`, `pagination_limit`, `site_info`, `about_info`, `mail_protocol`, `mail_title`, `mail_host`, `mail_port`, `mail_encryption`, `mail_username`, `mail_password`, `currency`, `country`, `created_on`, `created_by`, `updated_on`, `updated_by`, `isactive`) VALUES
|
INSERT INTO `settings` (`business_id`, `setting_id`, `site_name`, `site_title`, `favicon`, `logo`, `terms_service`, `footer_about`, `admin_email`, `mobile`, `copyright`, `pagination_limit`, `site_info`, `about_info`, `mail_protocol`, `mail_title`, `mail_host`, `mail_port`, `mail_encryption`, `mail_username`, `mail_password`, `currency`, `country`, `created_on`, `created_by`, `updated_on`, `updated_by`, `isactive`) VALUES
|
||||||
(0, 1, 'Bigbamboo Doner Management', 'BB Books', NULL, NULL, 'Term and Service', 'BBBP.COM', 'sadmin@bbbp.com', '1010101010', '2023', 1, 1, 'nil', 'nil', 'nil', 'nil', 'nil', 'ssl', 'nil', 'nil', 'USD', 1, '2023-09-06 15:22:18', 1, '2023-12-12 15:46:24', NULL, 1),
|
(0, 1, 'Bigbamboo Donor Management', 'BB Books', NULL, NULL, 'Term and Service', 'BBBP.COM', 'sadmin@bbbp.com', '1010101010', '2023', 1, 1, 'nil', 'nil', 'nil', 'nil', 'nil', 'ssl', 'nil', 'nil', 'USD', 1, '2023-09-06 15:22:18', 1, '2023-12-12 15:46:24', NULL, 1),
|
||||||
(1, 2, 'Doner Management', 'DM', 'Vijayabharatham.ico', 'Vijayabharatham_withname_1.png', 'Vijayabharatham Publishing Terms', 'https://vijayabharathambooks.com/', 'admin@vbp.com', NULL, '2023', NULL, 1, NULL, NULL, NULL, NULL, NULL, 'ssl', NULL, NULL, 'nil', 1, '2023-09-06 15:16:58', 1, '2023-12-12 15:35:35', NULL, 1),
|
(1, 2, 'Donor Management', 'DM', 'Vijayabharatham.ico', 'Vijayabharatham_withname_1.png', 'Vijayabharatham Publishing Terms', 'https://vijayabharathambooks.com/', 'admin@vbp.com', NULL, '2023', NULL, 1, NULL, NULL, NULL, NULL, NULL, 'ssl', NULL, NULL, 'nil', 1, '2023-09-06 15:16:58', 1, '2023-12-12 15:35:35', NULL, 1),
|
||||||
(2, 3, 'Doner Management', 'DM', 'JerryCharlesMiculekPublishing.ico', 'JerryCharlesMiculekPublishing.png', '', '', 'admin@hcc.com', NULL, NULL, NULL, 1, '', NULL, NULL, NULL, NULL, 'ssl', NULL, NULL, 'USD', 178, '2023-09-11 12:43:11', NULL, '2023-12-12 15:35:43', NULL, 1);
|
(2, 3, 'Donor Management', 'DM', 'JerryCharlesMiculekPublishing.ico', 'JerryCharlesMiculekPublishing.png', '', '', 'admin@hcc.com', NULL, NULL, NULL, 1, '', NULL, NULL, NULL, NULL, 'ssl', NULL, NULL, 'USD', 178, '2023-09-11 12:43:11', NULL, '2023-12-12 15:35:43', NULL, 1);
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
@ -1260,14 +1260,14 @@ CREATE TABLE `users` (
|
|||||||
|
|
||||||
INSERT INTO `users` (`business_id`, `user_id`, `email`, `first_name`, `last_name`, `password`, `mobile_no`, `date_of_birth`, `address`, `gender`, `profile_picture`, `city`, `state`, `postal_code`, `country`, `role`, `reset_link`, `created_on`, `created_by`, `updated_on`, `updated_by`, `isactive`) VALUES
|
INSERT INTO `users` (`business_id`, `user_id`, `email`, `first_name`, `last_name`, `password`, `mobile_no`, `date_of_birth`, `address`, `gender`, `profile_picture`, `city`, `state`, `postal_code`, `country`, `role`, `reset_link`, `created_on`, `created_by`, `updated_on`, `updated_by`, `isactive`) VALUES
|
||||||
(0, 1, 'sadmin@bbbp.com', 'BBBP', 'SA', '$2y$10$JymR48XU0h5ukLpCWIy0V.9uwTPXiS6LhQihT18pkidkwoxA.ZQpa', '7128122050', '2023-08-21', 'www', 'male', '', 'Trichy', 'Tamil Nadu', '620122', NULL, 'sadmin', NULL, '2023-08-18 12:31:39', 1, '2023-10-12 16:08:31', 1, 1),
|
(0, 1, 'sadmin@bbbp.com', 'BBBP', 'SA', '$2y$10$JymR48XU0h5ukLpCWIy0V.9uwTPXiS6LhQihT18pkidkwoxA.ZQpa', '7128122050', '2023-08-21', 'www', 'male', '', 'Trichy', 'Tamil Nadu', '620122', NULL, 'sadmin', NULL, '2023-08-18 12:31:39', 1, '2023-10-12 16:08:31', 1, 1),
|
||||||
(1, 2, 'admin@vbp.com', 'Donermanagement', 'A1', '$2y$10$JymR48XU0h5ukLpCWIy0V.9uwTPXiS6LhQihT18pkidkwoxA.ZQpa', '2266778899', NULL, '1/8', 'male', 'dummy.jpeg', 'nanganallur', 'tamilnadu', '630345', NULL, 'admin', 'f901031dfaaf15d4734fb405d24f9421afb2e1ccf175db85181056def6c08c9e', '2023-08-19 16:05:22', 1, '2023-12-12 15:38:54', 2, 1),
|
(1, 2, 'admin@vbp.com', 'Donormanagement', 'A1', '$2y$10$JymR48XU0h5ukLpCWIy0V.9uwTPXiS6LhQihT18pkidkwoxA.ZQpa', '2266778899', NULL, '1/8', 'male', 'dummy.jpeg', 'nanganallur', 'tamilnadu', '630345', NULL, 'admin', 'f901031dfaaf15d4734fb405d24f9421afb2e1ccf175db85181056def6c08c9e', '2023-08-19 16:05:22', 1, '2023-12-12 15:38:54', 2, 1),
|
||||||
(2, 3, 'admin@hcc.com', 'HCC', 'A1', '$2y$10$7NW11LCIjRiAYHE9wBsituMuqleV/ItTxcRZ9NrqAmqAbAy9Ph2Bq', '12344321', '2003-08-11', 'address001', 'female', '', 'Chennai', 'TN', '600001', NULL, 'admin', NULL, '2023-09-11 12:33:01', NULL, '2023-09-29 10:10:05', NULL, 1),
|
(2, 3, 'admin@hcc.com', 'HCC', 'A1', '$2y$10$7NW11LCIjRiAYHE9wBsituMuqleV/ItTxcRZ9NrqAmqAbAy9Ph2Bq', '12344321', '2003-08-11', 'address001', 'female', '', 'Chennai', 'TN', '600001', NULL, 'admin', NULL, '2023-09-11 12:33:01', NULL, '2023-09-29 10:10:05', NULL, 1),
|
||||||
(1, 4, 'vbptest@gmail.com', 'VBP', 'TEST', '$2y$10$ky2TxMj6LaBEqPma7VDC5Os9NxmgNlDgyUWzJUOrewdBdBOWaOgBq', '9090909090', NULL, 'No.123', 'male', 'dummy-prod-1.jpg', 'Banglore', 'Karnataka', '600051', NULL, 'admin', NULL, '2023-10-17 17:34:13', 2, '2023-11-06 16:05:05', 2, 1),
|
(1, 4, 'vbptest@gmail.com', 'VBP', 'TEST', '$2y$10$ky2TxMj6LaBEqPma7VDC5Os9NxmgNlDgyUWzJUOrewdBdBOWaOgBq', '9090909090', NULL, 'No.123', 'male', 'dummy-prod-1.jpg', 'Banglore', 'Karnataka', '600051', NULL, 'admin', NULL, '2023-10-17 17:34:13', 2, '2023-11-06 16:05:05', 2, 1),
|
||||||
(1, 5, 'online@vbp.com', 'Vijayabharatham', 'O1', '$2y$10$K8lwOXryrQZsp0QVMKdeXeAepYBLImxPgr5Ze4jDcik53ByLQYw6a', '8122050331', NULL, 'Chennai', NULL, 'nameboard2.jpeg', 'Nanganallur', 'Tamil nadu', '600009', NULL, 'online', NULL, '2023-10-11 15:17:51', 2, '2023-10-12 18:21:46', NULL, 0),
|
(1, 5, 'online@vbp.com', 'Vijayabharatham', 'O1', '$2y$10$K8lwOXryrQZsp0QVMKdeXeAepYBLImxPgr5Ze4jDcik53ByLQYw6a', '8122050331', NULL, 'Chennai', NULL, 'nameboard2.jpeg', 'Nanganallur', 'Tamil nadu', '600009', NULL, 'online', NULL, '2023-10-11 15:17:51', 2, '2023-10-12 18:21:46', NULL, 0),
|
||||||
(1, 6, 'manager@vbp.com', 'Vijayabharatham', 'M1', '$2y$10$K8lwOXryrQZsp0QVMKdeXeAepYBLImxPgr5Ze4jDcik53ByLQYw6a', '9812205034', NULL, 'Chennai', '', NULL, 'Nanganallur.', 'Tamil nadu', '600011', NULL, 'manager', NULL, '2023-10-11 15:17:51', 2, '2023-10-12 18:35:05', NULL, 1),
|
(1, 6, 'manager@vbp.com', 'Vijayabharatham', 'M1', '$2y$10$K8lwOXryrQZsp0QVMKdeXeAepYBLImxPgr5Ze4jDcik53ByLQYw6a', '9812205034', NULL, 'Chennai', '', NULL, 'Nanganallur.', 'Tamil nadu', '600011', NULL, 'manager', NULL, '2023-10-11 15:17:51', 2, '2023-10-12 18:35:05', NULL, 1),
|
||||||
(1, 7, 'kavitha123@gmail.com', 'Kavitha', 'L', '$2y$10$MQKj999N0XCgMvTT162jQ.pADLijrdbucdBivoYgCAAKzxhWGRQju', '8541236589', NULL, '', '', NULL, '', '', '', NULL, 'admin', NULL, '2023-11-08 09:18:26', 2, NULL, NULL, 1),
|
(1, 7, 'kavitha123@gmail.com', 'Kavitha', 'L', '$2y$10$MQKj999N0XCgMvTT162jQ.pADLijrdbucdBivoYgCAAKzxhWGRQju', '8541236589', NULL, '', '', NULL, '', '', '', NULL, 'admin', NULL, '2023-11-08 09:18:26', 2, NULL, NULL, 1),
|
||||||
(1, 8, 'nithiya123@gmail.com', 'Nithiya', 'K', '$2y$10$Cbj4.AJKYvSD1iSum34/E./ugnXYJVvDud/QuGBhGkHkK6hDE30ha', '8541236589', NULL, '', '', NULL, '', '', '', NULL, 'admin', NULL, '2023-11-08 09:19:10', 2, '2023-11-10 17:19:11', 2, 0),
|
(1, 8, 'nithiya123@gmail.com', 'Nithiya', 'K', '$2y$10$Cbj4.AJKYvSD1iSum34/E./ugnXYJVvDud/QuGBhGkHkK6hDE30ha', '8541236589', NULL, '', '', NULL, '', '', '', NULL, 'admin', NULL, '2023-11-08 09:19:10', 2, '2023-11-10 17:19:11', 2, 0),
|
||||||
(1, 9, 'raman@gmail.com', 'Donermanagement', 'VENKATESHRAMAN', '$2y$10$k5es.HKc0qOk2QtBE2gLP.MNeG7mg5KEpdiK4bLnTnW7MVibLk2mS', '8976543098', NULL, 'annappanpettain ', 'male', NULL, 'sirkali', 'tamilnadu', '908765', NULL, 'admin', NULL, '2023-12-12 18:36:22', 2, NULL, NULL, 1);
|
(1, 9, 'raman@gmail.com', 'Donormanagement', 'VENKATESHRAMAN', '$2y$10$k5es.HKc0qOk2QtBE2gLP.MNeG7mg5KEpdiK4bLnTnW7MVibLk2mS', '8976543098', NULL, 'annappanpettain ', 'male', NULL, 'sirkali', 'tamilnadu', '908765', NULL, 'admin', NULL, '2023-12-12 18:36:22', 2, NULL, NULL, 1);
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Indexes for dumped tables
|
-- Indexes for dumped tables
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
BIN
public/uploads/07156b4680962b650af1c6927c7019d5.jpg
Normal file
BIN
public/uploads/07156b4680962b650af1c6927c7019d5.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
public/uploads/07156b4680962b650af1c6927c7019d5_1.jpg
Normal file
BIN
public/uploads/07156b4680962b650af1c6927c7019d5_1.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
public/uploads/07156b4680962b650af1c6927c7019d5_2.jpg
Normal file
BIN
public/uploads/07156b4680962b650af1c6927c7019d5_2.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
public/uploads/07156b4680962b650af1c6927c7019d5_3.jpg
Normal file
BIN
public/uploads/07156b4680962b650af1c6927c7019d5_3.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 11 KiB |
BIN
public/uploads/600px-Instagram_icon_6.png
Normal file
BIN
public/uploads/600px-Instagram_icon_6.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
BIN
public/uploads/600px-Instagram_icon_7.png
Normal file
BIN
public/uploads/600px-Instagram_icon_7.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user