Merge branch 'main' of bitbucket.org:venbainformationtechnology/the_mechanic
This commit is contained in:
commit
1d182191c0
11
app/Models/BikemakeModel.php
Normal file
11
app/Models/BikemakeModel.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
use CodeIgniter\Model;
|
||||
class BikemakeModel extends Model
|
||||
{
|
||||
protected $table = 'make';
|
||||
protected $primaryKey = 'make_id';
|
||||
protected $allowedFields = ['make_id','make','isactive'];
|
||||
|
||||
|
||||
}
|
||||
9
app/Models/BikemodelsModel.php
Normal file
9
app/Models/BikemodelsModel.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
use CodeIgniter\Model;
|
||||
class BikemodelsModel extends Model
|
||||
{
|
||||
protected $table = 'model';
|
||||
protected $primaryKey = 'model_id';
|
||||
protected $allowedFields = ['model_id','make_id','model_name','isactive'];
|
||||
}
|
||||
@ -33,6 +33,11 @@
|
||||
background-color: #edd179 !important; /* Set background color to a solid color */
|
||||
opacity: 1 !important; /* Set opacity to 1 to remove transparency */
|
||||
}
|
||||
.toast-success {
|
||||
color: black !important;
|
||||
background-color: #2aa762 !important; /* Set background color to a solid color */
|
||||
opacity: 1 !important; /* Set opacity to 1 to remove transparency */
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
||||
@ -26,8 +26,8 @@
|
||||
<div class="form-row">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="inputEmail4" class="col-form-label">Client Name<span class="text-danger">*</span></label>
|
||||
|
||||
<i type="button" class="fe-plus-circle" id="addClientModalButton" style="font-size: 18px;" data-toggle="modal" data-target="#addClientModal" title="Add Client"></i>
|
||||
<?= isset($sales['client_id']) ? '' : '<i type="button" class="fe-plus-circle" id="addClientModalButton" style="font-size: 18px;" data-toggle="modal" data-target="#addClientModal" title="Add Client"></i>' ?>
|
||||
|
||||
|
||||
<select class="form-control cleint-select SelExample" name="client_id" <?= isset($sales['client_id']) ? '' : 'required' ?>>
|
||||
|
||||
@ -494,10 +494,13 @@ $(document).ready(function() {
|
||||
|
||||
// AJAX request to save client
|
||||
$('#saveClientBtn').click(function() {
|
||||
|
||||
|
||||
var clientName = $('#clientName').val();
|
||||
var clientMobile = $('#clientMobile').val();
|
||||
if(clientName != '' && clientMobile != ''){
|
||||
|
||||
// Send AJAX request to save the client
|
||||
// Send AJAX request to save the client
|
||||
$.ajax({
|
||||
url: '<?php echo base_url().'save_client'?>', // URL to your save_client method
|
||||
method: 'POST',
|
||||
@ -516,15 +519,21 @@ $(document).ready(function() {
|
||||
|
||||
} else {
|
||||
// Client save operation failed, display error message
|
||||
alert('Failed to save client. Please try again.');
|
||||
toastr.warning("Failed to save client. Please try again");
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
// AJAX request failed, display error message
|
||||
console.error('Error occurred while saving client:', error);
|
||||
alert('Failed to save client. Please try again.');
|
||||
toastr.warning("Failed to save client. Please try again");
|
||||
}
|
||||
});
|
||||
|
||||
}else{
|
||||
toastr.warning("Please Fill Name and Mobile data");
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user