CHANGE_TRACKER_ISSUE_PUSH : AADHAVAN
This commit is contained in:
parent
fd18f1011d
commit
34754b55b0
@ -12,12 +12,17 @@ $routes->setTranslateURIDashes(false);
|
|||||||
$routes->set404Override();
|
$routes->set404Override();
|
||||||
//Login//
|
//Login//
|
||||||
$routes->get('/', 'Login::index');
|
$routes->get('/', 'Login::index');
|
||||||
$routes->get('log_out', 'Login::index');
|
$routes->get('log_out', 'Login::logout');
|
||||||
$routes->post("authenticate", "Login::authenticate");
|
$routes->post("authenticate", "Login::authenticate");
|
||||||
$routes->get("edit_account/(:any)", "Users::edit_account/$1");
|
$routes->get("edit_account/(:any)", "Users::edit_account/$1");
|
||||||
$routes->post("edit_mail/(:any)", "Users::edit_mail/$1");
|
$routes->post("edit_mail/(:any)", "Users::edit_mail/$1");
|
||||||
$routes->post("change_password/(:any)", "Users::change_password/$1");
|
$routes->post("change_password/(:any)", "Users::change_password/$1");
|
||||||
|
$routes->post("change_password_forget", "Users::change_password_forget");
|
||||||
$routes->post("add_account", "Users::add_account");
|
$routes->post("add_account", "Users::add_account");
|
||||||
|
$routes->match(['get','post'],'/forgot_password','Users::forgot_password');
|
||||||
|
$routes->match(['get','post'],'/verify_otp','Users::verify_otp');
|
||||||
|
|
||||||
|
|
||||||
// $routes->get("new_user/(:any)", "Users::new_user/$1");
|
// $routes->get("new_user/(:any)", "Users::new_user/$1");
|
||||||
// $routes->get("delete_user/(:any)", "Users::delete_user/$1");
|
// $routes->get("delete_user/(:any)", "Users::delete_user/$1");
|
||||||
//end Login//
|
//end Login//
|
||||||
|
|||||||
@ -59,12 +59,12 @@ class Client extends BaseController
|
|||||||
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
|
if(!$this->session->has('logged_user')) { return redirect()->to(base_url()); }
|
||||||
$ClientModel = new ClientModel();
|
$ClientModel = new ClientModel();
|
||||||
|
|
||||||
|
$mobile_no = $this->request->getPost('mobile');
|
||||||
$data = [
|
$data = [
|
||||||
'client_name' => $this->request->getPost('client_name'),
|
'client_name' => $this->request->getPost('client_name'),
|
||||||
'email' => $this->request->getPost('email'),
|
'email' => $this->request->getPost('email'),
|
||||||
'address' => $this->request->getPost('address'),
|
'address' => $this->request->getPost('address'),
|
||||||
'mobile_no' => $this->request->getPost('mobile'),
|
'mobile_no' =>$mobile_no,
|
||||||
'city' => $this->request->getPost('city'),
|
'city' => $this->request->getPost('city'),
|
||||||
'state' => $this->request->getPost('state'),
|
'state' => $this->request->getPost('state'),
|
||||||
'postal_code' => $this->request->getPost('postalcode'),
|
'postal_code' => $this->request->getPost('postalcode'),
|
||||||
@ -74,20 +74,30 @@ class Client extends BaseController
|
|||||||
'branch_id' => $this->session->get('logged_user_branch_id')
|
'branch_id' => $this->session->get('logged_user_branch_id')
|
||||||
];
|
];
|
||||||
// print_r($data);die;
|
// print_r($data);die;
|
||||||
|
|
||||||
$client_id = $this->request->getPost('client_id');
|
$client_id = $this->request->getPost('client_id');
|
||||||
|
|
||||||
|
|
||||||
if (!empty($client_id)) {
|
if (!empty($client_id)) {
|
||||||
|
|
||||||
$ClientModel->update($client_id, $data);
|
$update= $ClientModel->update($client_id, $data);
|
||||||
} else {
|
|
||||||
|
|
||||||
$ClientModel->insert($data);
|
if($update){
|
||||||
|
return json_encode("update");
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if($ClientModel->where('mobile_no', $mobile_no)->first()){
|
||||||
|
$error = "Mobile number already exists";
|
||||||
|
return json_encode(false);
|
||||||
|
}else{
|
||||||
|
$ClientModel->insert($data);
|
||||||
|
return json_encode(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return redirect()->to('client_index');
|
// return redirect()->to('client_index');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete_client($client_id)
|
public function delete_client($client_id)
|
||||||
|
|||||||
@ -19,6 +19,24 @@ class Login extends BaseController
|
|||||||
return view('login_form');
|
return view('login_form');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function logout()
|
||||||
|
{
|
||||||
|
// Remove specific session variables
|
||||||
|
$this->session->remove('logged_user');
|
||||||
|
$this->session->remove('logged_user_branch_id');
|
||||||
|
$this->session->remove('logged_user_business_id');
|
||||||
|
$this->session->remove('logged_user_role');
|
||||||
|
$this->session->remove('logged_user_name');
|
||||||
|
|
||||||
|
// Destroy the session
|
||||||
|
$this->session->destroy();
|
||||||
|
|
||||||
|
// Redirect to the home page or login page
|
||||||
|
return redirect()->to('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function authenticate()
|
public function authenticate()
|
||||||
{
|
{
|
||||||
$loginModel = new LoginModel();
|
$loginModel = new LoginModel();
|
||||||
|
|||||||
@ -51,7 +51,10 @@ class Purchase extends BaseController
|
|||||||
$PurchaseOrderModel = new PurchaseOrderModel();
|
$PurchaseOrderModel = new PurchaseOrderModel();
|
||||||
|
|
||||||
$VendorModel = new VendorModel();
|
$VendorModel = new VendorModel();
|
||||||
$vendor = $VendorModel->where('branch_id',$this->session->get('logged_user_branch_id'))->select('vendor_id,vendor_name')->findAll();
|
$vendor = $VendorModel->where('branch_id',$this->session->get('logged_user_branch_id'))
|
||||||
|
->where('isactive', 1)
|
||||||
|
->select('vendor_id,vendor_name')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -60,9 +63,9 @@ class Purchase extends BaseController
|
|||||||
$branch = $BranchModel->where('branch_id', $this->session->get('logged_user_branch_id'))->get()->getRowArray();
|
$branch = $BranchModel->where('branch_id', $this->session->get('logged_user_branch_id'))->get()->getRowArray();
|
||||||
$business = $BusinessModel->where('business_id', $this->session->get('logged_user_business_id'))->get()->getRowArray();
|
$business = $BusinessModel->where('business_id', $this->session->get('logged_user_business_id'))->get()->getRowArray();
|
||||||
$ProductModel = new ProductModel();
|
$ProductModel = new ProductModel();
|
||||||
$product=$ProductModel
|
$product=$ProductModel->where('isactive',1)
|
||||||
->where('isactive',1)
|
->where('branch_id',$this->session->get('logged_user_branch_id'))
|
||||||
->where('branch_id',$this->session->get('logged_user_branch_id'))->findAll();
|
->findAll();
|
||||||
$data['product']=$product;
|
$data['product']=$product;
|
||||||
$data['branch'] = $branch;
|
$data['branch'] = $branch;
|
||||||
$data['business'] = $business;
|
$data['business'] = $business;
|
||||||
@ -78,7 +81,10 @@ class Purchase extends BaseController
|
|||||||
$purchase=$PurchaseOrderModel->where('purchase_order_id', $purchase_order_id)->get()->getRowArray();
|
$purchase=$PurchaseOrderModel->where('purchase_order_id', $purchase_order_id)->get()->getRowArray();
|
||||||
|
|
||||||
$VendorModel = new VendorModel();
|
$VendorModel = new VendorModel();
|
||||||
$vendor = $VendorModel->where('branch_id',$this->session->get('logged_user_business_id'))->select('vendor_id,vendor_name')->findAll();
|
$vendor = $VendorModel->where('branch_id',$this->session->get('logged_user_business_id'))
|
||||||
|
->where('isactive', 1)
|
||||||
|
->select('vendor_id,vendor_name')
|
||||||
|
->findAll();
|
||||||
$data['vendor']=$vendor;
|
$data['vendor']=$vendor;
|
||||||
|
|
||||||
$data['purchase'] = $purchase;
|
$data['purchase'] = $purchase;
|
||||||
@ -88,7 +94,7 @@ class Purchase extends BaseController
|
|||||||
$VendorModel = new VendorModel();
|
$VendorModel = new VendorModel();
|
||||||
$vendor = $VendorModel->findAll();
|
$vendor = $VendorModel->findAll();
|
||||||
$data['vendor'] = $vendor;
|
$data['vendor'] = $vendor;
|
||||||
|
//
|
||||||
$data['vendor_id'] = $purchase['vendor_id'];
|
$data['vendor_id'] = $purchase['vendor_id'];
|
||||||
// print_r($vendor);die;
|
// print_r($vendor);die;
|
||||||
$vendorId=$purchase['vendor_id'];
|
$vendorId=$purchase['vendor_id'];
|
||||||
|
|||||||
@ -11,6 +11,8 @@ use App\Models\JobcardModel;
|
|||||||
use App\Models\BikemodelsModel;
|
use App\Models\BikemodelsModel;
|
||||||
use App\Models\BikemakeModel;
|
use App\Models\BikemakeModel;
|
||||||
|
|
||||||
|
use App\Helpers\MailHelper;
|
||||||
|
|
||||||
|
|
||||||
class Users extends BaseController
|
class Users extends BaseController
|
||||||
{
|
{
|
||||||
@ -73,6 +75,86 @@ class Users extends BaseController
|
|||||||
return view('user_list',['users' => $users, 'roleModel' => $roleModel]);
|
return view('user_list',['users' => $users, 'roleModel' => $roleModel]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function forgot_password()
|
||||||
|
{
|
||||||
|
$UsersModel = new UsersModel();
|
||||||
|
|
||||||
|
|
||||||
|
if($this->request->getmethod() == 'post')
|
||||||
|
{
|
||||||
|
|
||||||
|
$email = $this->request->getVar('email');
|
||||||
|
$staff_data = $UsersModel->where('email', $email)->find();
|
||||||
|
|
||||||
|
|
||||||
|
if ($staff_data)
|
||||||
|
{
|
||||||
|
$otp = rand(1000 , 9999);
|
||||||
|
$MailHelper = new MailHelper();
|
||||||
|
$MailHelper->send_otp_email($this->request->getVar('email') , $otp );
|
||||||
|
|
||||||
|
$data['status'] = 'success';
|
||||||
|
$data['otp'] = $otp;
|
||||||
|
echo json_encode($data);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$data['status'] = 'failed';
|
||||||
|
echo json_encode($data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else{
|
||||||
|
// print_r("11111111111111111111");die;
|
||||||
|
return view('forgot_password.php');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function verify_otp()
|
||||||
|
{
|
||||||
|
$UsersModel = new UsersModel();
|
||||||
|
|
||||||
|
if($this->request->getmethod() == 'post')
|
||||||
|
{
|
||||||
|
$otp = $this->request->getVar('otp');
|
||||||
|
$verify_otp = $this->request->getVar('verify_otp');
|
||||||
|
|
||||||
|
if ($otp == $verify_otp)
|
||||||
|
{
|
||||||
|
$email = $this->request->getVar('email');
|
||||||
|
$data = $UsersModel->where('email', $email)->find();
|
||||||
|
if ($data)
|
||||||
|
{
|
||||||
|
$this->session->setTempdata('user_id',$data[0]['user_id'],3);
|
||||||
|
$this->session->setTempdata('email',$data[0]['email'],3);
|
||||||
|
$this->session->setTempdata('mail_success', "OTP verified sucessfully",3);
|
||||||
|
return view('reset_password.php');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->session->setTempdata('error', "You entered wrong OTP.Please retry",3);
|
||||||
|
return view('forgot_password.php');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function change_password_forget()
|
||||||
|
{
|
||||||
|
$UsersModel = new UsersModel();
|
||||||
|
|
||||||
|
if($this->request->getmethod() == 'post')
|
||||||
|
{
|
||||||
|
$userData = $this->request->getVar();
|
||||||
|
$user_id = $this->request->getVar('user_id');
|
||||||
|
$userData['password'] = password_hash($userData['password'], PASSWORD_DEFAULT);
|
||||||
|
$UsersModel->where('user_id', $user_id )->set($userData)->update();
|
||||||
|
$this->session->setTempdata('mail_success', "Password set sucessfully",3);
|
||||||
|
return redirect()->to(base_url());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function user_list($branch_id)
|
public function user_list($branch_id)
|
||||||
{
|
{
|
||||||
|
|||||||
24
app/Filters/AuthMVC.php
Normal file
24
app/Filters/AuthMVC.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Filters;
|
||||||
|
|
||||||
|
use CodeIgniter\Filters\FilterInterface;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
|
||||||
|
class AuthMVC implements FilterInterface
|
||||||
|
{
|
||||||
|
public function before(RequestInterface $request, $arguments = null)
|
||||||
|
{
|
||||||
|
if (!check_session()) {
|
||||||
|
|
||||||
|
return redirect()->to(base_url('/login'));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function after(RequestInterface $request, ResponseInterface $response, $arguments = null)
|
||||||
|
{
|
||||||
|
// Do something here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -42,6 +42,39 @@ class MailHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function send_otp_email($email_id,$otp)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$subject = 'BB-Sign Verify Document';
|
||||||
|
$message = "Hai ,
|
||||||
|
</br>
|
||||||
|
We have a requested forgot password OTP :".$otp;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
$email = \Config\Services::email();
|
||||||
|
$email->setMailType('html');
|
||||||
|
$email->setFrom('bbone@venbait.in', 'BB-Sign');
|
||||||
|
|
||||||
|
$email->setTo($email_id);
|
||||||
|
|
||||||
|
$email->setSubject($subject);
|
||||||
|
$email->setMessage($message);
|
||||||
|
|
||||||
|
if ($email->send()) {
|
||||||
|
return json_encode(['status' => 'success','code' => 200, 'message'=>'Email Sent Successfully...','data' => $email_id,],200);
|
||||||
|
} else {
|
||||||
|
return json_encode(['status' => 'failed','code' => 404,'message'=>'Email Sent Failed...','data' => $email_id ],404);
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return json_encode(['status' => 'failed','code' => 500,'data' => $email_id],500);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@ -10,4 +10,13 @@ if (!function_exists('get_branch_id')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('check_session')) {
|
||||||
|
function check_session()
|
||||||
|
{
|
||||||
|
// $ci =& get_instance();
|
||||||
|
$session = \Config\Services::session();
|
||||||
|
return $session->get('isLoggedIn');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<form action="<?= base_url() . "add_client"; ?>" method="post">
|
<form id="client_form" method="post">
|
||||||
<h4 class="header-title">Client Details :</h4>
|
<h4 class="header-title">Client Details :</h4>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
@ -24,7 +24,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="inputAddress" class="col-form-label">Mobile<span class="text-danger">*</span></label>
|
<label for="inputAddress" class="col-form-label">Mobile<span class="text-danger">*</span></label>
|
||||||
<input type="text" class="form-control" name="mobile" placeholder="Mobile" value="<?= isset($client['mobile_no']) ? $client['mobile_no'] : '' ?>" maxlength="16" minlength="6" onkeypress = "return onlyNumbers(event)" required/>
|
<span id="mobile_error" style="color:red;"></span>
|
||||||
|
<input type="text" class="form-control" name="mobile" id="mobile" placeholder="Mobile" value="<?= isset($client['mobile_no']) ? $client['mobile_no'] : '' ?>" maxlength="16" minlength="6" onkeypress = "return onlyNumbers(event)" required/>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<label for="inputPassword4" class="col-form-label">Client Type<span class="text-danger">*</span></label>
|
<label for="inputPassword4" class="col-form-label">Client Type<span class="text-danger">*</span></label>
|
||||||
@ -68,7 +69,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">Submit</button>
|
<button type="submit" id="client_form_submit" class="btn btn-primary">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -83,4 +84,45 @@
|
|||||||
if(charcode>= 48 && charcode <= 57)return true;
|
if(charcode>= 48 && charcode <= 57)return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('#client_form_submit').click(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
// action="<?= base_url() . "add_client"; ?>"
|
||||||
|
var formData = $('#client_form').serialize();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: '<?php echo base_url()."add_client"?>',
|
||||||
|
data: formData,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(response) {
|
||||||
|
console.log(response);
|
||||||
|
if(response == 'update'){
|
||||||
|
toastr.success('Client Updated Succssfully');
|
||||||
|
|
||||||
|
window.location.href = '<?= base_url() . "client_index"; ?>';
|
||||||
|
}else if(response){
|
||||||
|
toastr.success('Client Added Succssfully');
|
||||||
|
|
||||||
|
window.location.href = '<?= base_url() . "client_index"; ?>';
|
||||||
|
}else{
|
||||||
|
toastr.warning('Mobile number already exists');
|
||||||
|
$('#mobile_error').html('Mobile number already exists');
|
||||||
|
$('#mobile').css('border', '1px solid red');
|
||||||
|
$('#mobile').focus();
|
||||||
|
setTimeout(() => {
|
||||||
|
$('#mobile').css('border', '1px solid #ced4da');
|
||||||
|
|
||||||
|
}, 2000);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
// Handle error response here
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -132,6 +132,8 @@
|
|||||||
if (!complaint_id) {
|
if (!complaint_id) {
|
||||||
complaint_id = 0;
|
complaint_id = 0;
|
||||||
}
|
}
|
||||||
|
$(params).attr('disabled', true);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '<?php echo base_url()."create_complaint/"?>' + complaint_id,
|
url: '<?php echo base_url()."create_complaint/"?>' + complaint_id,
|
||||||
|
|||||||
@ -242,21 +242,36 @@
|
|||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
var oldPasswordField = document.getElementById('old_password');
|
||||||
var newPasswordField = document.getElementById('new_password');
|
var newPasswordField = document.getElementById('new_password');
|
||||||
var confirmPasswordField = document.getElementById('confirm_password');
|
var confirmPasswordField = document.getElementById('confirm_password');
|
||||||
var submitButton = document.getElementById('submit_password');
|
var submitButton = document.getElementById('submit_password');
|
||||||
|
|
||||||
// Add an event listener to the "Confirm Password" field
|
// Function to validate the password fields
|
||||||
confirmPasswordField.addEventListener('input', function() {
|
function validatePasswords() {
|
||||||
// Check if the passwords match
|
var oldPassword = oldPasswordField.value;
|
||||||
if (newPasswordField.value === confirmPasswordField.value) {
|
var newPassword = newPasswordField.value;
|
||||||
// Enable the submit button
|
var confirmPassword = confirmPasswordField.value;
|
||||||
submitButton.disabled = false;
|
|
||||||
} else {
|
if(oldPassword !== newPassword && newPassword !== ''){
|
||||||
// Disable the submit button
|
console.log(oldPassword);
|
||||||
|
console.log(newPassword);
|
||||||
|
console.log(confirmPassword);
|
||||||
|
if (newPassword === confirmPassword) {
|
||||||
|
submitButton.disabled = false;
|
||||||
|
} else {
|
||||||
|
submitButton.disabled = true;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
submitButton.disabled = true;
|
submitButton.disabled = true;
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add event listeners to all relevant fields
|
||||||
|
oldPasswordField.addEventListener('input', validatePasswords);
|
||||||
|
newPasswordField.addEventListener('input', validatePasswords);
|
||||||
|
confirmPasswordField.addEventListener('input', validatePasswords);
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
171
app/Views/forgot_password.php
Normal file
171
app/Views/forgot_password.php
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Forgotpassword</title>
|
||||||
|
<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="Coderthemes" name="author" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<!-- App favicon -->
|
||||||
|
<link rel="shortcut icon" href="public/assets/images/favicon.ico">
|
||||||
|
|
||||||
|
<!-- App css -->
|
||||||
|
<link href="<?= base_url()."public"; ?>/assets/css/bootstrap-material.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
||||||
|
<link href="<?= base_url()."public"; ?>/assets/css/app-material.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
||||||
|
|
||||||
|
<link href="<?= base_url()."public"; ?>/assets/css/bootstrap-material-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
||||||
|
<link href="<?= base_url()."public"; ?>/assets/css/app-material-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
||||||
|
|
||||||
|
<!-- icons -->
|
||||||
|
<link href="<?= base_url()."public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||||
|
|
||||||
|
<!-- css -->
|
||||||
|
<link href="<?= base_url()."/public"; ?>/assets/css/style.css" rel="stylesheet" type="text/css" />
|
||||||
|
<!-- jquery -->
|
||||||
|
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.4/jquery.min.js"></script> -->
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="loading">
|
||||||
|
|
||||||
|
<div class="account-pages mt-5 mb-5">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-8 col-lg-6 col-xl-5">
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
<div class="card-body p-4">
|
||||||
|
|
||||||
|
<div class="text-center w-75 m-auto">
|
||||||
|
<div class="auth-logo">
|
||||||
|
<a href="index.html" class="logo logo-dark text-center">
|
||||||
|
<span class="logo-lg">
|
||||||
|
<img src="<?php base_url()?>public/assets/images/logo.png" alt="" height="22" style="width: 305px; height: 190px;">
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="index.html" class="logo logo-light text-center">
|
||||||
|
<span class="logo-lg">
|
||||||
|
<img src="<?php base_url()?>public/assets/images/logo.png" alt="" height="22" style="width: 305px; height: 190px;">
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="text-center w-75 m-auto">
|
||||||
|
<h3>Account recovery</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</br>
|
||||||
|
<form method="post" action="<?php echo base_url();?>verify_otp" method="post">
|
||||||
|
<input type="hidden" id="verify_otp" name="verify_otp" value="">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<?php if(session()->getTempdata('error')):?>
|
||||||
|
<div class="alert alert-danger" id="alert">
|
||||||
|
<?= session()->getTempdata('error'); ?>
|
||||||
|
</div>
|
||||||
|
<?php endif;?>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group mb-3">
|
||||||
|
<label for="emailaddress">Email address</label>
|
||||||
|
<input class="form-control" type="email" name="email" id="email" required="required" value="" placeholder="Enter your email">
|
||||||
|
</div>
|
||||||
|
<div id="alert1" style="text-align:center;"></div>
|
||||||
|
|
||||||
|
<div class="form-group mb-3 disable" id="disable">
|
||||||
|
<label for="otp">OTP</label>
|
||||||
|
<div class="input-group input-group-merge">
|
||||||
|
<input type="text" id="otp" name="otp" value="" required="required" class="form-control" placeholder="Enter your otp">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</br>
|
||||||
|
|
||||||
|
<div class="form-group mb-0 text-center" id="re-sub">
|
||||||
|
<button class="btn btn-primary" type="submit" id="submit1"> Get OTP </button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div> <!-- end card-body -->
|
||||||
|
</div>
|
||||||
|
<!-- end card -->
|
||||||
|
|
||||||
|
<div class="row mt-3">
|
||||||
|
<div class="col-12 text-center">
|
||||||
|
<p> <a href="<?= base_url(); ?>" class="text-primary font-weight-medium ml-1">Back to login</a></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div> <!-- end col -->
|
||||||
|
</div>
|
||||||
|
<!-- end row -->
|
||||||
|
</div>
|
||||||
|
<!-- end container -->
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
|
|
||||||
|
<footer class="footer footer-alt">
|
||||||
|
<script>document.write(new Date().getFullYear())</script> © <a href="" class="text-dark"></a>
|
||||||
|
</footer>
|
||||||
|
|
||||||
|
<!-- Vendor js -->
|
||||||
|
<script src="<?= base_url()."public"; ?>/assets/js/vendor.min.js"></script>
|
||||||
|
|
||||||
|
<!-- App js -->
|
||||||
|
<script src="<?= base_url()."public"; ?>/assets/js/app.min.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// jQuery autohide element after 5 seconds
|
||||||
|
$('#alert').delay(3000).fadeOut('slow');
|
||||||
|
// This will disable just the div
|
||||||
|
$(".disable").hide();
|
||||||
|
|
||||||
|
$(document).on('click','#submit1',function(event){
|
||||||
|
$('#alert1').html('Please wait...');
|
||||||
|
var email = $("#email").val();
|
||||||
|
|
||||||
|
|
||||||
|
var url = "<?php echo base_url();?>forgot_password";
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: url,
|
||||||
|
data: { email : email },
|
||||||
|
json: true,
|
||||||
|
success: function(response) {
|
||||||
|
console.log(response);
|
||||||
|
response = jQuery.parseJSON(response);
|
||||||
|
if (response.status == "success")
|
||||||
|
{
|
||||||
|
$('#alert1').html('');
|
||||||
|
$(".disable").show();
|
||||||
|
$('#verify_otp').val(response.otp);
|
||||||
|
$("#re-sub").html('<button class="btn btn-primary btn-block" type="submit"> Submit </button>');
|
||||||
|
window.stop();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
$('#alert1').html('Invalid email , Please try again.');
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error: function(jqXHR, textStatus, err) { alert('text status '+textStatus+', err '+err) }
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</html>
|
||||||
@ -60,11 +60,18 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="email">Email:</label>
|
<label for="email">Email:</label>
|
||||||
<input type="email" class="form-control" id="email" name="email" value="<?= session()->getFlashdata('email_input') ?>" required>
|
<input type="email" class="form-control" id="email" name="email" placeholder="Enter your email" value="<?= session()->getFlashdata('email_input') ?>" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="password">Password:</label>
|
<label for="password">Password</label>
|
||||||
<input type="password" class="form-control" id="password" name="password" required>
|
<div class="input-group input-group-merge">
|
||||||
|
<input type="password" id="password" class="form-control" name="password" placeholder="Enter your password">
|
||||||
|
<div class="input-group-append" data-password="false">
|
||||||
|
<div class="input-group-text">
|
||||||
|
<span class="password-eye"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group mb-0 text-center">
|
<div class="form-group mb-0 text-center">
|
||||||
<button class="btn btn-primary btn-block" type="submit"> Log In </button>
|
<button class="btn btn-primary btn-block" type="submit"> Log In </button>
|
||||||
@ -84,9 +91,11 @@
|
|||||||
<div class="row mt-3">
|
<div class="row mt-3">
|
||||||
<div class="col-12 text-center">
|
<div class="col-12 text-center">
|
||||||
<!-- <p> <a href="auth-recoverpw.html" class="text-muted ml-1">Forgot your password?</a></p> -->
|
<!-- <p> <a href="auth-recoverpw.html" class="text-muted ml-1">Forgot your password?</a></p> -->
|
||||||
|
<p> <a href="<?= base_url('forgot_password'); ?>" class="text-primary font-weight-medium ml-1">Forgot your password?</a></p>
|
||||||
|
|
||||||
</div> <!-- end col -->
|
</div> <!-- end col -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
|
|
||||||
</div> <!-- end col -->
|
</div> <!-- end col -->
|
||||||
|
|||||||
181
app/Views/reset_password.php
Normal file
181
app/Views/reset_password.php
Normal file
@ -0,0 +1,181 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Reset Password</title>
|
||||||
|
<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="Coderthemes" name="author" />
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||||
|
<!-- App favicon -->
|
||||||
|
<link rel="shortcut icon" href="<?= base_url()."/public"; ?>/assets/images/favicon.ico">
|
||||||
|
|
||||||
|
<!-- App css -->
|
||||||
|
<link href="<?= base_url()."/public"; ?>/assets/css/bootstrap-corporate.min.css" rel="stylesheet" type="text/css" id="bs-default-stylesheet" />
|
||||||
|
<link href="<?= base_url()."/public"; ?>/assets/css/app-corporate.min.css" rel="stylesheet" type="text/css" id="app-default-stylesheet" />
|
||||||
|
|
||||||
|
<link href="<?= base_url()."/public"; ?>/assets/css/bootstrap-corporate-dark.min.css" rel="stylesheet" type="text/css" id="bs-dark-stylesheet" />
|
||||||
|
<link href="<?= base_url()."/public"; ?>/assets/css/app-corporate-dark.min.css" rel="stylesheet" type="text/css" id="app-dark-stylesheet" />
|
||||||
|
|
||||||
|
<!-- icons -->
|
||||||
|
<link href="<?= base_url()."/public"; ?>/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
|
||||||
|
<style>
|
||||||
|
.text-danger {
|
||||||
|
color: red !important;
|
||||||
|
}
|
||||||
|
.parsley-errors-list>li {
|
||||||
|
color: red !important;
|
||||||
|
}
|
||||||
|
.field-icon {
|
||||||
|
float: right;
|
||||||
|
margin-left: -35px;
|
||||||
|
margin-top: 12px;
|
||||||
|
margin-right: 12px;
|
||||||
|
position: relative;
|
||||||
|
z-index: 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="loading">
|
||||||
|
|
||||||
|
<div class="account-pages mt-5 mb-5">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<div class="card">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
|
||||||
|
<div class="text-center w-75 m-auto">
|
||||||
|
<div class="auth-logo">
|
||||||
|
<a href="index.html" class="logo logo-dark text-center">
|
||||||
|
<span class="logo-lg">
|
||||||
|
<img src="<?php base_url()?>public/assets/images/logo.png" alt="" height="22" style="width: 305px; height: 190px;">
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="index.html" class="logo logo-light text-center">
|
||||||
|
<span class="logo-lg">
|
||||||
|
<img src="<?php base_url()?>public/assets/images/logo.png" alt="" height="22" style="width: 305px; height: 190px;">
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="text-center w-75 m-auto">
|
||||||
|
<h3>Reset Password</h3>
|
||||||
|
</div>
|
||||||
|
<p class="sub-header">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<form method="post" action="<?= base_url()."change_password_forget"; ?>" role="form" class="parsley-examples">
|
||||||
|
<input id="id" type="hidden" value="<?= session()->getTempdata('user_id'); ?>" name="user_id">
|
||||||
|
|
||||||
|
|
||||||
|
<?php if(session()->getTempdata('mail_success')):?>
|
||||||
|
<div class="alert alert-success" >
|
||||||
|
<?= session()->getTempdata('mail_success'); ?>
|
||||||
|
</div>
|
||||||
|
<?php endif;?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php if(session()->getTempdata('error')):?>
|
||||||
|
<div class="alert alert-danger" >
|
||||||
|
<?= session()->getTempdata('error'); ?>
|
||||||
|
</div>
|
||||||
|
<?php endif;?>
|
||||||
|
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="hori-pass1" class="col-3 col-form-label">Email<span class="text-danger">*</span></label>
|
||||||
|
<div class="col-9">
|
||||||
|
<input type="text" class="form-control" value="<?= session()->getTempdata('email'); ?>" readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="hori-pass1" class="col-3 col-form-label">Password<span class="text-danger">*</span></label>
|
||||||
|
<div class="col-9">
|
||||||
|
<input id="hori-pass1" type="password" placeholder="Password"
|
||||||
|
|
||||||
|
title="Must contain at least one number and one uppercase and lowercase letter, and at least 8 or more characters"
|
||||||
|
required class="form-control" name="password">
|
||||||
|
</div>
|
||||||
|
<span toggle="#hori-pass1" id="toggle-password" class="fa fa-fw fa-eye field-icon toggle-password"></span>
|
||||||
|
</div>
|
||||||
|
<div class="form-group row">
|
||||||
|
<label for="hori-pass2" class="col-3 col-form-label">Confirm Password
|
||||||
|
<span class="text-danger">*</span></label>
|
||||||
|
<div class="col-9">
|
||||||
|
<input data-parsley-equalto="#hori-pass1" type="password" required
|
||||||
|
placeholder="Password" class="form-control" id="hori-pass2">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group mb-0 text-center">
|
||||||
|
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" style="background-color: #1aa79c; border-color: #1aa79c;">
|
||||||
|
Submit
|
||||||
|
</button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div> <!-- end card-box -->
|
||||||
|
|
||||||
|
<div class="row mt-3">
|
||||||
|
<div class="col-12 text-center">
|
||||||
|
<p> <a href="<?= base_url('forgot_password'); ?>" class="text-primary font-weight-medium ml-1">Want to change Mail id ?</a></p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div> <!-- end col -->
|
||||||
|
</div>
|
||||||
|
<!-- end row -->
|
||||||
|
</div>
|
||||||
|
<!-- end container -->
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
|
|
||||||
|
<!-- Right bar overlay-->
|
||||||
|
<div class="rightbar-overlay"></div>
|
||||||
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$("#toggle-password").click(function() {
|
||||||
|
$(this).toggleClass("fa-eye fa-eye-slash");
|
||||||
|
var input = $($(this).attr("toggle"));
|
||||||
|
if (input.attr("type") == "password") {
|
||||||
|
input.attr("type", "text");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
input.attr("type", "password");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- Vendor js -->
|
||||||
|
<script src="<?= base_url()."/public"; ?>/assets/js/vendor.min.js"></script>
|
||||||
|
|
||||||
|
<!-- Plugin js-->
|
||||||
|
<script src="<?= base_url()."/public"; ?>/assets/libs/parsleyjs/parsley.min.js"></script>
|
||||||
|
|
||||||
|
<!-- Validation init js-->
|
||||||
|
<script src="<?= base_url()."/public"; ?>/assets/js/pages/form-validation.init.js"></script>
|
||||||
|
|
||||||
|
<!-- App js -->
|
||||||
|
<script src="<?= base_url()."/public"; ?>/assets/js/app.min.js"></script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -1,4 +1,14 @@
|
|||||||
<?php include('layout/header.php'); ?>
|
<?php include('layout/header.php'); ?>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.fixed-dropdown-container {
|
||||||
|
/* position: fixed; */
|
||||||
|
/* top: 50px; Adjust as needed */
|
||||||
|
/* left: 50px; Adjust as needed */
|
||||||
|
width: 300px; /* Adjust as needed */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
@ -152,11 +162,11 @@
|
|||||||
<th>Item Details</th>
|
<th>Item Details</th>
|
||||||
<th>Rate</th>
|
<th>Rate</th>
|
||||||
<th>Qty</th>
|
<th>Qty</th>
|
||||||
<th>Taxable Amount</th>
|
<th>Taxable Amt</th>
|
||||||
<th>Tax</th>
|
<th>Tax</th>
|
||||||
<th>Tax Amount</th>
|
<th>Tax Amt</th>
|
||||||
<!-- <th style="text-align: center !important" colspan="2">Discount</th> -->
|
<!-- <th style="text-align: center !important" colspan="2">Discount</th> -->
|
||||||
<th>Total Amount</th>
|
<th>Tot Amt</th>
|
||||||
<th hidden></th>
|
<th hidden></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -168,7 +178,7 @@
|
|||||||
<?php foreach ($sales_product as $salechild) :
|
<?php foreach ($sales_product as $salechild) :
|
||||||
if ($salechild['isactive'] == 1) : ?>
|
if ($salechild['isactive'] == 1) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:5%;">
|
<td style="width:30%;" class="fixed-dropdown-container">
|
||||||
<select class="form-control book-select SelExample" name="item_details[]"
|
<select class="form-control book-select SelExample" name="item_details[]"
|
||||||
required data-toggle="select2" id="" style="width: 249px !important;">
|
required data-toggle="select2" id="" style="width: 249px !important;">
|
||||||
<option value="">Select a Product</option>
|
<option value="">Select a Product</option>
|
||||||
@ -188,7 +198,7 @@
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td style="width:10%;">
|
<td style="width:12%;">
|
||||||
<input type="text" class="form-control item-rate" name="unit-price[]"
|
<input type="text" class="form-control item-rate" name="unit-price[]"
|
||||||
readonly
|
readonly
|
||||||
value="<?= isset($salechild['net_price']) ? $salechild['net_price'] : '' ?>">
|
value="<?= isset($salechild['net_price']) ? $salechild['net_price'] : '' ?>">
|
||||||
@ -198,17 +208,17 @@
|
|||||||
min="0"
|
min="0"
|
||||||
value="<?= isset($salechild['qty']) ? $salechild['qty'] : '1' ?>" onchange="updateThirdColumnValue(this); updateTaxAmount(this)">
|
value="<?= isset($salechild['qty']) ? $salechild['qty'] : '1' ?>" onchange="updateThirdColumnValue(this); updateTaxAmount(this)">
|
||||||
</td>
|
</td>
|
||||||
<td style="width:12%;">
|
<td style="width:14%;">
|
||||||
<?php if (isset($salechild['net_price']) && isset($salechild['qty'])) {
|
<?php if (isset($salechild['net_price']) && isset($salechild['qty'])) {
|
||||||
$result = $salechild['net_price'] * $salechild['qty'];
|
$result = $salechild['net_price'] * $salechild['qty'];
|
||||||
echo '<input type="text" class="form-control item-result" value="' . $result . '" readonly>';
|
echo '<input type="text" class="form-control item-result" value="' . $result . '" readonly>';
|
||||||
} ?>
|
} ?>
|
||||||
</td>
|
</td>
|
||||||
<td style="width:10%;">
|
<td style="width:8%;">
|
||||||
<input type="text" class="form-control item-tax" name="item-tax[]"
|
<input type="text" class="form-control item-tax" name="item-tax[]"
|
||||||
value="<?= isset($salechild['tax']) ? $salechild['tax'] : '' ?>" onchange="updateTaxAmount(this)">
|
value="<?= isset($salechild['tax']) ? $salechild['tax'] : '' ?>" onchange="updateTaxAmount(this)">
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td style="width:13%;">
|
||||||
<?php if (isset($salechild['tax']) && isset($result) ) {
|
<?php if (isset($salechild['tax']) && isset($result) ) {
|
||||||
$tax_amount= $result * $salechild['tax'] / 100;
|
$tax_amount= $result * $salechild['tax'] / 100;
|
||||||
} else {
|
} else {
|
||||||
@ -218,15 +228,15 @@
|
|||||||
<input type="text" class="form-control" name="tax-amount[]" value="<?= number_format($tax_amount,2); ?>" readonly>
|
<input type="text" class="form-control" name="tax-amount[]" value="<?= number_format($tax_amount,2); ?>" readonly>
|
||||||
</td>
|
</td>
|
||||||
<!-- <td style="width:12%;">
|
<!-- <td style="width:12%;">
|
||||||
<input type="number" class="form-control item-discount-amount" min="0" name="discount_amount[]" value="<?= isset($salechild['discount']) ? $salechild['discount'] : '' ?>">
|
<input type="number" class="form-control item-discount-amount" min="0" name="discount_amount[]" value="<?= isset($salechild['discount']) ? $salechild['discount'] : '' ?>">
|
||||||
</td>
|
</td>
|
||||||
<td style="width:10%;">
|
<td style="width:10%;">
|
||||||
<select class="form-control item-discount-type" name="discount_type[]">
|
<select class="form-control item-discount-type" name="discount_type[]">
|
||||||
<option value="₹" <?= isset($salechild['discount_type']) && $salechild['discount_type'] == '₹' ? 'selected' : '' ?>>₹</option>
|
<option value="₹" <?= isset($salechild['discount_type']) && $salechild['discount_type'] == '₹' ? 'selected' : '' ?>>₹</option>
|
||||||
<option value="%" <?= isset($salechild['discount_type']) && $salechild['discount_type'] == '%' ? 'selected' : '' ?>>%</option>
|
<option value="%" <?= isset($salechild['discount_type']) && $salechild['discount_type'] == '%' ? 'selected' : '' ?>>%</option>
|
||||||
</select>
|
</select>
|
||||||
</td> -->
|
</td> -->
|
||||||
<td style="width:12%;">
|
<td style="width:13%;">
|
||||||
<input type="text" class="form-control item-amount" name="amount[]"
|
<input type="text" class="form-control item-amount" name="amount[]"
|
||||||
value="<?= isset($salechild['amount']) ? $salechild['amount'] : '' ?>">
|
value="<?= isset($salechild['amount']) ? $salechild['amount'] : '' ?>">
|
||||||
</td>
|
</td>
|
||||||
@ -445,8 +455,11 @@ $(document).ready(function() {
|
|||||||
var makeAndModel = response.makeName + ' ' + response.modelName;
|
var makeAndModel = response.makeName + ' ' + response.modelName;
|
||||||
$('#makeAndModel').val(makeAndModel);
|
$('#makeAndModel').val(makeAndModel);
|
||||||
|
|
||||||
productarray = response.product;
|
if(response.product.length){
|
||||||
|
productarray = response.product;
|
||||||
|
}else{
|
||||||
|
productarray = "No Product";
|
||||||
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
@ -567,8 +580,8 @@ $(document).ready(function() {
|
|||||||
var cgst = parseInt(product.cgst);
|
var cgst = parseInt(product.cgst);
|
||||||
var sgst = parseInt(product.sgst);
|
var sgst = parseInt(product.sgst);
|
||||||
var totalTax = cgst + sgst;
|
var totalTax = cgst + sgst;
|
||||||
// var total_tax_amount = product.unit_price * totalTax / 100;
|
var total_tax_amount = product.unit_price * totalTax / 100;
|
||||||
var total_tax_amount = product.total_amount;
|
// var total_tax_amount = product.total_amount;
|
||||||
|
|
||||||
|
|
||||||
$(this).closest('tr').find('.item-quantity').attr('max', product.qty_stock);
|
$(this).closest('tr').find('.item-quantity').attr('max', product.qty_stock);
|
||||||
@ -595,9 +608,18 @@ $(document).ready(function() {
|
|||||||
function calculateSubtotal() {
|
function calculateSubtotal() {
|
||||||
var subtotal = 0;
|
var subtotal = 0;
|
||||||
$('.item-amount').each(function() {
|
$('.item-amount').each(function() {
|
||||||
subtotal += parseFloat($(this).val()) || 0;
|
// subtotal += parseFloat($(this).val()) || 0;
|
||||||
|
|
||||||
|
var value1 = $(this).val();
|
||||||
|
var qty = $(this).parent().parent().find('.item-quantity').val();
|
||||||
|
var rate = $(this).parent().parent().find('.item-rate').val();
|
||||||
|
// console.log(value1);
|
||||||
|
// console.log(value2);
|
||||||
|
|
||||||
|
subtotal += qty * rate;
|
||||||
});
|
});
|
||||||
return subtotal;
|
return subtotal;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Function to calculate total tax
|
// Function to calculate total tax
|
||||||
@ -671,10 +693,12 @@ $(document).ready(function() {
|
|||||||
|
|
||||||
// Event listener for "Add More Item" button
|
// Event listener for "Add More Item" button
|
||||||
$('#addItem').click(function() {
|
$('#addItem').click(function() {
|
||||||
console.log(productarray.length);
|
console.log(productarray);
|
||||||
if (productarray.length > 0) {
|
if(productarray == 'No Product'){
|
||||||
|
toastr.warning("First Add the Product!");
|
||||||
|
}else if (productarray.length > 0) {
|
||||||
var newRow = '<tr>' +
|
var newRow = '<tr>' +
|
||||||
'<td style="width:30%"><select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" style="width: 249px !important;"><option value="">Select a Product</option>';
|
'<td style="width:30%" class="fixed-dropdown-container"><select class="form-control book-select SelExample" name="item_details[]" required data-toggle="select2" style="width: 2px !important;"><option value="">Select a Product</option>';
|
||||||
|
|
||||||
for (var i = 0; i < productarray.length; i++) {
|
for (var i = 0; i < productarray.length; i++) {
|
||||||
var product = productarray[i];
|
var product = productarray[i];
|
||||||
@ -692,8 +716,8 @@ $(document).ready(function() {
|
|||||||
'<td style="width:10%;"><input type="number" class="form-control item-quantity" min="0" max="" name="quantity[]" onchange="updateThirdColumnValue(this); updateTaxAmount(this)" /></td>' +
|
'<td style="width:10%;"><input type="number" class="form-control item-quantity" min="0" max="" name="quantity[]" onchange="updateThirdColumnValue(this); updateTaxAmount(this)" /></td>' +
|
||||||
'<td style="width:14%;"><input type="text" class="form-control item-result" readonly /></td>' +
|
'<td style="width:14%;"><input type="text" class="form-control item-result" readonly /></td>' +
|
||||||
'<td style="width:8%;"><input type="text" class="form-control item-tax" name="item-tax[]" readonly /></td>' +
|
'<td style="width:8%;"><input type="text" class="form-control item-tax" name="item-tax[]" readonly /></td>' +
|
||||||
'<td style="width:12%;"><input type="text" class="form-control tax-amount" name="tax-amount[]" readonly /></td>' +
|
'<td style="width:13%;"><input type="text" class="form-control tax-amount" name="tax-amount[]" readonly /></td>' +
|
||||||
'<td style="width:12%;"><input type="text" class="form-control item-amount" name="amount[]"/></td>' +
|
'<td style="width:13%;"><input type="text" class="form-control item-amount" name="amount[]"/></td>' +
|
||||||
'<td hidden><input type="hidden"></td>' +
|
'<td hidden><input type="hidden"></td>' +
|
||||||
'<td><center><i class="fa fa-trash remove-item"></i></center></td>' +
|
'<td><center><i class="fa fa-trash remove-item"></i></center></td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
@ -818,12 +842,15 @@ function onlyNumbers(event) {
|
|||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Initialize select2
|
// Initialize select2
|
||||||
$(".SelExample").select2();
|
$(".SelExample").select2({
|
||||||
|
// dropdownParent: $('.fixed-dropdown-container')
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function initializeSelect2() {
|
function initializeSelect2() {
|
||||||
$('.SelExample').select2({
|
$('.SelExample').select2({
|
||||||
width: '249px' // Adjust width as needed
|
// dropdownParent: $('.fixed-dropdown-container'),
|
||||||
|
width: '150px'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@ -919,7 +946,9 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
$(".SelExample").select2();
|
$(".SelExample").select2({
|
||||||
|
// dropdownParent: $('.fixed-dropdown-container')
|
||||||
|
});
|
||||||
|
|
||||||
// Event listener for change in make select dropdown
|
// Event listener for change in make select dropdown
|
||||||
$("#make").on('change', function() {
|
$("#make").on('change', function() {
|
||||||
|
|||||||
@ -73,7 +73,7 @@
|
|||||||
<select class="form-control cleint-select SelExample" id="clientData" name="client_name" required data-toggle="select2" >
|
<select class="form-control cleint-select SelExample" id="clientData" name="client_name" required data-toggle="select2" >
|
||||||
<option value="">Select a Client</option>
|
<option value="">Select a Client</option>
|
||||||
<?php foreach ($client as $value) : ?>
|
<?php foreach ($client as $value) : ?>
|
||||||
<?php if ($value["isactive"] === 1) : ?>
|
<?php if ($value["isactive"] == 1) : ?>
|
||||||
<option value="<?= $value["client_id"] ?>" <?= isset($vehicle['client_id']) && $vehicle['client_id'] == $value["client_id"] ? 'selected' : '' ?>>
|
<option value="<?= $value["client_id"] ?>" <?= isset($vehicle['client_id']) && $vehicle['client_id'] == $value["client_id"] ? 'selected' : '' ?>>
|
||||||
<?= $value["client_name"]; ?>
|
<?= $value["client_name"]; ?>
|
||||||
</option>
|
</option>
|
||||||
|
|||||||
@ -20,7 +20,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<form action="<?= base_url() . "add_vendor"; ?>" method="post">
|
<form id="vendor_form" action="<?= base_url() . "add_vendor"; ?>" method="post">
|
||||||
<h4 class="header-title">Vendor Details :</h4>
|
<h4 class="header-title">Vendor Details :</h4>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
@ -143,7 +143,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" class="btn btn-primary">Submit</button>
|
<button type="submit" id="vendor_add_submit" class="btn btn-primary">Submit</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -214,6 +214,16 @@ $(document).ready(function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#vendor_add_submit').click(function (event) {
|
||||||
|
var form = document.getElementById('vendor_form');
|
||||||
|
if (form.checkValidity()) {
|
||||||
|
$(this).attr('disabled', true);
|
||||||
|
$('#vendor_form').submit();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user